FFmpeg: libavformat/dump.c Source File

FFmpeg
dump.c
Go to the documentation of this file.
1 /*
2  * Various pretty-printing functions for use within FFmpeg
3  * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include <stdio.h>
23 #include <stdint.h>
24 
25 #include "libavutil/channel_layout.h"
26 #include "libavutil/display.h"
27 #include "libavutil/intreadwrite.h"
28 #include "libavutil/log.h"
29 #include "libavutil/mathematics.h"
30 #include "libavutil/opt.h"
31 #include "libavutil/avstring.h"
32 #include "libavutil/replaygain.h"
33 #include "libavutil/stereo3d.h"
34 
35 #include "avformat.h"
36 
37  #define HEXDUMP_PRINT(...) \
38  do { \
39  if (!f) \
40  av_log(avcl, level, __VA_ARGS__); \
41  else \
42  fprintf(f, __VA_ARGS__); \
43  } while (0)
44 
45  static void hex_dump_internal(void *avcl, FILE *f, int level,
46  const uint8_t *buf, int size)
47 {
48  int len, i, j, c;
49 
50  for (i = 0; i < size; i += 16) {
51  len = size - i;
52  if (len > 16)
53  len = 16;
54  HEXDUMP_PRINT("%08x ", i);
55  for (j = 0; j < 16; j++) {
56  if (j < len)
57  HEXDUMP_PRINT(" %02x", buf[i + j]);
58  else
59  HEXDUMP_PRINT(" ");
60  }
61  HEXDUMP_PRINT(" ");
62  for (j = 0; j < len; j++) {
63  c = buf[i + j];
64  if (c < ' ' || c > '~')
65  c = '.';
66  HEXDUMP_PRINT("%c", c);
67  }
68  HEXDUMP_PRINT("\n");
69  }
70 }
71 
72  void av_hex_dump(FILE *f, const uint8_t *buf, int size)
73 {
74  hex_dump_internal(NULL, f, 0, buf, size);
75 }
76 
77  void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
78 {
79  hex_dump_internal(avcl, NULL, level, buf, size);
80 }
81 
82  static void pkt_dump_internal(void *avcl, FILE *f, int level, const AVPacket *pkt,
83  int dump_payload, AVRational time_base)
84 {
85  HEXDUMP_PRINT("stream #%d:\n", pkt->stream_index);
86  HEXDUMP_PRINT(" keyframe=%d\n", (pkt->flags & AV_PKT_FLAG_KEY) != 0);
87  HEXDUMP_PRINT(" duration=%0.3f\n", pkt->duration * av_q2d(time_base));
88  /* DTS is _always_ valid after av_read_frame() */
89  HEXDUMP_PRINT(" dts=");
90  if (pkt->dts == AV_NOPTS_VALUE)
91  HEXDUMP_PRINT("N/A");
92  else
93  HEXDUMP_PRINT("%0.3f", pkt->dts * av_q2d(time_base));
94  /* PTS may not be known if B-frames are present. */
95  HEXDUMP_PRINT(" pts=");
96  if (pkt->pts == AV_NOPTS_VALUE)
97  HEXDUMP_PRINT("N/A");
98  else
99  HEXDUMP_PRINT("%0.3f", pkt->pts * av_q2d(time_base));
100  HEXDUMP_PRINT("\n");
101  HEXDUMP_PRINT(" size=%d\n", pkt->size);
102  if (dump_payload)
103  av_hex_dump(f, pkt->data, pkt->size);
104 }
105 
106  void av_pkt_dump2(FILE *f, const AVPacket *pkt, int dump_payload, const AVStream *st)
107 {
108  pkt_dump_internal(NULL, f, 0, pkt, dump_payload, st->time_base);
109 }
110 
111  void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_payload,
112  const AVStream *st)
113 {
114  pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base);
115 }
116 
117 
118  static void print_fps(double d, const char *postfix)
119 {
120  uint64_t v = lrintf(d * 100);
121  if (!v)
122  av_log(NULL, AV_LOG_INFO, "%1.4f %s", d, postfix);
123  else if (v % 100)
124  av_log(NULL, AV_LOG_INFO, "%3.2f %s", d, postfix);
125  else if (v % (100 * 1000))
126  av_log(NULL, AV_LOG_INFO, "%1.0f %s", d, postfix);
127  else
128  av_log(NULL, AV_LOG_INFO, "%1.0fk %s", d / 1000, postfix);
129 }
130 
131  static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
132 {
133  if (m && !(av_dict_count(m) == 1 && av_dict_get(m, "language", NULL, 0))) {
134  AVDictionaryEntry *tag = NULL;
135 
136  av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
137  while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX)))
138  if (strcmp("language", tag->key)) {
139  const char *p = tag->value;
140  av_log(ctx, AV_LOG_INFO,
141  "%s %-16s: ", indent, tag->key);
142  while (*p) {
143  char tmp[256];
144  size_t len = strcspn(p, "\x8\xa\xb\xc\xd");
145  av_strlcpy(tmp, p, FFMIN(sizeof(tmp), len+1));
146  av_log(ctx, AV_LOG_INFO, "%s", tmp);
147  p += len;
148  if (*p == 0xd) av_log(ctx, AV_LOG_INFO, " ");
149  if (*p == 0xa) av_log(ctx, AV_LOG_INFO, "\n%s %-16s: ", indent, "");
150  if (*p) p++;
151  }
152  av_log(ctx, AV_LOG_INFO, "\n");
153  }
154  }
155 }
156 
157 /* param change side data*/
158  static void dump_paramchange(void *ctx, AVPacketSideData *sd)
159 {
160  int size = sd->size;
161  const uint8_t *data = sd->data;
162  uint32_t flags, channels, sample_rate, width, height;
163  uint64_t layout;
164 
165  if (!data || sd->size < 4)
166  goto fail;
167 
168  flags = AV_RL32(data);
169  data += 4;
170  size -= 4;
171 
172  if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) {
173  if (size < 4)
174  goto fail;
175  channels = AV_RL32(data);
176  data += 4;
177  size -= 4;
178  av_log(ctx, AV_LOG_INFO, "channel count %"PRIu32", ", channels);
179  }
180  if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) {
181  if (size < 8)
182  goto fail;
183  layout = AV_RL64(data);
184  data += 8;
185  size -= 8;
186  av_log(ctx, AV_LOG_INFO,
187  "channel layout: %s, ", av_get_channel_name(layout));
188  }
189  if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) {
190  if (size < 4)
191  goto fail;
192  sample_rate = AV_RL32(data);
193  data += 4;
194  size -= 4;
195  av_log(ctx, AV_LOG_INFO, "sample_rate %"PRIu32", ", sample_rate);
196  }
197  if (flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) {
198  if (size < 8)
199  goto fail;
200  width = AV_RL32(data);
201  data += 4;
202  size -= 4;
203  height = AV_RL32(data);
204  data += 4;
205  size -= 4;
206  av_log(ctx, AV_LOG_INFO, "width %"PRIu32" height %"PRIu32, width, height);
207  }
208 
209  return;
210 fail:
211  av_log(ctx, AV_LOG_INFO, "unknown param");
212 }
213 
214 /* replaygain side data*/
215  static void print_gain(void *ctx, const char *str, int32_t gain)
216 {
217  av_log(ctx, AV_LOG_INFO, "%s - ", str);
218  if (gain == INT32_MIN)
219  av_log(ctx, AV_LOG_INFO, "unknown");
220  else
221  av_log(ctx, AV_LOG_INFO, "%f", gain / 100000.0f);
222  av_log(ctx, AV_LOG_INFO, ", ");
223 }
224 
225  static void print_peak(void *ctx, const char *str, uint32_t peak)
226 {
227  av_log(ctx, AV_LOG_INFO, "%s - ", str);
228  if (!peak)
229  av_log(ctx, AV_LOG_INFO, "unknown");
230  else
231  av_log(ctx, AV_LOG_INFO, "%f", (float) peak / UINT32_MAX);
232  av_log(ctx, AV_LOG_INFO, ", ");
233 }
234 
235  static void dump_replaygain(void *ctx, AVPacketSideData *sd)
236 {
237  AVReplayGain *rg;
238 
239  if (sd->size < sizeof(*rg)) {
240  av_log(ctx, AV_LOG_INFO, "invalid data");
241  return;
242  }
243  rg = (AVReplayGain*)sd->data;
244 
245  print_gain(ctx, "track gain", rg->track_gain);
246  print_peak(ctx, "track peak", rg->track_peak);
247  print_gain(ctx, "album gain", rg->album_gain);
248  print_peak(ctx, "album peak", rg->album_peak);
249 }
250 
251  static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
252 {
253  AVStereo3D *stereo;
254 
255  if (sd->size < sizeof(*stereo)) {
256  av_log(ctx, AV_LOG_INFO, "invalid data");
257  return;
258  }
259 
260  stereo = (AVStereo3D *)sd->data;
261 
262  switch (stereo->type) {
263  case AV_STEREO3D_2D:
264  av_log(ctx, AV_LOG_INFO, "2D");
265  break;
266  case AV_STEREO3D_SIDEBYSIDE:
267  av_log(ctx, AV_LOG_INFO, "side by side");
268  break;
269  case AV_STEREO3D_TOPBOTTOM:
270  av_log(ctx, AV_LOG_INFO, "top and bottom");
271  break;
272  case AV_STEREO3D_FRAMESEQUENCE:
273  av_log(ctx, AV_LOG_INFO, "frame alternate");
274  break;
275  case AV_STEREO3D_CHECKERBOARD:
276  av_log(ctx, AV_LOG_INFO, "checkerboard");
277  break;
278  case AV_STEREO3D_LINES:
279  av_log(ctx, AV_LOG_INFO, "interleaved lines");
280  break;
281  case AV_STEREO3D_COLUMNS:
282  av_log(ctx, AV_LOG_INFO, "interleaved columns");
283  break;
284  case AV_STEREO3D_SIDEBYSIDE_QUINCUNX:
285  av_log(ctx, AV_LOG_INFO, "side by side (quincunx subsampling)");
286  break;
287  default:
288  av_log(ctx, AV_LOG_WARNING, "unknown");
289  break;
290  }
291 
292  if (stereo->flags & AV_STEREO3D_FLAG_INVERT)
293  av_log(ctx, AV_LOG_INFO, " (inverted)");
294 }
295 
296  static void dump_audioservicetype(void *ctx, AVPacketSideData *sd)
297 {
298  enum AVAudioServiceType *ast = (enum AVAudioServiceType *)sd->data;
299 
300  if (sd->size < sizeof(*ast)) {
301  av_log(ctx, AV_LOG_INFO, "invalid data");
302  return;
303  }
304 
305  switch (*ast) {
306  case AV_AUDIO_SERVICE_TYPE_MAIN:
307  av_log(ctx, AV_LOG_INFO, "main");
308  break;
309  case AV_AUDIO_SERVICE_TYPE_EFFECTS:
310  av_log(ctx, AV_LOG_INFO, "effects");
311  break;
312  case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED:
313  av_log(ctx, AV_LOG_INFO, "visually impaired");
314  break;
315  case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED:
316  av_log(ctx, AV_LOG_INFO, "hearing impaired");
317  break;
318  case AV_AUDIO_SERVICE_TYPE_DIALOGUE:
319  av_log(ctx, AV_LOG_INFO, "dialogue");
320  break;
321  case AV_AUDIO_SERVICE_TYPE_COMMENTARY:
322  av_log(ctx, AV_LOG_INFO, "comentary");
323  break;
324  case AV_AUDIO_SERVICE_TYPE_EMERGENCY:
325  av_log(ctx, AV_LOG_INFO, "emergency");
326  break;
327  case AV_AUDIO_SERVICE_TYPE_VOICE_OVER:
328  av_log(ctx, AV_LOG_INFO, "voice over");
329  break;
330  case AV_AUDIO_SERVICE_TYPE_KARAOKE:
331  av_log(ctx, AV_LOG_INFO, "karaoke");
332  break;
333  default:
334  av_log(ctx, AV_LOG_WARNING, "unknown");
335  break;
336  }
337 }
338 
339  static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
340 {
341  int i;
342 
343  if (st->nb_side_data)
344  av_log(ctx, AV_LOG_INFO, "%sSide data:\n", indent);
345 
346  for (i = 0; i < st->nb_side_data; i++) {
347  AVPacketSideData sd = st->side_data[i];
348  av_log(ctx, AV_LOG_INFO, "%s ", indent);
349 
350  switch (sd.type) {
351  case AV_PKT_DATA_PALETTE:
352  av_log(ctx, AV_LOG_INFO, "palette");
353  break;
354  case AV_PKT_DATA_NEW_EXTRADATA:
355  av_log(ctx, AV_LOG_INFO, "new extradata");
356  break;
357  case AV_PKT_DATA_PARAM_CHANGE:
358  av_log(ctx, AV_LOG_INFO, "paramchange: ");
359  dump_paramchange(ctx, &sd);
360  break;
361  case AV_PKT_DATA_H263_MB_INFO:
362  av_log(ctx, AV_LOG_INFO, "h263 macroblock info");
363  break;
364  case AV_PKT_DATA_REPLAYGAIN:
365  av_log(ctx, AV_LOG_INFO, "replaygain: ");
366  dump_replaygain(ctx, &sd);
367  break;
368  case AV_PKT_DATA_DISPLAYMATRIX:
369  av_log(ctx, AV_LOG_INFO, "displaymatrix: rotation of %.2f degrees",
370  av_display_rotation_get((int32_t *)sd.data));
371  break;
372  case AV_PKT_DATA_STEREO3D:
373  av_log(ctx, AV_LOG_INFO, "stereo3d: ");
374  dump_stereo3d(ctx, &sd);
375  break;
376  case AV_PKT_DATA_AUDIO_SERVICE_TYPE:
377  av_log(ctx, AV_LOG_INFO, "audio service type: ");
378  dump_audioservicetype(ctx, &sd);
379  break;
380  default:
381  av_log(ctx, AV_LOG_WARNING,
382  "unknown side data type %d (%d bytes)", sd.type, sd.size);
383  break;
384  }
385 
386  av_log(ctx, AV_LOG_INFO, "\n");
387  }
388 }
389 
390 /* "user interface" functions */
391  static void dump_stream_format(AVFormatContext *ic, int i,
392  int index, int is_output)
393 {
394  char buf[256];
395  int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
396  AVStream *st = ic->streams[i];
397  AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
398  char *separator = ic->dump_separator;
399  char **codec_separator = av_opt_ptr(st->codec->av_class, st->codec, "dump_separator");
400  int use_format_separator = !*codec_separator;
401 
402  if (use_format_separator)
403  *codec_separator = av_strdup(separator);
404  avcodec_string(buf, sizeof(buf), st->codec, is_output);
405  if (use_format_separator)
406  av_freep(codec_separator);
407  av_log(NULL, AV_LOG_INFO, " Stream #%d:%d", index, i);
408 
409  /* the pid is an important information, so we display it */
410  /* XXX: add a generic system */
411  if (flags & AVFMT_SHOW_IDS)
412  av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id);
413  if (lang)
414  av_log(NULL, AV_LOG_INFO, "(%s)", lang->value);
415  av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->codec_info_nb_frames,
416  st->time_base.num, st->time_base.den);
417  av_log(NULL, AV_LOG_INFO, ": %s", buf);
418 
419  if (st->sample_aspect_ratio.num && // default
420  av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) {
421  AVRational display_aspect_ratio;
422  av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
423  st->codec->width * st->sample_aspect_ratio.num,
424  st->codec->height * st->sample_aspect_ratio.den,
425  1024 * 1024);
426  av_log(NULL, AV_LOG_INFO, ", SAR %d:%d DAR %d:%d",
427  st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
428  display_aspect_ratio.num, display_aspect_ratio.den);
429  }
430 
431  if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
432  int fps = st->avg_frame_rate.den && st->avg_frame_rate.num;
433  int tbr = st->r_frame_rate.den && st->r_frame_rate.num;
434  int tbn = st->time_base.den && st->time_base.num;
435  int tbc = st->codec->time_base.den && st->codec->time_base.num;
436 
437  if (fps || tbr || tbn || tbc)
438  av_log(NULL, AV_LOG_INFO, "%s", separator);
439 
440  if (fps)
441  print_fps(av_q2d(st->avg_frame_rate), tbr || tbn || tbc ? "fps, " : "fps");
442  if (tbr)
443  print_fps(av_q2d(st->r_frame_rate), tbn || tbc ? "tbr, " : "tbr");
444  if (tbn)
445  print_fps(1 / av_q2d(st->time_base), tbc ? "tbn, " : "tbn");
446  if (tbc)
447  print_fps(1 / av_q2d(st->codec->time_base), "tbc");
448  }
449 
450  if (st->disposition & AV_DISPOSITION_DEFAULT)
451  av_log(NULL, AV_LOG_INFO, " (default)");
452  if (st->disposition & AV_DISPOSITION_DUB)
453  av_log(NULL, AV_LOG_INFO, " (dub)");
454  if (st->disposition & AV_DISPOSITION_ORIGINAL)
455  av_log(NULL, AV_LOG_INFO, " (original)");
456  if (st->disposition & AV_DISPOSITION_COMMENT)
457  av_log(NULL, AV_LOG_INFO, " (comment)");
458  if (st->disposition & AV_DISPOSITION_LYRICS)
459  av_log(NULL, AV_LOG_INFO, " (lyrics)");
460  if (st->disposition & AV_DISPOSITION_KARAOKE)
461  av_log(NULL, AV_LOG_INFO, " (karaoke)");
462  if (st->disposition & AV_DISPOSITION_FORCED)
463  av_log(NULL, AV_LOG_INFO, " (forced)");
464  if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
465  av_log(NULL, AV_LOG_INFO, " (hearing impaired)");
466  if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
467  av_log(NULL, AV_LOG_INFO, " (visual impaired)");
468  if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
469  av_log(NULL, AV_LOG_INFO, " (clean effects)");
470  av_log(NULL, AV_LOG_INFO, "\n");
471 
472  dump_metadata(NULL, st->metadata, " ");
473 
474  dump_sidedata(NULL, st, " ");
475 }
476 
477  void av_dump_format(AVFormatContext *ic, int index,
478  const char *url, int is_output)
479 {
480  int i;
481  uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL;
482  if (ic->nb_streams && !printed)
483  return;
484 
485  av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
486  is_output ? "Output" : "Input",
487  index,
488  is_output ? ic->oformat->name : ic->iformat->name,
489  is_output ? "to" : "from", url);
490  dump_metadata(NULL, ic->metadata, " ");
491 
492  if (!is_output) {
493  av_log(NULL, AV_LOG_INFO, " Duration: ");
494  if (ic->duration != AV_NOPTS_VALUE) {
495  int hours, mins, secs, us;
496  int64_t duration = ic->duration + 5000;
497  secs = duration / AV_TIME_BASE;
498  us = duration % AV_TIME_BASE;
499  mins = secs / 60;
500  secs %= 60;
501  hours = mins / 60;
502  mins %= 60;
503  av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%02d", hours, mins, secs,
504  (100 * us) / AV_TIME_BASE);
505  } else {
506  av_log(NULL, AV_LOG_INFO, "N/A");
507  }
508  if (ic->start_time != AV_NOPTS_VALUE) {
509  int secs, us;
510  av_log(NULL, AV_LOG_INFO, ", start: ");
511  secs = ic->start_time / AV_TIME_BASE;
512  us = abs(ic->start_time % AV_TIME_BASE);
513  av_log(NULL, AV_LOG_INFO, "%d.%06d",
514  secs, (int) av_rescale(us, 1000000, AV_TIME_BASE));
515  }
516  av_log(NULL, AV_LOG_INFO, ", bitrate: ");
517  if (ic->bit_rate)
518  av_log(NULL, AV_LOG_INFO, "%d kb/s", ic->bit_rate / 1000);
519  else
520  av_log(NULL, AV_LOG_INFO, "N/A");
521  av_log(NULL, AV_LOG_INFO, "\n");
522  }
523 
524  for (i = 0; i < ic->nb_chapters; i++) {
525  AVChapter *ch = ic->chapters[i];
526  av_log(NULL, AV_LOG_INFO, " Chapter #%d:%d: ", index, i);
527  av_log(NULL, AV_LOG_INFO,
528  "start %f, ", ch->start * av_q2d(ch->time_base));
529  av_log(NULL, AV_LOG_INFO,
530  "end %f\n", ch->end * av_q2d(ch->time_base));
531 
532  dump_metadata(NULL, ch->metadata, " ");
533  }
534 
535  if (ic->nb_programs) {
536  int j, k, total = 0;
537  for (j = 0; j < ic->nb_programs; j++) {
538  AVDictionaryEntry *name = av_dict_get(ic->programs[j]->metadata,
539  "name", NULL, 0);
540  av_log(NULL, AV_LOG_INFO, " Program %d %s\n", ic->programs[j]->id,
541  name ? name->value : "");
542  dump_metadata(NULL, ic->programs[j]->metadata, " ");
543  for (k = 0; k < ic->programs[j]->nb_stream_indexes; k++) {
544  dump_stream_format(ic, ic->programs[j]->stream_index[k],
545  index, is_output);
546  printed[ic->programs[j]->stream_index[k]] = 1;
547  }
548  total += ic->programs[j]->nb_stream_indexes;
549  }
550  if (total < ic->nb_streams)
551  av_log(NULL, AV_LOG_INFO, " No Program\n");
552  }
553 
554  for (i = 0; i < ic->nb_streams; i++)
555  if (!printed[i])
556  dump_stream_format(ic, i, index, is_output);
557 
558  av_free(printed);
559 }
AVFormatContext::nb_chapters
unsigned int nb_chapters
Number of chapters in AVChapter array.
Definition: avformat.h:1471
NULL
#define NULL
Definition: coverity.c:32
v
float v
Definition: avf_showspectrum.c:96
av_pkt_dump2
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.
Definition: dump.c:106
AV_STEREO3D_LINES
Views are packed per line, as if interlaced.
Definition: stereo3d.h:97
data
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
AV_STEREO3D_FRAMESEQUENCE
Views are alternated temporally.
Definition: stereo3d.h:66
AV_STEREO3D_SIDEBYSIDE_QUINCUNX
Views are next to each other, but when upscaling apply a checkerboard pattern.
Definition: stereo3d.h:87
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:182
AV_PKT_DATA_STEREO3D
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
Definition: avcodec.h:1038
AVStream::sample_aspect_ratio
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
Definition: avformat.h:914
AVFormatContext::dump_separator
uint8_t * dump_separator
dump format separator.
Definition: avformat.h:1787
AVRational::num
int num
numerator
Definition: rational.h:44
AVPacket::size
int size
Definition: avcodec.h:1163
av_dict_count
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
Definition: dict.c:34
AV_DISPOSITION_DUB
#define AV_DISPOSITION_DUB
Definition: avformat.h:798
AVCodecContext::sample_aspect_ratio
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:1623
av_cmp_q
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
Definition: rational.h:66
AV_DISPOSITION_HEARING_IMPAIRED
#define AV_DISPOSITION_HEARING_IMPAIRED
stream for hearing impaired audiences
Definition: avformat.h:810
AV_DISPOSITION_CLEAN_EFFECTS
#define AV_DISPOSITION_CLEAN_EFFECTS
stream without voice
Definition: avformat.h:812
AV_RL64
uint64_t_TMPL AV_RL64
Definition: bytestream.h:85
AVStream::side_data
AVPacketSideData * side_data
An array of side data that applies to the whole stream (i.e.
Definition: avformat.h:954
pkt
static AVPacket pkt
Definition: demuxing_decoding.c:54
AVChapter::metadata
AVDictionary * metadata
Definition: avformat.h:1239
dump_audioservicetype
static void dump_audioservicetype(void *ctx, AVPacketSideData *sd)
Definition: dump.c:296
AVProgram::id
int id
Definition: avformat.h:1206
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...
Definition: avcodec.h:1017
AVReplayGain::track_peak
uint32_t track_peak
Peak track amplitude, with 100000 representing full scale (but values may overflow).
Definition: replaygain.h:40
AV_DISPOSITION_KARAOKE
#define AV_DISPOSITION_KARAOKE
Definition: avformat.h:802
AVCodecContext::time_base
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Definition: avcodec.h:1369
AVFMT_SHOW_IDS
#define AVFMT_SHOW_IDS
Show format stream IDs numbers.
Definition: avformat.h:467
AVFormatContext
Format I/O context.
Definition: avformat.h:1272
pkt_dump_internal
static void pkt_dump_internal(void *avcl, FILE *f, int level, const AVPacket *pkt, int dump_payload, AVRational time_base)
Definition: dump.c:82
AVProgram::nb_stream_indexes
unsigned int nb_stream_indexes
Definition: avformat.h:1210
if
if()
Definition: avfilter.c:975
AVOutputFormat::flags
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:532
uint8_t
uint8_t
Definition: audio_convert.c:194
nb_streams
static int nb_streams
Definition: ffprobe.c:226
opt.h
AVOptions.
AVInputFormat::flags
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, AVFMT_SEEK_TO_PTS.
Definition: avformat.h:642
AVStereo3D
Stereo 3D type: this structure describes how two videos are packed within a single video surface...
Definition: stereo3d.h:123
AV_PKT_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
Definition: avcodec.h:1032
AVStream::id
int id
Format-specific stream ID.
Definition: avformat.h:849
AVStream::nb_side_data
int nb_side_data
The number of elements in the AVStream.side_data array.
Definition: avformat.h:958
AVCodecContext::av_class
const AVClass * av_class
information on struct for av_log
Definition: avcodec.h:1246
AVFormatContext::streams
AVStream ** streams
A list of all streams in the file.
Definition: avformat.h:1340
av_pkt_dump_log2
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.
Definition: dump.c:111
av_q2d
static double av_q2d(AVRational a)
Convert rational to double.
Definition: rational.h:80
av_dict_get
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:39
AVPacket::data
uint8_t * data
Definition: avcodec.h:1162
tag
uint32_t tag
Definition: movenc.c:1333
lrintf
#define lrintf(x)
Definition: libm_mips.h:70
AVPacketSideData::data
uint8_t * data
Definition: avcodec.h:1112
size
ptrdiff_t size
Definition: opengl_enc.c:101
duration
static int64_t duration
Definition: ffplay.c:321
AVPacket::duration
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: avcodec.h:1180
AVProgram::stream_index
unsigned int * stream_index
Definition: avformat.h:1209
AVReplayGain::album_gain
int32_t album_gain
Same as track_gain, but for the whole album.
Definition: replaygain.h:44
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
print_fps
static void print_fps(double d, const char *postfix)
Definition: dump.c:118
m
unsigned m
Definition: audioconvert.c:187
AVFormatContext::oformat
struct AVOutputFormat * oformat
The output container format.
Definition: avformat.h:1291
AV_PKT_FLAG_KEY
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition: avcodec.h:1208
dump_metadata
static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
Definition: dump.c:131
av_dump_format
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:477
AVDictionary
Definition: dict.c:29
AVFormatContext::metadata
AVDictionary * metadata
Metadata that applies to the whole file.
Definition: avformat.h:1482
AVStereo3D::flags
int flags
Additional information about the frame packing.
Definition: stereo3d.h:132
av_opt_ptr
void * av_opt_ptr(const AVClass *class, void *obj, const char *name)
Gets a pointer to the requested field in a struct.
Definition: opt.c:1549
av_hex_dump
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:72
AVAudioServiceType
AVAudioServiceType
Definition: avcodec.h:672
AV_PKT_DATA_PARAM_CHANGE
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
Definition: avcodec.h:996
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:197
AVFormatContext::nb_programs
unsigned int nb_programs
Definition: avformat.h:1421
AVFormatContext::chapters
AVChapter ** chapters
Definition: avformat.h:1472
AVPacketSideData::type
enum AVPacketSideDataType type
Definition: avcodec.h:1114
AV_STEREO3D_2D
Video is not stereoscopic (and metadata has to be there).
Definition: stereo3d.h:35
AVStream::avg_frame_rate
AVRational avg_frame_rate
Average framerate.
Definition: avformat.h:925
av_strlcpy
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.
Definition: avstring.c:83
AVPacket::flags
int flags
A combination of AV_PKT_FLAG values.
Definition: avcodec.h:1168
AVStream::codec
AVCodecContext * codec
Codec context associated with this stream.
Definition: avformat.h:861
av_reduce
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
AV_DISPOSITION_LYRICS
#define AV_DISPOSITION_LYRICS
Definition: avformat.h:801
AV_DISPOSITION_FORCED
#define AV_DISPOSITION_FORCED
Track should be used during playback by default.
Definition: avformat.h:809
AVFormatContext::nb_streams
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
Definition: avformat.h:1328
channel_layout.h
audio channel layout utility functions
av_rescale
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:127
AV_TIME_BASE
#define AV_TIME_BASE
Internal time base represented as integer.
Definition: avutil.h:247
FFMIN
#define FFMIN(a, b)
Definition: common.h:66
HEXDUMP_PRINT
#define HEXDUMP_PRINT(...)
Definition: dump.c:37
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:1414
dump_stream_format
static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output)
Definition: dump.c:391
AVOutputFormat::name
const char * name
Definition: avformat.h:513
int32_t
int32_t
Definition: audio_convert.c:194
AV_STEREO3D_FLAG_INVERT
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
Definition: stereo3d.h:114
dump_paramchange
static void dump_paramchange(void *ctx, AVPacketSideData *sd)
Definition: dump.c:158
AVStream::metadata
AVDictionary * metadata
Definition: avformat.h:916
AVCodecContext::height
int height
Definition: avcodec.h:1414
AV_DISPOSITION_VISUAL_IMPAIRED
#define AV_DISPOSITION_VISUAL_IMPAIRED
stream for visual impaired audiences
Definition: avformat.h:811
AVStream
Stream structure.
Definition: avformat.h:842
AVChapter::end
int64_t end
chapter start/end time in time_base units
Definition: avformat.h:1238
AV_DISPOSITION_DEFAULT
#define AV_DISPOSITION_DEFAULT
Definition: avformat.h:797
sample_rate
sample_rate
Definition: ffmpeg_filter.c:182
AVStereo3D::type
enum AVStereo3DType type
How views are packed within the video.
Definition: stereo3d.h:127
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
AVCodecContext::codec_type
enum AVMediaType codec_type
Definition: avcodec.h:1249
av_strdup
char * av_strdup(const char *s)
Duplicate the string s.
Definition: mem.c:265
dump_replaygain
static void dump_replaygain(void *ctx, AVPacketSideData *sd)
Definition: dump.c:235
buf
void * buf
Definition: avisynth_c.h:553
height
BYTE int const BYTE int int int height
Definition: avisynth_c.h:676
index
int index
Definition: gxfenc.c:89
AVRational
rational number numerator/denominator
Definition: rational.h:43
hex_dump_internal
static void hex_dump_internal(void *avcl, FILE *f, int level, const uint8_t *buf, int size)
Definition: dump.c:45
AV_STEREO3D_TOPBOTTOM
Views are on top of each other.
Definition: stereo3d.h:55
AVProgram::metadata
AVDictionary * metadata
Definition: avformat.h:1211
AV_PKT_DATA_REPLAYGAIN
This side data should be associated with an audio stream and contains ReplayGain information in form ...
Definition: avcodec.h:1023
flags
static int flags
Definition: cpu.c:47
AVFormatContext::start_time
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds. ...
Definition: avformat.h:1357
level
uint8_t level
Definition: svq3.c:150
AVChapter::start
int64_t start
Definition: avformat.h:1238
AV_STEREO3D_SIDEBYSIDE
Views are next to each other.
Definition: stereo3d.h:45
avformat.h
Main libavformat public API header.
print_peak
static void print_peak(void *ctx, const char *str, uint32_t peak)
Definition: dump.c:225
print_gain
static void print_gain(void *ctx, const char *str, int32_t gain)
Definition: dump.c:215
c
static double c[64]
Definition: vsrc_mptestsrc.c:87
AVStream::disposition
int disposition
AV_DISPOSITION_* bit field.
Definition: avformat.h:905
AVChapter::time_base
AVRational time_base
time base in which the start/end timestamps are specified
Definition: avformat.h:1237
AVDictionaryEntry::key
char * key
Definition: dict.h:87
AVRational::den
int den
denominator
Definition: rational.h:45
AVFormatContext::iformat
struct AVInputFormat * iformat
The input container format.
Definition: avformat.h:1284
av_display_rotation_get
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
avcodec_string
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
Definition: utils.c:3010
AVReplayGain::album_peak
uint32_t album_peak
Same as track_peak, but for the whole album,.
Definition: replaygain.h:48
av_free
#define av_free(p)
Definition: tableprint_vlc.h:34
av_get_channel_name
const char * av_get_channel_name(uint64_t channel)
Get the name of a given channel.
Definition: channel_layout.c:255
AVDictionaryEntry::value
char * value
Definition: dict.h:88
len
int len
Definition: vorbis_enc_data.h:452
AV_STEREO3D_CHECKERBOARD
Views are packed in a checkerboard-like structure per pixel.
Definition: stereo3d.h:76
AVStream::codec_info_nb_frames
int codec_info_nb_frames
Number of frames that have been demuxed during av_find_stream_info()
Definition: avformat.h:1032
AV_STEREO3D_COLUMNS
Views are packed per column.
Definition: stereo3d.h:107
AV_DISPOSITION_COMMENT
#define AV_DISPOSITION_COMMENT
Definition: avformat.h:800
layout
uint64_t layout
Definition: channel_layout.c:77
AVPacket::dts
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
Definition: avcodec.h:1161
AVFormatContext::bit_rate
int bit_rate
Total stream bitrate in bit/s, 0 if not available.
Definition: avformat.h:1374
AVFormatContext::duration
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
Definition: avformat.h:1367
dump_stereo3d
static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
Definition: dump.c:251
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:628
AV_DICT_IGNORE_SUFFIX
#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.
Definition: dict.h:72
AVReplayGain::track_gain
int32_t track_gain
Track replay gain in microbels (divide by 100000 to get the value in dB).
Definition: replaygain.h:35
av_hex_dump_log
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:77
AVPacket::stream_index
int stream_index
Definition: avcodec.h:1164
AVStream::time_base
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Definition: avformat.h:884
AVStream::r_frame_rate
AVRational r_frame_rate
Real base framerate of the stream.
Definition: avformat.h:1062
AVReplayGain
ReplayGain information (see http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification).
Definition: replaygain.h:30
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:85
AVPacket
This structure stores compressed data.
Definition: avcodec.h:1139
av_mallocz
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:250
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: avcodec.h:1155
AV_NOPTS_VALUE
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:241
AVFormatContext::programs
AVProgram ** programs
Definition: avformat.h:1422
AV_DISPOSITION_ORIGINAL
#define AV_DISPOSITION_ORIGINAL
Definition: avformat.h:799
name
const char * name
Definition: opengl_enc.c:103
dump_sidedata
static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
Definition: dump.c:339
AV_PKT_DATA_AUDIO_SERVICE_TYPE
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType.
Definition: avcodec.h:1044
width
static int width
Definition: demuxing_decoding.c:39

Generated on Wed Jun 10 2015 01:56:57 for FFmpeg by   doxygen 1.8.6

AltStyle によって変換されたページ (->オリジナル) /