Page 1 of 1

[Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Tue Jan 01, 2008 3:16 pm
by kneeslasher
Previously, I was having problems zipping the CC track onto the m4v (the final step), but this is now, I think, fixed by using a slightly different QuickTime component straight from Apple. Updated instructions below.

Proof-of-concept for how to get a DVD's closed captions into the ripped m4v so that the QuickTime/iTunes/iPhone "Show/Hide CCs" option works. I am sure the method can be streamlined.

Software needed:
- DVD Decrypter (Win).
- VSRip (Win).
- Handbrake (Mac).
- McPoodle's SCC Tools (Win).
- QuickTime Pro (Mac).
- ClosedCaptionImporter.dmg from Apple (Mac).



Inspired from:

- How to get your Closed Captions *off* your DVD: http://www.geocities.com/mcpoodle43/SCC ... apture_DVD .
- How to get Closed Captions *into* your m4v file: http://www.zeitanker.com/content/e53/e5 ... x_ger.html and http://www.zeitanker.com/content/e43/e3272/e3404/ . Note: don't use their QuickTime component! The one from Apple seems to be better (https://developer.apple.com/samplecode/ ... index.html).



Here are the steps:

i) Rip and convert your episode/film for your, say, iPhone, from your DVD using Handbrake, using chapter titles, etc., but no (hard) subs.

ii) Extract and dump the DVD from the disc onto your hard disk using DVD Decrypter.

iii) Use VSRip on the dumped files on your hard disk to extract the subtitle/captions information (make sure the "closed caption" option is checked, all the subtitle options can be off). This will create a raw CC file.

iv) Use McPoodle's vobvsub2cc.exe to convert the raw CC file to an SCC closed caption file.

v) Put Apple's ClosedCaptionImporter.component into /Library/Quicktime.

vi) Start up QuickTime Pro.

vii) Open your .scc file with QT Pro (normally this is impossible, but the file you just placed in /Library/Quicktime make it possible).

viii) Open your m4v file in QT Pro as well.

ix) Press Apple-A (select all) on the m4v window in QT Pro.

x) Go to the .scc file window in QT Pro and press Apple-J for movie properties.

xi) Make sure that the aspect ratio is adjust to that of your m4v file.

xii) Make sure the "layer" is set to -4 or something.

xiii) In the .scc window in QT Pro, click on the Edit -> Add To Movie. Do not use copy and paste! What the Add To Movie will do is overlay the video and audio track from your m4v onto your closed caption track.

xiv) Test the file by making sure CCs are displayed, then playing the file. You may have to fiddle with the layer of the CCs, you can change it to -10 or -11 or some such.

xv) If you want to test that the CCs are there but not being displayed, increase the aspect ratio offset of the CC track (in the Apple-J dialogue box) so that there is white space beneath the video where you should see the CCs. Once you see the CCs being displayed, you only really need to fiddle with the layer to make sure that they display on top of the picture once you get rid of the offset.

xvi) This is the final step. Save the whole thing.

xvii) Transfer to your iPhone. Switch on CCs. The iPhone will show CCs. This is the Holy Grail of working softsubs.



I assure you, this process is actually simpler than it sounds: the two tutorials linked at the beginning of the article are probably much clearer than what I've written out here. Despite it taking so many steps, I just wanted to show that getting proper Closed Captions into an iPhone/iPod/iTunes/QuickTime compatible m4v file *is* possible. Any help on getting the process working with less steps would, of course, be highly desired.

Posted: Tue Jan 01, 2008 4:32 pm
by Cavalicious
How could you not see this thread...in the same forum.

http://handbrake.fr/forum/viewtopic.php?t=500

Posted: Tue Jan 01, 2008 4:41 pm
by kneeslasher
I was fully aware of the previous two threads on this issue. Indeed I started one of them (the one you linked to). Those two dealt with asking for support for this issue within Handbrake. This thread is about how to add CCs without Handbrake.

Posted: Tue Jan 01, 2008 5:00 pm
by Cavalicious
Fair enough, but I wouldn't put it in Ponies.

Posted: Tue Jan 01, 2008 5:14 pm
by kneeslasher
Yeah: I was a little perplexed where to put it. It might have been better off in general, except it seems all those who have a keen interest in CCs visit Ponies.

Posted: Thu Jan 03, 2008 8:58 pm
by kneeslasher
It now works. I've just tried it.

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Wed Mar 05, 2008 7:55 pm
by bspline
Is there a way to do this with windows?
I hate hard-encoded subtitles, and now that QT supports *both* subtitles and closed captions, this should be easy to do, but there's no documentation or help that I can find.
Can someone point me to the right direction? BTW, I prefer subtitles to captions, but both are better than nothing...
Thanks!

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Thu Mar 06, 2008 2:23 pm
by kneeslasher
I haven't tried it with Windows yet: presumably, QT for Windows also has the features described?

