savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.4k stars 130 forks source link

An error occurs when a simple example of using video #163

Closed ghost closed 10 years ago

ghost commented 10 years ago

!/usr/bin/liquidsoap --verbose --debug --errors-as-warnings

set("log.file.path","/var/log/icecast/liquidsoap-video.log") set("log.file",true) set("log.level",100) set("init.daemon.pidfile.path", "/var/run/icecast/liquidsoap-video.pid") set("init.daemon",false) set("init.daemon.change_user",true) set("init.daemon.change_user.group","apache") set("init.daemon.change_user.user","apache")

set("frame.audio.samplerate",44100) set("frame.video.width", 320) set("frame.video.height", 240) set("frame.video.samplerate",25)

set("decoder.image_file_decoders",["PPM","CAMLIMAGES"]) set("decoder.image_file_decoders",["PNG","CAMLIMAGES"]) set("decoder.image_file_decoders",["JPG","CAMLIMAGES"])

set("video.converter.preferred","gavl") set("video.converter.gavl.scale_mode", "quadratic")

audio_file = "jingle/J9.mp3" video_file = "img/1.jpg" (or video_file = "img/video3.mp4" *.avi etc) source = single("img/small.mp4")

source = video.add_image( width=30,height=30, x=10,y=10, file="img/logo1.jpg", source)

source = video.add_text("Hello world!", source)

output.file( %ogg(%theora(quality=25,width=320,height=240),%vorbis), id="youtube", fallible=true, on_stop=shutdown, reopen_on_metadata=false, "/tmp/1111111111111111.ogv", source)

if you specify a non-existent file on disk, it starts and runs video.add_text function:

Control-C ended...

