[FFmpeg-devel] [PATCH v7 06/11] avformat: add demuxer and probe support for H266/VVC

Nuo Mi nuomi2021 at gmail.com
Mon Dec 18 14:25:44 EET 2023


On Mon, Dec 18, 2023 at 7:43 PM Zhao Zhili <quinkblack at foxmail.com> wrote:

>
>
> > On Mar 21, 2023, at 23:01, Thomas Siedel <thomas.ff at spin-digital.com>
> wrote:
> >
> > Add demuxer to probe raw vvc and parse vvcc byte stream format.
> >
> > Co-authored-by: Nuo Mi <nuomi2021 at gmail.com>
> > ---
> >
>
>
> > +
> > +static int h266_probe(const AVProbeData *p)
> > +{
> > +    uint32_t code = -1;
> > +    int sps = 0, pps = 0, irap = 0;
> > +    int i;
> > +
> > +    for (i = 0; i < p->buf_size - 1; i++) {
> > +        code = (code << 8) + p->buf[i];
> > +        if ((code & 0xffffff00) == 0x100) {
> > +            uint8_t nal2 = p->buf[i + 1];
> > +            int type = (nal2 & 0xF8) >> 3;
> > +
> > +            if (code & 0x80) // forbidden_zero_bit
> > +                return 0;
> > +
> > +            if ((nal2 & 0x7) == 0) // nuh_temporal_id_plus1
> > +                return 0;
> > +
> > +            switch (type) {
> > +            case VVC_SPS_NUT:       sps++;  break;
> > +            case VVC_PPS_NUT:       pps++;  break;
> > +            case VVC_IDR_N_LP:
> > +            case VVC_IDR_W_RADL:
> > +            case VVC_CRA_NUT:
> > +            case VVC_GDR_NUT:       irap++; break;
> > +            }
> > +        }
> > +    }
> > +
> > +    if (sps && pps && irap)
> > +        return AVPROBE_SCORE_EXTENSION + 1; // 1 more than .mpg
>
> The probe isn’t reliable enough. It mistreated an TS as vvc,
>
> https://trac.ffmpeg.org/ticket/10731#comment:1
>
> Any idea to reduce false positive?
>
> > +    return 0;
> > +}
> > +
> > +FF_DEF_RAWVIDEO_DEMUXER(h266, "raw H.266/VVC video", h266_probe,
> "h266,266,vvc", AV_CODEC_ID_VVC)
> > --
> > 2.25.1

It will fix by
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20231205094038.12293-1-post@frankplowman.com/
Could you help merge and backport to 6.1
https://trac.ffmpeg.org/ticket/10703

thank you.


> >
> > _______________________________________________
> > 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