VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. Member
    Join Date
    Jun 2006
    Location
    United States
    Search Comp PM
    OK, so I have these two .MKV files. One is 30:15 in length and the other is 27:13. They are Xvid encoded. I am trying to convert them to h.264 AVC1 and pack it into a .MP4 container with .AAC audio. I've converted tons of files of varying types to this standard(AVC1+.AAC+.SRT in .MP4) in the past, so I don't consider myself a newb. =P

    However, the two files I mentioned above seem to be misbehaving. I first tried extracting the videos from the .MKV files using mkvextractGUI. They were in .AVI format and it worked(or so I thought), I joined the two .AVI files, and encoded that joined file into a h.264 stream using MeGUI. When I played said file, it's duration turned out to be much shorter(shorter than 30:15+27:13) than the two original videos combined. Definitely a big problem.

    I said to myself "WTF?". Then I took a look at the two .AVI files mkvextractGUI produced and it turns out they were shorter than the originals by a few minutes. I was perplexed by this and still am. No warning errors. What was the cause?

    Anyway, I remembered VirtualDubMod could handle .MKV files so I tried loading them into the program. When I loaded up the .MKV files into VirtualDubMod, I got this message for both:

    "[!] MKV: The video may have a variable framerate. If so we strongly advise you
    to use another tool to safely process your file."

    Regardless, I was able to extract the .AVI files and the resulting files had the same duration (30:16 and 27:13) as their original muxed .MKV counterparts. So I thought, "OK, good!". I joined them and encoded the resulting file to h.264 with MeGUI, BUT while the resulting file played faster than the audio.

    I then used mp4box to extract the raw .264 stream from the .MP4 file MeGui produced before I muxed it with the audio into the final file. I tried to mess with the framerate to the point where the resulting video file would be the same duration of the audio file. 24.2750fps made it the same exact duration as the audio file, but alas, it was still out of sync with video being played well over an hour, meaning the audio runs out first.

    The original .MKV files have a framerate of about 29.976. That's what I encoded them as, but it's still out of sync. When I use GSpot on them, it says the framerate is about 29.971.

    -----------------------------------------------------

    I can't help but thinking this has something to do with VirtualDubMod's variable framerate warning. Any ideas on what I can do to fix this?

    It suggested that I use "another tool that could safely process my file". What tools out there can handle variable framerate video?
    Quote Quote  
  2. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    VFR helper tool
    This utility is now part of the splitter package.
    As there are no tools to process/reencode VFR Matroska files, I've written a small utility to ease such processing.
    mkv2vfr extracts all video frames from Matroska to a CFR AVI file and a timecode file. You can extract video to avi, process it with any apps and mux back to matroska using a timecode file if you didn't add/remove frames. If you changed the frames you'd need to edit the timecode file by hand.

    http://haali.cs.msu.ru/mkv/
    --------------------------------------------------------------------------------
    avi_tc_package - 08/02/2006 v1.5 (Released)

    This package includes the commandline programs cfr2tc (v1.4), tc2cfr (v1.5), and tcConv (v1.0), as well as a GUI frontend named tc-GUI for using them. tc-GUI is a c# program and will require the .NET framework (at least version 1.1) to run. cfr2tc, tc2cfr, and tcConv are plain c++ commandline programs and do not require the .NET framework. Following are descriptions of cfr2tc, tc2cfr, and tcConv:

    cfr2tc takes an avi file with a video stream containing null frames and outputs a new avi file containing the same video stream, but with all null frames removed and a v1 or v2 timecode file. It also has timecode file only modes that create the timecode file but do not create a new avi file. As of v1.4 there is also the option to output an avs script instead of a new avi file.

    tc2cfr turns an avi file (with each frame present once) into a new avi file with null frames that has the specified framerate and varying display length for each individual frame based on a v1 or v2 timecode file.

    tcConv performs v1<->v2 timecode file conversions.

    Download http://bengal.missouri.edu/~kes25c/avi_tc_package.zip





    "AVC1" - Cool term. It's like Geddy Lee Roth
    Quote Quote  
  3. Member
    Join Date
    Jun 2006
    Location
    United States
    Search Comp PM
    OK, I still need help. =P

    I tried what you said and downloaded the programs. I was able to extract timecodes and an .avi from my mkvs using mkv2vfr. Now when I use tc-GUI/tc2cfr to create a 120fps avi, I get the following error:

    --------------------------
    Process Running...
    Processing Incomplete.
    Exit Code (19): A problem was encountered.

    CLI Output:
    tc2cfr v1.5 by tritical.
    Descernable number of framrates: 340 (min = 0.352589 fps).
    v1 timecode file type detected.
    Invalid frame range detected in v1 timecode file (0-1535).
    ----------------------------------------


    The time code looks like:

    ------------------
    # timecode format v1
    Assume 23.976
    0,1535,23.9760
    1536,1538,17.9641
    1539,2750,23.9763
    2751,2805,29.9564
    2806,2809,24.0964
    2810,2844,29.9658
    2845,2848,23.9521
    2849,2883,29.9658
    2884,4315,23.9762
    4316,4320,29.9401
    4321,6756,23.9759
    6757,6761,29.9401
    6762,12777,23.9761
    12778,12780,17.9641
    12781,15256,23.9760
    15257,15261,29.9401
    15262,17417,23.9761
    17418,17420,17.9641
    17421,18460,23.9758
    18461,18475,30.0000
    18476,18975,23.9762
    18976,18978,17.9641
    18979,19286,23.9763
    19287,19291,29.9401
    19292,19294,17.9641
    19295,27406,23.9760
    27407,27409,17.9641
    27410,27414,29.9401
    27415,27418,23.9521
    27419,27421,17.9641
    27422,27426,30.1205
    27427,29566,23.9760
    29567,29569,17.9641
    29570,33525,23.9759
    33526,33528,18.0723
    33529,36876,23.9759
    36877,36891,29.9401
    36892,36943,23.9852
    36944,36953,29.9401
    36954,36993,23.9808
    36994,37008,29.9401
    37009,37120,23.9777
    37121,37130,29.9401
    37131,37222,23.9771
    37223,37227,29.9401
    37228,37231,23.9521
    37232,37236,29.9401
    37237,37244,24.0240
    37245,37254,29.9401
    37255,37346,23.9771
    37347,37351,29.9401
    37352,37355,23.9521
    37356,37360,29.9401
    37361,37368,24.0240
    37369,37378,29.9401
    37379,37470,23.9771
    37471,37475,29.9401
    37476,37479,23.9521
    37480,37484,29.9401
    37485,37492,24.0240
    37493,37497,29.9401
    37498,37593,23.9760
    37594,37598,29.9401
    37599,37601,17.9641
    37602,37613,24.0000
    37614,37623,29.9401
    37624,37715,23.9771
    37716,37720,29.9401
    37721,37724,23.9521
    37725,37729,29.9401
    37730,37737,24.0240
    37738,37747,29.9401
    37748,37859,23.9777
    37860,37864,29.9401
    37865,37980,23.9768
    37981,37990,29.9401
    37991,38082,23.9771
    38083,38097,29.9401
    38098,38105,24.0240
    38106,38115,29.9401
    38116,38215,23.9751
    38216,38220,29.9401
    38221,38228,24.0240
    38229,38233,29.9401
    38234,38329,23.9760
    38330,38339,29.9401
    38340,38351,24.0000
    38352,38356,29.9401
    38357,38452,23.9760
    38453,38467,29.9401
    38468,38475,24.0240
    38476,38480,29.9401
    38481,38584,23.9742
    38585,38589,29.9401
    38590,38597,24.0240
    38598,38602,29.9401
    38603,38706,23.9742
    38707,38711,29.9401
    38712,38719,24.0240
    38720,38724,29.9401
    38725,38824,23.9751
    38825,38834,29.9401
    38835,38942,23.9787
    38943,38947,29.9401
    38948,38951,23.9521
    38952,38956,29.9401
    38957,38964,24.0240
    38965,38969,29.9401
    38970,39189,23.9756
    39190,39199,29.9401
    39200,39227,23.9931
    39228,39232,29.9401
    39233,39364,23.9738
    39365,39369,29.9401
    39370,39397,23.9931
    39398,39402,29.9401
    39403,39534,23.9738
    39535,39539,29.9401
    39540,39567,23.9931
    39568,39572,29.9401
    39573,39712,23.9767
    39713,39717,29.9401
    39718,39803,23.9688

    ------------------


    Any suggestions?
    Quote Quote  
  4. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Not really You can try converting the type 1 timecode file to type 2 and see if that works. The error message is too nebulous.
    Quote Quote  
  5. Member
    Join Date
    Jun 2006
    Location
    United States
    Search Comp PM
    I tried converting the v1 to a v2 timecode, but the program just crashes when I try to use the output file. Anyway, I've decided to just give up on messing with vfr stuff. Too much hassle.
    Quote Quote  
  6. If you have AVISynth and a DirectShow MKV file splitter installed (ie, if you can play your MKV files with WMP) you can use VirtualDubMod and its DirectShowSource AVISynth template. You might have to specify the frame rate and convertfps in the AVISynth script:

    DirectShowSource("filename.mkv", fps=29.97, convertfps=true)
    Quote Quote  
  7. Member
    Join Date
    May 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    If you have AVISynth and a DirectShow MKV file splitter installed (ie, if you can play your MKV files with WMP) you can use VirtualDubMod and its DirectShowSource AVISynth template. You might have to specify the frame rate and convertfps in the AVISynth script:

    DirectShowSource(&quot;filename.mkv&quot;, fps=29.97, convertfps=true)
    \
    that "convertfps=true" is all I needed to fix my variable frame issue! didn't even have to convert to mkv. thanks man
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!