* [FFmpeg-devel] [PATCH RFC 0/6] MP4 editlist and HEVC decoder
@ 2025-03-18 12:58 Zhao Zhili
2025-03-18 13:07 ` Zhao Zhili
0 siblings, 1 reply; 2+ messages in thread
From: Zhao Zhili @ 2025-03-18 12:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
Fix #11510
#11510 revealed multiple issues related to mp4 demuxer, hevc decoder
and videotoolbox.
1. mp4 demuxer output packets have rewind due to editlist,
POC POC
916 -----------> 944
then rewind back to
916 -----------> 944 942
2. Both POC 916 and POC 944 are CRA nalu, so no flush on output.
3. When decoding POC the second time, POC still inside DPB buffer.
Patch 1/6 fix videotoolbox which shouldn't reset when confronted with
ReferenceMissingErr
Patch 2/6 is trial.
Patch 3/6 allow duplicated POC in DPB buffer. I'm not quite sure the
side effect.
Patch 4 to 6 add a flag to indicate the start of a new sequence, so
the decoder can flush on output. I know it looks suspicious, please
comment.
There are more general stream rewind issues to be resolved.
Zhao Zhili (6):
avcodec/vt: Don't restart decoder when confronted with
ReferenceMissingErr
avformat/mov: generalize sgpd_sync index lookup
avcodec/hevc: Don't drop packet with duplicate POC
avcodec/packet: Add AV_PKT_FLAG_NEW_SEQUENCE flag
avformat/mov: Notify new sequence at the start of editlist
avcodec/hevc: Check AV_PKT_FLAG_NEW_SEQUENCE and flush pictures out
libavcodec/hevc/hevcdec.c | 3 +++
libavcodec/hevc/refs.c | 4 ++--
libavcodec/packet.h | 10 ++++++++++
libavcodec/videotoolbox.c | 10 ++++++----
libavformat/avformat.h | 2 ++
libavformat/mov.c | 21 ++++++++++++++-------
6 files changed, 37 insertions(+), 13 deletions(-)
--
2.46.0
_______________________________________________
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".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] [PATCH RFC 0/6] MP4 editlist and HEVC decoder
2025-03-18 12:58 [FFmpeg-devel] [PATCH RFC 0/6] MP4 editlist and HEVC decoder Zhao Zhili
@ 2025-03-18 13:07 ` Zhao Zhili
0 siblings, 0 replies; 2+ messages in thread
From: Zhao Zhili @ 2025-03-18 13:07 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> On Mar 18, 2025, at 20:58, Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org> wrote:
>
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> Fix #11510
>
> #11510 revealed multiple issues related to mp4 demuxer, hevc decoder
> and videotoolbox.
>
> 1. mp4 demuxer output packets have rewind due to editlist,
>
> POC POC
> 916 -----------> 944
>
> then rewind back to
>
> 916 -----------> 944 942
>
> 2. Both POC 916 and POC 944 are CRA nalu, so no flush on output.
>
> 3. When decoding POC the second time, POC still inside DPB buffer.
I mean when decoding POC 944 the second time, POC 944 still inside
DPB buffer.
>
> Patch 1/6 fix videotoolbox which shouldn't reset when confronted with
> ReferenceMissingErr
>
> Patch 2/6 is trial.
>
> Patch 3/6 allow duplicated POC in DPB buffer. I'm not quite sure the
> side effect.
>
> Patch 4 to 6 add a flag to indicate the start of a new sequence, so
> the decoder can flush on output. I know it looks suspicious, please
> comment.
>
> There are more general stream rewind issues to be resolved.
>
> Zhao Zhili (6):
> avcodec/vt: Don't restart decoder when confronted with
> ReferenceMissingErr
> avformat/mov: generalize sgpd_sync index lookup
> avcodec/hevc: Don't drop packet with duplicate POC
> avcodec/packet: Add AV_PKT_FLAG_NEW_SEQUENCE flag
> avformat/mov: Notify new sequence at the start of editlist
> avcodec/hevc: Check AV_PKT_FLAG_NEW_SEQUENCE and flush pictures out
>
> libavcodec/hevc/hevcdec.c | 3 +++
> libavcodec/hevc/refs.c | 4 ++--
> libavcodec/packet.h | 10 ++++++++++
> libavcodec/videotoolbox.c | 10 ++++++----
> libavformat/avformat.h | 2 ++
> libavformat/mov.c | 21 ++++++++++++++-------
> 6 files changed, 37 insertions(+), 13 deletions(-)
>
> --
> 2.46.0
>
> _______________________________________________
> 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".
_______________________________________________
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".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-18 13:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-18 12:58 [FFmpeg-devel] [PATCH RFC 0/6] MP4 editlist and HEVC decoder Zhao Zhili
2025-03-18 13:07 ` Zhao Zhili
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