[FFmpeg-user] ffmpeg minterpolate - scd option not working

J Mor windbreiz at gmail.com
Thu Aug 26 14:04:24 EEST 2021


Hello, I am trying to use minterpolate to replace duplicates with
interpolated frames.  I am doing it by first using the mpdecimate filter to
create an intermediate video  ( middle_test0.mkv) on which I apply the
minterpolate filter.
Overall, the duplicate replacement process seems to work OK except for the
scene change issue.
My understanding is that scd (scene detection change) will replace
interpolated frames with duplicates during the scene change.
In my original video 'middle_test0.mkv', a scene transition is
instantaneous: the first frame of a new scene is totally different from the
last frame of the previous scene.
In the following tests, the scene change takes always 12 frames, morphing
from the previous scene to the new one.  This is expected with
minterpolate, but I thought it would not happen with scd.

These are the commands I tried:

Without scd:
ffmpeg -i "middle_test0.mkv" -filter:v
minterpolate=fps=24000/1001:mi_mode=mci:mc_mode=obmc:me_mode=bidir:vsbmc=1
-threads 0 -c:v libx264 -profile:v main -preset:v medium -level 3.1
-x264opts crf=25.0 -aspect 16:9 -c:a ac3 -ac 2 -ar 48000 -b:a 160k
-max_muxing_queue_size 400 "final_test0.mp4"
Scene transition: 12 seconds (normal)

With scd=fdiff:
ffmpeg -i "middle_test0.mkv" -filter:v
minterpolate=fps=24000/1001:mi_mode=mci:mc_mode=obmc:me_mode=bidir:vsbmc=1:scd=fdiff
-threads 0 -c:v libx264 -profile:v main -preset:v medium -level 3.1
-x264opts crf=25.0 -aspect 16:9 -c:a ac3 -ac 2 -ar 48000 -b:a 160k
-max_muxing_queue_size 400 "final_test1.mp4"
Scene transition: 12 seconds (unexpected)

With scd=fdiff:scd_threshold=10
ffmpeg -i "middle_test0.mkv" -filter:v
minterpolate=fps=24000/1001:mi_mode=mci:mc_mode=obmc:me_mode=bidir:vsbmc=1:scd=fdiff:scd_threshold=10
-threads 0 -c:v libx264 -profile:v main -preset:v medium -level 3.1
-x264opts crf=25.0 -aspect 16:9 -c:a ac3 -ac 2 -ar 48000 -b:a 160k
-max_muxing_queue_size 400 "final_test2.mp4"
Scene transition: 12 seconds (no change)

With scd=fdiff:scd_threshold=10 right after fps in the chain (in case it
matters)
ffmpeg -i "middle_test0.mkv" -filter:v
minterpolate=fps=24000/1001:scd=fdiff:scd_threshold=10:mi_mode=mci:mc_mode=obmc:me_mode=bidir:vsbmc=1
-threads 0 -c:v libx264 -profile:v main -preset:v medium -level 3.1
-x264opts crf=25.0 -aspect 16:9 -c:a ac3 -ac 2 -ar 48000 -b:a 160k
-max_muxing_queue_size 400 "final_test3.mp4"
Scene transition: 12 seconds (no change)

With higher threshold scd=fdiff:scd_threshold=40
ffmpeg -i "middle_test0.mkv" -filter:v
minterpolate=fps=24000/1001:scd=fdiff:scd_threshold=40:mi_mode=mci:mc_mode=obmc:me_mode=bidir:vsbmc=1
-threads 0 -c:v libx264 -profile:v main -preset:v medium -level 3.1
-x264opts crf=25.0 -aspect 16:9 -c:a ac3 -ac 2 -ar 48000 -b:a 160k
-max_muxing_queue_size 400 "final_test4.mp4"
Scene transition: 12 seconds (no change)

In summary I seem not able to make scd work as I thought it should work.
Thank you for any tip.


More information about the ffmpeg-user mailing list