FFmpeg
|
Go to the source code of this file.
Data Structures | |
struct | AVTimecode |
Macros | |
#define | AV_TIMECODE_STR_SIZE 23 |
Enumerations | |
enum | AVTimecodeFlag { AV_TIMECODE_FLAG_DROPFRAME = 1<<0, AV_TIMECODE_FLAG_24HOURSMAX = 1<<1, AV_TIMECODE_FLAG_ALLOWNEGATIVE = 1<<2 } |
Functions | |
int | av_timecode_adjust_ntsc_framenum2 (int framenum, int fps) |
Adjust frame number for NTSC drop frame time code. More... | |
uint32_t | av_timecode_get_smpte_from_framenum (const AVTimecode *tc, int framenum) |
Convert frame number to SMPTE 12M binary representation. More... | |
uint32_t | av_timecode_get_smpte (AVRational rate, int drop, int hh, int mm, int ss, int ff) |
Convert sei info to SMPTE 12M binary representation. More... | |
char * | av_timecode_make_string (const AVTimecode *tc, char *buf, int framenum) |
Load timecode string in buf. More... | |
char * | av_timecode_make_smpte_tc_string2 (char *buf, AVRational rate, uint32_t tcsmpte, int prevent_df, int skip_field) |
Get the timecode string from the SMPTE timecode format. More... | |
char * | av_timecode_make_smpte_tc_string (char *buf, uint32_t tcsmpte, int prevent_df) |
Get the timecode string from the SMPTE timecode format. More... | |
char * | av_timecode_make_mpeg_tc_string (char *buf, uint32_t tc25bit) |
Get the timecode string from the 25-bit timecode format (MPEG GOP format). More... | |
int | av_timecode_init (AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx) |
Init a timecode struct with the passed parameters. More... | |
int | av_timecode_init_from_components (AVTimecode *tc, AVRational rate, int flags, int hh, int mm, int ss, int ff, void *log_ctx) |
Init a timecode struct from the passed timecode components. More... | |
int | av_timecode_init_from_string (AVTimecode *tc, AVRational rate, const char *str, void *log_ctx) |
Parse timecode representation (hh:mm:ss[:;. More... | |
int | av_timecode_check_frame_rate (AVRational rate) |
Check if the timecode feature is available for the given frame rate. More... | |
Timecode helpers header
Definition in file timecode.h.
#define AV_TIMECODE_STR_SIZE 23 |
Definition at line 33 of file timecode.h.
enum AVTimecodeFlag |
Enumerator | |
---|---|
AV_TIMECODE_FLAG_DROPFRAME | timecode is drop frame |
AV_TIMECODE_FLAG_24HOURSMAX | timecode wraps after 24 hours |
AV_TIMECODE_FLAG_ALLOWNEGATIVE | negative time values are allowed |
Definition at line 35 of file timecode.h.
int av_timecode_adjust_ntsc_framenum2 | ( | int | framenum, |
int | fps | ||
) |
Adjust frame number for NTSC drop frame time code.
framenum | frame number to adjust |
fps | frame per second, multiples of 30 |
Definition at line 35 of file timecode.c.
Referenced by av_timecode_get_smpte_from_framenum(), and av_timecode_make_string().
uint32_t av_timecode_get_smpte_from_framenum | ( | const AVTimecode * | tc, |
int | framenum | ||
) |
Convert frame number to SMPTE 12M binary representation.
tc | timecode data correctly initialized |
framenum | frame number |
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 FIELD (PAL) bits 8-14: minutes, in BCD(7bits) bits 15: BGF0 (NTSC) or BGF2 (PAL) bits 16-22: seconds, in BCD(7bits) bits 23: FIELD (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)
Definition at line 53 of file timecode.c.
Referenced by dv_write_pack(), mxf_write_system_item(), and decklink_input_callback::VideoInputFrameArrived().
uint32_t av_timecode_get_smpte | ( | AVRational | rate, |
int | drop, | ||
int | hh, | ||
int | mm, | ||
int | ss, | ||
int | ff | ||
) |
Convert sei info to SMPTE 12M binary representation.
rate | frame rate in rational form |
drop | drop flag |
hh | hour |
mm | minute |
ss | second |
ff | frame number |
Definition at line 69 of file timecode.c.
Referenced by av_timecode_get_smpte_from_framenum(), h264_export_frame_props(), and set_side_data().
char* av_timecode_make_string | ( | const AVTimecode * | tc, |
char * | buf, | ||
int | framenum | ||
) |
Load timecode string in buf.
tc | timecode data correctly initialized |
buf | destination buffer, must be at least AV_TIMECODE_STR_SIZE long |
framenum | frame number |
Definition at line 103 of file timecode.c.
Referenced by draw_text(), imf_read_header(), mxf_add_timecode_metadata(), parse_timecode_in_framenum_format(), segment_end(), test_cpl_parsing(), and decklink_input_callback::VideoInputFrameArrived().
char* av_timecode_make_smpte_tc_string2 | ( | char * | buf, |
AVRational | rate, | ||
uint32_t | tcsmpte, | ||
int | prevent_df, | ||
int | skip_field | ||
) |
Get the timecode string from the SMPTE timecode format.
In contrast to av_timecode_make_smpte_tc_string this function supports 50/60 fps timecodes by using the field bit.
buf | destination buffer, must be at least AV_TIMECODE_STR_SIZE long |
rate | frame rate of the timecode |
tcsmpte | the 32-bit SMPTE timecode |
prevent_df | prevent the use of a drop flag when it is known the DF bit is arbitrary |
skip_field | prevent the use of a field flag when it is known the field bit is arbitrary (e.g. because it is used as PC flag) |
Definition at line 139 of file timecode.c.
Referenced by av_timecode_make_smpte_tc_string(), decode_frame(), dump_s12m_timecode(), h264_export_frame_props(), print_frame_side_data(), set_side_data(), and wsd_read_header().
char* av_timecode_make_smpte_tc_string | ( | char * | buf, |
uint32_t | tcsmpte, | ||
int | prevent_df | ||
) |
Get the timecode string from the SMPTE timecode format.
buf | destination buffer, must be at least AV_TIMECODE_STR_SIZE long |
tcsmpte | the 32-bit SMPTE timecode |
prevent_df | prevent the use of a drop flag when it is known the DF bit is arbitrary |
Definition at line 163 of file timecode.c.
char* av_timecode_make_mpeg_tc_string | ( | char * | buf, |
uint32_t | tc25bit | ||
) |
Get the timecode string from the 25-bit timecode format (MPEG GOP format).
buf | destination buffer, must be at least AV_TIMECODE_STR_SIZE long |
tc25bit | the 25-bits timecode |
Definition at line 168 of file timecode.c.
Referenced by filter_frame(), mpeg_decode_frame(), mpeg_decode_gop(), and print_frame_side_data().
int av_timecode_init | ( | AVTimecode * | tc, |
AVRational | rate, | ||
int | flags, | ||
int | frame_start, | ||
void * | log_ctx | ||
) |
Init a timecode struct with the passed parameters.
tc | pointer to an allocated AVTimecode |
rate | frame rate in rational form |
flags | miscellaneous flags such as drop frame, +24 hours, ... (see AVTimecodeFlag) |
frame_start | the first frame number |
log_ctx | a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log) |
Definition at line 222 of file timecode.c.
Referenced by dv_write_header(), mxf_init_timecode(), mxf_parse_physical_source_package(), mxf_parse_structural_metadata(), and parse_timecode_in_framenum_format().
int av_timecode_init_from_components | ( | AVTimecode * | tc, |
AVRational | rate, | ||
int | flags, | ||
int | hh, | ||
int | mm, | ||
int | ss, | ||
int | ff, | ||
void * | log_ctx | ||
) |
Init a timecode struct from the passed timecode components.
tc | pointer to an allocated AVTimecode |
rate | frame rate in rational form |
flags | miscellaneous flags such as drop frame, +24 hours, ... (see AVTimecodeFlag) |
hh | hours |
mm | minutes |
ss | seconds |
ff | frames |
log_ctx | a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log) |
Definition at line 232 of file timecode.c.
Referenced by av_timecode_init_from_string(), fill_timecode(), and get_bmd_timecode().
int av_timecode_init_from_string | ( | AVTimecode * | tc, |
AVRational | rate, | ||
const char * | str, | ||
void * | log_ctx | ||
) |
Parse timecode representation (hh:mm:ss[:;.
]ff).
tc | pointer to an allocated AVTimecode |
rate | frame rate in rational form |
str | timecode string which will determine the frame start |
log_ctx | a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log). |
Definition at line 253 of file timecode.c.
Referenced by dv_write_header(), init(), mov_check_timecode_track(), mxf_init_timecode(), and segment_end().
int av_timecode_check_frame_rate | ( | AVRational | rate | ) |
Check if the timecode feature is available for the given frame rate.
Definition at line 217 of file timecode.c.