FFmpeg
|
Timecode helpers header. More...
Go to the source code of this file.
Data Structures | |
struct | AVTimecode |
Macros | |
#define | AV_TIMECODE_STR_SIZE 16 |
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... | |
char * | av_timecode_make_string (const AVTimecode *tc, char *buf, int framenum) |
Load timecode string in buf. 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_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... | |
Detailed Description
Timecode helpers header.
Definition in file libavutil/timecode.h.
Macro Definition Documentation
#define AV_TIMECODE_STR_SIZE 16 |
Definition at line 33 of file libavutil/timecode.h.
Referenced by av_timecode_make_mpeg_tc_string(), av_timecode_make_smpte_tc_string(), av_timecode_make_string(), draw_text(), dv_read_timecode(), mpeg_decode_gop(), mxf_add_timecode_metadata(), parse_timecode_in_framenum_format(), and show_stream().
Enumeration Type Documentation
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 libavutil/timecode.h.
Function Documentation
int av_timecode_adjust_ntsc_framenum2 | ( | int | framenum, |
int | fps | ||
) |
Adjust frame number for NTSC drop frame time code.
- Parameters
-
framenum frame number to adjust fps frame per second, 30 or 60
- Returns
- adjusted frame number
- Warning
- adjustment is only valid in NTSC 29.97 and 59.94
Definition at line 34 of file libavutil/timecode.c.
Referenced by av_timecode_get_smpte_from_framenum(), av_timecode_make_string(), and mpeg1_encode_sequence_header().
int av_timecode_check_frame_rate | ( | AVRational | rate | ) |
Check if the timecode feature is available for the given frame rate.
- Returns
- 0 if supported, <0 otherwise
Definition at line 177 of file libavutil/timecode.c.
Referenced by mov_create_timecode_track().
uint32_t av_timecode_get_smpte_from_framenum | ( | const AVTimecode * | tc, |
int | framenum | ||
) |
Convert frame number to SMPTE 12M binary representation.
- Parameters
-
tc timecode data correctly initialized framenum frame number
- Returns
- the SMPTE binary representation
- Note
- Frame number adjustment is automatically done in case of drop timecode, you do NOT have to call av_timecode_adjust_ntsc_framenum2().
- The frame number is relative to tc->start.
- Color frame (CF), binary group flags (BGF) and biphase mark polarity correction (PC) bits are set to zero.
Definition at line 55 of file libavutil/timecode.c.
Referenced by dv_write_pack(), and mxf_write_system_item().
int av_timecode_init | ( | AVTimecode * | tc, |
AVRational | rate, | ||
int | flags, | ||
int | frame_start, | ||
void * | log_ctx | ||
) |
Init a timecode struct with the passed parameters.
- 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
- Returns
- 0 on success, AVERROR otherwise
Definition at line 182 of file libavutil/timecode.c.
Referenced by dv_write_header(), mxf_parse_structural_metadata(), mxf_write_header(), 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).
- 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 str timecode string which will determine the frame start
- Returns
- 0 on success, AVERROR otherwise
Definition at line 192 of file libavutil/timecode.c.
Referenced by dv_write_header(), encode_init(), init(), mov_create_timecode_track(), and mxf_write_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).
- Parameters
-
buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long tc25bit the 25-bits timecode
- Returns
- the buf parameter
Definition at line 130 of file libavutil/timecode.c.
Referenced by mpeg_decode_gop(), and show_stream().
char* av_timecode_make_smpte_tc_string | ( | char * | buf, |
uint32_t | tcsmpte, | ||
int | prevent_df | ||
) |
Get the timecode string from the SMPTE timecode format.
- Parameters
-
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
- Returns
- the buf parameter
Definition at line 118 of file libavutil/timecode.c.
Referenced by dv_extract_timecode().
char* av_timecode_make_string | ( | const AVTimecode * | tc, |
char * | buf, | ||
int | framenum | ||
) |
Load timecode string in buf.
- Parameters
-
buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long tc timecode data correctly initialized framenum frame number
- Returns
- the buf parameter
- Note
- Timecode representation can be a negative timecode and have more than 24 hours, but will only be honored if the flags are correctly set.
- The frame number is relative to tc->start.
Definition at line 84 of file libavutil/timecode.c.
Referenced by draw_text(), mxf_add_timecode_metadata(), and parse_timecode_in_framenum_format().
Generated on Mon Nov 18 2024 06:52:09 for FFmpeg by 1.8.11