2 * Various pretty-printing functions for use within FFmpeg
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
5 * This file is part of FFmpeg.
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.
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.
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
25 #include "libavutil/channel_layout.h"
26 #include "libavutil/display.h"
27 #include "libavutil/intreadwrite.h"
28 #include "libavutil/log.h"
29 #include "libavutil/mastering_display_metadata.h"
30 #include "libavutil/mathematics.h"
31 #include "libavutil/opt.h"
32 #include "libavutil/avstring.h"
33 #include "libavutil/replaygain.h"
34 #include "libavutil/spherical.h"
35 #include "libavutil/stereo3d.h"
39 #define HEXDUMP_PRINT(...) \
42 av_log(avcl, level, __VA_ARGS__); \
44 fprintf(f, __VA_ARGS__); \
47 static void hex_dump_internal(void *avcl, FILE *f, int level,
48 const uint8_t *buf, int size)
52 for (i = 0; i < size; i += 16) {
56 HEXDUMP_PRINT("%08x ", i);
57 for (j = 0; j < 16; j++) {
59 HEXDUMP_PRINT(" %02x", buf[i + j]);
64 for (j = 0; j < len; j++) {
66 if (c < ' ' || c > '~')
68 HEXDUMP_PRINT("%c", c);
74 void av_hex_dump(FILE *f, const uint8_t *buf, int size)
76 hex_dump_internal(NULL, f, 0, buf, size);
79 void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
81 hex_dump_internal(avcl, NULL, level, buf, size);
84 static void pkt_dump_internal(void *avcl, FILE *f, int level, const AVPacket *pkt,
85 int dump_payload, AVRational time_base)
87 HEXDUMP_PRINT("stream #%d:\n", pkt->stream_index);
88 HEXDUMP_PRINT(" keyframe=%d\n", (pkt->flags & AV_PKT_FLAG_KEY) != 0);
89 HEXDUMP_PRINT(" duration=%0.3f\n", pkt->duration * av_q2d(time_base));
90 /* DTS is _always_ valid after av_read_frame() */
91 HEXDUMP_PRINT(" dts=");
92 if (pkt->dts == AV_NOPTS_VALUE)
95 HEXDUMP_PRINT("%0.3f", pkt->dts * av_q2d(time_base));
96 /* PTS may not be known if B-frames are present. */
97 HEXDUMP_PRINT(" pts=");
98 if (pkt->pts == AV_NOPTS_VALUE)
101 HEXDUMP_PRINT("%0.3f", pkt->pts * av_q2d(time_base));
103 HEXDUMP_PRINT(" size=%d\n", pkt->size);
105 hex_dump_internal(avcl, f, level, pkt->data, pkt->size);
108 void av_pkt_dump2(FILE *f, const AVPacket *pkt, int dump_payload, const AVStream *st)
110 pkt_dump_internal(NULL, f, 0, pkt, dump_payload, st->time_base);
113 void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_payload,
116 pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base);
120 static void print_fps(double d, const char *postfix)
122 uint64_t v = lrintf(d * 100);
124 av_log(NULL, AV_LOG_INFO, "%1.4f %s", d, postfix);
126 av_log(NULL, AV_LOG_INFO, "%3.2f %s", d, postfix);
127 else if (v % (100 * 1000))
128 av_log(NULL, AV_LOG_INFO, "%1.0f %s", d, postfix);
130 av_log(NULL, AV_LOG_INFO, "%1.0fk %s", d / 1000, postfix);
133 static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
135 if (m && !(av_dict_count(m) == 1 && av_dict_get(m, "language", NULL, 0))) {
136 AVDictionaryEntry *tag = NULL;
138 av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
139 while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX)))
140 if (strcmp("language", tag->key)) {
141 const char *p = tag->value;
142 av_log(ctx, AV_LOG_INFO,
143 "%s %-16s: ", indent, tag->key);
146 size_t len = strcspn(p, "\x8\xa\xb\xc\xd");
147 av_strlcpy(tmp, p, FFMIN(sizeof(tmp), len+1));
148 av_log(ctx, AV_LOG_INFO, "%s", tmp);
150 if (*p == 0xd) av_log(ctx, AV_LOG_INFO, " ");
151 if (*p == 0xa) av_log(ctx, AV_LOG_INFO, "\n%s %-16s: ", indent, "");
154 av_log(ctx, AV_LOG_INFO, "\n");
159 /* param change side data*/
160 static void dump_paramchange(void *ctx, AVPacketSideData *sd)
163 const uint8_t *data = sd->data;
164 uint32_t flags, channels, sample_rate, width, height;
167 if (!data || sd->size < 4)
170 flags = AV_RL32(data);
174 if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) {
177 channels = AV_RL32(data);
180 av_log(ctx, AV_LOG_INFO, "channel count %"PRIu32", ", channels);
182 if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) {
185 layout = AV_RL64(data);
188 av_log(ctx, AV_LOG_INFO,
189 "channel layout: %s, ", av_get_channel_name(layout));
191 if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) {
194 sample_rate = AV_RL32(data);
197 av_log(ctx, AV_LOG_INFO, "sample_rate %"PRIu32", ", sample_rate);
199 if (flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) {
202 width = AV_RL32(data);
205 height = AV_RL32(data);
208 av_log(ctx, AV_LOG_INFO, "width %"PRIu32" height %"PRIu32, width, height);
213 av_log(ctx, AV_LOG_ERROR, "unknown param");
216 /* replaygain side data*/
217 static void print_gain(void *ctx, const char *str, int32_t gain)
219 av_log(ctx, AV_LOG_INFO, "%s - ", str);
220 if (gain == INT32_MIN)
221 av_log(ctx, AV_LOG_INFO, "unknown");
223 av_log(ctx, AV_LOG_INFO, "%f", gain / 100000.0f);
224 av_log(ctx, AV_LOG_INFO, ", ");
227 static void print_peak(void *ctx, const char *str, uint32_t peak)
229 av_log(ctx, AV_LOG_INFO, "%s - ", str);
231 av_log(ctx, AV_LOG_INFO, "unknown");
233 av_log(ctx, AV_LOG_INFO, "%f", (float) peak / UINT32_MAX);
234 av_log(ctx, AV_LOG_INFO, ", ");
237 static void dump_replaygain(void *ctx, AVPacketSideData *sd)
241 if (sd->size < sizeof(*rg)) {
242 av_log(ctx, AV_LOG_ERROR, "invalid data");
245 rg = (AVReplayGain*)sd->data;
247 print_gain(ctx, "track gain", rg->track_gain);
248 print_peak(ctx, "track peak", rg->track_peak);
249 print_gain(ctx, "album gain", rg->album_gain);
250 print_peak(ctx, "album peak", rg->album_peak);
253 static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
257 if (sd->size < sizeof(*stereo)) {
258 av_log(ctx, AV_LOG_ERROR, "invalid data");
262 stereo = (AVStereo3D *)sd->data;
264 av_log(ctx, AV_LOG_INFO, "%s", av_stereo3d_type_name(stereo->type));
266 if (stereo->flags & AV_STEREO3D_FLAG_INVERT)
267 av_log(ctx, AV_LOG_INFO, " (inverted)");
270 static void dump_audioservicetype(void *ctx, AVPacketSideData *sd)
272 enum AVAudioServiceType *ast = (enum AVAudioServiceType *)sd->data;
274 if (sd->size < sizeof(*ast)) {
275 av_log(ctx, AV_LOG_ERROR, "invalid data");
280 case AV_AUDIO_SERVICE_TYPE_MAIN:
281 av_log(ctx, AV_LOG_INFO, "main");
283 case AV_AUDIO_SERVICE_TYPE_EFFECTS:
284 av_log(ctx, AV_LOG_INFO, "effects");
286 case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED:
287 av_log(ctx, AV_LOG_INFO, "visually impaired");
289 case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED:
290 av_log(ctx, AV_LOG_INFO, "hearing impaired");
292 case AV_AUDIO_SERVICE_TYPE_DIALOGUE:
293 av_log(ctx, AV_LOG_INFO, "dialogue");
295 case AV_AUDIO_SERVICE_TYPE_COMMENTARY:
296 av_log(ctx, AV_LOG_INFO, "commentary");
298 case AV_AUDIO_SERVICE_TYPE_EMERGENCY:
299 av_log(ctx, AV_LOG_INFO, "emergency");
301 case AV_AUDIO_SERVICE_TYPE_VOICE_OVER:
302 av_log(ctx, AV_LOG_INFO, "voice over");
304 case AV_AUDIO_SERVICE_TYPE_KARAOKE:
305 av_log(ctx, AV_LOG_INFO, "karaoke");
308 av_log(ctx, AV_LOG_WARNING, "unknown");
313 static void dump_cpb(void *ctx, AVPacketSideData *sd)
315 AVCPBProperties *cpb = (AVCPBProperties *)sd->data;
317 if (sd->size < sizeof(*cpb)) {
318 av_log(ctx, AV_LOG_ERROR, "invalid data");
322 av_log(ctx, AV_LOG_INFO,
323 #if FF_API_UNSANITIZED_BITRATES
324 "bitrate max/min/avg: %d/%d/%d buffer size: %d vbv_delay: %"PRIu64,
326 "bitrate max/min/avg: %"PRId64"/%"PRId64"/%"PRId64" buffer size: %d vbv_delay: %"PRIu64,
328 cpb->max_bitrate, cpb->min_bitrate, cpb->avg_bitrate,
333 static void dump_mastering_display_metadata(void *ctx, AVPacketSideData* sd) {
334 AVMasteringDisplayMetadata* metadata = (AVMasteringDisplayMetadata*)sd->data;
335 av_log(ctx, AV_LOG_INFO, "Mastering Display Metadata, "
336 "has_primaries:%d has_luminance:%d "
337 "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f) "
338 "min_luminance=%f, max_luminance=%f",
339 metadata->has_primaries, metadata->has_luminance,
340 av_q2d(metadata->display_primaries[0][0]),
341 av_q2d(metadata->display_primaries[0][1]),
342 av_q2d(metadata->display_primaries[1][0]),
343 av_q2d(metadata->display_primaries[1][1]),
344 av_q2d(metadata->display_primaries[2][0]),
345 av_q2d(metadata->display_primaries[2][1]),
346 av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1]),
347 av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance));
350 static void dump_content_light_metadata(void *ctx, AVPacketSideData* sd)
352 AVContentLightMetadata* metadata = (AVContentLightMetadata*)sd->data;
353 av_log(ctx, AV_LOG_INFO, "Content Light Level Metadata, "
354 "MaxCLL=%d, MaxFALL=%d",
355 metadata->MaxCLL, metadata->MaxFALL);
358 static void dump_spherical(void *ctx, AVCodecParameters *par, AVPacketSideData *sd)
360 AVSphericalMapping *spherical = (AVSphericalMapping *)sd->data;
361 double yaw, pitch, roll;
363 if (sd->size < sizeof(*spherical)) {
364 av_log(ctx, AV_LOG_ERROR, "invalid data");
368 av_log(ctx, AV_LOG_INFO, "%s ", av_spherical_projection_name(spherical->projection));
370 yaw = ((double)spherical->yaw) / (1 << 16);
371 pitch = ((double)spherical->pitch) / (1 << 16);
372 roll = ((double)spherical->roll) / (1 << 16);
373 av_log(ctx, AV_LOG_INFO, "(%f/%f/%f) ", yaw, pitch, roll);
375 if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR_TILE) {
377 av_spherical_tile_bounds(spherical, par->width, par->height,
379 av_log(ctx, AV_LOG_INFO,
380 "[%"SIZE_SPECIFIER", %"SIZE_SPECIFIER", %"SIZE_SPECIFIER", %"SIZE_SPECIFIER"] ",
382 } else if (spherical->projection == AV_SPHERICAL_CUBEMAP) {
383 av_log(ctx, AV_LOG_INFO, "[pad %"PRIu32"] ", spherical->padding);
387 static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
391 if (st->nb_side_data)
392 av_log(ctx, AV_LOG_INFO, "%sSide data:\n", indent);
394 for (i = 0; i < st->nb_side_data; i++) {
395 AVPacketSideData sd = st->side_data[i];
396 av_log(ctx, AV_LOG_INFO, "%s ", indent);
399 case AV_PKT_DATA_PALETTE:
400 av_log(ctx, AV_LOG_INFO, "palette");
402 case AV_PKT_DATA_NEW_EXTRADATA:
403 av_log(ctx, AV_LOG_INFO, "new extradata");
405 case AV_PKT_DATA_PARAM_CHANGE:
406 av_log(ctx, AV_LOG_INFO, "paramchange: ");
407 dump_paramchange(ctx, &sd);
409 case AV_PKT_DATA_H263_MB_INFO:
410 av_log(ctx, AV_LOG_INFO, "H.263 macroblock info");
412 case AV_PKT_DATA_REPLAYGAIN:
413 av_log(ctx, AV_LOG_INFO, "replaygain: ");
414 dump_replaygain(ctx, &sd);
416 case AV_PKT_DATA_DISPLAYMATRIX:
417 av_log(ctx, AV_LOG_INFO, "displaymatrix: rotation of %.2f degrees",
418 av_display_rotation_get((int32_t *)sd.data));
420 case AV_PKT_DATA_STEREO3D:
421 av_log(ctx, AV_LOG_INFO, "stereo3d: ");
422 dump_stereo3d(ctx, &sd);
424 case AV_PKT_DATA_AUDIO_SERVICE_TYPE:
425 av_log(ctx, AV_LOG_INFO, "audio service type: ");
426 dump_audioservicetype(ctx, &sd);
428 case AV_PKT_DATA_QUALITY_STATS:
429 av_log(ctx, AV_LOG_INFO, "quality factor: %"PRId32", pict_type: %c",
430 AV_RL32(sd.data), av_get_picture_type_char(sd.data[4]));
432 case AV_PKT_DATA_CPB_PROPERTIES:
433 av_log(ctx, AV_LOG_INFO, "cpb: ");
436 case AV_PKT_DATA_MASTERING_DISPLAY_METADATA:
437 dump_mastering_display_metadata(ctx, &sd);
439 case AV_PKT_DATA_SPHERICAL:
440 av_log(ctx, AV_LOG_INFO, "spherical: ");
441 dump_spherical(ctx, st->codecpar, &sd);
443 case AV_PKT_DATA_CONTENT_LIGHT_LEVEL:
444 dump_content_light_metadata(ctx, &sd);
447 av_log(ctx, AV_LOG_INFO,
448 "unknown side data type %d (%d bytes)", sd.type, sd.size);
452 av_log(ctx, AV_LOG_INFO, "\n");
456 /* "user interface" functions */
457 static void dump_stream_format(AVFormatContext *ic, int i,
458 int index, int is_output)
461 int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
462 AVStream *st = ic->streams[i];
463 AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
464 char *separator = ic->dump_separator;
465 AVCodecContext *avctx;
468 avctx = avcodec_alloc_context3(NULL);
472 ret = avcodec_parameters_to_context(avctx, st->codecpar);
474 avcodec_free_context(&avctx);
478 // Fields which are missing from AVCodecParameters need to be taken from the AVCodecContext
479 avctx->properties = st->codec->properties;
480 avctx->codec = st->codec->codec;
481 avctx->qmin = st->codec->qmin;
482 avctx->qmax = st->codec->qmax;
483 avctx->coded_width = st->codec->coded_width;
484 avctx->coded_height = st->codec->coded_height;
487 av_opt_set(avctx, "dump_separator", separator, 0);
488 avcodec_string(buf, sizeof(buf), avctx, is_output);
489 avcodec_free_context(&avctx);
491 av_log(NULL, AV_LOG_INFO, " Stream #%d:%d", index, i);
493 /* the pid is an important information, so we display it */
494 /* XXX: add a generic system */
495 if (flags & AVFMT_SHOW_IDS)
496 av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id);
498 av_log(NULL, AV_LOG_INFO, "(%s)", lang->value);
499 av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->codec_info_nb_frames,
500 st->time_base.num, st->time_base.den);
501 av_log(NULL, AV_LOG_INFO, ": %s", buf);
503 if (st->sample_aspect_ratio.num &&
504 av_cmp_q(st->sample_aspect_ratio, st->codecpar->sample_aspect_ratio)) {
505 AVRational display_aspect_ratio;
506 av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
507 st->codecpar->width * (int64_t)st->sample_aspect_ratio.num,
508 st->codecpar->height * (int64_t)st->sample_aspect_ratio.den,
510 av_log(NULL, AV_LOG_INFO, ", SAR %d:%d DAR %d:%d",
511 st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
512 display_aspect_ratio.num, display_aspect_ratio.den);
515 if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
516 int fps = st->avg_frame_rate.den && st->avg_frame_rate.num;
517 int tbr = st->r_frame_rate.den && st->r_frame_rate.num;
518 int tbn = st->time_base.den && st->time_base.num;
519 int tbc = st->codec->time_base.den && st->codec->time_base.num;
521 if (fps || tbr || tbn || tbc)
522 av_log(NULL, AV_LOG_INFO, "%s", separator);
525 print_fps(av_q2d(st->avg_frame_rate), tbr || tbn || tbc ? "fps, " : "fps");
527 print_fps(av_q2d(st->r_frame_rate), tbn || tbc ? "tbr, " : "tbr");
529 print_fps(1 / av_q2d(st->time_base), tbc ? "tbn, " : "tbn");
531 print_fps(1 / av_q2d(st->codec->time_base), "tbc");
534 if (st->disposition & AV_DISPOSITION_DEFAULT)
535 av_log(NULL, AV_LOG_INFO, " (default)");
536 if (st->disposition & AV_DISPOSITION_DUB)
537 av_log(NULL, AV_LOG_INFO, " (dub)");
538 if (st->disposition & AV_DISPOSITION_ORIGINAL)
539 av_log(NULL, AV_LOG_INFO, " (original)");
540 if (st->disposition & AV_DISPOSITION_COMMENT)
541 av_log(NULL, AV_LOG_INFO, " (comment)");
542 if (st->disposition & AV_DISPOSITION_LYRICS)
543 av_log(NULL, AV_LOG_INFO, " (lyrics)");
544 if (st->disposition & AV_DISPOSITION_KARAOKE)
545 av_log(NULL, AV_LOG_INFO, " (karaoke)");
546 if (st->disposition & AV_DISPOSITION_FORCED)
547 av_log(NULL, AV_LOG_INFO, " (forced)");
548 if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
549 av_log(NULL, AV_LOG_INFO, " (hearing impaired)");
550 if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
551 av_log(NULL, AV_LOG_INFO, " (visual impaired)");
552 if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
553 av_log(NULL, AV_LOG_INFO, " (clean effects)");
554 if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
555 av_log(NULL, AV_LOG_INFO, " (attached pic)");
556 if (st->disposition & AV_DISPOSITION_TIMED_THUMBNAILS)
557 av_log(NULL, AV_LOG_INFO, " (timed thumbnails)");
558 if (st->disposition & AV_DISPOSITION_CAPTIONS)
559 av_log(NULL, AV_LOG_INFO, " (captions)");
560 if (st->disposition & AV_DISPOSITION_DESCRIPTIONS)
561 av_log(NULL, AV_LOG_INFO, " (descriptions)");
562 if (st->disposition & AV_DISPOSITION_METADATA)
563 av_log(NULL, AV_LOG_INFO, " (metadata)");
564 if (st->disposition & AV_DISPOSITION_DEPENDENT)
565 av_log(NULL, AV_LOG_INFO, " (dependent)");
566 if (st->disposition & AV_DISPOSITION_STILL_IMAGE)
567 av_log(NULL, AV_LOG_INFO, " (still image)");
568 av_log(NULL, AV_LOG_INFO, "\n");
570 dump_metadata(NULL, st->metadata, " ");
572 dump_sidedata(NULL, st, " ");
575 void av_dump_format(AVFormatContext *ic, int index,
576 const char *url, int is_output)
579 uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL;
580 if (ic->nb_streams && !printed)
583 av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
584 is_output ? "Output" : "Input",
586 is_output ? ic->oformat->name : ic->iformat->name,
587 is_output ? "to" : "from", url);
588 dump_metadata(NULL, ic->metadata, " ");
591 av_log(NULL, AV_LOG_INFO, " Duration: ");
592 if (ic->duration != AV_NOPTS_VALUE) {
593 int hours, mins, secs, us;
594 int64_t duration = ic->duration + (ic->duration <= INT64_MAX - 5000 ? 5000 : 0);
595 secs = duration / AV_TIME_BASE;
596 us = duration % AV_TIME_BASE;
601 av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%02d", hours, mins, secs,
602 (100 * us) / AV_TIME_BASE);
604 av_log(NULL, AV_LOG_INFO, "N/A");
606 if (ic->start_time != AV_NOPTS_VALUE) {
608 av_log(NULL, AV_LOG_INFO, ", start: ");
609 secs = llabs(ic->start_time / AV_TIME_BASE);
610 us = llabs(ic->start_time % AV_TIME_BASE);
611 av_log(NULL, AV_LOG_INFO, "%s%d.%06d",
612 ic->start_time >= 0 ? "" : "-",
614 (int) av_rescale(us, 1000000, AV_TIME_BASE));
616 av_log(NULL, AV_LOG_INFO, ", bitrate: ");
618 av_log(NULL, AV_LOG_INFO, "%"PRId64" kb/s", ic->bit_rate / 1000);
620 av_log(NULL, AV_LOG_INFO, "N/A");
621 av_log(NULL, AV_LOG_INFO, "\n");
624 for (i = 0; i < ic->nb_chapters; i++) {
625 AVChapter *ch = ic->chapters[i];
626 av_log(NULL, AV_LOG_INFO, " Chapter #%d:%d: ", index, i);
627 av_log(NULL, AV_LOG_INFO,
628 "start %f, ", ch->start * av_q2d(ch->time_base));
629 av_log(NULL, AV_LOG_INFO,
630 "end %f\n", ch->end * av_q2d(ch->time_base));
632 dump_metadata(NULL, ch->metadata, " ");
635 if (ic->nb_programs) {
637 for (j = 0; j < ic->nb_programs; j++) {
638 AVDictionaryEntry *name = av_dict_get(ic->programs[j]->metadata,
640 av_log(NULL, AV_LOG_INFO, " Program %d %s\n", ic->programs[j]->id,
641 name ? name->value : "");
642 dump_metadata(NULL, ic->programs[j]->metadata, " ");
643 for (k = 0; k < ic->programs[j]->nb_stream_indexes; k++) {
644 dump_stream_format(ic, ic->programs[j]->stream_index[k],
646 printed[ic->programs[j]->stream_index[k]] = 1;
648 total += ic->programs[j]->nb_stream_indexes;
650 if (total < ic->nb_streams)
651 av_log(NULL, AV_LOG_INFO, " No Program\n");
654 for (i = 0; i < ic->nb_streams; i++)
656 dump_stream_format(ic, i, index, is_output);