Author Topic: Avidemux 2.7.1 Nightly (Win64): Discarding starting B frames?  (Read 414 times)

Steps

  • Newbie
  • *
  • Posts: 3
Avidemux 2.7.1 Nightly (Win64): Discarding starting B frames?
« on: December 01, 2018, 12:29:46 AM »
Videos of my camera (Canon PowerShot G7X) do for some reason start with 2 B-frames instead of an I-frame.

If I open up a video, select the first I-frame and delete everything before that and save the new video I
can see with ffprobe that the B frames still remain.

How can I get rid of those?
Is Avidemux not seeing these frames?

My problem is that I want to join some MP4 files, but maybe I want to trim them later.
This becomes a problem when the B-frames at the end of the first video and the beginning of the second video merge.
So I would loose frames on that cut.

On a sidenote: Does anybody know why my camera videos do not start with a I-frame? This seems to be wrong.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2868
Re: Avidemux 2.7.1 Nightly (Win64): Discarding starting B frames?
« Reply #1 on: December 01, 2018, 09:58:24 AM »
Take it for granted that the video starts with an IDR (in Avidemux called I-frame or keyframe), followed by a P-frame – in the stream order. However, the display order may be very different. B-frames, decoded after but displayed before the first IDR are not shown by Avidemux (the video playback starts always at the presentation time of the first IDR), but cannot be safely dropped because they may be referenced by later frames in the stream.

I guess, "hidden" early B-frames of the appended video would become visible in Avidemux as their PTS in the linear time are greater than the PTS of the very first keyframe of the first video. Or they should become visible after saving the resulting video in copy mode at the latest.

In the scripting shell of Avidemux,

Code: [Select]
ed = Editor()
for frame in range(0,20):
    ed.printTiming(frame)

would print the timing and type of the first 20 frames in the stream order to admlog.txt.
« Last Edit: December 01, 2018, 10:06:19 AM by eumagga0x2a »