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.39k stars 128 forks source link

Problems with youtube-pl #2827

Closed Russsgithub closed 1 year ago

Russsgithub commented 1 year ago

Describe the bug While trying to use youtube-pl: protocol as described in another git issue post I get the below error.

2023/01/05 13:51:30 [decoder:3] Unable to decode "/tmp/youtube-pld8cbb7" using image decoder(s)!
2023/01/05 13:51:30 [decoder:3] Available decoders cannot decode "/tmp/youtube-pld8cbb7" as {audio=pcm(stereo),video=canvas,midi=none}

If I try with this code

s = single("youtube-dl:https://www.youtube.com/watch?v=AxRQDYU4WFo")

I get this error

2023/01/05 13:55:20 [lang:3] Failed to execute rm -f '/tmp/liq-process870da1.' && youtube-dl -q -f best --no-playlist -o '/tmp/liq-process870da1.' -- 'https://www.youtube.com/watch?v=AxRQDYU4WFo': timeout (-1)

Executing the single video youtube-dl call on cmd line I have no errors and the video downloads as expected, though as you can see the file has no extention ?

To Reproduce


s = playlist("youtube-pl:RDMMAxRQDYU4WFo")
#s = single("youtube-dl:https://www.youtube.com/watch?v=AxRQDYU4WFo")

f = video.testsrc()

s = fallback(track_sensitive=false, [s, f])

aac_lofi = 
        %ffmpeg(
    format="mpegts", 
    %video(codec="libx264", pixel_format="yuv420p", b="1200k", preset="superfast", r=25, g=50),
    %audio(
        codec="aac",
        samplerate=44100,
        channels=2,
        b="96k",
        profile="aac_low"
    )
)

streams = [("aac_lofi", aac_lofi)]

output.file.hls(playlist="live.m3u8",
                "/tmp/hls",
                streams,
                s)

Expected behavior Youtube playlist to play over hls

Version details

Install method Opam

Common issues Can't decode or encode in some audio format? Check if you have installed the correct dependencies

smimram commented 1 year ago

For youtube-dl you are being hit by the default timeout. You can workaround with

s = single(timeout=600.,"youtube-dl:https://www.youtube.com/watch?v=AxRQDYU4WFo")
Russsgithub commented 1 year ago

Thanks @smimram.On 5 Jan 2023 14:14, Samuel Mimram @.***> wrote: For youtube-dl you are being hit by the default timeout. You can workaround with s = single(timeout=600.,"youtube-dl:https://www.youtube.com/watch?v=AxRQDYU4WFo")

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

smimram commented 1 year ago

I have just changed the default timeout for this protocol to 5 minutes in 4c6c4d052c268459f6dcbf3b7162a0af65074416.