]> git.sesse.net Git - ffmpeg/commitdiff
avutil/timecode: add description for SMPTE binary format
authorLimin Wang <lance.lmwang@gmail.com>
Tue, 30 Jun 2020 15:22:58 +0000 (23:22 +0800)
committerLimin Wang <lance.lmwang@gmail.com>
Tue, 14 Jul 2020 21:47:14 +0000 (05:47 +0800)
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
libavutil/frame.h
libavutil/timecode.h

index 3fb8c56be88e90499027a8f64660d21ea54d7100..3bd240fc972decf780fb929ca10f732db381252e 100644 (file)
@@ -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 documentation of av_timecode_get_smpte_from_framenum()
+     * function in libavutil/timecode.h.
      */
     AV_FRAME_DATA_S12M_TIMECODE,
 
index ab38e661f13edf81319c44e5fd2cf008559898b6..5801330921933894479c080a389524f78df38c26 100644 (file)
@@ -62,6 +62,19 @@ int av_timecode_adjust_ntsc_framenum2(int framenum, int fps);
  * @param framenum frame number
  * @return         the SMPTE binary representation
  *
+ * See SMPTE ST 314M-2005 Sec 4.4.2.2.1 "Time code pack (TC)"
+ * the format description as follows:
+ * bits 0-5:   hours, in BCD(6bits)
+ * bits 6:     BGF1
+ * bits 7:     BGF2 (NTSC) or PC (PAL)
+ * bits 8-14:  minutes, in BCD(7bits)
+ * bits 15:    BGF0 (NTSC) or BGF2 (PAL)
+ * bits 16-22: seconds, in BCD(7bits)
+ * bits 23:    PC (NTSC) or BGF0 (PAL)
+ * bits 24-29: frames, in BCD(6bits)
+ * 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 or 7 bits): 4 or 5 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.