Libav
dump.c
Go to the documentation of this file.
1 /*
2  * Various pretty-printing functions for use within Libav
3  *
4  * This file is part of Libav.
5  *
6  * Libav is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * Libav is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with Libav; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include <stdio.h>
22 #include <stdint.h>
23 
25 #include "libavutil/display.h"
26 #include "libavutil/intreadwrite.h"
27 #include "libavutil/log.h"
28 #include "libavutil/mathematics.h"
29 #include "libavutil/replaygain.h"
30 #include "libavutil/stereo3d.h"
31 
32 #include "avformat.h"
33 
34 #define HEXDUMP_PRINT(...) \
35  do { \
36  if (!f) \
37  av_log(avcl, level, __VA_ARGS__); \
38  else \
39  fprintf(f, __VA_ARGS__); \
40  } while (0)
41 
42 static void hex_dump_internal(void *avcl, FILE *f, int level,
43  const uint8_t *buf, int size)
44 {
45  int len, i, j, c;
46 
47  for (i = 0; i < size; i += 16) {
48  len = size - i;
49  if (len > 16)
50  len = 16;
51  HEXDUMP_PRINT("%08x ", i);
52  for (j = 0; j < 16; j++) {
53  if (j < len)
54  HEXDUMP_PRINT(" %02x", buf[i + j]);
55  else
56  HEXDUMP_PRINT(" ");
57  }
58  HEXDUMP_PRINT(" ");
59  for (j = 0; j < len; j++) {
60  c = buf[i + j];
61  if (c < ' ' || c > '~')
62  c = '.';
63  HEXDUMP_PRINT("%c", c);
64  }
65  HEXDUMP_PRINT("\n");
66  }
67 }
68 
69 void av_hex_dump(FILE *f, const uint8_t *buf, int size)
70 {
71  hex_dump_internal(NULL, f, 0, buf, size);
72 }
73 
74 void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
75 {
76  hex_dump_internal(avcl, NULL, level, buf, size);
77 }
78 
79 static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt,
80  int dump_payload, AVRational time_base)
81 {
82  HEXDUMP_PRINT("stream #%d:\n", pkt->stream_index);
83  HEXDUMP_PRINT(" keyframe=%d\n", (pkt->flags & AV_PKT_FLAG_KEY) != 0);
84  HEXDUMP_PRINT(" duration=%0.3f\n", pkt->duration * av_q2d(time_base));
85  /* DTS is _always_ valid after av_read_frame() */
86  HEXDUMP_PRINT(" dts=");
87  if (pkt->dts == AV_NOPTS_VALUE)
88  HEXDUMP_PRINT("N/A");
89  else
90  HEXDUMP_PRINT("%0.3f", pkt->dts * av_q2d(time_base));
91  /* PTS may not be known if B-frames are present. */
92  HEXDUMP_PRINT(" pts=");
93  if (pkt->pts == AV_NOPTS_VALUE)
94  HEXDUMP_PRINT("N/A");
95  else
96  HEXDUMP_PRINT("%0.3f", pkt->pts * av_q2d(time_base));
97  HEXDUMP_PRINT("\n");
98  HEXDUMP_PRINT(" size=%d\n", pkt->size);
99  if (dump_payload)
100  av_hex_dump(f, pkt->data, pkt->size);
101 }
102 
103 void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st)
104 {
105  pkt_dump_internal(NULL, f, 0, pkt, dump_payload, st->time_base);
106 }
107 
108 void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
109  AVStream *st)
110 {
111  pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base);
112 }
113 
114 
115 static void print_fps(double d, const char *postfix)
116 {
117  uint64_t v = lrintf(d * 100);
118  if (v % 100)
119  av_log(NULL, AV_LOG_INFO, ", %3.2f %s", d, postfix);
120  else if (v % (100 * 1000))
121  av_log(NULL, AV_LOG_INFO, ", %1.0f %s", d, postfix);
122  else
123  av_log(NULL, AV_LOG_INFO, ", %1.0fk %s", d / 1000, postfix);
124 }
125 
126 static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
127 {
128  if (m && !(av_dict_count(m) == 1 && av_dict_get(m, "language", NULL, 0))) {
130 
131  av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
132  while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX)))
133  if (strcmp("language", tag->key))
134  av_log(ctx, AV_LOG_INFO,
135  "%s %-16s: %s\n", indent, tag->key, tag->value);
136  }
137 }
138 
139 /* param change side data*/
140 static void dump_paramchange(void *ctx, AVPacketSideData *sd)
141 {
142  int size = sd->size;
143  const uint8_t *data = sd->data;
144  uint32_t flags, channels, sample_rate, width, height;
145  uint64_t layout;
146 
147  if (!data || sd->size < 4)
148  goto fail;
149 
150  flags = AV_RL32(data);
151  data += 4;
152  size -= 4;
153 
155  if (size < 4)
156  goto fail;
157  channels = AV_RL32(data);
158  data += 4;
159  size -= 4;
160  av_log(ctx, AV_LOG_INFO, "channel count %"PRIu32", ", channels);
161  }
163  if (size < 8)
164  goto fail;
165  layout = AV_RL64(data);
166  data += 8;
167  size -= 8;
168  av_log(ctx, AV_LOG_INFO,
169  "channel layout: %s, ", av_get_channel_name(layout));
170  }
172  if (size < 4)
173  goto fail;
174  sample_rate = AV_RL32(data);
175  data += 4;
176  size -= 4;
177  av_log(ctx, AV_LOG_INFO, "sample_rate %"PRIu32", ", sample_rate);
178  }
180  if (size < 8)
181  goto fail;
182  width = AV_RL32(data);
183  data += 4;
184  size -= 4;
185  height = AV_RL32(data);
186  data += 4;
187  size -= 4;
188  av_log(ctx, AV_LOG_INFO, "width %"PRIu32" height %"PRIu32, width, height);
189  }
190 
191  return;
192 fail:
193  av_log(ctx, AV_LOG_INFO, "unknown param");
194 }
195 
196 /* replaygain side data*/
197 static void print_gain(void *ctx, const char *str, int32_t gain)
198 {
199  av_log(ctx, AV_LOG_INFO, "%s - ", str);
200  if (gain == INT32_MIN)
201  av_log(ctx, AV_LOG_INFO, "unknown");
202  else
203  av_log(ctx, AV_LOG_INFO, "%f", gain / 100000.0f);
204  av_log(ctx, AV_LOG_INFO, ", ");
205 }
206 
207 static void print_peak(void *ctx, const char *str, uint32_t peak)
208 {
209  av_log(ctx, AV_LOG_INFO, "%s - ", str);
210  if (!peak)
211  av_log(ctx, AV_LOG_INFO, "unknown");
212  else
213  av_log(ctx, AV_LOG_INFO, "%f", (float) peak / UINT32_MAX);
214  av_log(ctx, AV_LOG_INFO, ", ");
215 }
216 
217 static void dump_replaygain(void *ctx, AVPacketSideData *sd)
218 {
219  AVReplayGain *rg;
220 
221  if (sd->size < sizeof(*rg)) {
222  av_log(ctx, AV_LOG_INFO, "invalid data");
223  return;
224  }
225  rg = (AVReplayGain*)sd->data;
226 
227  print_gain(ctx, "track gain", rg->track_gain);
228  print_peak(ctx, "track peak", rg->track_peak);
229  print_gain(ctx, "album gain", rg->album_gain);
230  print_peak(ctx, "album peak", rg->album_peak);
231 }
232 
233 static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
234 {
235  AVStereo3D *stereo;
236 
237  if (sd->size < sizeof(*stereo)) {
238  av_log(ctx, AV_LOG_INFO, "invalid data");
239  return;
240  }
241 
242  stereo = (AVStereo3D *)sd->data;
243 
244  switch (stereo->type) {
245  case AV_STEREO3D_2D:
246  av_log(ctx, AV_LOG_INFO, "2D");
247  break;
249  av_log(ctx, AV_LOG_INFO, "side by side");
250  break;
252  av_log(ctx, AV_LOG_INFO, "top and bottom");
253  break;
255  av_log(ctx, AV_LOG_INFO, "frame alternate");
256  break;
258  av_log(ctx, AV_LOG_INFO, "checkerboard");
259  break;
260  case AV_STEREO3D_LINES:
261  av_log(ctx, AV_LOG_INFO, "interleaved lines");
262  break;
263  case AV_STEREO3D_COLUMNS:
264  av_log(ctx, AV_LOG_INFO, "interleaved columns");
265  break;
267  av_log(ctx, AV_LOG_INFO, "side by side (quincunx subsampling)");
268  break;
269  default:
270  av_log(ctx, AV_LOG_WARNING, "unknown");
271  break;
272  }
273 
274  if (stereo->flags & AV_STEREO3D_FLAG_INVERT)
275  av_log(ctx, AV_LOG_INFO, " (inverted)");
276 }
277 
278 static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
279 {
280  int i;
281 
282  if (st->nb_side_data)
283  av_log(ctx, AV_LOG_INFO, "%sSide data:\n", indent);
284 
285  for (i = 0; i < st->nb_side_data; i++) {
286  AVPacketSideData sd = st->side_data[i];
287  av_log(ctx, AV_LOG_INFO, "%s ", indent);
288 
289  switch (sd.type) {
290  case AV_PKT_DATA_PALETTE:
291  av_log(ctx, AV_LOG_INFO, "palette");
292  break;
294  av_log(ctx, AV_LOG_INFO, "new extradata");
295  break;
297  av_log(ctx, AV_LOG_INFO, "paramchange: ");
298  dump_paramchange(ctx, &sd);
299  break;
301  av_log(ctx, AV_LOG_INFO, "h263 macroblock info");
302  break;
304  av_log(ctx, AV_LOG_INFO, "replaygain: ");
305  dump_replaygain(ctx, &sd);
306  break;
308  av_log(ctx, AV_LOG_INFO, "displaymatrix: rotation of %.2f degrees",
310  break;
312  av_log(ctx, AV_LOG_INFO, "stereo3d: ");
313  dump_stereo3d(ctx, &sd);
314  break;
315  default:
316  av_log(ctx, AV_LOG_WARNING,
317  "unknown side data type %d (%d bytes)", sd.type, sd.size);
318  break;
319  }
320 
321  av_log(ctx, AV_LOG_INFO, "\n");
322  }
323 }
324 
325 /* "user interface" functions */
326 static void dump_stream_format(AVFormatContext *ic, int i,
327  int index, int is_output)
328 {
329  char buf[256];
330  int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
331  AVStream *st = ic->streams[i];
332  AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
333 
334  avcodec_string(buf, sizeof(buf), st->codec, is_output);
335  av_log(NULL, AV_LOG_INFO, " Stream #%d.%d", index, i);
336 
337  /* the pid is an important information, so we display it */
338  /* XXX: add a generic system */
339  if (flags & AVFMT_SHOW_IDS)
340  av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id);
341  if (lang)
342  av_log(NULL, AV_LOG_INFO, "(%s)", lang->value);
343  av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->codec_info_nb_frames,
344  st->time_base.num, st->time_base.den);
345  av_log(NULL, AV_LOG_INFO, ": %s", buf);
346 
347  if (st->sample_aspect_ratio.num && // default
349  AVRational display_aspect_ratio;
350  av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
351  st->codec->width * st->sample_aspect_ratio.num,
352  st->codec->height * st->sample_aspect_ratio.den,
353  1024 * 1024);
354  av_log(NULL, AV_LOG_INFO, ", PAR %d:%d DAR %d:%d",
356  display_aspect_ratio.num, display_aspect_ratio.den);
357  }
358 
359  if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
360  if (st->avg_frame_rate.den && st->avg_frame_rate.num)
361  print_fps(av_q2d(st->avg_frame_rate), "fps");
362  if (st->time_base.den && st->time_base.num)
363  print_fps(1 / av_q2d(st->time_base), "tbn");
364  if (st->codec->time_base.den && st->codec->time_base.num)
365  print_fps(1 / av_q2d(st->codec->time_base), "tbc");
366  }
367 
369  av_log(NULL, AV_LOG_INFO, " (default)");
371  av_log(NULL, AV_LOG_INFO, " (dub)");
373  av_log(NULL, AV_LOG_INFO, " (original)");
375  av_log(NULL, AV_LOG_INFO, " (comment)");
377  av_log(NULL, AV_LOG_INFO, " (lyrics)");
379  av_log(NULL, AV_LOG_INFO, " (karaoke)");
381  av_log(NULL, AV_LOG_INFO, " (forced)");
383  av_log(NULL, AV_LOG_INFO, " (hearing impaired)");
385  av_log(NULL, AV_LOG_INFO, " (visual impaired)");
387  av_log(NULL, AV_LOG_INFO, " (clean effects)");
388  av_log(NULL, AV_LOG_INFO, "\n");
389 
390  dump_metadata(NULL, st->metadata, " ");
391 
392  dump_sidedata(NULL, st, " ");
393 }
394 
396  const char *url, int is_output)
397 {
398  int i;
399  uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL;
400  if (ic->nb_streams && !printed)
401  return;
402 
403  av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
404  is_output ? "Output" : "Input",
405  index,
406  is_output ? ic->oformat->name : ic->iformat->name,
407  is_output ? "to" : "from", url);
408  dump_metadata(NULL, ic->metadata, " ");
409 
410  if (!is_output) {
411  av_log(NULL, AV_LOG_INFO, " Duration: ");
412  if (ic->duration != AV_NOPTS_VALUE) {
413  int hours, mins, secs, us;
414  secs = ic->duration / AV_TIME_BASE;
415  us = ic->duration % AV_TIME_BASE;
416  mins = secs / 60;
417  secs %= 60;
418  hours = mins / 60;
419  mins %= 60;
420  av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%02d", hours, mins, secs,
421  (100 * us) / AV_TIME_BASE);
422  } else {
423  av_log(NULL, AV_LOG_INFO, "N/A");
424  }
425  if (ic->start_time != AV_NOPTS_VALUE) {
426  int secs, us;
427  av_log(NULL, AV_LOG_INFO, ", start: ");
428  secs = ic->start_time / AV_TIME_BASE;
429  us = abs(ic->start_time % AV_TIME_BASE);
430  av_log(NULL, AV_LOG_INFO, "%d.%06d",
431  secs, (int) av_rescale(us, 1000000, AV_TIME_BASE));
432  }
433  av_log(NULL, AV_LOG_INFO, ", bitrate: ");
434  if (ic->bit_rate)
435  av_log(NULL, AV_LOG_INFO, "%d kb/s", ic->bit_rate / 1000);
436  else
437  av_log(NULL, AV_LOG_INFO, "N/A");
438  av_log(NULL, AV_LOG_INFO, "\n");
439  }
440 
441  for (i = 0; i < ic->nb_chapters; i++) {
442  AVChapter *ch = ic->chapters[i];
443  av_log(NULL, AV_LOG_INFO, " Chapter #%d.%d: ", index, i);
445  "start %f, ", ch->start * av_q2d(ch->time_base));
447  "end %f\n", ch->end * av_q2d(ch->time_base));
448 
449  dump_metadata(NULL, ch->metadata, " ");
450  }
451 
452  if (ic->nb_programs) {
453  int j, k, total = 0;
454  for (j = 0; j < ic->nb_programs; j++) {
456  "name", NULL, 0);
457  av_log(NULL, AV_LOG_INFO, " Program %d %s\n", ic->programs[j]->id,
458  name ? name->value : "");
459  dump_metadata(NULL, ic->programs[j]->metadata, " ");
460  for (k = 0; k < ic->programs[j]->nb_stream_indexes; k++) {
462  index, is_output);
463  printed[ic->programs[j]->stream_index[k]] = 1;
464  }
465  total += ic->programs[j]->nb_stream_indexes;
466  }
467  if (total < ic->nb_streams)
468  av_log(NULL, AV_LOG_INFO, " No Program\n");
469  }
470 
471  for (i = 0; i < ic->nb_streams; i++)
472  if (!printed[i])
473  dump_stream_format(ic, i, index, is_output);
474 
475  av_free(printed);
476 }
unsigned int nb_chapters
Number of chapters in AVChapter array.
Definition: avformat.h:1119
Views are packed per line, as if interlaced.
Definition: stereo3d.h:97
int size
static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, int dump_payload, AVRational time_base)
Definition: dump.c:79
Views are alternated temporally.
Definition: stereo3d.h:66
Views are next to each other, but when upscaling apply a checkerboard pattern.
Definition: stereo3d.h:87
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:129
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
Definition: avcodec.h:919
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
Definition: avformat.h:769
int num
numerator
Definition: rational.h:44
int size
Definition: avcodec.h:974
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
Definition: dict.c:33
#define AV_DISPOSITION_DUB
Definition: avformat.h:669
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
Definition: avcodec.h:1429
void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st)
Send a nice dump of a packet to the specified file stream.
Definition: dump.c:103
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
Definition: rational.h:55
#define AV_DISPOSITION_HEARING_IMPAIRED
stream for hearing impaired audiences
Definition: avformat.h:681
#define AV_DISPOSITION_CLEAN_EFFECTS
stream without voice
Definition: avformat.h:683
AVPacketSideData * side_data
An array of side data that applies to the whole stream (i.e.
Definition: avformat.h:807
AVDictionary * metadata
Definition: avformat.h:909
int id
Definition: avformat.h:893
An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblo...
Definition: avcodec.h:898
uint32_t track_peak
Peak track amplitude, with 100000 representing full scale (but values may overflow).
Definition: replaygain.h:40
#define AV_DISPOSITION_KARAOKE
Definition: avformat.h:673
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Definition: avcodec.h:1175
#define AVFMT_SHOW_IDS
Show format stream IDs numbers.
Definition: avformat.h:411
Format I/O context.
Definition: avformat.h:922
#define AV_RL64
Definition: intreadwrite.h:173
unsigned int nb_stream_indexes
Definition: avformat.h:897
int flags
can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, AVFMT_TS_NONSTRICT
Definition: avformat.h:465
uint8_t
int flags
Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
Definition: avformat.h:539
Stereo 3D type: this structure describes how two videos are packed within a single video surface...
Definition: stereo3d.h:123
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
Definition: avcodec.h:913
int id
Format-specific stream ID.
Definition: avformat.h:706
int nb_side_data
The number of elements in the AVStream.side_data array.
Definition: avformat.h:811
const char * name
AVStream ** streams
A list of all streams in the file.
Definition: avformat.h:990
const char data[16]
Definition: mxf.c:70
static double av_q2d(AVRational a)
Convert rational to double.
Definition: rational.h:69
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
Definition: dict.c:38
uint8_t * data
Definition: avcodec.h:973
static int flags
Definition: log.c:44
uint32_t tag
Definition: movenc.c:844
uint8_t * data
Definition: avcodec.h:923
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: avcodec.h:991
unsigned int * stream_index
Definition: avformat.h:896
int32_t album_gain
Same as track_gain, but for the whole album.
Definition: replaygain.h:44
static void print_fps(double d, const char *postfix)
Definition: dump.c:115
struct AVOutputFormat * oformat
The output container format.
Definition: avformat.h:941
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition: avcodec.h:1019
static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
Definition: dump.c:126
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.
Definition: dump.c:395
AVDictionary * metadata
Metadata that applies to the whole file.
Definition: avformat.h:1130
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:186
int flags
Additional information about the frame packing.
Definition: stereo3d.h:132
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.
Definition: dump.c:69
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
Definition: avcodec.h:877
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:144
unsigned int nb_programs
Definition: avformat.h:1069
AVChapter ** chapters
Definition: avformat.h:1120
enum AVPacketSideDataType type
Definition: avcodec.h:925
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:169
Video is not stereoscopic (and metadata has to be there).
Definition: stereo3d.h:35
const char * av_get_channel_name(uint64_t channel)
Get the name of a given channel.
AVRational avg_frame_rate
Average framerate.
Definition: avformat.h:780
int flags
A combination of AV_PKT_FLAG values.
Definition: avcodec.h:979
AVCodecContext * codec
Codec context associated with this stream.
Definition: avformat.h:718
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
Definition: rational.c:35
#define AV_DISPOSITION_LYRICS
Definition: avformat.h:672
#define AV_DISPOSITION_FORCED
Track should be used during playback by default.
Definition: avformat.h:680
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
Definition: avformat.h:978
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.
Definition: mathematics.c:116
#define AV_TIME_BASE
Internal time base represented as integer.
Definition: avutil.h:234
#define HEXDUMP_PRINT(...)
Definition: dump.c:34
int width
picture width / height.
Definition: avcodec.h:1224
static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output)
Definition: dump.c:326
const char * name
Definition: avformat.h:446
int32_t
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
Definition: stereo3d.h:114
static void dump_paramchange(void *ctx, AVPacketSideData *sd)
Definition: dump.c:140
static av_always_inline av_const long int lrintf(float x)
Definition: libm.h:144
#define AV_RL32
Definition: intreadwrite.h:146
AVDictionary * metadata
Definition: avformat.h:771
#define AV_DISPOSITION_VISUAL_IMPAIRED
stream for visual impaired audiences
Definition: avformat.h:682
Stream structure.
Definition: avformat.h:699
int64_t end
chapter start/end time in time_base units
Definition: avformat.h:908
NULL
Definition: eval.c:55
#define AV_DISPOSITION_DEFAULT
Definition: avformat.h:668
static int width
Definition: utils.c:156
enum AVStereo3DType type
How views are packed within the video.
Definition: stereo3d.h:127
#define AV_LOG_INFO
Standard information.
Definition: log.h:134
enum AVMediaType codec_type
Definition: avcodec.h:1058
static void dump_replaygain(void *ctx, AVPacketSideData *sd)
Definition: dump.c:217
int index
Definition: gxfenc.c:72
rational number numerator/denominator
Definition: rational.h:43
static void hex_dump_internal(void *avcl, FILE *f, int level, const uint8_t *buf, int size)
Definition: dump.c:42
Views are on top of each other.
Definition: stereo3d.h:55
AVDictionary * metadata
Definition: avformat.h:898
This side data should be associated with an audio stream and contains ReplayGain information in form ...
Definition: avcodec.h:904
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds. ...
Definition: avformat.h:1007
uint8_t level
Definition: svq3.c:147
int height
Definition: gxfenc.c:72
int64_t start
Definition: avformat.h:908
Views are next to each other.
Definition: stereo3d.h:45
Main libavformat public API header.
static void print_peak(void *ctx, const char *str, uint32_t peak)
Definition: dump.c:207
static void print_gain(void *ctx, const char *str, int32_t gain)
Definition: dump.c:197
int disposition
AV_DISPOSITION_* bit field.
Definition: avformat.h:760
AVRational time_base
time base in which the start/end timestamps are specified
Definition: avformat.h:907
char * key
Definition: dict.h:75
int den
denominator
Definition: rational.h:45
struct AVInputFormat * iformat
The input container format.
Definition: avformat.h:934
double av_display_rotation_get(const int32_t matrix[9])
The display transformation matrix specifies an affine transformation that should be applied to video ...
Definition: display.c:34
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
Definition: utils.c:1842
uint32_t album_peak
Same as track_peak, but for the whole album,.
Definition: replaygain.h:48
char * value
Definition: dict.h:76
int len
Views are packed in a checkerboard-like structure per pixel.
Definition: stereo3d.h:76
int codec_info_nb_frames
Number of frames that have been demuxed during av_find_stream_info()
Definition: avformat.h:864
Views are packed per column.
Definition: stereo3d.h:107
#define AV_DISPOSITION_COMMENT
Definition: avformat.h:671
uint64_t layout
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
Definition: avcodec.h:972
int bit_rate
Total stream bitrate in bit/s, 0 if not available.
Definition: avformat.h:1024
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
Definition: avformat.h:1017
static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
Definition: dump.c:233
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:525
#define AV_DICT_IGNORE_SUFFIX
Definition: dict.h:62
int32_t track_gain
Track replay gain in microbels (divide by 100000 to get the value in dB).
Definition: replaygain.h:35
void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload, AVStream *st)
Send a nice dump of a packet to the log.
Definition: dump.c:108
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.
Definition: dump.c:74
int stream_index
Definition: avcodec.h:975
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Definition: avformat.h:741
ReplayGain information (see http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification).
Definition: replaygain.h:30
This structure stores compressed data.
Definition: avcodec.h:950
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:205
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: avcodec.h:966
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:228
AVProgram ** programs
Definition: avformat.h:1070
#define AV_DISPOSITION_ORIGINAL
Definition: avformat.h:670
static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
Definition: dump.c:278