Incidentally, the method is a little hit and miss: it works in very limited cases. The new CC tool (ccextractor) mentioned on McPoodle's page may help here. Has anyone used ccextractor to get CCs off a DVD?

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Thu Mar 06, 2008 7:57 pm
by bspline
With Windows I couldn't find the place to put ClosedCaptionImporter.dmg, so QTpro won't recognize .scc files.
Apple is really lacking on the whole subtitle/CC deal, lacking documentation, difficult implementation, etc.
I really wish it was as simple as a .sub or a .sif file being overlaid on top of the movie.

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Thu Mar 13, 2008 8:09 am
by Cyander
iTunes CCs are just Quicktime CCs in an MPEG-4 container. They have documentation on Quicktime CCs for programmers.

iTunes Subtitles are MPEG-4 Timed Text tracks. Heck, Quicktime now recognizes and displays proper timed text tracks that are embedded into an .mp4 using mp4box. The catch is that I haven't figured out how to enable them as a subtitle language yet. I wouldn't be surprised if it is some sort of track reference dangling off the video track as expected from the chapter track.

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Mon Jul 06, 2009 12:30 am
by WhosAsking
Cyander wrote:iTunes CCs are just Quicktime CCs in an MPEG-4 container. They have documentation on Quicktime CCs for programmers.

iTunes Subtitles are MPEG-4 Timed Text tracks. Heck, Quicktime now recognizes and displays proper timed text tracks that are embedded into an .mp4 using mp4box. The catch is that I haven't figured out how to enable them as a subtitle language yet. I wouldn't be surprised if it is some sort of track reference dangling off the video track as expected from the chapter track.
Speaking of that, I've been beginning work on the issue of importing Closed Captions into QuickTime without having to resort to the use of a Mac (because that Import filter only works on Macs right now), and based on Apple's source code I'm getting the gist of what's going on.

First off, Apple's source code uses the SCC format. From what I can read, this is out of convenience for them. An importer can use any other format that contains the preserves the raw CC data and times in some way. Second, the Closed Caption track appears to be nothing more than a series of "cdat" atoms (each atom being one of those instances of caption data, encoded 8-bit raw raw as in the ".bin" format) on a timeline. Normally, I would use this information to proceed to code my own converter, but I lack a critical component--enough knowledge of the QuickTime format and/or APIs to be able to do this without messing it all up. Since I'm a hobbyist, I don't have access to the official SDK, of course, but perhaps someone out here can help me out. I can provide a few MOV files that are nothing but a closed-caption track each, if it helps out (I got my hands on a Mac long enough to make a few straight import and saves to get these--that's the hard part, in fact; once you have them saved, you can add them later on the Windows side no problem).

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Mon Jul 06, 2009 2:17 pm
by rhester
Quite interested in this myself, since Subler doesn't seem to be available (even in CLI form) for any platform other than the Mac. Hint. *laughs*

Rodney

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Tue Jul 07, 2009 12:43 am
by WhosAsking
rhester wrote:Quite interested in this myself, since Subler doesn't seem to be available (even in CLI form) for any platform other than the Mac. Hint. *laughs*

Rodney
Well, as they say, nothing to it but to do it. Since I already have an Apple ID (I have QTPro), I just had to add on a bit or two to turn it into an ADC ID and download the QuickTime SDK. It's time to start digging. If I can just get my hands on a primer or something on QuickTime for Windows, I can probably slog my way to a solution. I'm sure plenty of people here would appreciate someone turning this project into a one-platform solution.

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Thu Jul 23, 2009 9:40 pm
by WhosAsking
UPDATE:
I'll be frank. This whole exercise has been like pulling teeth, and it seems even at this point I'm not getting anything near a proper clcp/c608 track (keep getting things like "wide" atoms). Perhaps a better approach would be to bypass QuickTime altogether and create a MOV file directly. However, I need help finding a Windows equivalent of Dumpster (the last Windows version is too old to understand my test files) that'll let me see how a QuickTime MOV file is laid out in tree fashion, showing atom types and so on. Using that and my trusty hex editor on some of my test files may help me to crack the format and create a MOV file directly.

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Fri Jul 24, 2009 2:25 pm
by rhester
Try mp4dump from mpeg4ip.

Rodney

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Fri Jul 31, 2009 8:02 pm
by WhosAsking
rhester wrote:Try mp4dump from mpeg4ip.

