Skip to content

Instantly share code, notes, and snippets.

Last active October 22, 2022 21:50
What would you like to do?
youtube-dl and ffmpeg with a YouTube live stream

The following will get the YT livestream (it should be a .m3u8 file), and will output multiple %d.mp4 files, every 20 seconds thanks to ffmpeg:

ffmpeg -i `youtube-dl --youtube-skip-dash-manifest -g ""` -c copy -flags +global_header -f segment -segment_time 20 -segment_format_options movflags=+faststart -reset_timestamps 1 "%d.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment