I'd like to get the hive mind's perspective on a script that I'm writing to go from Baseline or High 4.1 Profile MKV to M4V to play on iOS 4/5 devices (AppleTV 2, iPad 2, iPhone 4/4S, etc).
After doing some basic reverse engineering of YAMB and GOTSent (sorry richter03, I haven't taken a look at DDCGui yet), this is the basic pseudo code of what I'm doing:
- Get the MKV Info using mkvinfo.
- Parse it to get the following info:
- Track Number
- Track Type
- Default Duration (FPS)
- Language
- Sampling Frequency
- Channels
- Codec ID
- Extract the h264 video track using mkvextract
- Extract the audio tracks using mkvextract
- Process the audio tracks
If there is AAC and neither AC3 or DTS:
Pass it through
If there is no AAC but there is AC3:
Run through eac3to using
Run through neroaacenc using:Code:eac3.exe audio.ac3 audio.wav
[Previously, I used valdec using the GOTSent method:Code:neroaacenc.exe -lc -q 0.35 -ignorelength -if audio.wav -of audio.aac
If there is no AAC but there is DTS:Code:valdec.exe audio.ac3 -wav audio.wav -spk:NUMBER_OF_CHANNELS -fmt:0 -drc -gain:8 -drc_power:8
Run through eac3to using:
Run through neroaacenc using:Code:eac3.exe audio.dts audio.wav
Code:neroaacenc.exe -lc -q 0.35 -ignorelength -if audio.wav -of audio.aac- Remux using mp4box to mp4:
Code:mp4box -add video.h264:fps=FRAMES_PER_SECOND -add audio.aac -add audio.ac3 -add audio.dts out_filename -tmp C:\Temp\
Does anyone have any suggestions to making this better? I'm programming this in python with the intentions of releasing it's source here.
+ Reply to Thread
Results 1 to 1 of 1
Similar Threads
-
dtshd / mkv to m4v
By roughsporty in forum AudioReplies: 1Last Post: 13th Dec 2011, 13:57 -
Hard-coding subs for mkv in automkv
By overwatch in forum SubtitleReplies: 2Last Post: 16th Jan 2010, 09:03 -
Handbrake 0.94 MKV to M4V encoding
By Scarpad in forum Video ConversionReplies: 5Last Post: 7th Dec 2009, 20:44 -
MP4 vs M4V vs MKV vs AVI
By shapper in forum Newbie / General discussionsReplies: 6Last Post: 30th Mar 2009, 17:44 -
mkv -> m4v with AC3 soundtrack problem
By jamesmac in forum ffmpegX general discussionReplies: 2Last Post: 12th Aug 2008, 16:54