Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
When downloading YouTube live video, download from very beginning #21255
Comments
|
I did a quick test myself again.
Part of the log:
The video file I downloaded is only 3min:
The stream, if recorded from very beginning, should be around 4:55 as you can see in above link. |
|
Also by simply looking at the network traffic, you can see youtube-dl will only fetch the new video segments everytime one comes out (instead of trying to catch up all the available segments from the very beginning, which would have a much higher download speed). |
|
Another thing I want to mention is that if you stop the download manually by ctrl-C it will generate a broken (merged) mp4 file. So you have to wait for the stream to end itself, which makes testing hard. This doesn't seem to happen if you download a normal video from YouTube: you can always interrupt the download and the part file (after rename) can be played just fine. |
Cancelling with CTRL+C works for me. |
Did you try on a ongoing live stream? It works on normal video but not live stream here. I just tried again with this (currently ongoing): https://www.youtube.com/watch?v=QWTNIDZw608 The result is the same. I'm on Windows 7 64 bit with newest FFMPEG. Logs
Resulted video: (Unplayable on any player I have, including MPV and MPC-HC). |
|
Try it on Linux? |
|
I don't use Linux, but I may give it a try later in VM. |
Hi, just tested in a Ubuntu 19 VM. Ctrl+C indeed doesn't generate broken file like on Windows (tested on Win 7 and Win 10). But the main issue remains: it doesn't download from the very beginning on Linux either. |
|
Yeah, it doesn't download from the beginning, I was just troubleshooting the other issue. |
|
I don't think you can do it with just youtube-dl, but you can using ffmpeg. Caveats:
Instructions:
Hope this helps. |
Checklist
Description
Currently, when downloading an ongoing live stream video on YouTube, youtube-dl will start from the current time.
I was wondering if we can add a way to download it from the very beginning instead. (I can confirm it is technical-wise possible at least, the video sources are available in m3u8 files etc.).
This way, the user can get the full video once the stream is finished. Otherwise, at least the first few seconds will be missing since you can't really start downloading before the live starts.
Of course, you can start the download when the live is done, which typically will solve this problem. However, some uploaders delete their live stream immediately after premiere, makes it somewhat difficult (also if you wait too long, you can't get HLS version any more, only re-compressed version.)
Thanks.