VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    How to use AviSynth to convert a VFR video to CFR without losing any frame or inserting duplicates? Audio doesn't matter. I've looked at a few ways, but everywhere this aspect is skipped (or it says explicitly that frames are skipped or inserted.)
    (Or using ffmpeg)
    Quote Quote  
  2. Assuming the source uses timestamp VFR (not hardcoded encoded field or frame repeats) , avisynth is CFR anyways . ie. it's already CFR when you use an avs source filter. Since audio doesn't matter, sync doesn't matter. The FPS will be an average FPS . If you want to speed up, or slow down use AssumeFPS. The motion can look weird if you have highly variable frame rate source, since the original timing is no longer kept

    Inserting duplicates or dropping frames is only required to keep sync equivalent to the VFR timestamps
    Quote Quote  
  3. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by poisondeathray View Post
    it's already CFR when you use an avs source filter. Since audio doesn't matter, sync doesn't matter. The FPS will be an average FPS . If you want to speed up, or slow down use AssumeFPS.
    Thanks. Does VDub work the same way?
    Quote Quote  
  4. Originally Posted by rgr View Post
    Originally Posted by poisondeathray View Post
    it's already CFR when you use an avs source filter. Since audio doesn't matter, sync doesn't matter. The FPS will be an average FPS . If you want to speed up, or slow down use AssumeFPS.
    Thanks. Does VDub work the same way?
    No, vdub2 will add duplicate frames to keep the timing
    Quote Quote  
  5. For ffmpeg you can demux the video stream to elementary video. This will retain only the original encoded frames, and discard the time stamps. If you want to remux back into a container with some CFR value, you can too but only with a 2nd step; if you remux directly into a container, the timestamps will be retained. You need to discard the timestamps

    (Again , motion can look weird if source was highly variable; and the sync timing will be lost but you don't care about audio)
    Quote Quote  
  6. You may try to experiment with ffmpeg - seem there is some work on this:
    Code:
    -vsync parameter (global)
    -fps_mode[:stream_specifier] parameter (output,per-stream)
    
        Set video sync method / framerate mode. vsync is applied to all output video streams but can be overridden for a stream by setting fps_mode. vsync is deprecated and will be removed in the future.
    
        For compatibility reasons some of the values for vsync can be specified as numbers (shown in parentheses in the following table).
    
        passthrough (0)
    
            Each frame is passed with its timestamp from the demuxer to the muxer. 
        cfr (1)
    
            Frames will be duplicated and dropped to achieve exactly the requested constant frame rate. 
        vfr (2)
    
            Frames are passed through with their timestamp or dropped so as to prevent 2 frames from having the same timestamp. 
        drop
    
            As passthrough but destroys all timestamps, making the muxer generate fresh timestamps based on frame-rate. 
        auto (-1)
    
            Chooses between cfr and vfr depending on muxer capabilities. This is the default method. 
    
        Note that the timestamps may be further modified by the muxer, after this. For example, in the case that the format option avoid_negative_ts is enabled.
    
        With -map you can select from which stream the timestamps should be taken. You can leave either video or audio unchanged and sync the remaining stream(s) to the unchanged one.
    This and perhaps recreating timestamps may be option for you.
    Quote Quote  
  7. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Cool. Thanks for the replies. From what I checked, the source has no large deviations in frame time, it can easily be CFR.
    Quote Quote  
  8. Originally Posted by rgr View Post
    Cool. Thanks for the replies. From what I checked, the source has no large deviations in frame time, it can easily be CFR.
    Quite common situation nowadays for various cameras in smartphones - they produce frequently quasi CFR but in fact it is VFR...
    Quote Quote  



Similar Threads

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