2014/04/04 02:00:48 >>> LOG START 2014/04/04 02:00:47 [protocols.external:3] Found "/usr/bin/wget". 2014/04/04 02:00:48 [main:3] Liquidsoap 1.1.1 2014/04/04 02:00:48 [main:3] Using: graphics=[distributed with Ocaml] pcre=7.0.4 dtools=0.3.1 duppy=0.5.1 cry=0.2.2 mm=0.2.1 ogg=0.4.5 vorbis=0.6.1 speex=0.2.0 mad=0.4.4 flac=0.1.1 flac.ogg=0.1.1 dynlink=[distributed with Ocaml] lame=0.3.2 gstreamer=0.2.0 frei0r=0.1.0 theora=0.3.0 gavl=0.1.5 ffmpeg=0.1.0 ao=0.2.0 samplerate=0.1.2 taglib=0.3.1 camomile=0.8.3 faad=0.3.2 soundtouch=0.1.7 ladspa=0.1.4 camlimages=4.1.1 lo=0.1.0 gd=1.0a5 2014/04/04 02:00:48 [dynamic.loader:3] Could not find dynamic module for aacplus encoder. 2014/04/04 02:00:48 [single:3] "/Clients/STREAM/img/small1.mp4" will be queued. 2014/04/04 02:00:48 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master. 2014/04/04 02:00:48 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples. 2014/04/04 02:00:48 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks. 2014/04/04 02:00:48 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks. 2014/04/04 02:00:48 [single:3] "annotate:width=30,height=30,x=10,y=10:/Clients/STREAM/img/logo1.jpg" will be queued. 2014/04/04 02:00:48 [video.converter:4] Using preferred video converter: gavl. 2014/04/04 02:00:48 [audio.converter:4] Using preferred samplerate converter: libsamplerate. 2014/04/04 02:00:48 [threads:3] Created thread "generic queue #1". 2014/04/04 02:00:48 [threads:3] Created thread "generic queue #2". 2014/04/04 02:00:48 [clock:4] Currently 1 clocks allocated. 2014/04/04 02:00:48 [clock.wallclock_main:4] Starting 1 sources... 2014/04/04 02:00:48 [source:4] Source youtube gets up. 2014/04/04 02:00:48 [source:4] Source video.add_text_8631 gets up. 2014/04/04 02:00:48 [video.add_text_8631:4] Content kind is {audio=2;video=1;midi=0}. 2014/04/04 02:00:48 [source:4] Source add_8629 gets up. 2014/04/04 02:00:48 [add_8629:4] Content kind is {audio=2;video=1;midi=0}. 2014/04/04 02:00:48 [source:4] Source mksafe gets up. 2014/04/04 02:00:48 [source:4] Source single_8623 gets up. 2014/04/04 02:00:48 [single_8623:4] Content kind is {audio=2;video=1;midi=0}. 2014/04/04 02:00:48 [single_8623:4] Activations changed: static=[], dynamic=[mksafe:add_8629:video.add_text_8631:youtube:youtube]. 2014/04/04 02:00:48 [source:4] Source safe_blank gets up. 2014/04/04 02:00:48 [request:3] Nonexistent file or ill-formed URI "/Clients/STREAM/img/small1.mp4"! 2014/04/04 02:00:48 [safe_blank:4] Content kind is {audio=2;video=1;midi=0}. 2014/04/04 02:00:48 [safe_blank:4] Activations changed: static=[], dynamic=[mksafe:add_8629:video.add_text_8631:youtube:youtube]. 2014/04/04 02:00:48 [request:3] Nonexistent file or ill-formed URI "/Clients/STREAM/img/small1.mp4"! 2014/04/04 02:00:48 [mksafe:4] Activations changed: static=[add_8629:video.add_text_8631:youtube:youtube], dynamic=[]. 2014/04/04 02:00:48 [source:4] Source single_8628 gets up. 2014/04/04 02:00:48 [request:3] Nonexistent file or ill-formed URI "/Clients/STREAM/img/small1.mp4"! 2014/04/04 02:00:48 [single_8628:4] Content kind is {audio=2;video=1;midi=0}. 2014/04/04 02:00:48 [request:3] Nonexistent file or ill-formed URI "/Clients/STREAM/img/small1.mp4"! 2014/04/04 02:00:48 [single_8628:4] Activations changed: static=[add_8629:video.add_text_8631:youtube:youtube], dynamic=[]. 2014/04/04 02:00:48 [add_8629:4] Activations changed: static=[video.add_text_8631:youtube:youtube], dynamic=[]. 2014/04/04 02:00:48 [decoder:4] Trying method "META" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [youtube:4] Activations changed: static=[youtube], dynamic=[]. 2014/04/04 02:00:48 [decoder.wav:4] Invalid file extension for "/Clients/STREAM/img/logo1.jpg"! 2014/04/04 02:00:48 [youtube:4] Enabling caching mode: active source. 2014/04/04 02:00:48 [decoder:4] Trying method "MIDI" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [threads:3] Created thread "wallclock_main" (1 total). 2014/04/04 02:00:48 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock. 2014/04/04 02:00:48 [decoder:4] Trying method "FLAC" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [clock:4] Main phase starts. 2014/04/04 02:00:48 [decoder.flac:4] Invalid file extension for "/Clients/STREAM/img/logo1.jpg"! 2014/04/04 02:00:48 [decoder:4] Trying method "MAD" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder:3] Unable to decode "/Clients/STREAM/img/logo1.jpg" as {audio=2;video=1;midi=0}! 2014/04/04 02:00:48 [decoder:4] Trying method "META" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder:4] Trying method "WAV" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder.wav:4] Invalid file extension for "/Clients/STREAM/img/logo1.jpg"! 2014/04/04 02:00:48 [decoder:4] Trying method "MIDI" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder:4] Trying method "FLAC" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder.flac:4] Invalid file extension for "/Clients/STREAM/img/logo1.jpg"! 2014/04/04 02:00:48 [decoder:4] Trying method "MAD" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder:3] Unable to decode "/Clients/STREAM/img/logo1.jpg" as {audio=2;video=1;midi=0}! 2014/04/04 02:00:48 [decoder:4] Trying method "META" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder:4] Trying method "WAV" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder.wav:4] Invalid file extension for "/Clients/STREAM/img/logo1.jpg"! 2014/04/04 02:00:48 [decoder:4] Trying method "MIDI" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder:4] Trying method "FLAC" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder.flac:4] Invalid file extension for "/Clients/STREAM/img/logo1.jpg"! 2014/04/04 02:00:48 [decoder:4] Trying method "MAD" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder:3] Unable to decode "/Clients/STREAM/img/logo1.jpg" as {audio=2;video=1;midi=0}! 2014/04/04 02:00:48 [decoder:4] Trying method "META" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder:4] Trying method "WAV" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder.wav:4] Invalid file extension for "/Clients/STREAM/img/logo1.jpg"! 2014/04/04 02:00:48 [decoder:4] Trying method "MIDI" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder:4] Trying method "FLAC" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder.flac:4] Invalid file extension for "/Clients/STREAM/img/logo1.jpg"! 2014/04/04 02:00:48 [decoder:4] Trying method "MAD" for "/Clients/STREAM/img/logo1.jpg"... 2014/04/04 02:00:48 [decoder:3] Unable to decode "/Clients/STREAM/img/logo1.jpg" as {audio=2;video=1;midi=0}! 2014/04/04 02:00:48 [single_8628:5] Queue is empty! 2014/04/04 02:00:48 [single_8628:5] Failed to prepare track: no file. 2014/04/04 02:00:48 [single_8623:5] Queue is empty! 2014/04/04 02:00:48 [single_8623:5] Failed to prepare track: no file. 2014/04/04 02:00:48 [single_8628:5] Queue is empty! 2014/04/04 02:00:48 [single_8628:5] Failed to prepare track: no file. 2014/04/04 02:00:48 [single_8628:5] Queue is empty! 2014/04/04 02:00:48 [single_8628:5] Failed to prepare track: no file.

