I’m working on a newer version of my automatic MKV to DVR-MS process and found myself needing to do these conversions automatically. So I figured I’d share them so people could use them until my entire process is done.
The main uses from my perspective is to make various video files Media Center compatible, but since MPG and AC3 are pretty much the most standard codecs in the industry, there are plenty of other uses. Both of them require the latest version of DVRMSToolBox, written by my good from Andy. In fact it is what makes the entire process automatic. For both profiles, the DTB temp directory is used to create the files and then the final file is moved back to the location of the original file (in the case of the MKV AC3 files, the name is changed for obvious reasons). Until I release the rest of my process, you can create a simple “process conditioner” to automatically convert these files, or you can run them on demand with DVRMStoMPEGGUI (or queue them up manually).
The first is a very simple VOB to MPG converter. All it does is use ffmpeg to repackage the MPG and AC3 streams into an MPG container. The best way to create a vob to convert is to use something like DVDShrink to rip only the main feature and the main AC3 audio to a single vob. You can use DTS, but as you might know, in the case of Media Center DTS is not supported nativly and thus doesn’t work on extenders. To use this drop “Convert vob into mpg – ffmpeg.dpc” into “C:\Program Files\DVRMSToolbox\Profiles” and put ffmpeg.conf into “C:\Program Files\DVRMSToolbox\Applications\ConvertFfmpeg”
The second one was actually very difficult to get right and I’d still like to do some more testing. What it does is extract a DTS stream from an MKV file, then convert it to AC3 with eac3to, then finally remuxes it back to an MKV with AC3. It only retains the original video and audio streams and in fact doesn’t touch the video stream. To use it you’ll need to download eac3to and MKVtoolnix (both free). First extract the eac3to archive to “C:\Program Files\DVRMSToolbox\Applications\eac3to” and install MKVtoolnix with the isntall path of “C:\Program Files\DVRMSToolbox\Applications\MKVtoolnix\” And of course you’ll have to copy the “Convert MKV with DTS to MKV with AC3.dpc” to “C:\Program Files\DVRMSToolbox\Profiles”
Please let me know if these work for you or not, I’m really hoping to get these throughly tested before my final project is complete.
**Update** Already had to update the DTS to AC3 profile, this one should work better. Thanks Rich.
**UPdate2** Had to update it once again because the AC3 bit rate was too high for dvr-ms files, it is now set to 448 instead of 640.
[…] is the original post: How to automatically convert VOB to MPG and DTS to AC3 Nessun tag per questo […]
[…] Ben Drawbaugh’s DVR-MS Profiles […]
[…] Ben Drawbaugh’s DVR-MS Profiles […]
[…] is to extract the audio, convert it to AC3 and then place it back inside the mkv container. Ben Drawbaugh of EngadgetHD has worked this out using DVRMSToolbox and you can find the profile and files you […]
Hi. I listen to the Engadget HD podcast every week and appreciate all the good work you’re doing. I have a quick question — for an MKV with DTS audio, do you need to use this conversion to AC3 profile before running your MKV to DVR-MS solution? Ultimately I want to end up with something that is compatible with a Linksys DMA2100 extender, but retaining the best video quality I can and surround sound. Thanks.
Neil,
Yes after you convert the audio from DTS to AC3, then you can run it through the MKV to dvr-ms profile. Just go into it and check the “continueonfail” checkbox in the Get Metadata action since that action only works for TV shows. I’m working on a profile just for movies, but am still trying to figure out the best way to make it work.
[…] It’s to convert the audio inside of your MKV containers from DTS to AC3. Ben Drawbaugh authored a profile for DVRMS-Toolbox that will do exactly that. On my lower end laptop it takes about 30 minutes […]
So far, I’ve used your MKV/DTS to MKV/AC3 profile on movie file. Before converting it to DVR-MS, however, I noticed that the aspect ratio was altered (everything appears to be stretched out a bit now). What didn’t make sense was both the original and the converted file both had the same resolution of 1920×1080.
I ended up having to take the video stream from the original and the new ac3 track from the converted file and remuxing them into a new mkv file before converting to DVR-MS.
It’s no big deal for me, considering everything else I’ve done so far trying to get my HD videos to play with 5.1 audio on my DMA2200.
Just thought I’d point this out since you’re working on the profile.
Other than that, thank you. This conversion of the DTS track to AC3 has made my 7MC experience that much better.
I forgot to add:
Yes, I know the profile doesn’t touch the video track. I’ve even looked at the settings to be sure. I don’t get it either.
You are right, that is odd. But don’t worry, I’m working with another blogger to streamline this process which definitely addresses any aspect ratio issues.
Sweet. In the meantime, your solution to convert the MKV’s with DTS to those with AC3 has resolved my audio issue. I happily enjoyed watching 2 HD movies in full surround sound after work today.
All that’s left is this darn conversion to DVR-MS so I can say goodbye to Transcode360 once and for all.
If there’s anything I can do to be of help, including testing, feel free to ask.
In the meantime, keep up the great posts! 😀
Okay, I figured out why the converted mkv files had a different aspect ratio after the conversion to AC3 audio. I edited your DTS>AC3 profile removing the following from the “ArguementsContext” field in the eac3to step:
–display-dimensions 1:12×5
I’ve successfully converted two mkv files with DTS audio to AC3 audio with no change to the video dimensions.
Marc,
Yes, I’ve noticed that as well. I’m actually in the process of refining this procedure and it addresses that problem.
Thanks for tip though.
Ben
My pleasure. This process has helped me immensely since finding your article. Definitely looking forward to the final process.
I used your original MKV to DVRMS guide and it works like a champ. I was curious if it were possible to make a profile so that the WTV files created with an HDPVR can somehow be converted to DVRMS so the Linksys extenders can play them? I know DVRMS doesn’t support the h.264 in them but maybe something like mencoder can change things like it did with the MKV solution?
Send me an example and I’ll see what I can do. Email me at bjdraw at my google mail address with a link to a download.
Just sent along a link to an example file at your convenience.
THanks
This might seem like a ridiculous question, but I stumbled up upon this post while trying to figure out how to change the audio codec in an mkv file from DTS 5.1 to AC3. I followed the steps you outlined above installing DVRMSToolbox, extracting and installing eac3to and mkvtoolnix to the apps folder in DVRMSToolbox. Now, however, I can’t figure out how to actually convert/change the audio in my mkv file. DVRMSToolbox doesn’t seem to be a program..I can’t open the mkv with it, am I missing something? Any help would be appreciated.
–Brutus
I too am confused about the dts to ac3 conversion in a mkv file. There is no option to save the new file as a mkv.
The profile will only create an MKV file. While its true that DTB doesn’t realize it works with mkv, you can just choose all files in the file picker and it works fine.
The output File drop down box doesn’t have “all files”. I have no problem opening the mkv and I have the programs and the profile in the right places but what should my output be?
Overall that GUI leaves a lot to be desired. What I do is just copy and paste the path from the input file and then edit it so it doesn’t overwrite.
OK will try that thanks.
Duration = 00:19:08.3014828
Run C:\Program Files\DVRMSToolbox\Applications\eac3to\eac3to.exe “C:\Users\Public\DvrmsToolbox\DTBTemp\Angels and Demons.dts” “C:\Users\Public\DvrmsToolbox\DTBTemp\Angels and Demons.AC3” -448 -libav -lowPriority
Run C:\Program Files\DVRMSToolbox\Applications\eac3to\eac3to.exe “C:\Users\Public\DvrmsToolbox\DTBTemp\Angels and Demons.dts” “C:\Users\Public\DvrmsToolbox\DTBTemp\Angels and Demons.AC3” -448 -libav -lowPriority
Error in Shell
The directory name is invalid
Action did not complete successfully
Total Duration = 00:19:09.4558848
Can’t get passed this.
Are you sure the paths are valid? Maybe you didn’t extract eac3to into the correct directory?
Yeah I found it. My eac3to directory was missing the 3. Man, thanks for all the help. Maybe I can watch this tonight finally.
I have it working and it works great!
Hey Ben,
Does this retain the original DTS file and add the AC3 as a 2nd audio track or does it replace the DTS file with the AC3 track? I am looking for a way to add the AC3 track so that I can switch audio tracks on Sage for when I’m watching a movie on a TV that doesn’t support DTS decoding, but retain the original DTS track.
It actually deletes all the other audio tracks from the MKV. You can edit it pretty easily to do what you want though, just have to edit the parameters of the mkvmerge command.
Where can I find argument syntax?
nevermind, I found this
http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html
I’m having trouble with the -track-order and ID’ing the audio tracks. How does mkvmerge handle the TempDTS file and give it an ID?
I don’t think I’d take that approach. Instead I’d take the AC3 file that is created and add it back to the original mkv, in which case it’d be as simple as.
mkvmerge -o MyMovie-with-extra-sound.mkv MyMovie.mkv MyMovie.ac3
Can I remane the dpc and post it to the sagetv forums? It would solve a problem that has come up a lot with dts encoded mkv files and people wanting to play them on multiple extenders around the house with varying decoder situations but still retain the original higher res audio.
Yes, of course, just mention you edited mine and link to where you got it from (here).
Of course. Thanks for doing the hard part. I’ll run it on a few more files before I post it.
Okay, so I’m not as far along as I thought I was.
Going back to your plugin (forget what I plan to edit), no matter what I put in the output file dialog box, it will use the input file setting as the output
—————————————————–
InputFile=\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv
Processing actions, this may take some time!!
File is not a dvrms-file
Could not retrieve stream information
Meta data could not be read, some actions may not function properly
Run Profile = Convert MKV with DTS to MKV with AC3
ProcessId = 16412
DvrmsToolbox Version: 1.2.1.8
Throttle DVRMStoMPEG
FWThrottle: \\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv
WaitTime: 5 PollTime
Waiting to process file
Queue file
Duration = 00:00:01.0625000
Waiting for available worker: 10/21/2009 6:43 PM
Worker allocated: 10/21/2009 6:43 PM
Get the value of Context[“InputFile”] and set the value of Context[“TempAC3”]
Context[“InputFile”] = \\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv
Context[“TempAC3”] = \\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv
Duration = 00:00:00.3125000
Get the value of Context[“InputFile”] and set the value of Context[“TempDTS”]
Context[“InputFile”] = \\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv
Context[“TempDTS”] = \\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv
Duration = 00:00:00.0312500
Get the value of Context[“InputFile”] and set the value of Context[“OutputFile”]
Context[“InputFile”] = \\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv
Context[“OutputFile”] = \\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv
Duration = 00:00:00
Get the value of Context[“InputFile”] and set the value of Context[“InputPath”]
Context[“InputFile”] = \\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv
Context[“InputPath”] = \\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv
Duration = 00:00:00
Run C:\Program Files\DVRMSToolbox\Applications\MKVtoolnix\mkvextract.exe tracks “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” 2:”\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv”
Run C:\Program Files\DVRMSToolbox\Applications\MKVtoolnix\mkvextract.exe tracks “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” 2:”\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv”
Extracting track 2 with the CodecID ‘A_DTS’ to the file ‘\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv’. Container format: Digital Theater System (DTS)
Progress: 100%
Duration = 00:00:05.1093750
Run C:\Program Files\DVRMSToolbox\Applications\eac3to\eac3to.exe “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” -448 -libav -lowPriority
Run C:\Program Files\DVRMSToolbox\Applications\eac3to\eac3to.exe “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” -448 -libav -lowPriority
Duration = 00:00:05.1093750
Run C:\Program Files\DVRMSToolbox\Applications\MKVtoolnix\mkvmerge.exe -o “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” –display-dimensions 1:12×5 -d 1 -A -S “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” -a 0 -D -S “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” –track-order 0:1,1:0
Run C:\Program Files\DVRMSToolbox\Applications\MKVtoolnix\mkvmerge.exe -o “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” –display-dimensions 1:12×5 -d 1 -A -S “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” -a 0 -D -S “\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv” –track-order 0:1,1:0
mkvmerge v2.9.8 (‘C’est le bon’) built on Aug 13 2009 12:49:06
Error: The name of the output file ‘\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv’ and of one of the input files is the same. This would cause mkvmerge to overwrite one of your input files. This is most likely not what you want.
Duration = 00:00:05.0937500
Delete the file in Context[“TempAC3”]
Duration = 00:00:00
Delete the file in Context[“TempDTS”]
Duration = 00:00:00
Move the file in Context[“OutputFile”] to %InputPath%
\\Server\Videos\Conversions\Old\Ice Age Dawn of the Dinosaurs (2009).mkv does not exist
Action did not complete successfully
Total Duration = 00:00:17.0781250
Yes that is how I wrote it and it sucks. I’ve written a few more profiles since and totally changed my method to avoid that issue. Without me going into too much detail, what you need to do is edit the change context that is messing it up and edit the regular expression to set the file name to what you want.
I’ll try that.
It also deletes my input file every time. That is a bit annoying.
Yes I know, it sucks. I figured out a better way to do it and in fact I started using the new method in my “Convert MKV to DVR-MS and put in Movie Folder” profile, but it would take me some time to update the old one to make it use the new method. Take a look and see if you can see how it is different.
Nevermind, I just went back and looked and totally forgot how I did it. All you should have to do is delete the context change towards the top that over writes the output file with the input file. Then it should work as you expect it to. Sorry for the confusion.
Holy crap, I’m in regex hell here.
Yeah no kidding, what are you trying to rename?
This might help.
http://gskinner.com/RegExr/
Well, I was trying to take my rudimentary regex knowledge to decipher what you had written and what some of the other processes do, but then I started reading the syntax and my head exploded.
Basically, I can’t get dvrms to recognize that the output file is in a different directory. It always points to the input directory now matter how many lines I delete from your process.
Guys can someone help me !!how can i convert dts audio to ac3 audio on a mkv file!Reason is i got a wdtv hd media player and it doesnt play dts audio!i downloaded all of the above it looks like i extracted the audio from the video but now im lost!!any help i would like.
@Billy,
Your answer is in this blog post.
[…] need to download a new DTB profile called Convert VOB to mpeg – ffmpeg. You can get his from Ben Drawbaugh’s website. Follow his instructions for copying the profile file to the correct place, and replacing the […]
Hi… im getting this error
Error: The name of the output file ‘E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv’ and of one of the input files is the same. This would cause mkvmerge to overwrite one of your input files. This is most likely not what you want.
Duration = 00:00:05.0065006
Delete the file in Context[“TempAC3”]
Duration = 00:00:00.0040004
Delete the file in Context[“TempDTS”]
Duration = 00:00:00.0010001
Move the file in Context[“OutputFile”] to %InputPath%
E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv does not exist
Action did not complete successfully
Total Duration = 00:00:16.0746073
the input and the output are on dif drives so i have no idea 🙁
Thanks
dumb question which i cannot find an answer to:
i am running a 64 bit version of windows, so the predefined path for eac3to is in the c:\Program Files (86) folder insted of c:\Program Files.
So i attempt to change this in the .dpc file using notepad, but after saving the changes the profile no longer loads in DRVMStoMPEGgui.
Repasting the original into the directory works, but I cannot get the edited profile to show.
What do I need to do to modify the .dpc profile files?
alright, i figured out why it is going wrong (or at least partially) but not how to fix it. By changing the path from DC:\Program Files \DVRMSToolbox\Applications\MKVtoolnix\mkvextract.exe to DC:\Program Files (86)\DVRMSToolbox\Applications\MKVtoolnix\mkvextract.exe the engine thinks (86) is a regex group (or something like that).
I still cannot figure out the regex to resolve this issue though
You use DVRMSToolBox Settings to edit the dpc files. Let me know if this doesn’t solve your regex question.
it worked, knew it had to be a simple answer, but could not figure it out…
thanks
Hi Ben, im running your script and it starts out fine then deletes the file somehow… then of course it stops saying it cant find the file?
Context[“InputFile”] = E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv
Context[“InputPath”] = E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv
Duration = 00:00:00.0010000
Run C:\Program Files (x86)\DVRMSToolbox\Applications\MKVtoolnix\mkvextract.exe tracks “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” 2:”E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv”
Run C:\Program Files (x86)\DVRMSToolbox\Applications\MKVtoolnix\mkvextract.exe tracks “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” 2:”E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv”
Extracting track 2 with the CodecID ‘A_DTS’ to the file ‘E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv’. Container format: Digital Theater System (DTS)
Progress: 100%
Duration = 00:00:05.0350000
Run C:\Program Files (x86)\DVRMSToolbox\Applications\eac3to\eac3to.exe “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” -448 -libav -lowPriority
Run C:\Program Files (x86)\DVRMSToolbox\Applications\eac3to\eac3to.exe “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” -448 -libav -lowPriority
Duration = 00:00:05.0320000
Run C:\Program Files (x86)\DVRMSToolbox\Applications\MKVtoolnix\mkvmerge.exe -o “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” –display-dimensions 1:12×5 -d 1 -A -S “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” -a 0 -D -S “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” –track-order 0:1,1:0
Run C:\Program Files (x86)\DVRMSToolbox\Applications\MKVtoolnix\mkvmerge.exe -o “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” –display-dimensions 1:12×5 -d 1 -A -S “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” -a 0 -D -S “E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv” –track-order 0:1,1:0
mkvmerge v3.0.0 (‘Hang up your Hang-Ups’) built on Dec 12 2009 15:20:35
Error: The name of the output file ‘E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv’ and of one of the input files is the same. This would cause mkvmerge to overwrite one of your input files. This is most likely not what you want.
Duration = 00:00:05.0310000
Delete the file in Context[“TempAC3”]
Duration = 00:00:00.0040000
Delete the file in Context[“TempDTS”]
Duration = 00:00:00.0010000
Move the file in Context[“OutputFile”] to %InputPath%
E:\Ghost_in_the_Shell_2.0_(2008)_[720p,BluRay,x264,DTS-ES]_-_THORA.mkv does not exist
Action did not complete successfully
Total Duration = 00:00:16.2410000
I dont get the part about the input file being the same… I have called the output file something completely different?
Thanks
[…] to shove it into a WTV container is pointless. If your MKV files contain DTS, you can use a profile created by Ben Drawbaugh to flip the audio to AC3 before using todvrms for the container swap. (Ben’s provided full […]
Ben, thanks for the great write-up. Any experience converting the video into h264 w/ the ac3 audio in a .wtv container? I know DVD’s are mpeg2 natively so it makes sense just doing the container swap to .dvr-ms. But I’m thinking of possible space saving and future high-def stuff. Thanks…
Just create a new profile from mine and edit the todvrms action and add a -wtv switch.
Thanks for the reply Ben. I tried that, but the resulting .wtv does not play. Do I need the Haali Splitter installed for this? Right now I have the Divx splitter as I was experimenting streaming the h.264 mkv’s right to the 360.
I’d also like to ask you a question on that topic – as it seems you and Andy are the gurus on it. The mkv played nicely on the extender, but when I used “skip” ahead or back, the video would freeze for 5-10 seconds while the audio caught up. Someone suggesting remuxing the mkv into .m2ts – that actually took care of my skip problem – but now I’m not sure if its playing natively on the 360 or being transcoded. Is there a way I could tell?
I never tried it so I’m not sure, installing Haali is probably worth a try.
Yeah playing back mkv on extenders isn’t perfect.
[…] soundtracks are rumored to not work without changing the audio into AC-3. Ben Drawbaugh has laid out steps for this process. I have not attempted this […]