[FFmpeg-user] 1080i AVC-I 100 frame rate conversion

Bruce Roberts roberb04 at gmail.com
Fri Mar 26 16:02:17 EET 2021


Hello,

I'm looking for advice on the best ways to convert 23.976fps and 29.97fps
AVC-I 100Mbps content to 25fps (also interlaced AVC-I 100Mbps).

So far I have tried the fps filter as follows:

ffmpeg \

-i 23_967.mxf \

-filter_complex "[0:v:0]fps=fps=25[v25fps]" \

-map "[v25fps]" -map a: -codec:v libx264 -s:v 1920x1080 -x264opts
avcintra-class=100 \

-codec:a pcm_s24le -ar 48000 -ac 1 \

-map_metadata -1 \

25.mxf


The results of that are reasonable but the motion doesn't look particularly
smooth.


I've also changed the speed using the following 2-pass method:


ffmpeg -i 23_976.mxf -map 0:v -c:v copy -bsf:v h264_mp4toannexb raw.h264


followed by


ffmpeg -fflags +genpts -r 25 \

-i raw.h264 \

-i 23_976.mxf \

-map 0:v:0 -c:v copy \

-map 1:a:0 -map 1:a:1 -af 'atempo=1/0.95904' \

-map_metadata -1 \

25.mxf


This looks smoother to me but I haven't found a way to do it in a single
pass.


I notice from the documentation that the "framerate" filter changes the
frame rate by interpolating new video output frames from the source frames
so that seems like a potentially good candidate but I can't get it to work
properly. The documentation also says "This filter is not designed to
function correctly with interlaced media. If you wish to change the frame
rate of interlaced media then you are required to deinterlace before this
filter and re-interlace after this filter" so I began by using yadif (in
both modes 0 and 1) and tinterlace using commands similar to this:



ffmpeg \

-i 23.976.mxf \

-filter_complex \

"[0:v:0]yadif=1:-1:0[vdeint]; \

[vdeint]framerate=fps=25[v25fps]; \

[v25fps]tinterlace=3[v25fpsint]" \

-map "[v25fpsint]" -map a: -codec:v libx264 -s:v 1920x1080 -x264opts
avcintra-class=100 \

-codec:a pcm_s24le -ar 48000 -ac 1 \

-map_metadata -1 \

25.mxf


The problems with this are (a) the attempts to use tinterlace modes 0, 1,
2, 4, or 5 fail with "FPS 25/2p not compatible with AVC-Intra" and (b)
because tinterlace modes 3, 6, and 7 all produce progressive output.


I attempted to address these problems by dispensing with tinterlace
altogether with commands similar to this:


ffmpeg \

-i 23_976.mxf \

-filter_complex \

"[0:v:0]yadif=1:-1:0[vdeint]; \

[vdeint]framerate=fps=25[v25fps]" \

-map "[v25fps]" -map a: -codec:v libx264 -s:v 1920x1080 -flags +ilme+ildct
-x264opts avcintra-class=100:tff=1 \

-codec:a pcm_s24le -ar 48000 -ac 1 \

-map_metadata -1 \

25.mxf


This command does complete successfully but the output has bands of
different luminance which are maybe 120 pixels high and I can't get rid of
them.


Finally, I ran a test with "minterpolate" but my particular choice of
settings (-vf
"minterpolate=fps=25:mi_mode=mci:mc_mode=aobmc:me_mode=bidir:vsbmc=1") (a)
wouldn't work with AVC-I output and (b) produced very jerky output when I
removed "-x264opts avcintra-class=100" but in any case, the process was
much too slow for my purposes.


So could anyone please advise me on

1. how I might get the "framerate" filter to work properly please?

2. Whether I should use different methods for converting 23.976 to 25 to
those used for 29.97 to 25?

3. Is there a way to combine the two speed change processes into a single
pass?

4. Any other good frame rate conversion tips please?



Many thanks!

Bruce.


More information about the ffmpeg-user mailing list