Rodney
Well, I got something out of it. I managed to perform a dump on my test MOVs that contains nothing but CC information, though I don't think I have the whole story. If you wish, I could pass along the information to see if anyone can wrap their heads around how c608 data figures into a MOV file. As I've said, my current efforts to do it through QuickTime for Windows have been unproductive--I don't think QTW contains the proper facilities for making closed captions (just transferring and displaying them), which is why the CC importer has been Mac-only for so long. It's tempting to go looking for a Mac Mini, but my budget's too tight. Well, the ordeal continues...

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Fri Jul 31, 2009 11:34 pm
by rhester
Oh, I see - mp4dump will give you the structure but not the content of "private" or unrecognized atoms. Not sure what to recommend in that case besides a good old-fashioned hex editor.

Rodney

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Sat Aug 01, 2009 8:17 am
by Ritsuka
WhosAsking wrote:
rhester wrote:Try mp4dump from mpeg4ip.

Rodney
Well, I got something out of it. I managed to perform a dump on my test MOVs that contains nothing but CC information, though I don't think I have the whole story. If you wish, I could pass along the information to see if anyone can wrap their heads around how c608 data figures into a MOV file. As I've said, my current efforts to do it through QuickTime for Windows have been unproductive--I don't think QTW contains the proper facilities for making closed captions (just transferring and displaying them), which is why the CC importer has been Mac-only for so long. It's tempting to go looking for a Mac Mini, but my budget's too tight. Well, the ordeal continues...
It doesn't contain the code to do it, but you can always write it yourself. Look at how the closed caption importer creates the CC track and how it wraps the samples.

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Mon Aug 10, 2009 4:53 pm
by WhosAsking
Ritsuka wrote:
WhosAsking wrote:
rhester wrote:Try mp4dump from mpeg4ip.

Rodney
Well, I got something out of it. I managed to perform a dump on my test MOVs that contains nothing but CC information, though I don't think I have the whole story. If you wish, I could pass along the information to see if anyone can wrap their heads around how c608 data figures into a MOV file. As I've said, my current efforts to do it through QuickTime for Windows have been unproductive--I don't think QTW contains the proper facilities for making closed captions (just transferring and displaying them), which is why the CC importer has been Mac-only for so long. It's tempting to go looking for a Mac Mini, but my budget's too tight. Well, the ordeal continues...
It doesn't contain the code to do it, but you can always write it yourself. Look at how the closed caption importer creates the CC track and how it wraps the samples.
I tried that already (read about five posts up). Copying the code as close as I could, I keep ending up with junk files that don't even come close to the files made on a Mac. Like I said, I think QTW lacks the facilities to create closed caption tracks from scratch. That's why I need something like Dumpster. In my Hex editor, all I see is a bunch of atoms, but I can't make out which atoms are children of which, and I get lost. The tree format will let me see the proper structure, figure out what atoms are what, and perhaps decipher the layout of the timecode and most importantly the c608 atoms. Once I know the proper layout, I can perhaps come up with a way to write the files without the need for QuickTime.

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Mon Aug 10, 2009 5:51 pm
by Ritsuka
the c608 atom is just a normal sample description atom with a 16bit space for the data reference index.

4 bit reserved
2 bit reserved

16 bit data reference index

http://forum.handbrake.fr/viewtopic.php ... 144#p58091

[partially solved] Non-Handbrake solution for Subs/Captions

Posted: Mon Oct 05, 2009 4:36 pm
by Cawas
While the importer for QT seems nice, SCC do not. I can't generate or find them anywhere, and never even heard of it before this post.

Anyway, mac-wise...

I've used subler http://code.google.com/p/subler/ to properly add a SRT (maybe it would also work with SCC, dunno) file to the m4v generated by handbrake. Great app, highly advised.

The problem now is generating the SRT.

I've tried D-Subtitler 1.0 written by Ludovic Paquot, but it gets a hard time with its OCR, and it works only directly on the DVD, or an image of course. There's also http://www.subsfactory.fr/ for fine tunning subs, but that's more usefull if there's no other way to obtain the subs (like no subs on DVD and internet) or to fix minor details.

Anyway, just with subler I can at least get the subs from internet and ta-da, get the work done with ease!

Hoping to see if anyone could fill the gap here before I find something (which shouldn't be hard, since I'm not searching for months now).

Re: [Updated: SUCCESS!] Non-Handbrake solution for Subs/Captions

Posted: Thu Oct 08, 2009 12:42 pm
by kneeslasher
The best subs OCR program is still on Windows AFAIK. Subrip. But previous to using it, unencrypted DVD content (split up into titles) is needed. So DVD Decrypter is needed as a prelude too.