Author Topic: Bug? Mpeg-2 + h264: Frames get omitted when cutting on specific spots  (Read 2469 times)

Offline Maxim.Sakhankov

  • Users
  • *
  • Posts: 241
    • View Profile
Re: Bug? Mpeg-2 + h264: Frames get omitted when cutting on specific spots
« Reply #4 on: October 02, 2017, 07:20:59 PM »
Hello Berni11,
Thank you for such a detailed description.
We reproduced some cases described here and will check the others.

As soon as there will be a fix I'll let you know.

Offline Berni11

  • Users
  • *
  • Posts: 2
    • View Profile
Re: Bug? Mpeg-2 + h264: Frames get omitted when cutting on specific spots
« Reply #3 on: September 23, 2017, 11:28:57 PM »
For the Mpeg-2 cuts:
I had tested it with the following start and end cuts:
As the start cut I used the "End Marker"
As the end cut I used the "Begin Marker"


... I B B P B B P B B P B     B I B B P B B P B B P B B     I B B P B B P B B P B B I ...
                                     ^                                       ^
                               start cut                              end cut

expected 13 frames
result: 11 frames


... I B B P B B P B B P B     B I B B P B B P B B P B     B I B B P B B P B B P B B I ...
                                    ^                                     ^
                              start cut                           end cut

expected 12 frames
result: 11 frames


I also tested the following cuts, where sometimes too much frames were outputted.


... I B B P B B P B B P B B     I B B P B B P B B P B B     I B B P B B P B B P B B I ...
                                       ^                                     ^
                                 start cut                           end cut

expected 12 frames
result: 10 frames


... I B B P B B P B B P B B     I B B P B B P B B P B     B I B B P B B P B B P B B I ...
                                       ^                                  ^
                                 start cut                        end cut

expected 11 frames
result: 10 frames
________________________________________________________________________

... I B B P B B P B B P B B I     B B P B B P B B P B B     I B B P B B P B B P B B I ...
                                          ^                                  ^
                                   start cut                         end cut

expected: 11 frames
result: 14 frames



... I B B P B B P B B P B B I     B B P B B P B B P B     B I B B P B B P B B P B B I ...
                                          ^                               ^
                                    start cut                      end cut

expected: 10 frames
result: 14 frames
________________________________________________________________________

... I B B P B B P B B P B B I B     B P B B P B B P B B     I B B P B B P B B P B B I ...
                                             ^                               ^
                                       start cut                      end cut

expected: 10 frames
result: 13 frames


... I B B P B B P B B P B B I B     B P B B P B B P B     B I B B P B B P B B P B B I ...
                                             ^                            ^
                                       start cut                  end cut

expected: 9 frames
result: 13 frames
________________________________________________________________________

... I B B P B B P B B P B B I B B     P B B P B B P B B     I B B P B B P B B P B B I ...
                                                ^                            ^
                                          start cut                  end cut

expected: 9 frames
result: 12 frames


... I B B P B B P B B P B B I B B     P B B P B B P B     B I B B P B B P B B P B B I ...
                                               ^                          ^
                                        start cut                end cut

expected: 8 frames
result: 12 frames
________________________________________________________________________

... I B B P B B P B B P B B I B B P     B B P B B P B B     I B B P B B P B B P B B I ...
                                                  ^                          ^
                                            start cut                 end cut

expected: 8 frames
result: 11 frames


... I B B P B B P B B P B B I B B P     B B P B B P B     B I B B P B B P B B P B B I ...
                                                  ^                       ^
                                           start cut             end cut

expected: 7 frames
result: 11 frames

For the h264 cuts I had the start cut before an I-Frame

Offline Dmitry Vergeles

  • Administrator
  • Users
  • *****
  • Posts: 878
    • View Profile
Re: Bug? Mpeg-2 + h264: Frames get omitted when cutting on specific spots
« Reply #2 on: September 23, 2017, 04:24:25 AM »
Hi Berni,
Could you show at your scheme start-stop frames you set cutting cues to?
Regards,
Dmitry Vergeles
Solveig Multimedia

Offline Berni11

  • Users
  • *
  • Posts: 2
    • View Profile
Bug? Mpeg-2 + h264: Frames get omitted when cutting on specific spots
« Reply #1 on: September 23, 2017, 12:00:54 AM »
Hello,

I stumbled upon the following bug, when cutting Mpeg-2 video:

I have TV-recordings, which have the following frame structure:

... I B B P B B P B B P B B I B B P B B P B B P B B I B B P B B P B B P B B I ...

When cutting before the I-Frame:
... I B B P B B P B B P B B I B B P B B P B B P B B     I B B P B B P B B P B B I ...
                                                                           ^
The last two frames, which should be included (two B-Frames) get omitted.


Or when cutting before the B-Frame before the I-Frame:
... I B B P B B P B B P B B I B B P B B P B B P B     B I B B P B B P B B P B B I ...
                                                                        ^
The last frame, which should be included (one B-Frames) gets omitted.



Also I had this strange inconsistent behaviour when cutting h264 TV-recordings:

When the output should have an even number of frames, then often the last frame gets omitted. But sometimes the last frame is there.
When the output should have an odd number of frames, then often all frames are there, but the last two or three frames have no audio.


I hope everything is understandable.