[FFmpeg-user] Why does '-c:v copy' decode video frames?

Ted Park kumowoon1025 at gmail.com
Wed Feb 20 11:32:12 EET 2019


> The original video seems problematic, so FFmpeg outputs several lines of
> "co located POCs
> unavailable" error. The error message is printed in
> `h264_direct.c/ff_h264_direct_ref_list_init`,
> which is further called by `h264dec.c/h264_decode_frame`. What confuses me
> is why does the copy
> codec still try to decode H.264 frames and even do motion vector
> prediction?

It doesn’t. And as you noted it doesn’t make sense for it to be doing any prediction with no picture, it is just calculating the mv. If slice data partitioning is used (or maybe regardless, don’t remember) the equation for motion vector needs at least the field order list and sub/mb partition indexes for the current and colocated mbs, so parsing the parameter sets can get pretty involved even if the stream isn’t actually decoded.

>  If I understand
> correctly, FFmpeg can simply extract SPS/PPS from
> AVCDecoderConfigurationRecord and copy slice data
> verbatim.
I guess this is the “extract” phase of that process, except it’s not liking the input bitstream.

> Besides that, I find `h264_decode_frame` is only called sparsely,
> not as many as the
> actual frame number.
I bet the ones it is not called on correspond with nal_ref_idc == 0


More information about the ffmpeg-user mailing list