41 #define HEXDUMP_PRINT(...) \ 44 av_log(avcl, level, __VA_ARGS__); \ 46 fprintf(f, __VA_ARGS__); \ 54 for (i = 0; i <
size; i += 16) {
59 for (j = 0; j < 16; j++) {
66 for (j = 0; j <
len; j++) {
68 if (c < ' ' || c >
'~')
124 uint64_t v =
lrintf(d * 100);
129 else if (v % (100 * 1000))
142 if (strcmp(
"language", tag->
key)) {
143 const char *p = tag->
value;
145 "%s %-16s: ", indent, tag->
key);
148 size_t len = strcspn(p,
"\x8\xa\xb\xc\xd");
169 if (!data || sd->
size < 4)
222 if (gain == INT32_MIN)
243 if (sd->
size <
sizeof(*rg)) {
259 if (sd->
size <
sizeof(*stereo)) {
276 if (sd->
size <
sizeof(*ast)) {
319 if (sd->
size <
sizeof(*cpb)) {
326 "bitrate max/min/avg: %d/%d/%d buffer size: %d ",
328 "bitrate max/min/avg: %"PRId64
"/%"PRId64
"/%"PRId64
" buffer size: %d ",
343 "has_primaries:%d has_luminance:%d " 344 "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f) " 345 "min_luminance=%f, max_luminance=%f",
362 "MaxCLL=%d, MaxFALL=%d",
370 double yaw, pitch, roll;
372 if (sd->
size <
sizeof(*spherical)) {
379 yaw = ((double)spherical->
yaw) / (1 << 16);
380 pitch = ((double)spherical->
pitch) / (1 << 16);
381 roll = ((double)spherical->
roll) / (1 << 16);
402 "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d",
413 const uint32_t *
tc = (
const uint32_t *)sd->
data;
415 if ((sd->
size !=
sizeof(uint32_t) * 4) || (tc[0] > 3)) {
420 for (
int j = 1; j <= tc[0]; j++) {
499 "unknown side data type %d (%d bytes)", sd->
type, sd->
size);
509 int index,
int is_output)
529 #if FF_API_LAVF_AVCTX 533 avctx->
codec = st->codec->codec;
534 avctx->
qmin = st->codec->qmin;
535 avctx->
qmax = st->codec->qmax;
542 av_opt_set(avctx,
"dump_separator", separator, 0);
567 display_aspect_ratio.
num, display_aspect_ratio.
den);
574 #if FF_API_LAVF_AVCTX 582 if (fps || tbr || tbn || tbc)
591 #if FF_API_LAVF_AVCTX 641 const char *url,
int is_output)
649 is_output ?
"Output" :
"Input",
652 is_output ?
"to" :
"from", url);
658 int64_t hours, mins, secs,
us;
707 name ? name->
value :
"");
unsigned int nb_chapters
Number of chapters in AVChapter array.
int32_t pitch
Rotation around the right vector [-90, 90].
uint8_t dv_bl_signal_compatibility_id
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
const struct AVCodec * codec
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.
unsigned MaxCLL
Max content light level (cd/m^2).
ptrdiff_t const GLvoid * data
int coded_width
Bitstream width / height, may be different from width/height e.g.
static void dump_sidedata(void *ctx, const AVStream *st, const char *indent)
#define AV_LOG_WARNING
Something somehow does not look correct.
static void dump_paramchange(void *ctx, const AVPacketSideData *sd)
int max_bitrate
Maximum bitrate of the stream, in bits per second.
AVRational sample_aspect_ratio
Video only.
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
Video represents a portion of a sphere mapped on a flat surface using equirectangular projection...
static void dump_stream_format(const AVFormatContext *ic, int i, int index, int is_output)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
uint8_t * dump_separator
dump format separator.
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
#define us(width, name, range_min, range_max, subs,...)
int64_t bit_rate
Total stream bitrate in bit/s, 0 if not available.
static void dump_mastering_display_metadata(void *ctx, const AVPacketSideData *sd)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
AVPacketSideData * side_data
An array of side data that applies to the whole stream (i.e.
An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblo...
This struct describes the properties of an encoded stream.
int min_bitrate
Minimum bitrate of the stream, in bits per second.
uint32_t track_peak
Peak track amplitude, with 100000 representing full scale (but values may overflow).
Mastering display metadata (based on SMPTE-2086:2014).
static void pkt_dump_internal(void *avcl, FILE *f, int level, const AVPacket *pkt, int dump_payload, AVRational time_base)
uint64_t vbv_delay
The delay between the time the packet this structure is associated with is received and the time when...
unsigned int nb_stream_indexes
Stereo 3D type: this structure describes how two videos are packed within a single video surface...
static void dump_stereo3d(void *ctx, const AVPacketSideData *sd)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
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
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
int id
Format-specific stream ID.
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.
int nb_side_data
The number of elements in the AVStream.side_data array.
AVStream ** streams
A list of all streams in the file.
int avcodec_parameters_to_context(AVCodecContext *codec, const AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
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.
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
static void dump_audioservicetype(void *ctx, const AVPacketSideData *sd)
int buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
unsigned int * stream_index
int32_t album_gain
Same as track_gain, but for the whole album.
static void print_fps(double d, const char *postfix)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
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, streams, container, programs, metadata, side data, codec and time base.
DOVI configuration ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2, section 2.2 dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2, section 3.3 Tags are stored in struct AVDOVIDecoderConfigurationRecord.
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
int flags
Additional information about the frame packing.
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette...
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.
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
int qmax
maximum quantizer
ICC profile data consisting of an opaque octet buffer following the format described by ISO 15076-1...
ff_const59 struct AVInputFormat * iformat
The input container format.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
enum AVMediaType codec_type
General type of the encoded data.
enum AVPacketSideDataType type
AVRational avg_frame_rate
Average framerate.
New fields can be added to the end with minor version bumps.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
int flags
A combination of AV_PKT_FLAG values.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.
audio channel layout utility functions
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
#define AV_TIME_BASE
Internal time base represented as integer.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
This side data contains quality related information from the encoder.
#define HEXDUMP_PRINT(...)
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
This side data should be associated with a video stream and corresponds to the AVSphericalMapping str...
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.
int32_t yaw
Rotation around the up vector [-180, 180].
ff_const59 struct AVOutputFormat * oformat
The output container format.
uint32_t padding
Number of pixels to pad from the edge of each cube face.
static void dump_s12m_timecode(void *ctx, const AVStream *st, const AVPacketSideData *sd)
int64_t end
chapter start/end time in time_base units
Content light level (based on CTA-861.3).
static void dump_metadata(void *ctx, const AVDictionary *m, const char *indent)
This structure describes the bitrate properties of an encoded bitstream.
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
enum AVStereo3DType type
How views are packed within the video.
#define AV_LOG_INFO
Standard information.
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer...
main external API structure.
int qmin
minimum quantizer
static void dump_cpb(void *ctx, const AVPacketSideData *sd)
static void dump_content_light_metadata(void *ctx, const AVPacketSideData *sd)
int32_t roll
Rotation around the forward vector [-180, 180].
Rational number (pair of numerator and denominator).
static void hex_dump_internal(void *avcl, FILE *f, int level, const uint8_t *buf, int size)
This structure describes how to handle spherical videos, outlining information about projection...
static void dump_spherical(void *ctx, const AVCodecParameters *par, const AVPacketSideData *sd)
static void dump_replaygain(void *ctx, const AVPacketSideData *sd)
#define flags(name, subs,...)
This side data should be associated with an audio stream and contains ReplayGain information in form ...
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds. ...
Timecode which conforms to SMPTE ST 12-1:2014.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
static void print_peak(void *ctx, const char *str, uint32_t peak)
#define FF_DISABLE_DEPRECATION_WARNINGS
#define FF_API_UNSANITIZED_BITRATES
enum AVSphericalProjection projection
Projection type.
static void print_gain(void *ctx, const char *str, int32_t gain)
int disposition
AV_DISPOSITION_* bit field.
static void dump_dovi_conf(void *ctx, const AVPacketSideData *sd)
AVRational time_base
time base in which the start/end timestamps are specified
unsigned properties
Properties of the stream that gets decoded.
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
uint32_t album_peak
Same as track_peak, but for the whole album,.
const char * av_get_channel_name(uint64_t channel)
Get the name of a given channel.
#define FF_ENABLE_DEPRECATION_WARNINGS
int avg_bitrate
Average bitrate of the stream, in bits per second.
int codec_info_nb_frames
Number of frames that have been demuxed during avformat_find_stream_info()
This side data corresponds to the AVCPBProperties struct.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
double av_display_rotation_get(const int32_t matrix[9])
Extract the rotation component of the transformation matrix.
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string.
int32_t track_gain
Track replay gain in microbels (divide by 100000 to get the value in dB).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
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.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
AVRational r_frame_rate
Real base framerate of the stream.
ReplayGain information (see http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification).
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
unsigned MaxFALL
Max average light level per frame (cd/m^2).
This structure stores compressed data.
const char * av_spherical_projection_name(enum AVSphericalProjection projection)
Provide a human-readable name of a given AVSphericalProjection.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel layout
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define AV_TIMECODE_STR_SIZE
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType.