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.41k stars 130 forks source link

"Failed to prepare track: request not ready" when using annotate. #636

Closed MCOfficer closed 6 years ago

MCOfficer commented 6 years ago

I'm trying to create a video with a slideshow (sort of). i'm tried to imitate the slideshow script from here.

audio = playlist("some/folder/") # .mp3 files
video = playlist.safe(prefix="annotate:duration=3:", "images.txt") # .jpeg/.jpg files

source = mux_video(video=video, audio)
output.youtube.live(key="hackme", fallible=true, source)

i stripped away some fancypants stuff for better readability - if noone can reproduce this, i 'll put it here, too.

whenever i try to use prefix=, the output is spammed with

[images(dot)txt:1] Failed to prepare track: request not ready.

i checked my syntax at least a dozen times. when i remove ´prefix`, everything is back to normal. i'm running the almost latest master (b44f282c4d8bc2e5cb6a514b226aa352e4db9bb4). I also found this E-Mail string, but apparently that was left unresolved.

Edit: thinking about it, there's probably a reason why you didn't use mux_video in the script- and then that (to me) cryptic comment at the end of the script also makes sense. damn. If that is the case, let me rephrase the question: how could i change images every now and then while still using a gstreamer output?

toots commented 6 years ago

You need to use quotes:

video = playlist.safe(prefix="annotate:duration=\"3\":", "images.txt")
MCOfficer commented 6 years ago

pretty sure i tried that... i'm on mobile atm, but i'll check tomorrow, thank you.

MCOfficer commented 6 years ago

still no dice, even after copying your version literally. this is my script:

def fix_title(m) =
  title = m["filename"]
  title = string.sub(title, start=19, length=string.length(title) - 23)
  [("title","#{title}")]
end

set("log.file.path", "./liquidsoap.log")
set("log.stdout", true)
set("log.level", 4)
set("gstreamer.max_buffers", 20)
set("server.telnet", false)

set("frame.video.width", 1280)
set("frame.video.height", 720)

#audio = playlist.safe("proghouse/library/")
audio = mksafe(single("test.mp3")) # didn't want to spam the log with >100 files
video = playlist.safe(prefix="annotate:duration=\"3\":", "images.txt")

source = mux_video(video=video, audio)
#source = video.volume(audio)
source = map_metadata(fix_title, source)
source = video.add_text(metadata="title", "<no title>", size=60, speed=0, x=20, y=-10, font="densia.otf", source)

output.youtube.live(key="foo", fallible=true, source)

here's the log (pastebin.com, hasteb.in):

``` 2018/09/25 11:32:15 >>> LOG START 2018/09/25 11:32:15 [main:3] Liquidsoap 1.3.4+scm 2018/09/25 11:32:15 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.3.4 dtools=0.4.1 duppy=0.7.3 duppy.syntax=0.7.3 mm=0.4.0 ogg=0.5.2 vorbis=0.7.1 mad=0.4.5 dynlink=[distributed with Ocaml] lame=0.3.3 gstreamer=0.3.0 2018/09/25 11:32:15 [main:2] 2018/09/25 11:32:15 [main:2] DISCLAIMER: This version of Liquidsoap has been 2018/09/25 11:32:15 [main:2] compiled from a snapshot of the development code. 2018/09/25 11:32:15 [main:2] As such, it should not be used in production 2018/09/25 11:32:15 [main:2] unless you know what you are doing! 2018/09/25 11:32:15 [main:2] 2018/09/25 11:32:15 [main:2] We are, however, very interested in any feedback 2018/09/25 11:32:15 [main:2] about our development code and committed to fix 2018/09/25 11:32:15 [main:2] issues as soon as possible. 2018/09/25 11:32:15 [main:2] 2018/09/25 11:32:15 [main:2] If you are interested in collaborating to 2018/09/25 11:32:15 [main:2] the development of Liquidsoap, feel free to 2018/09/25 11:32:15 [main:2] drop us a mail at 2018/09/25 11:32:15 [main:2] or to join the #savonet IRC channel on Freenode. 2018/09/25 11:32:15 [main:2] 2018/09/25 11:32:15 [main:2] Please send any bug report or feature request 2018/09/25 11:32:15 [main:2] at . 2018/09/25 11:32:15 [main:2] 2018/09/25 11:32:15 [main:2] We hope you enjoy this snapshot build of Liquidsoap! 2018/09/25 11:32:15 [main:2] 2018/09/25 11:32:15 [gstreamer.loader:3] Loaded GStreamer 1.14.1 0 2018/09/25 11:32:15 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder. 2018/09/25 11:32:15 [decoder:4] Trying method "META" for "test.mp3"... 2018/09/25 11:32:15 [decoder:4] Trying method "WAV" for "test.mp3"... 2018/09/25 11:32:15 [decoder.wav/aiff:4] Invalid file extension for "test.mp3"! 2018/09/25 11:32:15 [decoder:4] Trying method "AIFF" for "test.mp3"... 2018/09/25 11:32:15 [decoder.wav/aiff:4] Invalid file extension for "test.mp3"! 2018/09/25 11:32:15 [decoder:4] Trying method "MIDI" for "test.mp3"... 2018/09/25 11:32:15 [decoder:4] Trying method "IMAGE" for "test.mp3"... 2018/09/25 11:32:15 [decoder:4] Trying method "OGG" for "test.mp3"... 2018/09/25 11:32:15 [decoder.ogg:4] Invalid file extension for "test.mp3"! 2018/09/25 11:32:15 [decoder:4] Trying method "MAD" for "test.mp3"... 2018/09/25 11:32:15 [decoder.mad:4] Libmad recognizes "test.mp3" as mpeg audio (layer III, 64kbps, 44100Hz, 2 channels). 2018/09/25 11:32:15 [decoder:3] Method "MAD" accepted "test.mp3". 2018/09/25 11:32:15 [decoder.ogg:4] Invalid file extension for "test.mp3"! 2018/09/25 11:32:15 [decoder.gstreamer:4] Invalid file extension for "test.mp3"! 2018/09/25 11:32:15 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master. 2018/09/25 11:32:15 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples. 2018/09/25 11:32:15 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks. 2018/09/25 11:32:15 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks. 2018/09/25 11:32:15 [video.converter:4] Couldn't find preferred video converter: gavl. 2018/09/25 11:32:15 [threads:3] Created thread "gstreamer_main_loop" (1 total). 2018/09/25 11:32:15 [audio.converter:4] Using preferred samplerate converter: libsamplerate. 2018/09/25 11:32:15 [threads:3] Created thread "generic queue #1". 2018/09/25 11:32:15 [threads:3] Created thread "generic queue #2". 2018/09/25 11:32:15 [threads:3] Created thread "non-blocking queue #1". 2018/09/25 11:32:15 [threads:3] Created thread "non-blocking queue #2". 2018/09/25 11:32:15 [clock:4] Currently 1 clocks allocated. 2018/09/25 11:32:15 [clock.wallclock_gstreamer:4] Starting 1 sources... 2018/09/25 11:32:15 [source:4] Source gstreamer_6181 gets up. 2018/09/25 11:32:15 [source:4] Source video.add_text_6179 gets up. 2018/09/25 11:32:15 [video.add_text_6179:4] Content kind is {audio=2;video=1;midi=0}. 2018/09/25 11:32:15 [source:4] Source map_metadata_6177 gets up. 2018/09/25 11:32:15 [map_metadata_6177:4] Content kind is {audio=2;video=1;midi=0}. 2018/09/25 11:32:15 [source:4] Source mux_6175 gets up. 2018/09/25 11:32:15 [mux_6175:4] Content kind is {audio=2;video=1;midi=0}. 2018/09/25 11:32:15 [source:4] Source mksafe gets up. 2018/09/25 11:32:15 [source:4] Source single_6169 gets up. 2018/09/25 11:32:15 [single_6169:3] "test.mp3" is static, resolving once for all... 2018/09/25 11:32:15 [test(dot)mp3:4] Content kind is {audio=2;video=0;midi=0}. 2018/09/25 11:32:15 [test(dot)mp3:4] Activations changed: static=[], dynamic=[mksafe:mux_6175:map_metadata_6177:video.add_text_6179:output(dot)gstreamer:output(dot)gstreamer]. 2018/09/25 11:32:15 [source:4] Source safe_blank gets up. 2018/09/25 11:32:15 [safe_blank:4] Content kind is {audio=2;video=0;midi=0}. 2018/09/25 11:32:15 [safe_blank:4] Activations changed: static=[], dynamic=[mksafe:mux_6175:map_metadata_6177:video.add_text_6179:output(dot)gstreamer:output(dot)gstreamer]. 2018/09/25 11:32:15 [mksafe:4] Activations changed: static=[mux_6175:map_metadata_6177:video.add_text_6179:output(dot)gstreamer:output(dot)gstreamer], dynamic=[]. 2018/09/25 11:32:15 [source:4] Source playlist.safe_6173 gets up. 2018/09/25 11:32:15 [images(dot)txt:3] Loading playlist... 2018/09/25 11:32:15 [images(dot)txt:3] No mime type specified, trying autodetection. 2018/09/25 11:32:15 [playlist parser:4] Trying application/x-cue parser 2018/09/25 11:32:15 [playlist parser:4] Trying audio/x-scpls parser 2018/09/25 11:32:15 [playlist parser:4] Trying application/x-mpegURL parser 2018/09/25 11:32:15 [images(dot)txt:3] Playlist treated as format application/x-mpegURL 2018/09/25 11:32:15 [decoder:4] Trying method "META" for "./test.jpg"... 2018/09/25 11:32:15 [decoder:4] Trying method "WAV" for "./test.jpg"... 2018/09/25 11:32:15 [decoder:4] Trying method "AIFF" for "./test.jpg"... 2018/09/25 11:32:15 [decoder:4] Trying method "MIDI" for "./test.jpg"... 2018/09/25 11:32:15 [decoder:4] Trying method "IMAGE" for "./test.jpg"... 2018/09/25 11:32:15 [decoder:4] Trying method "PPM" for "./test.jpg"... 2018/09/25 11:32:15 [decoder:4] Decoder "PPM" failed on "./test.jpg": Image.RGBA32.Invalid_format("Not a PPM file.")! 2018/09/25 11:32:15 [decoder:4] Trying method "SDL/IMAGE" for "./test.jpg"... 2018/09/25 11:32:15 [decoder.sdlimage:4] SDL loaded "./test.jpg" as 24bpp. 2018/09/25 11:32:16 [decoder:3] Method "SDL/IMAGE" accepted "./test.jpg". 2018/09/25 11:32:16 [decoder:3] Method "IMAGE" accepted "./test.jpg". 2018/09/25 11:32:16 [decoder.ogg:4] Invalid file extension for "./test.jpg"! 2018/09/25 11:32:16 [decoder.taglib:4] Invalid file extension for "./test.jpg"! 2018/09/25 11:32:16 [decoder.gstreamer:4] Invalid file extension for "./test.jpg"! 2018/09/25 11:32:16 [decoder:4] Trying method "META" for "./test.jpeg"... 2018/09/25 11:32:16 [decoder:4] Trying method "WAV" for "./test.jpeg"... 2018/09/25 11:32:16 [decoder:4] Trying method "AIFF" for "./test.jpeg"... 2018/09/25 11:32:16 [decoder:4] Trying method "MIDI" for "./test.jpeg"... 2018/09/25 11:32:16 [decoder:4] Trying method "IMAGE" for "./test.jpeg"... 2018/09/25 11:32:16 [decoder:4] Trying method "PPM" for "./test.jpeg"... 2018/09/25 11:32:16 [decoder:4] Decoder "PPM" failed on "./test.jpeg": Image.RGBA32.Invalid_format("Not a PPM file.")! 2018/09/25 11:32:16 [decoder:4] Trying method "SDL/IMAGE" for "./test.jpeg"... 2018/09/25 11:32:16 [decoder.sdlimage:4] SDL loaded "./test.jpeg" as 24bpp. 2018/09/25 11:32:16 [decoder:3] Method "SDL/IMAGE" accepted "./test.jpeg". 2018/09/25 11:32:16 [decoder:3] Method "IMAGE" accepted "./test.jpeg". 2018/09/25 11:32:16 [decoder.ogg:4] Invalid file extension for "./test.jpeg"! 2018/09/25 11:32:16 [decoder.taglib:4] Invalid file extension for "./test.jpeg"! 2018/09/25 11:32:16 [decoder.gstreamer:4] Invalid file extension for "./test.jpeg"! 2018/09/25 11:32:16 [images(dot)txt:3] Successfully loaded a playlist of 2 tracks. 2018/09/25 11:32:16 [images(dot)txt:4] Content kind is {audio=0;video=1;midi=0}. 2018/09/25 11:32:16 [images(dot)txt:4] Activations changed: static=[mux_6175:map_metadata_6177:video.add_text_6179:output(dot)gstreamer:output(dot)gstreamer], dynamic=[]. 2018/09/25 11:32:16 [mux_6175:4] Activations changed: static=[map_metadata_6177:video.add_text_6179:output(dot)gstreamer:output(dot)gstreamer], dynamic=[]. 2018/09/25 11:32:16 [map_metadata_6177:4] Activations changed: static=[video.add_text_6179:output(dot)gstreamer:output(dot)gstreamer], dynamic=[]. 2018/09/25 11:32:16 [video.add_text_6179:4] Activations changed: static=[output(dot)gstreamer:output(dot)gstreamer], dynamic=[]. 2018/09/25 11:32:16 [output(dot)gstreamer:4] Activations changed: static=[output(dot)gstreamer], dynamic=[]. 2018/09/25 11:32:16 [output(dot)gstreamer:4] Enabling caching mode: active source. 2018/09/25 11:32:16 [clock.wallclock_gstreamer:4] Delegating clock to active sources. 2018/09/25 11:32:16 [threads:3] Created thread "wallclock_gstreamer" (2 total). 2018/09/25 11:32:16 [clock:4] Main phase starts. 2018/09/25 11:32:16 [clock.wallclock_gstreamer:3] Streaming loop starts, synchronized by active sources. 2018/09/25 11:32:16 [test(dot)mp3:3] Prepared "test.mp3" (RID 0). 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [output(dot)gstreamer:3] Source failed (no more tracks) stopping output... 2018/09/25 11:32:16 [clock.wallclock_gstreamer:4] All active sources stopped, synching with wallclock. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:16 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:17 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:18 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:18 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:18 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:18 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:18 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:18 [images(dot)txt:1] Failed to prepare track: request not ready. 2018/09/25 11:32:18 [main:3] Shutdown started! 2018/09/25 11:32:18 [main:3] Waiting for threads to terminate... 2018/09/25 11:32:18 [threads:3] Thread "gstreamer_main_loop" terminated (1 remaining). 2018/09/25 11:32:18 [threads:3] Shuting down thread wallclock_gstreamer 2018/09/25 11:32:18 [output(dot)gstreamer:4] Activations changed: static=[], dynamic=[]. 2018/09/25 11:32:18 [source:4] Source output(dot)gstreamer gets down. 2018/09/25 11:32:18 [video.add_text_6179:4] Activations changed: static=[], dynamic=[]. 2018/09/25 11:32:18 [source:4] Source video.add_text_6179 gets down. 2018/09/25 11:32:18 [map_metadata_6177:4] Activations changed: static=[], dynamic=[]. 2018/09/25 11:32:18 [source:4] Source map_metadata_6177 gets down. 2018/09/25 11:32:18 [mux_6175:4] Activations changed: static=[], dynamic=[]. 2018/09/25 11:32:18 [source:4] Source mux_6175 gets down. 2018/09/25 11:32:18 [mksafe:4] Activations changed: static=[], dynamic=[]. 2018/09/25 11:32:18 [source:4] Source mksafe gets down. 2018/09/25 11:32:18 [test(dot)mp3:4] Activations changed: static=[], dynamic=[]. 2018/09/25 11:32:18 [source:4] Source test(dot)mp3 gets down. 2018/09/25 11:32:18 [test(dot)mp3:3] Finished with "test.mp3". 2018/09/25 11:32:18 [safe_blank:4] Activations changed: static=[], dynamic=[]. 2018/09/25 11:32:18 [source:4] Source safe_blank gets down. 2018/09/25 11:32:18 [images(dot)txt:4] Activations changed: static=[], dynamic=[]. 2018/09/25 11:32:18 [source:4] Source images(dot)txt gets down. 2018/09/25 11:32:18 [clock.wallclock_gstreamer:3] Streaming loop stopped. 2018/09/25 11:32:18 [threads:3] Thread "wallclock_gstreamer" terminated (0 remaining). 2018/09/25 11:32:18 [main:3] Threads terminated. 2018/09/25 11:32:18 [threads:3] Shutting down scheduler... 2018/09/25 11:32:18 [threads:3] Scheduler shut down. 2018/09/25 11:32:18 [threads:3] Shutting down queues... 2018/09/25 11:32:18 [threads:3] Thread "generic queue #1" terminated. 2018/09/25 11:32:18 [threads:3] Thread "generic queue #2" terminated. 2018/09/25 11:32:18 [threads:3] Thread "non-blocking queue #1" terminated. 2018/09/25 11:32:18 [threads:3] Thread "non-blocking queue #2" terminated. 2018/09/25 11:32:18 [threads:3] Queues shut down 2018/09/25 11:32:18 [main:3] Cleaning downloaded files... 2018/09/25 11:32:18 [main:3] Freeing memory... 2018/09/25 11:32:18 >>> LOG END ``` (i hit ctrl-c to trigger the shutdown)

edit: same thing happens with 'annotate:duration="3":'

edit 2: i resorted to change the images on every new track, using on_track.

MCOfficer commented 6 years ago

today i was messing with LS again, and it turns out that using playlist (with escaped quotes) works as expected. only playlist.safe is running into this error.