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.
ffmpeg/avconv settings to improve encoding of Twitch streams #9082
Comments
|
What you request is achievable with |
|
Thanks for pointing that out, I wasn't aware of that. That does seem to work well, however the options I mentioned here do have an advantage: VLC can recognize the increasing duration of the file as it plays it, and displays it in the progress bar. Without them, it always displays the duration as So it might be helpful to add these encoding settings to the |
I recently discovered that youtube-dl can process Twitch past-broadcast streams with ffmpeg/avconv, which is great. However, with the encoding settings it uses, the resulting file does not allow players to seek or recognize the duration until after the video has been completely downloaded, because the MP4 file does not have fragmentation enabled.
But by using some additional encoding settings, the file can be played immediately, while it is being downloaded and muxed, and players can seek and recognize the increasing duration properly. For example, it works perfectly in VLC 2.2.1.
Here's an example shell command:
This sets the video and audio streams to be copied directly without reencoding, uses the
setptsvideo filter and theasetptsaudio filter to synchronize the timestamps, and uses-frag_size 1048576to set a 1 MB fragment size in the MP4 container, which writes metadata for every 1 MB fragment, rather than writing it at the end of the file (which won't happen until the download is complete).I just pulled from master and looked through
twitch.pyandffmpeg.pybut I couldn't find a way to set encoding options just for Twitch. It might be fine to use these for all encoding, because it would probably benefit much more than just Twitch downloads, but I'll leave that decision to you. :)Thanks for your work on youtube-dl!