Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMpeg - decode video H264 with warning: SEI type truncated ; error concealment; No accelerated colorspace conversion

Tags:

ffmpeg

h.264

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!

like image 752
kaienfr Avatar asked Apr 02 '14 21:04

kaienfr


1 Answers

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.

like image 65
Dennis Mungai Avatar answered Sep 17 '22 21:09

Dennis Mungai