when calling avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, &packet); to decode H264 video from PMP file.
I often get the following warnings as:
FF: SEI type 1 size 40 truncated at 36
FF: error while decoding MB 23 15, bytestream (td)
FF: Cannot use next picture in error concealment
...
FF: No accelerated colorspace conversion found from yuv420p to rgb24.
....
While, got_picture still return 1, but the video quality is bad, often vague and flicker. What's the problem? and what can I do? Thank you!
The content you're decoding comes from an older ffmpeg/libav build with an older libx264 version generating an invalid SEI payload. What you're seeing is the truncation of the same, treated as a warning.
To correct this, you will need to re-encode (not stream-copy) with the bitstream filter below enabled:
-bsf:v 'h264_metadata=sei_user_data=dc45e9bde6d948b7962cd820d923eeef+x264 - core 150'
Then retest.
For error correction, use -ec 0
.
If you're playing this file with mpv, you'll also need to pass the --vd-lavc-assume-old-x264
option.
References: This patchwork on the mailing list describes the issue in detail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With