Solveig Multimedia Forum - Get help for video editing software

SolveigMM End-User Products => SolveigMM Video Splitter => Topic started by: Berni11 on September 23, 2017, 12:00:54 AM

Title: Bug? Mpeg-2 + h264: Frames get omitted when cutting on specific spots
Post by: Berni11 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.
Title: Re: Bug? Mpeg-2 + h264: Frames get omitted when cutting on specific spots
Post by: Dmitry Vergeles on September 23, 2017, 04:24:25 AM
Hi Berni,
Could you show at your scheme start-stop frames you set cutting cues to?
Title: Re: Bug? Mpeg-2 + h264: Frames get omitted when cutting on specific spots
Post by: Berni11 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
Title: Re: Bug? Mpeg-2 + h264: Frames get omitted when cutting on specific spots
Post by: Maxim.Sakhankov 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.