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:
- FFMS22. Create the following Avisynth script:
- VFRtoCFR here
3. Run the avs script through ffmpeg, e.g.: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
This seems to work pretty well. I am sure many will have other preferred methods for Step 3.Code:ffmpeg -i VFRtoCFR.avs -pix_fmt uyvy422 -c:v rawvideo -vtag "UYVY" -a:n CFR.avi
I am curious what other workflows/filters everyone else uses for Steps 1 and 2. Thanks.
+ Reply to Thread
Results 1 to 7 of 7
v=ffvideosource(clip, fpsnum=x, fpsden=y)
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.
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.
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.