Hello,
My issue is similar to knightplex's thread here, in that I would like to convert DTS to AAC. However, I wasn't able to find a solution specific to my needs when using MKV files so I didn't want to hijack his thread with my question.
Most of my files contain DTS-HD which I've come to realize is total overkill for my setup. Also I'm running out of space and can't add any more hard drives since I'm out of SATA ports. So basically what I hope to achieve is to batch convert the audio throughout my entire video library and remux the MKVs in the process. Not sure if this is possible in ffmpeg or if there would be a better tool to use, but ideally it would go something like this:
Even if I have to use a combination of ffmpeg and mkvmerge that would be fine, whatever gets the job done. If possible it would be great to not have to demux the DTS-HD audio files first as that will just add an extra step.Code:take input mkv > convert dts-hd track to aac > remux video and subs (if any) from input mkv with new aac track
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 6 of 6
Thread
-
-
Windows command line:
Code:for %F in (*.mkv) do ffmpeg -i %F -map 0 -acodec aac -b:a 160k [or whatever bitrate you want] -vcodec copy -scodec copy %~nF_new.mkv
-
Thanks for the quick reply. A couple follow up questions.
1. Do I need a special version of ffmpeg to decode the DTS-HD and encode the AAC?
2. For MKV files with multiple audio tracks, is there any way to detect which tracks are the DTS-HD ones and only convert those? So say in File "A" it has a DTS-HD track and an AC3 track and then in File "B" there are two DTS-HD tracks and one AC3 track. Is it possible to only convert the DTS-HD tracks and leave the AC3 as is without manually intervening? -
1. The latest Windows build at Zeranoe decodes DTS-HD.
2. FFmpeg maps only on stream type and index, not codec, so you would have to use FFprobe -show_streams to report stats to a file, then parse it to discover which audio streams are DTS-HD, then set appropriate map indices in the call to FFmpeg. This is doable in a batch file. -
Something like (untested):
Code:setlocal enabledelayedexpansion For %%F in (*.mkv) do ( FFprobe -v quiet -show_streams %%F > streams.txt for /f "tokens=* delims==" %%G in (streams.txt) do ( if %%G==index set cur_index=%%H if %%G==codec_name ( if %%H==dtshd ( set recode_list=!recode_list! -c:0:!cur_index! aac ) else ( set copy_list=!copy_list! -c:0:!cur_index! copy ) ) ) FFmpeg -i %%F -map 0 !recode_list! !copy_list! -b:a 160k "newdrive:\path\%%F" set recode_list= set copy_list= )
Last edited by JVRaines; 18th Nov 2016 at 13:27.
Similar Threads
-
How to batch convert/multiplex any files with ffmpeg
By Baldrick in forum User guidesReplies: 215Last Post: 1st Dec 2023, 11:38 -
Batch stabilize script for ffmpeg
By racer-x in forum Video ConversionReplies: 20Last Post: 2nd Jun 2016, 17:10 -
Batch script for forcing subtitles on MKV files.
By hemstock in forum SubtitleReplies: 2Last Post: 9th Oct 2015, 15:40 -
Can I get a little help with an ffmpeg script/batch file?
By Iced Coffee in forum Newbie / General discussionsReplies: 14Last Post: 26th Aug 2015, 01:56 -
Script to Batch edit MKV files with MKVMerge or any other program
By Animebuster in forum EditingReplies: 3Last Post: 21st Oct 2013, 18:17