|
General Discussion General discussion about SageTV and related companies, products, and technologies. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Convert H.264 Quicktime (eg HD trailers) to MKV with AC3 audio
Figure this might be of interest to the rest of the community. Apple's quicktime site is a great place to find high quality (including 1080p) trailers. But they use AAC audio which doesn't play well with S/PDIF output, and the mov format isn't quite as well supported as mkv.
Being that I've got extenders hooked up to my HT system, I wanted to convert these QT trailers to MKV with AC3 (S/PDIF friendly) audio, with minimal processing/fuss. I found that SageTVTranscoder/ffmpeg could do it in one step, but it always screwed up the channel order. But another problem was it required a parameter for the number of channels to encode, and since the QT trailers come in both Stereo and 5.1 that posed a problem. Being that I'm too lazy to do each trailer by hand, I spent way too much time researching and I finally came up with a single batch file that will remux a QT trailer/file into an MKV with AC3 audio, automatically handling the 2/5.1 channel thing. The requirements:
Then create a batch file with the following contents: Code:
@echo OFF set input=%1 set output=%input:.hdmov=.mkv% if EXIST %output% GOTO EXISTS d:\sagetv\sagetv\sagetvtranscoder.exe -i %input% > fmt.txt 2>&1 findstr /R "Audio.*5\.1" fmt.txt echo. %errorlevel% if %ERRORLEVEL% EQU 0 GOTO DD findstr /R "Audio.*stereo" fmt.txt echo. %errorlevel% if %ERRORLEVEL% EQU 0 GOTO ST goto ERR :DD echo. "It's 5.1!" REM d:\sagetv\sagetv\sagetvtranscoder.exe -i %input% -vn -acodec ac3 -ab 640k -ar 48000 -ac 6 -y tmp.ac3 O:\apps\MPlayer-athlon-svn-28311\MPlayer-athlon-svn-28311\mencoder -channels 6 -oac lavc -lavcopts acodec=ac3:abitrate=640 -ovc frameno -of rawaudio -o tmp.ac3 %input% mkvmerge -o %output% -d 1 -A S %input% -a 0 -D -S tmp.ac3 --track-order 0:1,1:0 goto OK :ST echo. "It's Stereo!" REM d:\sagetv\sagetv\sagetvtranscoder.exe -i %input% -vn -acodec ac3 -ab 192k -ar 48000 -ac 2 -y tmp.ac3 O:\apps\MPlayer-athlon-svn-28311\MPlayer-athlon-svn-28311\mencoder -oac lavc -lavcopts acodec=ac3:abitrate=192 -ovc frameno -of rawaudio -o tmp.ac3 %input% mkvmerge -o %output% -d 1 -A S %input% -a 0 -D -S tmp.ac3 --track-order 0:1,1:0 goto OK :OK "c:\Program Files\MKVtoolnix\mkvmerge.exe" -o %output% -d 1 -A -S %input% -a 0 -D -S tmp.ac3 --track-order 0:1,1:0 del tmp.ac3 REM del %input% goto end :ERR echo. "It's Unknown!" goto end :EXISTS echo. "Already exists, skipping." :end del fmt.txt
Usage: I called my batch file "transcode_mov_ac3_auto.bat", so you simply type "transcode_mov_ac3_auto.bat file.mov" at the command prompt. You can also just drag a trailer on top of the batch file in windows and I think that works, or presumably you could use something like Dirmon to automatically kick it off. Or if you're handy with the command line you could use the for command to do everything in a directory. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Conversion of MKV (h264 w/AC3) = choppy playback | ldavis | SageTV Software | 3 | 10-14-2008 01:57 PM |
HD-PRV and Apple Quicktime H.264/.mp4 files-final nut to crack! | Shield | SageTV Software | 0 | 07-17-2008 03:04 PM |
H.264 ts with AC3 Audio? | Taddeusz | SageTV Beta Test Software | 2 | 07-11-2008 05:22 AM |
No AC3 Filter for MKV files | technazz | SageTV Software | 29 | 01-02-2008 02:56 PM |
r5000hd h.264 vs Quicktime H.264 playback | HawgGuy | Hardware Support | 0 | 04-30-2007 08:09 AM |