• Marton Balint's avatar
    avutil/timecode: fix av_timecode_get_smpte_from_framenum with 50/60 fps · 00117e28
    Marton Balint authored
    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: 's avatarMarton Balint <cus@passwd.hu>
    00117e28
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...