ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.35k stars 9.95k forks source link

Please support --recode-video ts or --recode-video mpegts #13991

Open tv21 opened 7 years ago

tv21 commented 7 years ago

Please follow the guide below


Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.08.18. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

Before submitting an issue make sure you have:

What is the purpose of your issue?


Description of your issue, suggested solution and other information

When downloading a video I often need to convert it to a .ts (transport stream) file, which requires an additional step, typically running something like

ffmpeg "original_file.mp4" -c copy "new_file.ts"

Since ffmpeg supports .ts files, it would be handy if the --recode-video option also allowed specifying ts or mpegts as an option. At present if you try to specify either --recode-video ts or --recode-video mpegts you get "youtube-dl: error: invalid video recode format specified".

What I am requesting may or may not be similar to issue #11498, I didn't fully understand that issue but what I am asking for is a way to re-encode ANY video downloaded from ANY supported site as a .ts file, without having to do an additional separate run of ffmpeg. Most supported sites don't offer a .ts file natively, so I think the only way to do this would be to recode the file. You already support recoding to several other formats, so why not .ts?

tv21 commented 6 years ago

There is one other thing I have discovered. When you get the video from certain sites it is already in .ts format but sometimes in small chunks that would just need to be combined. In such cases the .ts file(s) often contain embedded ATSC closed captions that can be displayed with no problem by a standard ATSC television. However when the .ts files are converted to some other format, the closed captions are either lost, garbled, or converted to a non-embedded format in a separate file (if that option is used), all of which are useless to ATSC television sets. So having the ability to save files that originate in .ts format as .ts files would be a big help for the hearing-impaired.

remitamine commented 6 years ago

So having the ability to save files that originate in .ts format as .ts files would be a big help for the hearing-impaired.

you can use:

--hls-use-mpegts                 Use the mpegts container for HLS videos,
                                 allowing to play the video while
                                 downloading (some players may not be able