YUView icon indicating copy to clipboard operation
YUView copied to clipboard

Render error when h264 annexB raw bitstream contains several gop that has different width or height

Open xyz1001 opened this issue 3 years ago • 5 comments

I have a h264 annexB raw bitstream file. The NAL 0 ~ 380 is a gop, which frame size is 576x1280. YUView can display these frame successfully. image The NAL 381 is SPS, NAL 382 is PPS and NAL 383 is IDR frame. Frame size change to 1280x576. Then YUView fail to display the frame. image

xyz1001 avatar Sep 15 '21 03:09 xyz1001

Hi! First, it would be great to get the bitstream. Without it debugging it will be close to impossible. But just from the top of my head this sounds like it is a problem with FFmpeg plus this bitstream. YUView is just pushing the NAL units to ffmpeg and then gets frames back. Probably it is not supported by ffmpeg that the resolution of a bitstream changes mid-sequence.

ChristianFeldmann avatar Sep 16 '21 15:09 ChristianFeldmann

I tried ffplay and it is ok bitstream.h264.zip

xyz1001 avatar Sep 17 '21 01:09 xyz1001

I just did some testing and you are right ffplay supports it / can display the sequence. But there is also other software that does not handle it correctly. I tested VLC media player and there are also decoding errors there.

ChristianFeldmann avatar Sep 20 '21 16:09 ChristianFeldmann

I investigated a bit further and adding this is not that easy. I thought the FFmpeg decoder would just recognize the change in resolution and handle it correctly but it does not. That means that YUView has to handle it. So the parser should recognize resolution changes and then we have to reallocate the decoder whenever the resolution changes.

ChristianFeldmann avatar Nov 02 '21 12:11 ChristianFeldmann

To be honest I don't think that this is a real important feature for YUView at the moment. So I don't think that I will work on this any time soon. But of course please feel free to implement this. I can give some hints on how.

ChristianFeldmann avatar Nov 02 '21 12:11 ChristianFeldmann