VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. I'm trying to compare a CFR and VFR encode side by side, but I can't get them to sync properly. Directshow doesn't work, it screws up during seeking.

    Is there a way to get Avisynth to read internal timecodes and open it up frame-accurately?
    Quote Quote  
  2. Not quite - because the VFR version has fewer frames and avisynth is CFR only

    But you can use FFVideoSource() with FFInfo() and it will show the CFR and VFR times overlaid so you can compare. You might compare in different tabs in avspmod for example. Seeking should be frame accurate with ffms2 for most types of files, but you can add seekmode=0, threads=1 with FFVideoSource() for extra security (slower)
    Quote Quote  
  3. Not quite - because the VFR version has fewer frames and avisynth is CFR only
    Yes but can it include the D frames so the sync matches with the CFR version? Directshowsource already does this, but it's not frame accurate especially when seeking. FFVideosource opens the video without regard for D frames.

    But you can use FFVideoSource() with FFInfo() and it will show the CFR and VFR times overlaid so you can compare.
    Okay, how do I do this? Here is my original script

    Code:
    a=directshowsource("C:\VFR.mkv")
    b=directshowsource("C:\CFR.mkv")
    stackhorizontal(a,b)
    Quote Quote  
  4. There are no duplicate frames with ffms2 and it's frame accurate - I was suggesting to match by timecode using ffinfo()

    You can use DSS2() if you want frame accuracy with directshow duplicates
    Quote Quote  
  5. There are no duplicate frames with ffms2 and it's frame accurate - I was suggesting to match by timecode using ffinfo()
    Oh right I should've mentioned that what I'm comparing are two videos from different sources, one from DVD one from BD so the frame orientation is not identical to the BD but close enough to compare side-by-side in real time. There's about a 2-second longer delay at the beginning of the DVD which is easily dealt with trim.

    Also, how do I extract timecodes from MKV? I know how to do it with MP4. And if I had the times.txt, you're saying FFINFO would sync the videos together? You lost me a bit on the last post.

    You can use DSS2() if you want frame accuracy with directshow duplicates
    Directshow's gonna desync while seeking anyways, will it not?
    Quote Quote  
  6. Originally Posted by Mephesto View Post


    Also, how do I extract timecodes from MKV? I know how to do it with MP4. And if I had the times.txt, you're saying FFINFO would sync the videos together? You lost me a bit on the last post.
    You can use ffvideosource to extract timecodes (flv, mkv, mp4 any container)

    eg.
    FFVideoSource("movie.mkv", timecodes="movie_timecodes_v2.txt")

    For FFInfo, it overlays CFR and VFR times so you can match them up to the correct frame

    Try this and you will see what I mean

    FFVideoSource("video.mkv")
    FFInfo()





    You can use DSS2() if you want frame accuracy with directshow duplicates
    Directshow's gonna desync while seeking anyways, will it not?
    dss2 is frame accurate when seeking; directshowsource() isn't
    Quote Quote  
  7. Is the VFR video actually VFR, or is it CFR with duplicate frames or with some frames which last for what would normally be the duration for 2 frames etc? If it's the latter, by telling ffms2 to convert the frame rate to the original frame rate you should be able to effectively get it to "fill in" the duplicate/missing frames. For example, 23.976fps:
    FFVideoSource("E:\video.mkv", fpsnum=24000, fpsden=1001)

    If you're using DirectShowSource:
    DirectShowSource("E:\video.mkv", fps=25, convertfps=true)

    When using AVISynth to convert VFR video, you can probably convert it as though it's CFR, extract the time codes from the source, then use the extracted timecodes when remuxing the encoded version to match the audio sync. But of course that relies on both the source and the encode having the same number of frames. I doubt you'd have much luck trying to sync two different videos that way. I've not done it much myself but MKVCleaver will extract timecodes from MKV files and of course MKVMergeGUI will let you use those timecodes when muxing.
    Quote Quote  
  8. Thanks PDR, DSS2 worked perfectly. I will use this from now on.

    I did FFInfo and what it showed confuses me. Scrolling all the way to the middle the VFR is about 1-2 minutes behind the CFR time as reported by FFInfo but all the way at the end, it's all matched up. The VFR has 33% less frames than the CFR so I expected it to get 10-20 minutes behind at the very end. What is this reporting? The seeking offset of Directshow?

    hello_hello, the video was VFR but I wanted it to be opened with the D frames included so I can align it perfectly with the CFR video for a comparison.

    In this particular department, it's great to have so many choices. I usually hate endless choices.
    Quote Quote  



Similar Threads

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