ffmpeg: switch to the new BSF API

Multimedia / FFmpeg - Clément Bœsch [stupeflix.com] - 24 September 2016 12:25 UTC

This commit is initially largely based on commit 4426540 from Anton Khirnov and two following fixes (80fb19b and fe7b21c) which were previously skipped respectively in 98e3153, c9ee36e, and 7fe7cdc.

mpeg4-bsf-unpack-bframes FATE reference is updated because the bsf filter now actually fixes the extradata (mpeg4_unpack_bframes_init() changing one byte is now honored on the output extradata).

The FATE references for remove_extra change because the packet flags were wrong and the keyframes weren't marked, causing the bsf relying on these proprieties to not actually work as intended.

The following was fixed by James Almer:

The filter option arguments are now also parsed correctly.

A hack to propagate extradata changed by bitstream filters after the first av_bsf_receive_packet() call is added to maintain the current behavior. This was previously done by av_bitstream_filter_filter() and is needed for the aac_adtstoasc bsf.

The exit_on_error was not being checked anymore, and led to an exit error in the last frame of h264_mp4toannexb test. Restoring this behaviour prevents erroring out. The test is still changed as a result due to the badly filtered frame now not being written after the failure.

5ef1959 ffmpeg: switch to the new BSF API
cmdutils.c | 5 +-
ffmpeg.c | 154 +++++++++++++++++++++-------
ffmpeg.h | 6 +-
ffmpeg_opt.c | 73 +++++++++----
tests/ref/fate/ffmpeg-bsf-remove-k | 55 +++++-----
tests/ref/fate/ffmpeg-bsf-remove-r | 55 +++++-----
tests/ref/fate/h264_mp4toannexb_ticket2991 | 6 +-
tests/ref/fate/mpeg4-bsf-unpack-bframes | 2 +-
8 files changed, 237 insertions(+), 119 deletions(-)

  • Share