1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to extract/convert v_mpeg4/iso/avc (h264) to avi?

Discussion in 'DivX / XviD' started by trungn, Dec 20, 2005.

  1. trungn

    trungn Member

    Joined:
    Dec 20, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
    I've tried searching the forums for an answer but couldn't find a solution to my problem.

    I've got a matroska .mkv file with video [bold](v_mpeg4/iso/avc)[/bold], multiple audio tracks and subtitles. I am trying to convert the h264 video to divx/xvid. My only problem is trying to get access to the video stream to do the conversion. I am able to extract audio and subs from the .mkv file using mkvextract, but gives me this error when trying to extract the video stream:

    Opening the mkv file in VirtualDubMod gives me this error:

    Can anyone give me some pointers as to what I need to do?
     
  2. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    Your mkvextract I think is out of date since it now supports native AVC extraction. Once you extract though, you get a raw AVC stream. Can't see what use that would be. If you want to convert, I would just convert the mkv directly.

    VirtualDubMod's (as the popup points out when you first run it) matroska support is out of date. It doesn't support VOBSub's or nativce AVC. There is also the possibility that your video is VFR.
     
  3. trungn

    trungn Member

    Joined:
    Dec 20, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
    Ok, I've got the latest mkvextract and managed to extract the video stream. Is there anyway to convert the raw avc to divx/xvid?
     
  4. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    There are some directshow filters that can handle raw avc streams. Can't see any advantage of converting a raw avc stream over an mkv though.
     
  5. trungn

    trungn Member

    Joined:
    Dec 20, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
    My problem is that my computer is not powerful enough to play the h264 mkv video without major stuttering. I don't have problems with Divx/Xvid so that's why I want to convert it. I'm currently trying to find avc2avi tool to put the avc in avi container so I am open it in Vdub.

    EDIT: I've managed to find avc2avi and have now got an avi file of the h264 video stream. I've installed the X264VFW but when I open in vdub I get the following error message:

    I can see x264 codec in compression settings...

    What should I do?
     
    Last edited: Dec 21, 2005
  6. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    x264 is an encoder only. No decoder (decoder is in libavcodec). I'd still convert the mkv directly. You can frameserve with AVISynth to VDub.
     
  7. trungn

    trungn Member

    Joined:
    Dec 20, 2005
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
    How do I go about doing that?
     
  8. Matador

    Matador Regular member

    Joined:
    Jul 3, 2003
    Messages:
    344
    Likes Received:
    0
    Trophy Points:
    26
    Try to encode it with TMPGEnc Plus 2.5.It worked for me.I tryed this after VDM gave me the same error.But Im using ffdshow witch is using libavcodec as a decoder.
    IF you want to open it with CCE without errors In TMPGEnc save it as project then use VFAPIConv to frameserve it to avi then load it to CCE for MPEG-2.
     
    Last edited: Dec 22, 2005
  9. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    VFAPI means converting to RGB24. With AVISynth you can keep it YV12, although I think CCE only properly handles YUY2 input anyway.
     
  10. wierdling

    wierdling Guest

    After extracting the avc from mkv using mkvextract and subsequently coverting it to avi using avc2avi, I've noticed that the framerate changes from 23.976fps (mkv) to 25.000fpx (avi). I've tried to change the framerate using virtualdub and got a video that is out-of-sync (i.e. lagging) for the last 2 mins. How can I correct this?
     
  11. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    The default value for avc2avi is 25fps. So if you don't sepecify anything, that is what you get.

    As for the sync, could be that the mkv was VFR (Variable FrameRate). When you change to CFR like that the video isn't supposed to sync with the audio.
     
  12. wierdling

    wierdling Guest

    Manage to overcome the fps problem with the -f 23.976 command, but it seems now that the mkv is truly VFR. Anyway to convert it into an AVI container (preferably XVID as my PC cannot handle H264 quick enough) without the de-sync problem. Source audio is CBR so it should not pose a problem...Thanks!
     
  13. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    Have you tried using CoreAVC to decode? It is quicker than any other decoder.

    If you just need XviD for the lower CPU usage, then I would suggest that you keep it as mkv. That way you can just reuse the original time codes when remuxing the XviD.

    Otherwise I'd suggest that you forget about extracting and just try AVISynth to open the mkv with directshowsource(convertfps=true, fps=119.88).

    119.88fps is used because generally such a source is a mixture of 23.976 and 29.97fps.
     
  14. wierdling

    wierdling Guest

    Tried using CoreAVC and works...thanks.
    By the way, I've noticed that you you have mentioned that it is possible to directly convert the mkv(v_mpeg4/iso/avc) to avi(XviD). How do I go about that?
    Also, is it possible to edit files (mainly cutting out the mkv with the avc stream at certain portions)?
     
  15. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    You can only really cut at IDR frames. MPEG codecs really weren't designed for editing. Best to edit, then encode. If you are re-encoding, then that is a different matter.
     
  16. rick5446

    rick5446 Guest

    I've got some old series[Monk]that are RMVP,all around 182 meg.Cucosoft will convert them to VOB's,but very large about 4.2gig per 2episodes [good quality though]. I'm looking for something that will convert them to AVI,Divx,Xvid[around 350meg].I've tried everything that does'nt work...Any help would be appreciated.
    I'm not real sure what they are!I'm asuming they are H264.
     
  17. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    rmvb means that they are RV9/RV9EHQ which is not AVC. Similar advice though, you can use AVISynth with directshowsource, then just encode with VirtualDubMod or whatever. mencoder would also work. mencoder.exe -ovc xvid -xvidencopts pass=1 -oac mp3lame input.rmvb -o output.avi, etc.
     
  18. rick5446

    rick5446 Guest

    celtic_d..THANKS..is there any directions [instructions]as to how to go about setting this up,as Im not real familiar with all these conversions.
     

Share This Page