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.
Add muxing option; allow --embed-subs to automatically remux if needed #6996
Comments
|
There is already an option for recode: |
|
To clarify, I’m not trying to re-encode. MKV/MP4 muxing is a lossless action; it keeps the original video and audio streams, does not involve re-encoding and takes much less time than the recode command. In Verbose log follows. Not shown is the long wait during the encoding stage before subtitles are embedded.
|
|
Yeah, this would be nice. Whatever subtitle format is picked (either by default or manually with |
|
Just want to add my support to this issue. I was unaware that --embed-subs would fail if the format wasn't already in a compatible format for other reasons. I may delay my archiving tasks until this is fixed because I don't want to have to figure out down the line which ones need to have subtitles redownloaded. It would be great if the solution allows forcing remux to mkv, because for archiving tasks, I want all of the content to have uniform filenames / container formats. |
|
same here, I thought I am doing something wrong. |
|
another +1 from me on this old issue! Right now there seems to be no good solution if the source video's format doesn't support embedding subtitles. The only thing that works is a very slow and unnecessary "recoding" is so slow because youtube-dl calls ffmpeg without any codec information, so ffmpeg just uses sensible defaults based on the output file's container format. For example, here's what youtube-dl calls: after turning up ffmpeg's verbosity you can see it's made these re-encoding choices
In the meantime, I've hacked up my copy of youtube-dl to always pass Here's a tiny diff in case others might find this useful:
|
|
This please. I want to download CR shows, which come in as MP4, but to use the .ass subtitles I need MKV format. I thought --merge-output-format was what I needed, but it only takes effect if it thinks merge is required, which it apparently doesn't. Instead, it simply downloads MP4, converts the .ass file to a different format, and merged. Not good |
Problem
A video from Crunchyroll is downloaded with
--write-sub,--embed-subsand--merge-output-format mkvenabled. The expected outcome is that the downloaded FLV file will be losslessly muxed with the subtitles into an MKV file. What actually happens is that the two files are downloaded as normal without merging; the message[ffmpeg] Subtitles can only be embedded in mp4 or mkv filesis returned.Possible Solution 1
Add an option to remux the video to a given container format without re-encoding. (i.e.
--mux mkv,--mux mp4etc.)Possible Solution 2
Change the behaviour of
--embed-subsso that it automatically remuxes if the file format doesn’t allow embedded subtitles. Allow the container format (MKV, MP4) to be specified if possible.Possible Solution 3
Change the behaviour of
--merge-output-formatto always remux regardless of whether or not a merge is required.Verbose output follows.