Commit Graph

10 Commits

Author SHA1 Message Date
Marton Balint
837b6eb90e avutil/timecode: add av_timecode_make_smpte_tc_string2
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-09-13 17:51:57 +02:00
Marton Balint
00117e28c1 avutil/timecode: fix av_timecode_get_smpte_from_framenum with 50/60 fps
SMPTE 12M timecode can only count frames up to 39, because the tens-of-frames
value is stored in 2 bit. In order to resolve this 50/60 fps SMPTE timecode is
using the field bit (which is the same bit as the phase correction bit) to
signal the least significant bit of a 50/60 fps timecode. See SMPTE ST
12-1:2014 section 12.1.

Therefore we slightly change the format of the return value of
av_timecode_get_smpte_from_framenum and AV_FRAME_DATA_S12M_TIMECODE and start
using the previously unused Phase Correction bit as Field bit. (As the SMPTE
standard suggests)

We add 50/60 fps support to av_timecode_get_smpte_from_framenum by calling the
recently added av_timecode_get_smpte function in it which already handles this
properly.

This change affects the decklink indev and the DV and MXF muxers. MXF has no
fate test for 50/60fps content, DV does, therefore the changes.

MediaInfo (a recent version) confirms that half-frame timecode must be inserted
to DV. MXFInspect confirms valid timecode insertion to the System Item of MXF
files. For MXF, also see EBU R122.

Note that for DV the field flag is not used because in the HDV specs (SMPTE
370M) it is still defined as biphase mark polarity correction flag. So it
should not matter that the DV muxer overrides the field bit.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-09-13 17:51:57 +02:00
Limin Wang
c24c6a1bee avutil/timecode: add description for SMPTE binary format
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-07-15 05:47:14 +08:00
Limin Wang
79723c2a87 avutil/timecode: add function av_timecode_get_smpte()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-28 21:00:52 +08:00
Carl Eugen Hoyos
ae68bb779c lavu/timecode: Increase AV_TIMECODE_STR_SIZE.
Fixes the following warning:
libavutil/timecode.c:103:60: warning: '%02d' directive output may be truncated writing between 2 and 10 bytes into a region of size between 0 and 7
2017-05-05 10:09:12 +02:00
Stefano Sabatini
74a50e75a8 lavu: drop disabled FF_API_OLD_TC_ADJUST_FRAMENUM code 2012-11-04 18:10:39 +01:00
Clément Bœsch
4b365b0868 lavu/timecode: add av_timecode_check_frame_rate(). 2012-08-08 09:11:26 +02:00
Matthieu Bouron
789f8cb03a avutil: support 50 and 60 frame rates in timecode api
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-27 13:41:58 +02:00
Clément Bœsch
6b35f1a2a6 timecode: move timecode muxer options to metadata.
Some demuxers set a timecode in the format or streams metadata. The
muxers now make use of this metadata instead of a duplicated private
option.

This makes possible transparent copy of the timecode when transmuxing
and transcoding.

-timecode option for MPEG1/2 codec is also renamed to -gop_timecode. The
global ffmpeg -timecode option will set it anyway so no option change
visible for the user.
2012-06-04 07:41:22 +02:00
Clément Bœsch
0eaa123b34 lavu: add public timecode API. 2012-02-02 14:30:28 +01:00