Author Topic: Show current keyframe interval and (lossless?) insert additional keyframes?  (Read 472 times)

pstein

  • Jr. Member
  • **
  • Posts: 87
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?

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3389
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.

Quote
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?

This is impossible without re-encoding the video stream.

Mamecube

  • Newbie
  • *
  • Posts: 3
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.