Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] lavc/hevc_ps: fix process failed when SPS before VPS in hvcC
Date: Fri, 9 Sep 2022 10:55:13 -0300
Message-ID: <f662b6f9-ae6c-7598-e7d3-15ee18c475f6@gmail.com> (raw)
In-Reply-To: <tencent_85D7773EAE21F4645415BD4794A772232E07@qq.com>

On 9/9/2022 10:09 AM, 1035567130@qq.com wrote:
> From: Wang Yaqiang <wangyaqiang03@kuaishou.com>
> 
> In some videos, SPS will be stored before VPS in hvcC box,
> parse SPS does not depend on VPS, so the video is expected to be processed normally.
> Added "parsed_vps" parameter to indicate whether VPS have been parsed.
> Only VPS have been parsed can be verified during SPS parsing.
> 
> Signed-off-by: Wang Yaqiang <wangyaqiang03@kuaishou.com>
> ---
>   libavcodec/hevc_ps.c | 4 ++--
>   libavcodec/hevc_ps.h | 1 +
>   2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> index f665d8053c..71835d0f36 100644
> --- a/libavcodec/hevc_ps.c
> +++ b/libavcodec/hevc_ps.c
> @@ -464,7 +464,7 @@ int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx,
>       if (!vps_buf)
>           return AVERROR(ENOMEM);
>       vps = (HEVCVPS*)vps_buf->data;
> -
> +    ps->parsed_vps = 1;

This would need to be reset in ff_hevc_ps_uninit().

>       av_log(avctx, AV_LOG_DEBUG, "Decoding VPS\n");
>   
>       nal_size = gb->buffer_end - gb->buffer;
> @@ -1272,7 +1272,7 @@ int ff_hevc_decode_nal_sps(GetBitContext *gb, AVCodecContext *avctx,
>   
>       ret = ff_hevc_parse_sps(sps, gb, &sps_id,
>                               apply_defdispwin,
> -                            ps->vps_list, avctx);
> +                            ps->parsed_vps ? ps->vps_list : NULL, avctx);

If VPS is not required to parse SPS, wouldn't it be better to just 
change the check in ff_hevc_parse_sps() to turn the log message into a 
warning and then not error out?

>       if (ret < 0) {
>           av_buffer_unref(&sps_buf);
>           return ret;
> diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h
> index 2a1bbf6489..e6b694e7f3 100644
> --- a/libavcodec/hevc_ps.h
> +++ b/libavcodec/hevc_ps.h
> @@ -333,6 +333,7 @@ typedef struct HEVCParamSets {
>       const HEVCVPS *vps;
>       const HEVCSPS *sps;
>       const HEVCPPS *pps;
> +    int parsed_vps; // indicates VPS has been parsed
>   } HEVCParamSets;
>   
>   /**
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2022-09-09 13:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 13:09 1035567130
2022-09-09 13:55 ` James Almer [this message]
2022-09-09 14:34   ` wangyaqiang
2022-09-26  9:38 ` [FFmpeg-devel] [PATCH v2] " 1035567130
2022-09-26 20:21   ` Michael Niedermayer
2022-09-27 12:20     ` wangyaqiang
2022-10-14 10:13     ` wangyaqiang
2022-10-14 23:00       ` Michael Niedermayer
2022-10-25 14:29         ` wangyaqiang
2022-10-26  2:23 ` [FFmpeg-devel] [PATCH v3] " 1035567130
2022-11-11  2:25   ` wangyaqiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f662b6f9-ae6c-7598-e7d3-15ee18c475f6@gmail.com \
    --to=jamrial@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git