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

James Almer jamrial at gmail.com
Sat Jan 9 17:57:34 EET 2021


On 1/9/2021 12:14 PM, Nuo Mi wrote:
> On Sat, Jan 9, 2021 at 11:11 PM Nuo Mi <nuomi2021 at gmail.com> wrote:
> 
>>
>> Hi James,
>> On Sat, Jan 9, 2021 at 10:53 PM James Almer <jamrial at gmail.com> wrote:
>>
>>> 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.
>>
>> Thanks for suggestion. I will try it.
>> I tried to disable hevc native decoder, and use hevc bsf only. It got the
>> same error as vvc.
>> Do we need fix this too?
>>
> We have set dimensions and format code in 8/11, but it still need decoder.
> I will dig it more.

You're setting them in AVCodecParserContext, which is standard for 
parsers. What you need to do until an internal decoder is introduced is 
setting the same values in avctx (You're currently setting profile and 
level there).
For dimensions, compare the current values in avctx with the ones you 
read from the bitstream, and use ff_set_dimensions() to set them if they 
don't match.

That should hopefully be enough.

> 
>>
>>
>>
>>
>>>> ---
>>>>    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.
>>>
>> This is a funny part. Seems the filter name is hevc_metadata. But the
>> class name is h265_metadata_bsf...
>>
>>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel at ffmpeg.org
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>> To unsubscribe, visit link above, or email
>>> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>>
>>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 



More information about the ffmpeg-devel mailing list