Log in

View Full Version : how to convert h264 from vfw mode to normal mode?


junglemike
5th September 2006, 14:56
Hello. I've used gordianknot, and virtualdubmod to encode video using x264 codec.
Mkvmergegui refuses to mux the output, even if I specify "mkv" as output container in virtualdubmod. So, after virtualdub is finished working, I get the x264 video which is already in .mkv container, and plays fine. Yet MKVmerge gives me this error, when i try to mux the audio:
Error: 'O:\laptop.mkv' track 1: You are trying to put AVC/h.264 video from an AVI or a similar VfW (Video for Windows) compatible source into a Matroska file in the so-called 'VfW compatibility mode'. Please note that this is not the official way to store AVC/h.264 video in Matroska. Therefore proper playback of such files cannot be guaranteed, and we strongly urge you to use the native Matroska-mode.

Also, in the main mkvmerge window I see this message:

At the moment mkvmerge does not support converting from VfW-mode AVC/h.264 tracks to native Matroska-mode AVC/h.264 tracks. You can, however, first import the video track into a MP4 file with e.g. 'MP4Box' (use Google). Then you can use mkvmerge and put the video into a Matroska file.
If you're trying to get AVC/h.264 from an AVI into Matroska then the commands you need to use are for example:
avi2raw avc.avi raw.264
mp4box -fps 23.976 -add raw.264 avc.mp4
Keep in mind to replace '-fps 23.976' with the actual frame rate of your source file.
If you really know what you are doing then you can force mkvmerge to put this AVC/h.264 track into a Matroska file even in VfW mode if you add '--engage allow_avc_in_vfw_mode' to the command line. You can do that in mmg with the 'Add command line options' menu entry in the 'Muxing' menu.


I've searched the google for "avi2raw" and found notheing, is it a tool? I'm not sure what it is?
Also, I searched the forum, and found exactly same problem as mine, but w/o a solution, here:
http://forum.doom9.org/showthread.php?t=110049

So I would like to know if there's solution for this problem.

Sharktooth
5th September 2006, 15:44
avi2raw is part of the MPEG4IP tools. Get them and follow the instructions you posted.
Next time drop GK and use an appropriate software for encoding with x264 (megui,staxrip,realanime,etc...).

PS: btw google returns A LOT of stuff regarding avi2raw... next time dont lie :P

bond
5th September 2006, 19:16
demux the video stream to raw .264 with mkvextract and mux the resulting .264 to .mp4 with yamb (and if you want remux from .mp4 to .mkv with mkvmerge)

junglemike
6th September 2006, 11:14
Thanks guys for trying to help

Next time drop GK and use an appropriate software for encoding with x264 (megui,staxrip,realanime,etc...)
On my 1st computer I normally use Megui, and happy w/ it. I set up 2nd machine for encoding PIII-800mhz, but .Net won't install there. I tried (un)(re)installing .net many times w/o luck.
All progs you mentioned rely on .net.
demux the video stream to raw .264 with mkvextract
Mkvextract can only extract to .avi, or at least i didn't find option to extract to raw.
and mux the resulting .264 to .mp4 with yamb (and if you want remux from .mp4 to .mkv with mkvmerge)
I Was able to demux .avi to .h264 with Yamb, Than I muxed .h24 with audio to .mp4 with Yamb again, and Then muxed it to .mkv with mkvtools.
Source avi (and source .mkv in vfw) was 23.976fps, resulting .mp4 and .mkv is 25 fps. Of course a/v sync if off.


I posted couple of days before and asked other soft which doesn't require .net, Doom9 replied and said to try realanime.
But I wasn't able to understand how it works, I couldn't open .avs file there.

I'm not a guru, I'm just trying to encode some video. I see this is too complicated for me.
I'll probably try to reformat 2nd computer second time, and hope that buggy bloatware m$ .net works next time.

Sharktooth
6th September 2006, 15:24
you need to specify the FPS when muxing .264 into MP4.
Or, you can use a timecode file when muxing with MKVMerge GUI:
# timecode format v1
Assume 23.976