How do you use youtube-dl to download live streams (that are live)?

前端 未结 5 634
醉梦人生
醉梦人生 2020-12-07 07:46

Just wondering if that\'s possible or not- when I copy the video URL into YouTube-dl it spits out

[https @ 0x7fc351416080] inflate return value: -3, incorrect         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 08:11

    There is no need to pass anything to ffmpeg you can just grab the desired format, in this example, it was the "95" format.

    So once you know that it is the 95, you just type:

    youtube-dl -f 95  https://www.youtube.com/watch\?v\=6aXR-SL5L2o
    

    that is to say:

    youtube-dl -f  
    

    It will begin generating on the working directory a ..part which is the partially downloaded file, let it go and just press to stop the capture.

    The file will still be named .part, rename it to .mp4 and there it is...

    The ffmpeg code:

    ffmpeg -i $(youtube-dl -f  -g ) -copy .ts
    

    also worked for me, but sound and video got out of sync, using just youtube-dl seemed to yield a better result although it too uses ffmpeg.

    The downside of this approach is that you cannot watch the video while downloading, well you can open yet another FF or Chrome, but it seems that mplayer cannot process the video output till youtube-dl/ffmpeg are running.

提交回复
热议问题