|Oct 19, 2008, 04:53 AM||#1|
How to make CC on a win OS?
The ATV now supports CC (soft subs) - in a beta version I know - but still I'm interested in experimenting with it.
Whenever hearing about making CC I hear Muxo or Compressor which both are non-windows compatible afaik.
Anyone has a solution for embedding CC in my h264 when using a Win OS only?
I'm not buying a mac quite yet so that doesnt count for a valid solution
Any pointers are greatly appreciated as I have been unable to find anything on google that remotely solves my problem.
|Oct 19, 2008, 07:32 AM||#2|
You can use MP4Box to import a ttxt file into your mp4 file:
MP4Box -add [ttxtfilepath]:lang=[yourlangcode] [path_to_a_valid_mp4_file]
You can convert a .srt file to .ttxt using:
MP4Box -ttxt [srtfilepath])
Afterwards you need to edit a your .mp4v (on Mac use Dumpster, I don't know about a Windows equivalant). Set moov..mdia.hdl.subType to sbtl. Now you have your subtitles on your Apple TV. However the top is cut off and just one line is displayed.
|Oct 20, 2008, 05:07 PM||#3|
Thanx for your reply - I was closer than I thought.
Here is what I've done so far
1) Converted to h264 from mkv
2) Extracted subs from original mkv with MKVExtractGUI that's based on mkvtoolnix (http://www.videohelp.com/tools/MKVExtractGUI)
3) Converted to ttxt via yamb that's based on mp4box (http://yamb.unite-video.com/)
4) added the ttxt stream to the container by using yamb
5) ensured that the extension was m4v and not mp4 (you can just rename to get the proper effect)
6) Used QT Atom Viewer (http://tsviatko.jongov.com/index_prj...timeviewer.htm) to determine my point of entry which you stated and is mentioned here http://hendrik.kaju.pri.ee/2008/08/2...tles-revealed/. The Atom viewer was veeery slow but it got it gave me a hex offset.
7) Used ultraedit (http://www.ultraedit.com/downloads/u..._download.html) to find the offset and change it to the correct value (text->sbtl). For future passes I think i will skip step 6 and just seach in the binary code for "text".
8) Tada... captions that can be switch on/off via QT (havnt tried it on my ATV yet though.
- The language is listed as "unknown". How can one change that?
- The subtitle is located top left instead of bottom center. How to change that?
|Oct 25, 2008, 04:57 PM||#4|
Did some more digging:
- The undefined language track was my own fault - I didnt explicitly select the language for the stream. When selecting this it worked like a charm.
However, when I try to insert 2 text streams by doing the same steps (listed above) I am only able to control 1 of the added streams. The second stream is not listed as a possible selection i QT but is still shown (as subs) all the time and hence I have 2 text streams displayed when I select the first one to be enabled in QT. I assumed that I was able to add more that one text stream.
Is this a known error or am I doing smth wrong?
- I still have position problems with the ttxt. I have played with the settings according to http://gpac.sourceforge.net/doc_ttxt.php but still no cigar. Is this a known error as well or have I forgotten smth obvious?
- I have tried to embed srt's instead of ttxt's but these show even bigger problems (very large text). Funny thing is that if I don't do the "text"->"sbtl" step the text looks acceptable and in the right position but with no QT enable/disable support. Which of srt or ttxt is the better choice when the final goal is ATV (in a future ATV update that supports CC correctly of course) - religion or ...?
Any inputs are very welcome - especially if the errors above are known errors and hence would be pointless to hunt down.
|Oct 26, 2008, 11:42 AM||#5|
I've done some more testing
I've actually just tried to play the m4v on the ATV and here subs has the correct position when using ttxt's. It would seem that it is QT that is flawed in this equation. I can - as expected - switch the text stream on and off via the option menu on the ATV when playing the m4v.
Initially the subtitle looks as it should - no cut-off but just one line. I dont think it is a problem for me just yet because my test subject (The.Orphanage.2007.720p.BluRay.DTS.x264-ESiR.mkv) doesnt seem to have 2 liners any where (?). I must say I find it perfect until now.
Only thing left (just for the sake of completeness) is to obtain more text streams in same m4v (different languages) but my efforts has been in vain so far.
As always input is greatly appreciated.
|Nov 14, 2008, 06:42 PM||#6|
There is a second way however. Edit it directly in Dumpster. The offset is stored in moov > trak > tkhd > matrix. In my example I set an offset of 158x500 for my movie. This resulted in the following values in the last line of the matrix: 0.0158, 0.0500, 0.01. You get the picture
|Nov 15, 2008, 07:24 PM||#7|
Actually looking at it again. You don't even need to set the position of the subtitles in Dumpster. The ttxt file contains the position too. Just look at the following code from my file:
<TextStreamHeader width="400" height="60" layer="0" translation_x="158" translation_y="500">
Now I wish there was a way to get rid of Dumpster altogether. Maybe dump the track as xml with mp4box, change its handler subtype to "sbtl" and then import those settings back into the movie file?
|Nov 16, 2008, 10:09 AM||#8|
Thank you for your replies. I have - until now - concluded that things work fine on ATV but not so good in QT. Until those two handle text streams similar I wont do anything further.
However, I'm still investigating on how to embed more that 1 text stream in the m4v container but havnt been able to do so. Any pointers on this issues would be very welcome... and please remember that everything has to be done on a Win OS platform.
|Nov 16, 2008, 02:14 PM||#9|
Basically there is no limit for the number of subtitle tracks. You can use MP4Box to add a bunch of subtitles. Just indicate the language of the subtitle with the three letter country code (use MP4Box -languages to get a list of the supported country codes). Then change the handler subtype of the tracks from text to sbtl.
Since you most probably want to see only one subtitle track at the same time you need to put them all in the same alternate group. You'll find the "alternateGroup" in each tracks header (moov/trak/tkhd). Each alternate group is just a unique value inside the movie. Since alternate group 1 is usually taken by alternate audio tracks you can take alternate group 2. Just put the same value into all subtitle tracks alternate groups.
That's it. This should work on Windows as well as on Mac OS X. The only difference is how you edit the QT atoms. On Mac OS X you can do that with Dumpster (that's what I'm using). On Windows you can do that with QT Atom Viewer and a hex editor.
I only tried playing that movie on my Mac in Quicktime since I don't have an Apple TV. It works fine on the Mac. I suppose that later firmware upgrades for the Apple TV will fix the subtitle problem you described earlier in this thread.
|Jan 4, 2009, 11:29 AM||#10|
Better late that never - but I finally got around to test your suggestion.
You are indeed right! I changed the alternate group from 0 to 2 for both sbtl tracks and everything worked as it should! Thank You.
I desperately need dumpster for windows though (is such a project perhaps in the making somewhere?) the Atom viewer is not what I need and I found myself counting offset bytes based on the Movie Atoms documentation - way too error prone...
|Jan 12, 2009, 07:36 PM||#11|
Muxo is no help as its development has stopped and Handbrake has refused to accept the patches to include this in the program.
I assume either MP4Box or a modified AtomicParsley should be able to set this bit correctly (and I'm half thinking of traversing the sourcecode for mp4box to search for the ttxt atom and change it to sbtl and recompile, just to see how it goes).
Have you found anything on this front?
|Jan 18, 2009, 07:29 AM||#12|
This was idd to be my next step. I havnt got around to reversing the code but it shouldt be too hard as the principle - as you state - is fairly simple.
This will be a long term project for me so dont expect anything too soon I will post any findings here none-the-less, I hopy equally minded will do the same.
|Feb 2, 2009, 05:23 AM||#13|
Well. I have tried.
I have traversed as best as I can the MP4Box code. I can't find which instance of "text" is the one that actually sets the atom's fourcc name.
Since using sed from the command line to replace all instances of "text" (or "0000text0000" if you want to play it safe) works to set all text tracks so they're recognized by apple programs and devices (except for the non-touch ipods) and pre-setting in the ttxt the correct width (full width of video) and height (20% of height of video) ends up giving perfect subtitles, changing that atom's fourcc from "text" to "sbtl" should be enough to create the track properly to begin with (instead of having to run the whole video through a search & replace routine).
I've gone and asked in the sf forums for MP4Box for help on where to locate this fourcc to change it in source and compile a personal version (as I only want to see the videos in Apple devices. I've also separately made a request for an "Apple Format" switch in the app itself. Seeing the activity of these forums I suspect none of these two will be answered.
|Feb 23, 2009, 09:30 AM||#14|
I am having some problems with using your sed method.
I am using the line:
sed s/0000text0000/0000sbtl0000/ <movie.m4v >movie_sub.m4v
But the resulting fille is unreadable by quicktime or dumpster.
I have also been trying to automate the encoding process, the sbtl part and the automatic positioning of the sub in the .ttxt is still giving me problems.
|Feb 23, 2009, 03:47 PM||#15|
cat tmp_"$NEWFILE" |sed -e's/text/sbtl/g' > "$NEWFILE"
I was documenting this yesterday here: http://forum.entropicgarden.com/view...p=15367#p15367
When I got a PM elsewhere pointing me to this: http://forum.doom9.org/showthread.php?t=145192
And then today I got another, to an open source muxo alternative: Subler.
So I'm a happy camper now.
|Feb 23, 2009, 04:14 PM||#16|
You Sir, are my hero!
I will pass on the subler way, because it uses a GUI.
But I will try to use the C code on my windows box.
The reason I want to use a Windows machine to encode is because my fastest Mac OS machine is a PowerMac G4 450dp and the Windows machine is a Core2Duo.
If there is an alternative to Vroksub (A subtitle downloader for opensubtitles.org) I want to switch the rest of the handling to my Mac machines.
This is what I have so far on my Windows Server (my Mac os knowledge isn't enough to come with a equivalent
::Lock the conversion
IF EXIST d:\CONVERSION\lock.txt GOTO END
copy d:\CONVERSION\lockfile\lock.txt d:\CONVERSION\lock.txt
::Copy all Downloaded files and unpack the rars
::Move files to D:\downloaded\
MOVE D:\bittorrent\done\*.* D:\downloaded\
::Unrar Downloaded files - var %%r and delete the rars
for /f %%r IN ('dir /b /s *.rar') do call start /wait cmd /c "%WINRAR% X -o+ %%r"
DEL /q /S *.r??
:elete the sample movies
del /s /q *sample*.*
::Sort movies by type
::Move The TV Shows into the conversion directory per show
for /f %%a IN ('dir /b /s *bones*.avi') do call start /wait cmd /c "move %%a D:\video\avi\tvshows\bones\unsubbed\"
::Move AVI files into the conversion directory
for /f %%b IN ('dir /b /s *.avi') do call start /wait cmd /c "move %%b D:\video\avi\unsubbed\"
::Move MKV files into the conversion directory
for /f %%c IN ('dir /b /s *.mkv') do call start /wait cmd /c "move %%c D:\video\mkv\unsubbed\"
::Find subtitles for the TV Shows
start /wait "%VROKSUB% "D:\video\avi\tvshows\bones\unsubbed" nl /move="D:\video\avi\tvshows\bones\subbed""
::Find subtitles for the avi's
start /wait "%VROKSUB% "D:\video\avi\unsubbed" nl /move="D:\video\avi\subbed""
::Find subtitles for the mkv's
start /wait "%VROKSUB% "D:\video\mkv\unsubbed" nl /move="D:\video\mkv\subbed""
::rename nl named files to usable files - var %%d
for /f %%d IN ('dir /b /s *.avi') do call start /wait cmd /c "rename %%~nd.nl.srt %%~nd.srt"
::Convert Srt to TTXT - var %%e %%f %%g
for /f %%e IN ('dir /b /s *.srt') do call start /wait cmd /c ""%MP4BOX%" -ttxt "%%e""
move *.ttxt e:\convert\tvshows\subbing\
DEL /q *.srt
for /f %%f IN ('dir /b /s *.srt') do call start /wait cmd /c ""%MP4BOX%" -ttxt "%%f""
move *.ttxt e:\convert\avi\subbing\
DEL /q *.srt
for /f %%g IN ('dir /b /s *.srt') do call start /wait cmd /c ""%MP4BOX%" -ttxt "%%g""
move *.ttxt e:\convert\mkv\subbing\
DEL /q *.srt
::Conversion LOOP for Subtitled Movie files
IF EXIST D:\video\avi\tvshows\bones\subbed\*bones*.avi GOTO BONES
IF EXIST D:\video\avi\subbed\*.avi GOTO AVI
IF EXIST D:\video\avi\subbed\*.avi GOTO MKV
IF EXIST D:\video\DVD\*.* GOTO DVD
::Convert the TV Show Bones, Add iTunes Episode information and finish it
::Handbrake converts SUBBED AVI to M4V without chapters - var %%a
for /f %%a IN ('dir /b *.avi') do call start /wait cmd /c ""%HANDBRAKE%" -i "%%a" -t 1 -c 1 -o "e:\convert\tvshows\subbing\%%~na.m4v" -f m4v -4 -X 960 -P -e x264 -q 0.59 -2 -T -a 1,1 -E faac,ac3 -B 160 -R 48,0 -6 dpl2,dpl2 -D 1,1 -x level=30:cabac=0:ref=3:mixed-refs=1:bframes=6:weightb=1:direct=auto:no-fast-pskip=1:me=umh:subq=7:analyse=all -v"
DEL /q *.*
::mux ttext into m4v - var %%h
for /f %%h IN ('dir /b *.m4v') do call start /wait cmd /c ""%MP4BOX%" -add "%%~nh.ttxt":lang=nld "%%h""
::Rename TV Show to usable format
::Rename file for further processing - Bones.S04E14.HDTV.XviD-LOL.m4v to Bones-04-14.m4v
for /f "tokens=1,2,3,4* delims=.SE" %%a IN ('dir /b *.m4v') do rename %%a.S%%bE%%c.%%d*.m4v %%a-%%b-%%c.m4v
::Goto working directory
::Set iTunes Atoms
for /f "tokens=1,2,3 delims=-." %%a IN ('dir /b *.m4v') do %ATOMIC% %%a-%%b-%%c.m4v --stik "TV Show" --genre "TV Shows" --TVShowName "%%a" --TVSeasonNum "%%b" --TVEpisodeNum "%%c" --TVEpisode "%%b%%c" --artwork d:\conversion\art\bones\bones.jpg"
move *.m4v e:\convert\tvshows\finished\
DEL /q e:\convert\tvshows\subbing\*.*
::Handbrake converts SUBBED AVI to M4V without chapters - var %%a
for /f %%a IN ('dir /b *.avi') do call start /wait cmd /c ""%HANDBRAKE%" -i "%%a" -t 1 -c 1 -o "e:\convert\avi\subbing\%%~na.m4v" -f m4v -4 -X 960 -P -e x264 -q 0.59 -2 -T -a 1,1 -E faac,ac3 -B 160 -R 48,0 -6 dpl2,dpl2 -D 1,1 -x level=30:cabac=0:ref=3:mixed-refs=1:bframes=6:weightb=1:direct=auto:no-fast-pskip=1:me=umh:subq=7:analyse=all -v"
DEL /q *.avi
::mux ttext into m4v - var %%i
for /f %%i IN ('dir /b *.m4v') do call start /wait cmd /c ""%MP4BOX%" -add "%%~ni.ttxt":lang=nld "%%i""
move *.m4v e:\convert\avi\finished\
DEL /q e:\convert\avi\subbing\*.*
::Handbrake converts subbed MKV to M4V without chapters - var %%a
for /f %%a IN ('dir /b *.mkv') do call start /wait cmd /c ""%HANDBRAKE%" -i "%%a" -t 1 -c 1 -o "e:\convert\avi\subbing\%%~na.m4v" -f m4v -4 -X 960 -P -e x264 -q 0.59 -2 -T -a 1 -E faac -B 160 -R 48 -6 dpl2 -D 1 -x level=30:cabac=0:ref=3:mixed-refs=1:bframes=6:weightb=1:direct=auto:no-fast-pskip=1:me=umh:subq=7:analyse=all -v"
DEL /q *.mkv
::mux ttext into m4v - var %%j
for /f %%j IN ('dir /b *.m4v') do call start /wait cmd /c ""%MP4BOX%" -add "%%~nj.ttxt":lang=nld "%%j""
move *.m4v e:\convert\mkv\finished\
DEL /q e:\convert\mkv\subbing\*.*
rem call start /wait d:\CONVERSION\BATCHFILES\DVD.BAT
|Apr 12, 2009, 09:13 AM||#17|
Thx for your replies - seems as if we are at the end of the road for now.
I have validated your findings and can now sum up :
- It is my experience that the new MP4box release writes sbtl instead of text so you dont have to do this step anymore
- It is my experience that you are required to change alternate group if you have more that one language track.
The executive summary on the original problem "how to make CC on a win OS?" will hence be:
I'm looking forward to when HB will support it all - according to the roadmap it will be available in the next public release.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Does Win 8.1 run cooler than Win 7?||ilian92||Windows, Linux & Others on the Mac||5||Mar 18, 2014 12:33 AM|
|Win 8 to win 8.1 with boot camp again or to update?||vigorito||Windows, Linux & Others on the Mac||1||Dec 23, 2013 04:13 AM|
|How to make iso file from win 8 bootable files for bootcamp||vigorito||OS X 10.8 Mountain Lion||0||Dec 17, 2013 05:11 AM|
|How to Download Win 8.1 ISO with Win 8 Retail Key||xcodeSyn||Windows, Linux & Others on the Mac||2||Oct 22, 2013 11:06 PM|
|How to make the font size bigger under Win XP Mode on rMBP?||deltauser||Windows, Linux & Others on the Mac||1||Mar 19, 2013 12:25 PM|
All times are GMT -5. The time now is 09:10 AM.