Go to the documentation of this file.
46 #define HEXDUMP_PRINT(...) \
49 av_log(avcl, level, __VA_ARGS__); \
51 fprintf(f, __VA_ARGS__); \
55 const uint8_t *buf,
int size)
59 for (
i = 0;
i <
size;
i += 16) {
64 for (j = 0; j < 16; j++) {
71 for (j = 0; j <
len; j++) {
73 if (c < ' ' || c >
'~')
127 static void print_fps(
double d,
const char *postfix,
int log_level)
134 else if (v % (100 * 1000))
137 av_log(
NULL, log_level,
"%1.0fk %s",
d / 1000, postfix);
141 const char *
name,
const char *indent,
151 if (strcmp(
"language",
tag->key)) {
152 const char *p =
tag->value;
154 "%s %-16s: ", indent,
tag->key);
156 size_t len = strcspn(p,
"\x8\xa\xb\xc\xd");
159 if (*p == 0xd)
av_log(
ctx, log_level,
" ");
160 if (*p == 0xa)
av_log(
ctx, log_level,
"\n%s %-16s: ", indent,
"");
217 if (gain == INT32_MIN)
220 av_log(
ctx, log_level,
"%f", gain / 100000.0
f);
224 static void print_peak(
void *
ctx,
const char *str, uint32_t peak,
int log_level)
230 av_log(
ctx, log_level,
"%f", (
float) peak / UINT32_MAX);
238 if (sd->
size <
sizeof(*rg)) {
254 if (sd->
size <
sizeof(*stereo)) {
271 if (sd->
size <
sizeof(*ast)) {
284 av_log(
ctx, log_level,
"visually impaired");
287 av_log(
ctx, log_level,
"hearing impaired");
314 if (sd->
size <
sizeof(*cpb)) {
320 "bitrate max/min/avg: %"PRId64
"/%"PRId64
"/%"PRId64
" buffer size: %"PRId64
" ",
324 av_log(
ctx, log_level,
"vbv_delay: N/A");
334 av_log(
ctx, log_level,
"Mastering Display Metadata, "
335 "has_primaries:%d has_luminance:%d "
336 "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f) "
337 "min_luminance=%f, max_luminance=%f",
354 av_log(
ctx, log_level,
"Content Light Level Metadata, "
355 "MaxCLL=%d, MaxFALL=%d",
364 "ambient_illuminance=%f, ambient_light_x=%f, ambient_light_y=%f",
374 double yaw, pitch, roll;
376 if (sd->
size <
sizeof(*spherical)) {
383 yaw = ((
double)spherical->
yaw) / (1 << 16);
386 av_log(
ctx, log_level,
"(%f/%f/%f) ", yaw, pitch, roll);
406 av_log(
ctx, log_level,
"version: %d.%d, profile: %d, level: %d, "
407 "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d",
419 const uint32_t *
tc = (
const uint32_t *)sd->
data;
421 if ((sd->
size !=
sizeof(uint32_t) * 4) || (
tc[0] > 3)) {
426 for (
int j = 1; j <=
tc[0]; j++) {
429 av_log(
ctx, log_level,
"timecode - %s%s", tcbuf, j !=
tc[0] ?
", " :
"");
439 av_log(
ctx, log_level,
"%sSide data:\n", indent);
457 av_log(
ctx, log_level,
"H.263 macroblock info");
464 av_log(
ctx, log_level,
"displaymatrix: rotation of %.2f degrees",
472 av_log(
ctx, log_level,
"audio service type: ");
476 av_log(
ctx, log_level,
"quality factor: %"PRId32
", pict_type: %c",
497 av_log(
ctx, log_level,
"DOVI configuration record: ");
501 av_log(
ctx, log_level,
"SMPTE ST 12-1:2014: ");
508 av_log(
ctx, log_level,
"unknown side data type %d "
534 av_log(
NULL, log_level,
" (hearing impaired)");
536 av_log(
NULL, log_level,
" (visual impaired)");
542 av_log(
NULL, log_level,
" (timed thumbnails)");
559 int group_index,
int index,
int is_output,
568 const char *group_indent = group_index >= 0 ?
" " :
"";
569 const char *extra_indent = group_index >= 0 ?
" " :
" ";
594 av_opt_set(avctx,
"dump_separator", separator, 0);
618 av_log(
NULL, log_level,
", SAR %d:%d DAR %d:%d",
620 display_aspect_ratio.
num, display_aspect_ratio.
den);
628 if (fps || tbr || tbn)
648 int i,
int index,
int is_output)
667 for (
int j = 0; j < audio_element->
nb_layers; j++) {
675 for (
int k = 0; channel_count > 0 && k < stg->
nb_streams; k++) {
678 printed[st->
index] = 1;
691 for (
int j = 0; j < mix_presentation->
nb_submixes; j++) {
712 for (
int k = 0; k < sub_mix->
nb_layouts; k++) {
729 const char *ptr =
NULL;
751 printed[st->
index] = 1;
761 const char *url,
int is_output)
769 is_output ?
"Output" :
"Input",
772 is_output ?
"to" :
"from", url);
831 for (k = 0; k <
program->nb_stream_indexes; k++) {
834 printed[
program->stream_index[k]] = 1;
836 total +=
program->nb_stream_indexes;
@ AV_PKT_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
void av_pkt_dump2(FILE *f, const AVPacket *pkt, int dump_payload, const AVStream *st)
Send a nice dump of a packet to the specified file stream.
AVIAMFSubmixElement ** elements
Array of submix elements.
#define AV_LOG_WARNING
Something somehow does not look correct.
unsigned int nb_layers
Number of layers, or channel groups, in the Audio Element.
#define AV_TIMECODE_STR_SIZE
AVStreamGroup ** stream_groups
A list of all stream groups in the file.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
static void dump_dovi_conf(void *ctx, const AVPacketSideData *sd, int log_level)
int64_t id
Group type-specific group ID.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C program
AVIAMFSubmixLayout ** layouts
Array of submix layouts.
@ AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT
Ambient viewing environment metadata, as defined by H.274.
enum AVMediaType codec_type
General type of the encoded data.
struct AVStreamGroupTileGrid * tile_grid
enum AVSphericalProjection projection
Projection type.
@ AV_PKT_DATA_QUALITY_STATS
This side data contains quality related information from the encoder.
unsigned int nb_chapters
Number of chapters in AVChapter array.
This struct describes the properties of an encoded stream.
Ambient viewing environment metadata as defined by H.274.
char * av_stristr(const char *s1, const char *s2)
Locate the first case-independent occurrence in the string haystack of the string needle.
@ AV_PKT_DATA_NEW_EXTRADATA
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
@ AV_PKT_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata (based on SMPTE-2086:2014).
static void dump_stereo3d(void *ctx, const AVPacketSideData *sd, int log_level)
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
static void hex_dump_internal(void *avcl, FILE *f, int level, const uint8_t *buf, int size)
unsigned int nb_submixes
Number of submixes in the presentation.
int disposition
Stream group disposition - a combination of AV_DISPOSITION_* flags.
unsigned MaxCLL
Max content light level (cd/m^2).
AVStream ** streams
A list of all streams in the file.
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
void av_spherical_tile_bounds(const AVSphericalMapping *map, size_t width, size_t height, size_t *left, size_t *top, size_t *right, size_t *bottom)
Convert the bounding fields from an AVSphericalVideo from 0.32 fixed point to pixels.
AVRational ambient_light_x
Normalized x chromaticity coordinate of the environmental ambient light in the nominal viewing enviro...
int32_t album_gain
Same as track_gain, but for the whole album.
AVRational avg_frame_rate
Average framerate.
@ AV_AUDIO_SERVICE_TYPE_VOICE_OVER
@ AV_PKT_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1:2014.
static void dump_disposition(int disposition, int log_level)
enum AVIAMFSubmixLayoutType layout_type
@ AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE
#define AV_LOG_VERBOSE
Detailed information.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
@ AV_SPHERICAL_EQUIRECTANGULAR_TILE
Video represents a portion of a sphere mapped on a flat surface using equirectangular projection.
int qmax
maximum quantizer
int nb_channels
Number of channels in this layout.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static void print_fps(double d, const char *postfix, int log_level)
static void dump_s12m_timecode(void *ctx, const AVStream *st, const AVPacketSideData *sd, int log_level)
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
@ AV_PKT_DATA_DOVI_CONF
DOVI configuration ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2....
static void print_gain(void *ctx, const char *str, int32_t gain, int log_level)
@ AV_PKT_DATA_REPLAYGAIN
This side data should be associated with an audio stream and contains ReplayGain information in form ...
static void dump_mastering_display_metadata(void *ctx, const AVPacketSideData *sd, int log_level)
const struct AVCodec * codec
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
AVStreamGroupTileGrid holds information on how to combine several independent images on a single canv...
Submix layout as defined in section 3.7.6 of IAMF.
int coded_width
Width of the canvas.
struct AVCodecContext * avctx
The codec context used by avformat_find_stream_info, the parser, etc.
static void dump_cpb(void *ctx, const AVPacketSideData *sd, int log_level)
static void dump_content_light_metadata(void *ctx, const AVPacketSideData *sd, int log_level)
uint8_t * dump_separator
dump format separator.
int coded_height
Width of the canvas.
#define us(width, name, range_min, range_max, subs,...)
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
AVRational ambient_illuminance
Environmental illuminance of the ambient viewing environment in lux.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
int64_t bit_rate
Total stream bitrate in bit/s, 0 if not available.
AVDictionary * annotations
A dictionary of strings describing the submix in different languages.
static void dump_ambient_viewing_environment_metadata(void *ctx, const AVPacketSideData *sd)
@ AV_PKT_DATA_PARAM_CHANGE
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)
Print detailed information about the input or output format, such as duration, bitrate,...
static void dump_sidedata(void *ctx, const AVStream *st, const char *indent, int log_level)
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
static void dump_audioservicetype(void *ctx, const AVPacketSideData *sd, int log_level)
@ AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
int64_t end
chapter start/end time in time_base units
AVRational sample_aspect_ratio
Video only.
const struct AVInputFormat * iformat
The input container format.
static void dump_replaygain(void *ctx, const AVPacketSideData *sd, int log_level)
static double av_q2d(AVRational a)
Convert an AVRational to a double.
unsigned int index
Group index in AVFormatContext.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static void dump_metadata(void *ctx, const AVDictionary *m, const char *indent, int log_level)
int codec_info_nb_frames
Number of frames that have been demuxed during avformat_find_stream_info()
AVChannelLayout ch_layout
@ AV_PKT_DATA_STEREO3D
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
@ AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED
int nb_coded_side_data
Amount of entries in coded_side_data.
uint32_t track_peak
Peak track amplitude, with 100000 representing full scale (but values may overflow).
This structure describes the bitrate properties of an encoded bitstream.
static void dump_paramchange(void *ctx, const AVPacketSideData *sd, int log_level)
int flags
Additional information about the frame packing.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avcodec_parameters_to_context(AVCodecContext *codec, const struct AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
uint8_t dv_bl_signal_compatibility_id
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
Rational number (pair of numerator and denominator).
enum AVPacketSideDataType type
A layer defining a Channel Layout in the Audio Element.
@ AV_AUDIO_SERVICE_TYPE_EMERGENCY
AVChannelLayout ch_layout
Audio only.
static void dump_dictionary(void *ctx, const AVDictionary *m, const char *name, const char *indent, int log_level)
@ AV_PKT_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
unsigned int audio_element_id
The id of the Audio Element this submix element references.
@ AV_PKT_DATA_SPHERICAL
This side data should be associated with a video stream and corresponds to the AVSphericalMapping str...
Submix layout as defined in section 3.7 of IAMF.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
const char * av_spherical_projection_name(enum AVSphericalProjection projection)
Provide a human-readable name of a given AVSphericalProjection.
@ AV_SPHERICAL_CUBEMAP
Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.
#define AV_NOPTS_VALUE
Undefined timestamp value.
struct AVIAMFAudioElement * iamf_audio_element
int32_t track_gain
Track replay gain in microbels (divide by 100000 to get the value in dB).
int64_t min_bitrate
Minimum bitrate of the stream, in bits per second.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
uint32_t padding
Number of pixels to pad from the edge of each cube face.
Information on how to combine one or more audio streams, as defined in section 3.6 of IAMF.
int flags
A combination of AV_PKT_FLAG values.
int64_t avg_bitrate
Average bitrate of the stream, in bits per second.
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
AVStream ** streams
A list of streams in the group.
static void dump_stream_format(const AVFormatContext *ic, int i, int group_index, int index, int is_output, int log_level)
struct AVIAMFMixPresentation * iamf_mix_presentation
#define AV_LOG_INFO
Standard information.
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
uint64_t vbv_delay
The delay between the time the packet this structure is associated with is received and the time when...
#define HEXDUMP_PRINT(...)
@ AV_PKT_DATA_CPB_PROPERTIES
This side data corresponds to the AVCPBProperties struct.
int width
Width of the final image for presentation.
int32_t roll
Rotation around the forward vector [-180, 180].
@ AV_PKT_DATA_H263_MB_INFO
An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblo...
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
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.
unsigned properties
Properties of the stream that gets decoded.
#define AV_TIME_BASE
Internal time base represented as integer.
@ AV_PKT_DATA_ICC_PROFILE
ICC profile data consisting of an opaque octet buffer following the format described by ISO 15076-1.
Information on how to render and mix one or more AVIAMFAudioElement to generate the final audio outpu...
int64_t max_bitrate
Maximum bitrate of the stream, in bits per second.
@ AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
New fields can be added to the end with minor version bumps.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
AVPacketSideData * coded_side_data
Additional data associated with the entire stream.
union AVStreamGroup::@298 params
Group type-specific parameters.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
unsigned int nb_layouts
Number of layouts in the submix.
int disposition
Stream disposition - a combination of AV_DISPOSITION_* flags.
int id
Format-specific stream ID.
void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
Send a nice hexadecimal dump of a buffer to the log.
const struct AVOutputFormat * oformat
The output container format.
int64_t buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
static void dump_spherical(void *ctx, const AVCodecParameters *par, const AVPacketSideData *sd, int log_level)
int32_t pitch
Rotation around the right vector [-90, 90].
AVDictionary * metadata
Metadata that applies to the whole group.
enum AVStereo3DType type
How views are packed within the video.
@ AV_AUDIO_SERVICE_TYPE_KARAOKE
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
main external API structure.
int index
stream index in AVFormatContext
unsigned int nb_streams
Number of elements in AVStreamGroup.streams.
int qmin
minimum quantizer
@ AV_AUDIO_SERVICE_TYPE_COMMENTARY
AVChannelLayout sound_system
Channel layout matching one of Sound Systems A to J of ITU-2051-3, plus 7.1.2ch and 3....
uint32_t album_peak
Same as track_peak, but for the whole album,.
AVRational r_frame_rate
Real base framerate of the stream.
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
static void pkt_dump_internal(void *avcl, FILE *f, int level, const AVPacket *pkt, int dump_payload, AVRational time_base)
ReplayGain information (see http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1....
unsigned int nb_elements
Number of elements in the submix.
int coded_width
Bitstream width / height, may be different from width/height e.g.
@ AV_PKT_DATA_AUDIO_SERVICE_TYPE
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType.
enum AVStreamGroupParamsType type
Group type.
static void print_peak(void *ctx, const char *str, uint32_t peak, int log_level)
AVDictionary * annotations
A dictionary of strings describing the mix in different languages.
unsigned int nb_stream_groups
Number of elements in AVFormatContext.stream_groups.
int height
Height of the final image for presentation.
@ AV_AUDIO_SERVICE_TYPE_EFFECTS
unsigned MaxFALL
Max average light level per frame (cd/m^2).
This structure stores compressed data.
int width
picture width / height.
Submix element as defined in section 3.7 of IAMF.
#define flags(name, subs,...)
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds.
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_payload, const AVStream *st)
Send a nice dump of a packet to the log.
@ AV_AUDIO_SERVICE_TYPE_DIALOGUE
Stereo 3D type: this structure describes how two videos are packed within a single video surface,...
AVRational ambient_light_y
Normalized y chromaticity coordinate of the environmental ambient light in the nominal viewing enviro...
AVRational time_base
time base in which the start/end timestamps are specified
AVIAMFSubmix ** submixes
Array of submixes.
static void dump_stream_group(const AVFormatContext *ic, uint8_t *printed, int i, int index, int is_output)
@ AV_AUDIO_SERVICE_TYPE_MAIN
This structure describes how to handle spherical videos, outlining information about projection,...
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
int32_t yaw
Rotation around the up vector [-180, 180].
double av_display_rotation_get(const int32_t matrix[9])
Extract the rotation component of the transformation matrix.
void av_hex_dump(FILE *f, const uint8_t *buf, int size)
Send a nice hexadecimal dump of a buffer to the specified file stream.