[FFmpeg-devel] [PATCH v5 1/2] avutil/timecode: add description for SMPTE binary format
lance.lmwang at gmail.com
lance.lmwang at gmail.com
Tue Jun 30 18:26:40 EEST 2020
From: Limin Wang <lance.lmwang at gmail.com>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
libavutil/frame.h | 4 ++--
libavutil/timecode.h | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 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..65c5e91 100644
--- a/libavutil/timecode.h
+++ b/libavutil/timecode.h
@@ -62,6 +62,18 @@ int av_timecode_adjust_ntsc_framenum2(int framenum, int fps);
* @param framenum frame number
* @return the SMPTE binary representation
*
+ * the format description as follows:
+ * bits 0-5: hours, in BCD
+ * bits 6: BGF1
+ * bits 7: BGF2 (NTSC) or PC (PAL)
+ * bits 8-13: minutes, in BCD
+ * bits 15: BGF0 (NTSC) or BGF2 (PAL)
+ * bits 16-21: seconds, in BCD
+ * bits 23: PC (NTSC) or BGF0 (PAL)
+ * bits 24-29: frames, in BCD
+ * bits 30: drop frame flag (0: non drop, 1: drop)
+ * bits 31: color frame flag (0: unsync mode, 1: sync mode)
+ * @note BCD numbers (6 bits): 4 lower bits for units, 2 higher bits for tens.
* @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