-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only 1 set of subtitles is copied, seems to be hard coded to English #6
Comments
Currently the subtitle copying feature is a very basic/dirty implementation. The API that I'm using to handle ffmpeg didn't have any subtitle support so I just added a quick and dirty feature to copy the first subtitle track that was found. Some more aggressive additions to the FFMPEG wrapper would let this be improved upon but as of now it isn't possible. As someone who is relatively new to python reverse engineering this wrapper is gonna be challenging; if you were looking for a project to undertake adding support for subtitles to that would be a major help to making this a cleaner implementation. |
I'm looking in to it now :) It seems that in ffmpeg you can specify which audio, video and subtitle streams to copy using the "-map" parameter. See http://ffmpeg.org/ffmpeg.html#Subtitle-options_003a To copy ALL streams simply add "-map 0". You still need "-scodec mov_text" as mp4s are too dumb to play srt/ass formats. Now just trying to find the cleanest way to implement this for this project. Will post back shortly. |
I added another comment but it doesn't seem to have appeared, even though it says there are 2 comments. Anyway, it seems there is no clean way to achieve this using the ffmpeg wrapper script you're using. You can however alter the current hack to force ffmpeg to copy ALL streams, not just the first of each (audio, video, subtitle). Simply replace |
Added some functionality to the ffmpeg wrapper so we can now read subtitle information from multiple streams. Also beefed up the audio reading to allow for multiple streams as well. Eventually we can use this info to intelligently generate our conversion string rather than just blindly copying everything. Lot of work still needs to be done though |
I made a 3.0 branch with a ton of new changes, I rewrote/beefed up a vast majority of the ffmpeg api so it can now handle multiple audio streams and subtitles (also multiple). I still need to figure out how to set forced and default tags in ffmpeg (maybe you can help here) but check out the new branch. I'm genuinely surprised I got everything working so quickly haha Everything seems to be working on my end, if you could give it some testing and let me know if you find any bugs we can get it merged with the master branch quickly |
Awesome work. I've been off work the last few days as I've been sick, but I don't know ffmpeg terribly well (nor python for that matter) but I will On 20 February 2013 09:41, Michael Higgins notifications@github.com wrote:
|
Well done on the new branch. Not sure if my comments are working properly? From what I have found there is apparently no way to enable forced subs in mp4s, see http://forum.doom9.org/showthread.php?p=1579492#post1579492 and also http://forum.doom9.org/showthread.php?t=155544 This is a real shame, because the only other option is to use burned-in subs. Instead I'd rather manually enable subs when they start speaking another language. What I am wondering is why the generated ffmpeg command specifies each piece of metadata, instead of just using the map_metadata paramater (see http://ffmpeg.org/ffmpeg.html#Advanced-options ). Can reduce Down to Probably even more reductions can be made, I'm not sure. I guess the more verbose option gives more control, but also has the potential to miss something? I also wonder why the title of the subtitle streams doesn't seem to have an effect, my mkv streams are "English (forced)" and "English", but end up as "English" and "English" in the mp4 :( The ffmpeg output even suggests it's going to use that piece of metadata (when I use map_metadata) |
3.0 branch has been merged with the master branch, changes are live and mapping is now handled dynamically |
Accidentally submitted this before writing a description, however I think the title sums it up. An important consideration would be handling "forced" subtitles, eg. when a show (like Breaking Bad) is primarily in English but has a few Spanish parts there are two English tracks - English (forced) and English. The former is just the Spanish bits and the latter is everything. Is this doable via ffmpeg?
The text was updated successfully, but these errors were encountered: