[FFmpeg-devel] [PATCH 2/3 v2] avcodec: add an AVCodecContext flag to export PRFT side data on demand

James Almer jamrial at gmail.com
Mon Feb 10 20:26:45 EET 2020


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/avcodec.h       | 8 +++++++-
 libavcodec/options_table.h | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 1280a7ffe2..7a40fa12b5 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1106,6 +1106,10 @@ typedef struct RcOverride{
  * Export motion vectors through frame side data
  */
 #define AV_CODEC_EXPORT_DATA_MVS         (1 << 0)
+/**
+ * Export Producer Reference Time through packet side data
+ */
+#define AV_CODEC_EXPORT_DATA_PRFT        (1 << 1)
 
 /**
  * Pan Scan area.
@@ -1426,7 +1430,9 @@ enum AVPacketSideDataType {
     AV_PKT_DATA_AFD,
 
     /**
-     * Producer Reference Time data corresponding to the AVProducerReferenceTime struct.
+     * Producer Reference Time data corresponding to the AVProducerReferenceTime struct
+     * exported by some encoders (on demand through the prft flag set in the AVCodecContext
+     * export_side_data field).
      */
     AV_PKT_DATA_PRFT,
 
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 3f278d5c68..3265889b8e 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -80,6 +80,7 @@ static const AVOption avcodec_options[] = {
 {"ass_ro_flush_noop", "do not reset ASS ReadOrder field on flush", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_RO_FLUSH_NOOP}, INT_MIN, INT_MAX, S|D, "flags2"},
 {"export_side_data", "Export metadata as side data", OFFSET(export_side_data), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, A|V|S|D|E, "export_side_data"},
 {"mvs", "export motion vectors through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_MVS}, INT_MIN, INT_MAX, V|D, "export_side_data"},
+{"prft", "export Producer Reference Time through packet side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_PRFT}, INT_MIN, INT_MAX, A|V|S|E, "export_side_data"},
 {"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, INT_MAX},
 {"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
 {"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
-- 
2.25.0



More information about the ffmpeg-devel mailing list