Tool to add subtitles to mp4s
Tool to add subtitles to mp4s
As a side product of my srt releated work on handbrake i wrote a small macos cli-tool that adds subtitle tracks to existing mp4 files.
In case you want to give it a try:
http://muxo.entropicgarden.com/Muxo_v0.1.zip
Its in a really early stage - so don't be suprised if it destroys any files
Right now it only reads srt files - and can't handle any errors. Make sure that you are using a valid srt file or the result will be crap...
Run it without arguments to see how it is used.
I've lots of plans to extend this tool - eventually add a GUI.
Feedback is welcome....
In case you want to give it a try:
http://muxo.entropicgarden.com/Muxo_v0.1.zip
Its in a really early stage - so don't be suprised if it destroys any files
Right now it only reads srt files - and can't handle any errors. Make sure that you are using a valid srt file or the result will be crap...
Run it without arguments to see how it is used.
I've lots of plans to extend this tool - eventually add a GUI.
Feedback is welcome....
Re: Tool to add subtitles to mp4s
Don't suppose you'd be willing to share the source?
I was thinking I might compile on cygwin for windows users, then create a very quick/simple c# gui to interface with it.
I was thinking I might compile on cygwin for windows users, then create a very quick/simple c# gui to interface with it.
Re: Tool to add subtitles to mp4s
So additional infos:
For now it fails if you try to add subs to a file that has already been tagged - so only fresh handbrake encodes for now...
Even worse - it seems that MetaX is stripping my subtitle tracks out
My longterm goal is to create a full mp4 editor - to add/remove all kinds of tracks and metadata to files. All in an ipod/itunes/atv complatible way. Lets see...
http://muxo.entropicgarden.com/Muxo_v0.1a_src.zip
It's still pretty messy tho
For now it fails if you try to add subs to a file that has already been tagged - so only fresh handbrake encodes for now...
Even worse - it seems that MetaX is stripping my subtitle tracks out
Sure! Eventually i want a public svn repo for it...but right now I spend the little time i have available rather on actually implementing something...Don't suppose you'd be willing to share the source?
My longterm goal is to create a full mp4 editor - to add/remove all kinds of tracks and metadata to files. All in an ipod/itunes/atv complatible way. Lets see...
http://muxo.entropicgarden.com/Muxo_v0.1a_src.zip
It's still pretty messy tho
Re: Tool to add subtitles to mp4s
Thanks for this. I was following all your threads on soft subtitles but I think it certainly makes more sense to add the subs after encoding so that we can make sure it syncs up. I can finally start encoding my foreign language movies now.
Just a couple of notes. It will fail to open the file if it has an AC3 track. Also the subs and the black bar are not centered on anamorphic encodes. The width is set to the actual video resolution and so it aligns left on widescreen anamorphic video. Fortunately, the iPhone does not read that information and it shows up nicely centered even on TV out.
Just a couple of notes. It will fail to open the file if it has an AC3 track. Also the subs and the black bar are not centered on anamorphic encodes. The width is set to the actual video resolution and so it aligns left on widescreen anamorphic video. Fortunately, the iPhone does not read that information and it shows up nicely centered even on TV out.
Re: Tool to add subtitles to mp4s
Exactly the kind of feedback i've been hoping for.
I'll try to fix the these issues later today.
I'll try to fix the these issues later today.
Re: Tool to add subtitles to mp4s
Okay entropic, exactly *why* did you decide not to put this right in HandBrake ??
Re: Tool to add subtitles to mp4s
Version 0.2
- now with GUI
- support for files with anamorphic video
- support for movies with ac3 track
http://muxo.entropicgarden.com/Muxo_0.2.zip
- now with GUI
- support for files with anamorphic video
- support for movies with ac3 track
http://muxo.entropicgarden.com/Muxo_0.2.zip
Still ask myself the same questionOkay entropic, exactly *why* did you decide not to put this right in HandBrake ??
Re: Tool to add subtitles to mp4s
If your still willing, I think it would be a great addition to HB. Otherwise kudos on Muxo, very nice. Thanks.entropic wrote:Still ask myself the same questionOkay entropic, exactly *why* did you decide not to put this right in HandBrake ??
Re: Tool to add subtitles to mp4s
Version 0.3
What's new
- Added auto update
- Added more error checks
- Improved subtitle language selection
Known Issues
- Multiple subtitle tracks won't work in iPhone/iPod touch
Download here: http://muxo.entropicgarden.com/muxo.zip
What's new
- Added auto update
- Added more error checks
- Improved subtitle language selection
Known Issues
- Multiple subtitle tracks won't work in iPhone/iPod touch
Download here: http://muxo.entropicgarden.com/muxo.zip
Re: Tool to add subtitles to mp4s
Thanks for continuing to update it. It works perfectly with everything I've throw at it so far.
The only flaws I've encountered (italic tags and the maximum of 2 rows of text), I assume are caused by Quicktime player's shoddy subtitle support because they show up perfectly fine on the iPhone. I'm still debating on whether I want to keep the tags.
Edit: Looks like I spoke a little too early. I finally had time to sit down a watch an entire movie with subtitles added using Muxo. The subtitles stopped showing up half way through the movie. I looked at all my other movies that I added subtitles to and it seemed to be a problem with all of them. The subtitles doesn't always go out at the same point but it's usually after the one hour mark. Looking at the movie properties in Quicktime, it looks like all the subtitle tracks are shorter than movie length. I checked the srt files at the point where the subtitle track stops but they all seem to be.
The only flaws I've encountered (italic tags and the maximum of 2 rows of text), I assume are caused by Quicktime player's shoddy subtitle support because they show up perfectly fine on the iPhone. I'm still debating on whether I want to keep the tags.
Edit: Looks like I spoke a little too early. I finally had time to sit down a watch an entire movie with subtitles added using Muxo. The subtitles stopped showing up half way through the movie. I looked at all my other movies that I added subtitles to and it seemed to be a problem with all of them. The subtitles doesn't always go out at the same point but it's usually after the one hour mark. Looking at the movie properties in Quicktime, it looks like all the subtitle tracks are shorter than movie length. I checked the srt files at the point where the subtitle track stops but they all seem to be.
Re: Tool to add subtitles to mp4s
Doh! Just noticed the same thing... can't belive i've missed this all the timekyc wrote:Thanks for continuing to update it. It works perfectly with everything I've throw at it so far.
The only flaws I've encountered (italic tags and the maximum of 2 rows of text), I assume are caused by Quicktime player's shoddy subtitle support because they show up perfectly fine on the iPhone. I'm still debating on whether I want to keep the tags.
Edit: Looks like I spoke a little too early. I finally had time to sit down a watch an entire movie with subtitles added using Muxo. The subtitles stopped showing up half way through the movie. I looked at all my other movies that I added subtitles to and it seemed to be a problem with all of them. The subtitles doesn't always go out at the same point but it's usually after the one hour mark. Looking at the movie properties in Quicktime, it looks like all the subtitle tracks are shorter than movie length. I checked the srt files at the point where the subtitle track stops but they all seem to be.
Will be fixed in v0.3.2 (eg. probably tomorrow)
Edit
Was quicker then i expected... got it fixed.
Just grab the latest version directly from the appcast http://muxo.entropicgarden.com/appcast.xml or just use auto update in Muxo.
Edit 2
I'm not conviced yet that the subtitle support of quicktime is still so crappy compared to the iphone. Maybe I'm just missing something here.kyc wrote:...The only flaws I've encountered (italic tags and the maximum of 2 rows of text), I assume are caused by Quicktime player's shoddy subtitle support because they show up perfectly fine on the iPhone. I'm still debating on whether I want to keep the tags....
As soon as I figure this out Ill add a feature to Muxo that lets you correct this issue in existing mp4s with subtitles. (+ remove and change language of subtitle tracks...)
Re: Tool to add subtitles to mp4s
I humbly beg of you that, whatever direction this takes, please always make sure a multiplatform, command-line-only version of Muxo exists. There is a huge market for this outside of HandBrake, particularly with past-ripped content. While I'd very much like to see something like this integrated into HB, there will always be a need for a stand-alone tool with this feature set.
Now if only CCExtractor could get the timings right... (van, you ever get my personal message on this?
Rodney
Now if only CCExtractor could get the timings right... (van, you ever get my personal message on this?
Rodney
Re: Tool to add subtitles to mp4s
Wait a second... this tool gives us soft subtitle support in iTunes/Quicktime-compatible mp4s?
Now I need to learn how to rip subtitles from DVDs...
Now I need to learn how to rip subtitles from DVDs...
Re: Tool to add subtitles to mp4s
Methinks entropic has a winner here ...
-
- Bright Spark User
- Posts: 342
- Joined: Mon Apr 14, 2008 5:08 am
Re: Tool to add subtitles to mp4s
i have a file it just plain isn't working with...I've tried using muxo, then tried doing it the old 'manual' way. the ttxt file looks fine, all the track atoms look fine in dumpster. mplayer is recognizing the track and displaying subtitles, ffmpeg recognizes the subtitle track, but neither quicktime nor vlc is even acknowledging the MP4 has an additional track beyond the audio and video.
i'll try using another sub source next, but I'm fairly sure its being saved as a proper SRT, I had jumbler (subtitle tool for os x) save it as sub, then I reopened it and reexported it as an SRT.
not sure what's going on here :/
the only other thing I can think that's odd that I'm doing is using ffmpeg to encode audio, mencoder to encode video, and then muxing it with mp4box, but that shouldn't be a problem? i've tried remuxing the raw AAC and H.264 and subtitles all in one fell swoop with mp4box too.
i'll try using another sub source next, but I'm fairly sure its being saved as a proper SRT, I had jumbler (subtitle tool for os x) save it as sub, then I reopened it and reexported it as an SRT.
not sure what's going on here :/
the only other thing I can think that's odd that I'm doing is using ffmpeg to encode audio, mencoder to encode video, and then muxing it with mp4box, but that shouldn't be a problem? i've tried remuxing the raw AAC and H.264 and subtitles all in one fell swoop with mp4box too.
Re: Tool to add subtitles to mp4s
So, how would one generate a compatible subttle file from a DVD in OSX? I want to play around with this, but just realized I've never tried to create a subtitle file in OSX (and it's been awhile in Windows as well).
Re: Tool to add subtitles to mp4s
Perhaps D-Subtitler will be suitable, although I still prefer using Subrip under Windows.
-
- Bright Spark User
- Posts: 342
- Joined: Mon Apr 14, 2008 5:08 am
Re: Tool to add subtitles to mp4s
tried different video files, different srt sources...same odd results. I was fine until I started muxing with mp4box (oooold version, 0.4.3dev), next step for me is trying to get it recompiled on OS X, which seems to be a chore right now...
-
- Bright Spark User
- Posts: 342
- Joined: Mon Apr 14, 2008 5:08 am
Re: Tool to add subtitles to mp4s
found a binary version of 0.4.4 MP4Box, Quicktime and VLC still don't want to pick up that an additional track beyond video even exists
to recap:
i'm transcoding 720p MKVs to raw H.264 using MEncoder (so no audio, just the raw H.264 video, I've also done a standard XviD dvd rip in an AVI)
making that into an MP4 using mp4box -add file.264#video container.mp4
then using Muxo
this won't work, so I tried
mp4box -ttxt file.srt
then
mp4box -add file.ttxt -add file.264#video container.mp4
and then used dumpster to change the media handler to sbtl
still won't work. :/
pleae let me know what could help you further, if you would like example files I can probably upload something to rapidshare containing a small sample file, the raw H.264, and the muxed MP4 that quicktime can't recognize the subtitles in
to recap:
i'm transcoding 720p MKVs to raw H.264 using MEncoder (so no audio, just the raw H.264 video, I've also done a standard XviD dvd rip in an AVI)
making that into an MP4 using mp4box -add file.264#video container.mp4
then using Muxo
this won't work, so I tried
mp4box -ttxt file.srt
then
mp4box -add file.ttxt -add file.264#video container.mp4
and then used dumpster to change the media handler to sbtl
still won't work. :/
pleae let me know what could help you further, if you would like example files I can probably upload something to rapidshare containing a small sample file, the raw H.264, and the muxed MP4 that quicktime can't recognize the subtitles in
Re: Tool to add subtitles to mp4s
You sure you changed the file extension over to .m4v? Quicktime wont recognize the track otherwise.mp4box -add file.ttxt -add file.264#video container.mp4
If this is not the issue, please upload a sample and i'll figure out why it doesn't work with muxo.
-
- Bright Spark User
- Posts: 342
- Joined: Mon Apr 14, 2008 5:08 am
Re: Tool to add subtitles to mp4s
oh god.entropic wrote:You sure you changed the file extension over to .m4v? Quicktime wont recognize the track otherwise.mp4box -add file.ttxt -add file.264#video container.mp4
If this is not the issue, please upload a sample and i'll figure out why it doesn't work with muxo.
i just spent literally 12 hours (after I got home from work at 4 PM EST until now at 3:56 AM EST) hacking around with trying to compile mp4box 4.5, different muxing techniques, different x264 encoding techniques, different shell scripts etc etc etc
and all it was, was that I didn't change to m4v
thanks SO much for all your work on this by the way, as long as I'm posting
EDIT: well, quicktime is recognizing it, but they're not actually displaying in either itunes or quicktime. under visual settings in the movie properties in quicktime, it says the subtitle track is "0x60" pixels, which I'm assuming is the problem, or is this not a problem and something else is wrong?
EDIT2: yep, changing the width from 0 and then changing the offset from -60 fixed it
Re: Tool to add subtitles to mp4s
Is this happening when you add the subtitle track with muxo, or if you do it with mp4box?yep, changing the width from 0 and then changing the offset from -60 fixed it
I know for a fact that mp4box is not handling everything correctly (in the sense of 'not the apple way') when adding subtitles.
If muxo does it, please give me a small sample file so I can try to fix it.
-
- Bright Spark User
- Posts: 342
- Joined: Mon Apr 14, 2008 5:08 am
Re: Tool to add subtitles to mp4s
muxo, I had a 'clean' (mp4box'd raw AAC + raw H264) file, then muxo'd subs in...I'll cut down the size a little bit (its 720 MB, maybe I'll make a 1 minute sample?) and upload it to rapidshare later, and then edit this post to include the linkentropic wrote:Is this happening when you add the subtitle track with muxo, or if you do it with mp4box?yep, changing the width from 0 and then changing the offset from -60 fixed it
I know for a fact that mp4box is not handling everything correctly (in the sense of 'not the apple way') when adding subtitles.
If muxo does it, please give me a small sample file so I can try to fix it.
EDIT:
~ 1 min clip of the movie: http://rapidshare.de/files/39252654/muxotest.m4v.html
srt file I'm using: http://rapidshare.de/files/39252657/lost.srt.html
Re: Tool to add subtitles to mp4s
Everything looks great on Quicktime but now how do I "turn on" subtitles on AppleTV, I've already switched to on the show closed captions option in the settings menu, but still nothing.
Anyone has a clue?
Anyone has a clue?