Frame rate conversions via Interpolation or Motion Estimation

1,546 views
Skip to first unread message

PhillC

unread,
Nov 5, 2012, 1:43:57 PM11/5/12
to ffmbc-...@googlegroups.com
It's been a while since I had a need to post here, but today I was looking to do some frame rate conversion. Source footage is from a Canon 5D MkII and is at 25fps. I wanted to convert this to interlaced DNxHD 220 (60i).

My FFmbc command was:

ffmbc -i MVI_3766.MOV -vcodec dnxhd -acodec copy -r 30000/1001 -b 220M -flags +ildct -mbd rd -tff -vf crop=1920:1088-2*4 MVI_3766_30fps_me.mov

This did all the right things and created a valid file.

Unfortunately, when I looked closer I realised that that FFmbc has just copied frames to increase frame rate.

Is there currently an option to do frame rate conversions using frame interpolation or motion estimation? I've had a good search and haven't really found anything about this. I thought maybe there could be a libavfilter, but not that I could find. I also created a file using a trial version Telestream's Episode Engine (which puts a big watermark across the middle of the picture) and it did very nice motion estimation.

Any thoughts or knowledge on this?

Phillip Blucas

unread,
Nov 5, 2012, 5:11:06 PM11/5/12
to ffmbc-...@googlegroups.com
Basically you want to do 25p -> 60p -> 30i.  <-- frame (not field) rates

Lots of ways to do this with Avisynth.  I'm much too lazy right now to write a full script, but doom9 has a huge archive where someone has already done this.  Don't reinvent the wheel.  Lots of PAL->NTSC discussions.

SVPflow seems new and fancy, so the interpolation could be done with that or Interframe/MSmoothFPS:
You could also blend frames with ConvertFPS (may not work well, but easy enough to try).

The second part (60p -> 30i) is done with clever field/frame manipulation using built-in Avisynth functions:

PhillC

unread,
Nov 5, 2012, 5:30:01 PM11/5/12
to ffmbc-...@googlegroups.com


On Monday, 5 November 2012 22:11:08 UTC, Phillip wrote:

Basically you want to do 25p -> 60p -> 30i.  <-- frame (not field) rates

Lots of ways to do this with Avisynth.  I'm much too lazy right now to write a full script, but doom9 has a huge archive where someone has already done this.  Don't reinvent the wheel.  Lots of PAL->NTSC discussions.

SVPflow seems new and fancy, so the interpolation could be done with that or Interframe/MSmoothFPS:
You could also blend frames with ConvertFPS (may not work well, but easy enough to try).

The second part (60p -> 30i) is done with clever field/frame manipulation using built-in Avisynth functions:

 
Thanks for the response, and perhaps I should have been clearer in my original post.

I am not interested in doing this with Avisynth. The toolset should be Linux based. I guess perhaps I caused confusion when I mentioned creating a test file with Episode.

Avisynth in WINE isn't really an option. Avisynth 3.0 doesn't do half the things 2.5 does. And avxsynth looks dead in the water (at least all the links to their Wiki pages are 404s).

Ideally, I'd like to use FFmbc, or FFmpeg or libav, if either one of them will do frame rate conversions in an advanced manner. My preference would be FFmbc.

Phillip Blucas

unread,
Nov 5, 2012, 8:22:43 PM11/5/12
to ffmbc-...@googlegroups.com
Avisynth 3.0 has been dead for years, but avxsynth has commits today:

I'd never use it anyway since Avisynth 2.5/2.6 and wine work just fine, but whatever. Vapoursynth is the new cool thing, but it may not be featured enough yet.

There is nothing in FF*/libav that will do more than add/drop frames.

PhillC

unread,
Nov 6, 2012, 6:00:34 AM11/6/12
to ffmbc-...@googlegroups.com


On Tuesday, 6 November 2012 01:22:44 UTC, Phillip wrote:

Avisynth 3.0 has been dead for years, but avxsynth has commits today:

I'd never use it anyway since Avisynth 2.5/2.6 and wine work just fine, but whatever. Vapoursynth is the new cool thing, but it may not be featured enough yet.

There is nothing in FF*/libav that will do more than add/drop frames.


Hmm, I thought I replied to this again last night regarding avxsynth and that I'd found them on github, rather than Google. Anyway, thanks for the information regarding FF*/libav.

 

PhillC

unread,
Nov 6, 2012, 1:18:31 PM11/6/12
to ffmbc-...@googlegroups.com
 
On Tuesday, 6 November 2012 01:22:44 UTC, Phillip wrote:


There is nothing in FF*/libav that will do more than add/drop frames.



After quite a bit of further research, I've found at least a somewhat satisfactory solution, with further exploration available. I used yuvfps, which is part of mjpegtools

http://mjpeg.sourceforge.net/

Using FFmbc, I piped out to mjpegtools and used yuvfps to change frame rate. The FFmbc line I used is:

ffmbc -i MVI_3766.MOV -f yuv4mpegpipe -pix_fmt yuv420p -| yuvfps -w -s 25000:1000 -r 30000:1001 | ffmbc  -f yuv4mpegpipe -i - -vcodec dnxhd -acodec copy -b 220M -flags +ildct -mbd rd -tff -vf crop=1920:1088-2*4 MVI_3766_30fps_yuvfps.mov
 
The output is reasonable, without being fantastic, but it is clearly motion interpolated and not simply adding/dropping frames. Compared to the job done in Episode Engine, the quality is not as good.

Further things to research:

yuvifps - http://silicontrip.net/~mark/lavtools/#yuvafps
yuvmotionfps - http://jcornet.free.fr/linux/yuvmotionfps.html


Reply all
Reply to author
Forward
0 new messages