YUView
YUView copied to clipboard
Render error when h264 annexB raw bitstream contains several gop that has different width or height
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.
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.
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.
I tried ffplay and it is ok bitstream.h264.zip
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.
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.
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.