VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Yes, that time has come. Sigh. I wanted to poll you experts on the best way to convert VFR to CFR e.g. a smartphone mp4. After some fiddling around, this is the workflow I have come up with:

    1. Download the following plug-ins for Avisynth:
    - FFMS2
    - VFRtoCFR here
    2. Create the following Avisynth script:

    Code:
    v=ffvideosource(clip,timecodes=tc)
    VFRtoCFR(v, times=tc, numfps=30000, denfps=1001, dropped=false)
    ConvertToYV16(v,interlaced=false,matrix="PC.701",chromaresample="spline36") #For final output as 4:2:2, leave out otherwise
    3. Run the avs script through ffmpeg, e.g.:

    Code:
    ffmpeg -i VFRtoCFR.avs -pix_fmt uyvy422 -c:v rawvideo -vtag "UYVY" -a:n CFR.avi
    This seems to work pretty well. I am sure many will have other preferred methods for Step 3.

    I am curious what other workflows/filters everyone else uses for Steps 1 and 2. Thanks.
    Quote Quote  
  2. Or just:
    Code:
    v=ffvideosource(clip, fpsnum=x, fpsden=y)
    Quote Quote  
  3. Thanks for the reply. I read about that on the doom9 forum. Seems there are some differences in how FFMS2 and VFRtoCFR handle the conversion. I have only just started playing around with this. Any thoughts or experience on the differences between the two?
    Quote Quote  
  4. Never used VFRtoCFR. LWLibAvVideoSource supports fpsnum and fpsden too. Even DirectShowSource, though I don't trust it, supports VFR to CFR with fps and convertfps.
    Quote Quote  
  5. The differences are subtle but real which motivated the creator of VFRtoCFR. FFMS2 chooses the frame that is closest to the requested timecode. This means FFMS2 will grab frames forward in time if the requested timecode is greater than half the distance between the most recent and next frames. This may or may not be acceptable. VFRtoCFR takes a different approach that basically involves picking the frame that occupies the greatest window in the elapsed time should more than one exist, iow, not the necessarily most recent frame and apparently never a future frame.

    I find it interesting that different strategies exist and contemplating which is best has made wonder: with the prevalence of VFR video, I am surprised nobody has tried to tackle this problem using the interpolation algorithms found in de-interlacing tools.
    Quote Quote  
  6. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    For vfr video files i open them with tsmuxer and set the change fps to 24000/1000 for video and demux and then remux the created files,needs no re-encoding,this will work as long as the source has no real frames that switch to a different frame rate.Use different fps for pal and other rates.
    I think,therefore i am a hamster.
    Quote Quote  
  7. johns0, thanks. Never messed with tsmuxer before, but that was surprisingly easy. It even worked on my 4K video.
    Quote Quote  



Similar Threads

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