......... skip more lines ..............

^C2014/04/04 02:00:49 [main:3] Shutdown started! 2014/04/04 02:00:49 [main:3] Waiting for threads to terminate... 2014/04/04 02:00:49 [youtube:4] Activations changed: static=[], dynamic=[]. 2014/04/04 02:00:49 [source:4] Source youtube gets down. 2014/04/04 02:00:49 [ogg.muxer:4] youtube: Setting end of track 31548ed6. 2014/04/04 02:00:49 [ogg.muxer:4] youtube: Setting end of track 23c12561. 2014/04/04 02:00:49 [ogg.muxer:4] youtube: Every ogg logical tracks have ended: setting end of stream. 2014/04/04 02:00:49 [video.add_text_8631:4] Activations changed: static=[], dynamic=[]. 2014/04/04 02:00:49 [source:4] Source video.add_text_8631 gets down. 2014/04/04 02:00:49 [add_8629:4] Activations changed: static=[], dynamic=[]. 2014/04/04 02:00:49 [source:4] Source add_8629 gets down. 2014/04/04 02:00:49 [mksafe:4] Activations changed: static=[], dynamic=[]. 2014/04/04 02:00:49 [source:4] Source mksafe gets down. 2014/04/04 02:00:49 [single_8623:4] Activations changed: static=[], dynamic=[]. 2014/04/04 02:00:49 [source:4] Source single_8623 gets down. 2014/04/04 02:00:49 [single_8623:4] Waiting for feeding task to stop... 2014/04/04 02:00:49 [single_8623:4] Cleaning up request queue... 2014/04/04 02:00:49 [safe_blank:4] Activations changed: static=[mksafe:add_8629:video.add_text_8631:youtube:youtube], dynamic=[]. 2014/04/04 02:00:49 [safe_blank:4] Activations changed: static=[], dynamic=[]. 2014/04/04 02:00:49 [source:4] Source safe_blank gets down. 2014/04/04 02:00:49 [single_8628:4] Activations changed: static=[], dynamic=[]. 2014/04/04 02:00:49 [source:4] Source single_8628 gets down. 2014/04/04 02:00:49 [single_8628:4] Waiting for feeding task to stop... 2014/04/04 02:00:49 [single_8628:4] Cleaning up request queue... 2014/04/04 02:00:49 [clock.wallclock_main:3] Streaming loop stopped. 2014/04/04 02:00:49 [threads:3] Thread "wallclock_main" terminated (0 remaining). 2014/04/04 02:00:49 [main:3] Cleaning downloaded files... 2014/04/04 02:00:49 [main:3] Freeing memory... 2014/04/04 02:00:49 >>> LOG END

else, if video fail found (mpg,mp4,avi,jpg,png...), error:

Invalid value at line 81, char 17-47: Could not get a valid media file of kind {audio=2;video=1;midi=0} from "/Clients/STREAM/img/small.mp4".

Compile options:

dbaelde commented 10 years ago

I'm not sure what is "wrong" here. You'd like a stronger warning if you specify an inexistent file? Note that, right now, you're doing a lot to avoid the safeguards that we've put in place: you explicitly ignore errors with errors-as-warnings and you disable the infallibility check with fallible=true (I'm not sure what the former leads to here, but the latter is the reason why liquidsoap accepts to start even though your file doesn't exist). Finally, if your problem is why liquidsoap doesn't detect a file, you should start with simply calling "liquidsoap -r " to see how it supports it. Hope this helps!

toots commented 10 years ago

Yeah, it looks like the file /Clients/STREAM/img/small.mp4 is missing:

2014/04/04 02:00:48 [request:3] Nonexistent file or ill-formed URI "/Clients/STREAM/img/small1.mp4"!

I'm thus closing this issue. Please re-open or submit a new one if you're still having trouble after fixing this..

ghost commented 10 years ago

Yes, i'm write: is file not missing, only one error found:

Invalid value at line 81, char 17-47: Could not get a valid media file of kind {audio=2;video=1;midi=0} from "/Clients/STREAM/img/small.mp4".