[FFmpeg-devel] [PATCH v4 1/2] avutil/timecode: add description for SMPTE binary format
lance.lmwang at gmail.com
lance.lmwang at gmail.com
Tue Jun 30 07:29:17 EEST 2020
From: Limin Wang <lance.lmwang at gmail.com>
AV_FRAME_DATA_S12M_TIMECODE is public API, so user need to know its format
by the API header instead of reading the code.
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
libavutil/frame.h | 4 ++--
libavutil/timecode.h | 16 +++++++++++++++-
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 3fb8c56..c694b12 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -162,8 +162,8 @@ enum AVFrameSideDataType {
/**
* Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 uint32_t
* where the first uint32_t describes how many (1-3) of the other timecodes are used.
- * The timecode format is described in the av_timecode_get_smpte_from_framenum()
- * function in libavutil/timecode.c.
+ * The timecode format is described in the comments of av_timecode_get_smpte_from_framenum()
+ * function in libavutil/timecode.h.
*/
AV_FRAME_DATA_S12M_TIMECODE,
diff --git a/libavutil/timecode.h b/libavutil/timecode.h
index ab38e66..b1c1887 100644
--- a/libavutil/timecode.h
+++ b/libavutil/timecode.h
@@ -61,7 +61,21 @@ int av_timecode_adjust_ntsc_framenum2(int framenum, int fps);
* @param tc timecode data correctly initialized
* @param framenum frame number
* @return the SMPTE binary representation
- *
+ * the format description as follows, note it's in system byte order:
+ * 31b: color frame flag (0: unsync mode, 1: sync mode)
+ * 30b: drop frame flag (0: non drop, 1: drop)
+ * 28b,29b: tens of frames
+ * 24-27b: units of frames
+ * 23b: PC (NTSC) or BGF0 (PAL)
+ * 20b,22b: tens of seconds
+ * 16-19b: units of seconds
+ * 15b: BGF0 (NTSC) or BGF2 (PAL)
+ * 12b,13b: tens of minutes
+ * 8-11b: units of minutes
+ * 7b: BGF2 (NTSC) or PC (PAL)
+ * 6b: BGF1
+ * 4b,5b: tens of hours
+ * 0b-3b: units of hours
* @note Frame number adjustment is automatically done in case of drop timecode,
* you do NOT have to call av_timecode_adjust_ntsc_framenum2().
* @note The frame number is relative to tc->start.
--
1.8.3.1
More information about the ffmpeg-devel
mailing list