FFmpeg
|
Timecode helpers. More...
Go to the source code of this file.
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... | |
char * | av_timecode_make_string (const AVTimecode *tc, char *buf, int framenum) |
Load timecode string in buf. More... | |
static unsigned | bcd2uint (uint8_t bcd) |
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... | |
static int | check_fps (int fps) |
static int | check_timecode (void *log_ctx, AVTimecode *tc) |
static int | fps_from_frame_rate (AVRational rate) |
int | av_timecode_check_frame_rate (AVRational rate) |
Check if the timecode feature is available for the given frame rate. 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_string (AVTimecode *tc, AVRational rate, const char *str, void *log_ctx) |
Parse timecode representation (hh:mm:ss[:;. More... | |
Timecode helpers.
Definition in file timecode.c.
Adjust frame number for NTSC drop frame time code.
framenum | frame number to adjust |
fps | frame per second, 30 or 60 |
Definition at line 34 of file timecode.c.
Referenced by av_timecode_get_smpte_from_framenum(), av_timecode_make_string(), and mpeg1_encode_sequence_header().
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 |
Definition at line 55 of file timecode.c.
Referenced by dv_write_pack(), and mxf_write_system_item().
char* av_timecode_make_string | ( | const AVTimecode * | tc, |
char * | buf, | ||
int | framenum | ||
) |
Load timecode string in buf.
buf | destination buffer, must be at least AV_TIMECODE_STR_SIZE long |
tc | timecode data correctly initialized |
framenum | frame number |
Definition at line 84 of file timecode.c.
Referenced by draw_text(), mxf_add_timecode_metadata(), parse_timecode_in_framenum_format(), and segment_end().
|
static |
Definition at line 109 of file timecode.c.
Referenced by av_timecode_make_smpte_tc_string().
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 118 of file timecode.c.
Referenced by dv_extract_timecode(), and wsd_read_header().
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 130 of file timecode.c.
Referenced by mpeg_decode_gop(), show_frame(), and show_stream().
Definition at line 142 of file timecode.c.
Referenced by av_timecode_check_frame_rate(), and check_timecode().
|
static |
Definition at line 155 of file timecode.c.
Referenced by av_timecode_init(), and av_timecode_init_from_string().
|
static |
Definition at line 172 of file timecode.c.
Referenced by av_timecode_check_frame_rate(), av_timecode_init(), and av_timecode_init_from_string().
int av_timecode_check_frame_rate | ( | AVRational | rate | ) |
Check if the timecode feature is available for the given frame rate.
Definition at line 179 of file timecode.c.
Referenced by find_fps().
int av_timecode_init | ( | AVTimecode * | tc, |
AVRational | rate, | ||
int | flags, | ||
int | frame_start, | ||
void * | log_ctx | ||
) |
Init a timecode struct with the passed parameters.
log_ctx | a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log) |
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 |
Definition at line 184 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_string | ( | AVTimecode * | tc, |
AVRational | rate, | ||
const char * | str, | ||
void * | log_ctx | ||
) |
Parse timecode representation (hh:mm:ss[:;.
]ff).
log_ctx | a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log). |
tc | pointer to an allocated AVTimecode |
rate | frame rate in rational form |
str | timecode string which will determine the frame start |
Definition at line 194 of file timecode.c.
Referenced by dv_write_header(), encode_init(), init(), mov_check_timecode_track(), mxf_init_timecode(), and segment_end().