* [FFmpeg-devel] [PATCH 4/6] avcodec/packet: Add AV_PKT_FLAG_NEW_SEQUENCE flag
@ 2025-03-18 12:58 Zhao Zhili
0 siblings, 0 replies; only message 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>
Sometimes AV_PKT_FLAG_KEY is the start of a new sequence, sometimes
it's not. For example, HEVC CRA NALU can be marked as keyframe.
hevc decoder doesn't check AV_PKT_FLAG_KEY, and doesn't treat CRA
as new sequence. But sometimes CRA is really the start of a new
sequence, and the decoder should flush all pictures out, e.g.,
after a rewind by mp4 editlist.
AV_PKT_FLAG_KEY works with no problem for seek, AV_PKT_FLAG_NEW_SEQUENCE
works for rewind inside demuxer, that is, no explicit flush on
decoder.
---
libavcodec/packet.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index c1f1ad7b43..331c66d7aa 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -612,6 +612,16 @@ typedef struct AVPacketList {
*/
#define AV_PKT_FLAG_DISPOSABLE 0x0010
+/**
+ * Flag is used to indicate the start of a new sequence.
+ *
+ * For example, HEVC CRA can be handled differently depending on whether it's
+ * the start of a new sequence or not.
+ *
+ * A new sequence can be created by timeline map in mp4 editlist.
+ */
+#define AV_PKT_FLAG_NEW_SEQUENCE 0x0020
+
enum AVSideDataParamChangeFlags {
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004,
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
--
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] only message in thread
only message in thread, other threads:[~2025-03-18 12:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-18 12:58 [FFmpeg-devel] [PATCH 4/6] avcodec/packet: Add AV_PKT_FLAG_NEW_SEQUENCE flag 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