[FFmpeg-devel] [PATCH v2 10/11] avcodec: add vvc metadata bsf

James Almer jamrial at gmail.com
Sat Jan 9 15:50:28 EET 2021


On 1/9/2021 4:34 AM, Nuo Mi wrote:
> use following command to test:
> ffmpeg -i in.bin  -c:v copy -bsf vvc_metadata -f vvc out.bin
> 
> 79.11%(197/249) can bit match with original clips
> 6.83%(17/249) are not bit match, the original clips has redundant emulation prevent bytes
> other all failed since vvdec failed to decode the first frame

You don't (or shouldn't) need a decoder in order to do bitstream 
filtering, since it works on packets (codec copy) and not frames.

Since the decoder you submitted is, if committed, going to be external, 
it will not be present in most libavcodec builds out there. This means 
that you should ensure parsing of such files can succeed without a 
decoder, so bsfs can run without it. If not possible already in the 
state you wrote it in patch 8/11, it can be achieved by temporarily 
setting some values in the parser until an internal decoder is implemented.
For AV1 i had to set avctx dimensions and pixel format, both things i 
removed once the internal decoder (as barebones as it is) was 
introduced, since it's its job. I assume h266 will require the same.

> ---
>   configure                      |   1 +
>   libavcodec/Makefile            |   1 +
>   libavcodec/bitstream_filters.c |   1 +
>   libavcodec/vvc_metadata_bsf.c  | 243 +++++++++++++++++++++++++++++++++
>   4 files changed, 246 insertions(+)
>   create mode 100644 libavcodec/vvc_metadata_bsf.c
> 
> diff --git a/configure b/configure
> index 5ff743d9c2..b41f2af151 100755
> --- a/configure
> +++ b/configure
> @@ -3184,6 +3184,7 @@ mjpeg2jpeg_bsf_select="jpegtables"
>   mpeg2_metadata_bsf_select="cbs_mpeg2"
>   trace_headers_bsf_select="cbs"
>   vp9_metadata_bsf_select="cbs_vp9"
> +vvc_metadata_bsf_select="cbs_h266"

For the sake of consistency, this bsf should be called h266_metadata and 
not vcc_metadata, seeing the other two are h264 and h265 respectively. 
It's part of what i suggested, but guess it got mixed in between the rest.


More information about the ffmpeg-devel mailing list