Printable Version of Topic
Click here to view this topic in its original format
Unofficial VirtualDub Support Forums > Advanced Video Processing > How To Reencode Mkv To Mp4 ?


Posted by: MhXDigital Feb 27 2011, 10:20 AM
Hi there,
I've got an MKV file (x264 Video + MP3 Audio) that I'm trying to reencode to MP4 (x264 Video + AAC+ Audio) through the external encoder feature in VirtualDub, Here are the commands I'm using :

x264
CODE
--level 5.1 --bitrate 464 --no-deblock --min-keyint 12 --open-gop none --bframes 2 --b-adapt 2 --b-pyramid strict --scenecut 36 --ref 2 --qpmin 8 --qpmax 31 --qpstep 8 --aq-mode 0 --ipratio 1.4 --pbratio 1.3 --ratetol 0.01 --no-mbtree --no-fast-pskip --cqm "jvt" --me umh --merange 24 --direct spatial --subme 6 --partitions all --trellis 0 --psy-rd 0.08:0 --demuxer raw --input-csp i420 --input-res %(width)x%(height) --fps %(fpsnum)/%(fpsden) -o "tempvideofile" -

(video.264 as output filename)

AAC+ (Nero)
CODE
-if - -of "tempaudiofile" -cbr 48000 -hev2

(audio.mp4 as output filename, Audio input format is set to WAV file and the audio compression dialog in VirtualDub is set to PCM)

Muxer (MP4Box)
CODE
-add "video.264" -add "audio.mp4" -fps %(fps) "%(outputname)"

I keep on getting an error message about audio encoding process, I've tried extracting the audio from the MKV to a WAV file, feeding it once again to VirtualDub through the External Audio File feature doesn't solve the problem. So, is there a way to convert that MKV file to an MP4 in VirtualDub, or if this is impossible, is there a work around that will help me do so, maybe encode the video using VirtualDub and mux it with the audio encoded with another app.

Please help, and thanks in advance smile.gif

Posted by: phaeron Feb 27 2011, 11:00 PM
I don't have the Nero AAC encoder installed on this machine at the moment, but I think you need to pass it a command-line parameter to tell it to ignore the size fields in the WAV stream.

Posted by: DarrellS Feb 28 2011, 12:40 AM
Virtualdub is not the tool you need for this. The x264 video does not need to be re-encoded.

Use mkvextractgui to demux the elementary streams. Convert the mp3 audio to aac. Use mp4boxgui or yamb to mux the files into an mp4 container.

You can use foobar 2000, dBpoweramp or Nero Wave Editor to convert the mp3 to aac.


Posted by: DarrellS Feb 28 2011, 12:57 AM
For mp4box.exe, I have...

-add "%(tempvideofile)" -add "%(tempaudiofile)" "%(outputname)" -fps %(fps)

Important: "Delete output file before starting" must be enabled in the encoder profile


For neroaacencode, I have...

-q 0.35 -ignorelength -if - -of "%(tempaudiofile)"
%(outputname).aac

under audio, wav and bypass compression ticked.


Posted by: davexnet Feb 28 2011, 11:40 PM
An alternative method is to use Avidemux.
Leave video on"copy"
Set audio to your desired type.

Set container to mp4. Save the file.

Posted by: MhXDigital Mar 1 2011, 12:47 PM
Thank you all for your help, I really appreciate it.
I figured out how to do it smile.gif

Posted by: evropej Mar 7 2011, 05:23 PM
For media conversion, I have found another program which does a great job.
xMediRecode
biggrin.gif

Powered by Invision Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)