News:

--

Main Menu

Scene change detection

Started by Bobber, June 05, 2020, 07:27:03 AM

Previous topic - Next topic

Bobber

Hi,
I haven't used avidemux in ages. There used to be a "scene cut threshold" option in the MPEG-4 AVC configuration, but that seems to be gone now. How should I configure the settings now to get a similar result?
Thanks,
Rob

eumagga0x2a

It is still there, in the "Frame" tab of the x264 configuration dialog --> "I-frame Threshold". The default value is 40, higher values result in more scene changes detected.

nnamerz

Quote from: eumagga0x2a on June 05, 2020, 10:24:48 AMThe default value is 40, higher values result in more scene changes detected.

I'm a bit confused. You mentioned that a higher value means more scene changes are detected, but on the (H.264 Encoding Guide ), it says "A lower threshold results in a more aggressive scene change detection."

eumagga0x2a

Clearly my error. Thanks for pointing out.

nnamerz

Since I wasn't sure which was correct, I tried several test conversions in an attempt to figure it out and if I'm not mistaken, I believe you were correct and the Encoding Guide had it backwards.

SOURCE VIDEO: 1280x720, 1 minute length, 15 FPS. Note: I used this same video for all the conversions.
I-FRAME SETTINGS: Min GOP = 15 / Max GOP = 150 / I-frame Threshold = This was the only variable I changed between tests.

TEST #     THRESHOLD           RESULT
Test 1  Threshold = 1    5 IDR Frames (1 every ~12 seconds)
Test 2  Threshold = 5    5 IDR Frames (1 every ~12 seconds)
Test 3  Threshold = 25  5 IDR Frames (1 every ~12 seconds)
Test 4  Threshold = 50  5 IDR Frames (1 every ~12 seconds)
Test 5  Threshold = 75  5 IDR Frames (1 every ~11 seconds)
Test 6  Threshold = 100 9 IDR Frames (1 every ~8 seconds)

The test results seem to match what you had originally said in this thread...The higher the I-frame threshold value, the more scene changes are detected.
•Tests 1, 2, 3 & 4 resulted in 5 IDR frames at the exact same intervals & timestamps.
•When the threshold jumped to 75 on Test 5, there were still 5 IDR frames, but the intervals were shorter and I assume if the video was a smidge longer, there would have been 6 IDR frames.
•Lastly, when I maxed out the threshold value to 100 on Test 6, I ended up with 9 IDR frames & much shorter intervals.

eumagga0x2a

It is still my error – in the German translation ;D :o

I am not sure whether over a decade old x264 encoding guide in Avidemux Wiki was correct for some legacy Avidemux version back then, but the scenecut parameter for x264 and in the current x264 plugin in Avidemux definitely works as you describe, with higher values making insertion of an IDR (or of an intra-coded P-frame if keyint_min prohibits inserting an IDR) more likely.

Regarding Avidemux Wiki, it contributes to confusion more often than not, please ignore.

nnamerz

Thank you for the clarification. I had no clue that Encoding Guide was over a decade old, lol.

Would you happen to know of a more current x264 encoding guide that I could refer to?