Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: pstein on May 17, 2019, 01:26:07 PM

Title: Show current keyframe interval and (lossless?) insert additional keyframes?
Post by: pstein on May 17, 2019, 01:26:07 PM
Assume I drag & drop an MP4 video file onto Avidemux.

How can I find out after how many frames a keyframe is following in current video file?

If it is e.g. more than 200 I want to insert additional keyframes after at most 50 frames.

How can I achieve this without loss of quality/having to re-code the video?

Is it possible at all?
Title: Re: Show current keyframe interval and (lossless?) insert additional keyframes?
Post by: eumagga0x2a on May 17, 2019, 02:09:32 PM
Quote from: pstein on May 17, 2019, 01:26:07 PM
How can I find out after how many frames a keyframe is following in current video file?

Remux it as MKV, load this MKV in Avidemux and inspect the resulting Avidemux log. The MKV demuxer prints frame numbers of all keyframes to the log.

Alternatively, you could estimate from the FPS and the presentation time difference between two keyframes (set marker A to a keyframe, seek to the next one, set marker B to it, the duration of the selection is displayed in the selection widget). Multiply the selection duration with the FPS to get an approximate number of frames in this GOP.

QuoteIf it is e.g. more than 200 I want to insert additional keyframes after at most 50 frames.

How can I achieve this without loss of quality/having to re-code the video?

This is impossible without re-encoding the video stream.
Title: Re: Show current keyframe interval and (lossless?) insert additional keyframes?
Post by: Mamecube on June 07, 2019, 08:49:35 PM
Quote from: pstein on May 17, 2019, 01:26:07 PM
If it is e.g. more than 200 I want to insert additional keyframes after at most 50 frames.
Complain to video production/editor designers about their defaults. I agree, this 200 frame thing is obnoxious and a relic from the late 90s and Usenet anime piracy. A key frame every 15 seconds simply should not be a thing in the age of h264 - but it is.