You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

560 lines
19KB

  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. #include <stdio.h>
  22. #include <stdint.h>
  23. #include "libavutil/channel_layout.h"
  24. #include "libavutil/display.h"
  25. #include "libavutil/intreadwrite.h"
  26. #include "libavutil/log.h"
  27. #include "libavutil/mathematics.h"
  28. #include "libavutil/opt.h"
  29. #include "libavutil/avstring.h"
  30. #include "libavutil/replaygain.h"
  31. #include "libavutil/stereo3d.h"
  32. #include "avformat.h"
  33. #define HEXDUMP_PRINT(...) \
  34. do { \
  35. if (!f) \
  36. av_log(avcl, level, __VA_ARGS__); \
  37. else \
  38. fprintf(f, __VA_ARGS__); \
  39. } while (0)
  40. static void hex_dump_internal(void *avcl, FILE *f, int level,
  41. const uint8_t *buf, int size)
  42. {
  43. int len, i, j, c;
  44. for (i = 0; i < size; i += 16) {
  45. len = size - i;
  46. if (len > 16)
  47. len = 16;
  48. HEXDUMP_PRINT("%08x ", i);
  49. for (j = 0; j < 16; j++) {
  50. if (j < len)
  51. HEXDUMP_PRINT(" %02x", buf[i + j]);
  52. else
  53. HEXDUMP_PRINT(" ");
  54. }
  55. HEXDUMP_PRINT(" ");
  56. for (j = 0; j < len; j++) {
  57. c = buf[i + j];
  58. if (c < ' ' || c > '~')
  59. c = '.';
  60. HEXDUMP_PRINT("%c", c);
  61. }
  62. HEXDUMP_PRINT("\n");
  63. }
  64. }
  65. void av_hex_dump(FILE *f, const uint8_t *buf, int size)
  66. {
  67. hex_dump_internal(NULL, f, 0, buf, size);
  68. }
  69. void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
  70. {
  71. hex_dump_internal(avcl, NULL, level, buf, size);
  72. }
  73. static void pkt_dump_internal(void *avcl, FILE *f, int level, const AVPacket *pkt,
  74. int dump_payload, AVRational time_base)
  75. {
  76. HEXDUMP_PRINT("stream #%d:\n", pkt->stream_index);
  77. HEXDUMP_PRINT(" keyframe=%d\n", (pkt->flags & AV_PKT_FLAG_KEY) != 0);
  78. HEXDUMP_PRINT(" duration=%0.3f\n", pkt->duration * av_q2d(time_base));
  79. /* DTS is _always_ valid after av_read_frame() */
  80. HEXDUMP_PRINT(" dts=");
  81. if (pkt->dts == AV_NOPTS_VALUE)
  82. HEXDUMP_PRINT("N/A");
  83. else
  84. HEXDUMP_PRINT("%0.3f", pkt->dts * av_q2d(time_base));
  85. /* PTS may not be known if B-frames are present. */
  86. HEXDUMP_PRINT(" pts=");
  87. if (pkt->pts == AV_NOPTS_VALUE)
  88. HEXDUMP_PRINT("N/A");
  89. else
  90. HEXDUMP_PRINT("%0.3f", pkt->pts * av_q2d(time_base));
  91. HEXDUMP_PRINT("\n");
  92. HEXDUMP_PRINT(" size=%d\n", pkt->size);
  93. if (dump_payload)
  94. av_hex_dump(f, pkt->data, pkt->size);
  95. }
  96. void av_pkt_dump2(FILE *f, const AVPacket *pkt, int dump_payload, const AVStream *st)
  97. {
  98. pkt_dump_internal(NULL, f, 0, pkt, dump_payload, st->time_base);
  99. }
  100. void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_payload,
  101. const AVStream *st)
  102. {
  103. pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base);
  104. }
  105. static void print_fps(double d, const char *postfix)
  106. {
  107. uint64_t v = lrintf(d * 100);
  108. if (!v)
  109. av_log(NULL, AV_LOG_INFO, "%1.4f %s", d, postfix);
  110. else if (v % 100)
  111. av_log(NULL, AV_LOG_INFO, "%3.2f %s", d, postfix);
  112. else if (v % (100 * 1000))
  113. av_log(NULL, AV_LOG_INFO, "%1.0f %s", d, postfix);
  114. else
  115. av_log(NULL, AV_LOG_INFO, "%1.0fk %s", d / 1000, postfix);
  116. }
  117. static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
  118. {
  119. if (m && !(av_dict_count(m) == 1 && av_dict_get(m, "language", NULL, 0))) {
  120. AVDictionaryEntry *tag = NULL;
  121. av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
  122. while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX)))
  123. if (strcmp("language", tag->key)) {
  124. const char *p = tag->value;
  125. av_log(ctx, AV_LOG_INFO,
  126. "%s %-16s: ", indent, tag->key);
  127. while (*p) {
  128. char tmp[256];
  129. size_t len = strcspn(p, "\x8\xa\xb\xc\xd");
  130. av_strlcpy(tmp, p, FFMIN(sizeof(tmp), len+1));
  131. av_log(ctx, AV_LOG_INFO, "%s", tmp);
  132. p += len;
  133. if (*p == 0xd) av_log(ctx, AV_LOG_INFO, " ");
  134. if (*p == 0xa) av_log(ctx, AV_LOG_INFO, "\n%s %-16s: ", indent, "");
  135. if (*p) p++;
  136. }
  137. av_log(ctx, AV_LOG_INFO, "\n");
  138. }
  139. }
  140. }
  141. /* param change side data*/
  142. static void dump_paramchange(void *ctx, AVPacketSideData *sd)
  143. {
  144. int size = sd->size;
  145. const uint8_t *data = sd->data;
  146. uint32_t flags, channels, sample_rate, width, height;
  147. uint64_t layout;
  148. if (!data || sd->size < 4)
  149. goto fail;
  150. flags = AV_RL32(data);
  151. data += 4;
  152. size -= 4;
  153. if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) {
  154. if (size < 4)
  155. goto fail;
  156. channels = AV_RL32(data);
  157. data += 4;
  158. size -= 4;
  159. av_log(ctx, AV_LOG_INFO, "channel count %"PRIu32", ", channels);
  160. }
  161. if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) {
  162. if (size < 8)
  163. goto fail;
  164. layout = AV_RL64(data);
  165. data += 8;
  166. size -= 8;
  167. av_log(ctx, AV_LOG_INFO,
  168. "channel layout: %s, ", av_get_channel_name(layout));
  169. }
  170. if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) {
  171. if (size < 4)
  172. goto fail;
  173. sample_rate = AV_RL32(data);
  174. data += 4;
  175. size -= 4;
  176. av_log(ctx, AV_LOG_INFO, "sample_rate %"PRIu32", ", sample_rate);
  177. }
  178. if (flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) {
  179. if (size < 8)
  180. goto fail;
  181. width = AV_RL32(data);
  182. data += 4;
  183. size -= 4;
  184. height = AV_RL32(data);
  185. data += 4;
  186. size -= 4;
  187. av_log(ctx, AV_LOG_INFO, "width %"PRIu32" height %"PRIu32, width, height);
  188. }
  189. return;
  190. fail:
  191. av_log(ctx, AV_LOG_INFO, "unknown param");
  192. }
  193. /* replaygain side data*/
  194. static void print_gain(void *ctx, const char *str, int32_t gain)
  195. {
  196. av_log(ctx, AV_LOG_INFO, "%s - ", str);
  197. if (gain == INT32_MIN)
  198. av_log(ctx, AV_LOG_INFO, "unknown");
  199. else
  200. av_log(ctx, AV_LOG_INFO, "%f", gain / 100000.0f);
  201. av_log(ctx, AV_LOG_INFO, ", ");
  202. }
  203. static void print_peak(void *ctx, const char *str, uint32_t peak)
  204. {
  205. av_log(ctx, AV_LOG_INFO, "%s - ", str);
  206. if (!peak)
  207. av_log(ctx, AV_LOG_INFO, "unknown");
  208. else
  209. av_log(ctx, AV_LOG_INFO, "%f", (float) peak / UINT32_MAX);
  210. av_log(ctx, AV_LOG_INFO, ", ");
  211. }
  212. static void dump_replaygain(void *ctx, AVPacketSideData *sd)
  213. {
  214. AVReplayGain *rg;
  215. if (sd->size < sizeof(*rg)) {
  216. av_log(ctx, AV_LOG_INFO, "invalid data");
  217. return;
  218. }
  219. rg = (AVReplayGain*)sd->data;
  220. print_gain(ctx, "track gain", rg->track_gain);
  221. print_peak(ctx, "track peak", rg->track_peak);
  222. print_gain(ctx, "album gain", rg->album_gain);
  223. print_peak(ctx, "album peak", rg->album_peak);
  224. }
  225. static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
  226. {
  227. AVStereo3D *stereo;
  228. if (sd->size < sizeof(*stereo)) {
  229. av_log(ctx, AV_LOG_INFO, "invalid data");
  230. return;
  231. }
  232. stereo = (AVStereo3D *)sd->data;
  233. switch (stereo->type) {
  234. case AV_STEREO3D_2D:
  235. av_log(ctx, AV_LOG_INFO, "2D");
  236. break;
  237. case AV_STEREO3D_SIDEBYSIDE:
  238. av_log(ctx, AV_LOG_INFO, "side by side");
  239. break;
  240. case AV_STEREO3D_TOPBOTTOM:
  241. av_log(ctx, AV_LOG_INFO, "top and bottom");
  242. break;
  243. case AV_STEREO3D_FRAMESEQUENCE:
  244. av_log(ctx, AV_LOG_INFO, "frame alternate");
  245. break;
  246. case AV_STEREO3D_CHECKERBOARD:
  247. av_log(ctx, AV_LOG_INFO, "checkerboard");
  248. break;
  249. case AV_STEREO3D_LINES:
  250. av_log(ctx, AV_LOG_INFO, "interleaved lines");
  251. break;
  252. case AV_STEREO3D_COLUMNS:
  253. av_log(ctx, AV_LOG_INFO, "interleaved columns");
  254. break;
  255. case AV_STEREO3D_SIDEBYSIDE_QUINCUNX:
  256. av_log(ctx, AV_LOG_INFO, "side by side (quincunx subsampling)");
  257. break;
  258. default:
  259. av_log(ctx, AV_LOG_WARNING, "unknown");
  260. break;
  261. }
  262. if (stereo->flags & AV_STEREO3D_FLAG_INVERT)
  263. av_log(ctx, AV_LOG_INFO, " (inverted)");
  264. }
  265. static void dump_audioservicetype(void *ctx, AVPacketSideData *sd)
  266. {
  267. enum AVAudioServiceType *ast = (enum AVAudioServiceType *)sd->data;
  268. if (sd->size < sizeof(*ast)) {
  269. av_log(ctx, AV_LOG_INFO, "invalid data");
  270. return;
  271. }
  272. switch (*ast) {
  273. case AV_AUDIO_SERVICE_TYPE_MAIN:
  274. av_log(ctx, AV_LOG_INFO, "main");
  275. break;
  276. case AV_AUDIO_SERVICE_TYPE_EFFECTS:
  277. av_log(ctx, AV_LOG_INFO, "effects");
  278. break;
  279. case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED:
  280. av_log(ctx, AV_LOG_INFO, "visually impaired");
  281. break;
  282. case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED:
  283. av_log(ctx, AV_LOG_INFO, "hearing impaired");
  284. break;
  285. case AV_AUDIO_SERVICE_TYPE_DIALOGUE:
  286. av_log(ctx, AV_LOG_INFO, "dialogue");
  287. break;
  288. case AV_AUDIO_SERVICE_TYPE_COMMENTARY:
  289. av_log(ctx, AV_LOG_INFO, "comentary");
  290. break;
  291. case AV_AUDIO_SERVICE_TYPE_EMERGENCY:
  292. av_log(ctx, AV_LOG_INFO, "emergency");
  293. break;
  294. case AV_AUDIO_SERVICE_TYPE_VOICE_OVER:
  295. av_log(ctx, AV_LOG_INFO, "voice over");
  296. break;
  297. case AV_AUDIO_SERVICE_TYPE_KARAOKE:
  298. av_log(ctx, AV_LOG_INFO, "karaoke");
  299. break;
  300. default:
  301. av_log(ctx, AV_LOG_WARNING, "unknown");
  302. break;
  303. }
  304. }
  305. static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
  306. {
  307. int i;
  308. if (st->nb_side_data)
  309. av_log(ctx, AV_LOG_INFO, "%sSide data:\n", indent);
  310. for (i = 0; i < st->nb_side_data; i++) {
  311. AVPacketSideData sd = st->side_data[i];
  312. av_log(ctx, AV_LOG_INFO, "%s ", indent);
  313. switch (sd.type) {
  314. case AV_PKT_DATA_PALETTE:
  315. av_log(ctx, AV_LOG_INFO, "palette");
  316. break;
  317. case AV_PKT_DATA_NEW_EXTRADATA:
  318. av_log(ctx, AV_LOG_INFO, "new extradata");
  319. break;
  320. case AV_PKT_DATA_PARAM_CHANGE:
  321. av_log(ctx, AV_LOG_INFO, "paramchange: ");
  322. dump_paramchange(ctx, &sd);
  323. break;
  324. case AV_PKT_DATA_H263_MB_INFO:
  325. av_log(ctx, AV_LOG_INFO, "h263 macroblock info");
  326. break;
  327. case AV_PKT_DATA_REPLAYGAIN:
  328. av_log(ctx, AV_LOG_INFO, "replaygain: ");
  329. dump_replaygain(ctx, &sd);
  330. break;
  331. case AV_PKT_DATA_DISPLAYMATRIX:
  332. av_log(ctx, AV_LOG_INFO, "displaymatrix: rotation of %.2f degrees",
  333. av_display_rotation_get((int32_t *)sd.data));
  334. break;
  335. case AV_PKT_DATA_STEREO3D:
  336. av_log(ctx, AV_LOG_INFO, "stereo3d: ");
  337. dump_stereo3d(ctx, &sd);
  338. break;
  339. case AV_PKT_DATA_AUDIO_SERVICE_TYPE:
  340. av_log(ctx, AV_LOG_INFO, "audio service type: ");
  341. dump_audioservicetype(ctx, &sd);
  342. break;
  343. default:
  344. av_log(ctx, AV_LOG_WARNING,
  345. "unknown side data type %d (%d bytes)", sd.type, sd.size);
  346. break;
  347. }
  348. av_log(ctx, AV_LOG_INFO, "\n");
  349. }
  350. }
  351. /* "user interface" functions */
  352. static void dump_stream_format(AVFormatContext *ic, int i,
  353. int index, int is_output)
  354. {
  355. char buf[256];
  356. int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
  357. AVStream *st = ic->streams[i];
  358. AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
  359. char *separator = ic->dump_separator;
  360. char **codec_separator = av_opt_ptr(st->codec->av_class, st->codec, "dump_separator");
  361. int use_format_separator = !*codec_separator;
  362. if (use_format_separator)
  363. *codec_separator = av_strdup(separator);
  364. avcodec_string(buf, sizeof(buf), st->codec, is_output);
  365. if (use_format_separator)
  366. av_freep(codec_separator);
  367. av_log(NULL, AV_LOG_INFO, " Stream #%d:%d", index, i);
  368. /* the pid is an important information, so we display it */
  369. /* XXX: add a generic system */
  370. if (flags & AVFMT_SHOW_IDS)
  371. av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id);
  372. if (lang)
  373. av_log(NULL, AV_LOG_INFO, "(%s)", lang->value);
  374. av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->codec_info_nb_frames,
  375. st->time_base.num, st->time_base.den);
  376. av_log(NULL, AV_LOG_INFO, ": %s", buf);
  377. if (st->sample_aspect_ratio.num && // default
  378. av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) {
  379. AVRational display_aspect_ratio;
  380. av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
  381. st->codec->width * st->sample_aspect_ratio.num,
  382. st->codec->height * st->sample_aspect_ratio.den,
  383. 1024 * 1024);
  384. av_log(NULL, AV_LOG_INFO, ", SAR %d:%d DAR %d:%d",
  385. st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
  386. display_aspect_ratio.num, display_aspect_ratio.den);
  387. }
  388. if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
  389. int fps = st->avg_frame_rate.den && st->avg_frame_rate.num;
  390. int tbr = st->r_frame_rate.den && st->r_frame_rate.num;
  391. int tbn = st->time_base.den && st->time_base.num;
  392. int tbc = st->codec->time_base.den && st->codec->time_base.num;
  393. if (fps || tbr || tbn || tbc)
  394. av_log(NULL, AV_LOG_INFO, "%s", separator);
  395. if (fps)
  396. print_fps(av_q2d(st->avg_frame_rate), tbr || tbn || tbc ? "fps, " : "fps");
  397. if (tbr)
  398. print_fps(av_q2d(st->r_frame_rate), tbn || tbc ? "tbr, " : "tbr");
  399. if (tbn)
  400. print_fps(1 / av_q2d(st->time_base), tbc ? "tbn, " : "tbn");
  401. if (tbc)
  402. print_fps(1 / av_q2d(st->codec->time_base), "tbc");
  403. }
  404. if (st->disposition & AV_DISPOSITION_DEFAULT)
  405. av_log(NULL, AV_LOG_INFO, " (default)");
  406. if (st->disposition & AV_DISPOSITION_DUB)
  407. av_log(NULL, AV_LOG_INFO, " (dub)");
  408. if (st->disposition & AV_DISPOSITION_ORIGINAL)
  409. av_log(NULL, AV_LOG_INFO, " (original)");
  410. if (st->disposition & AV_DISPOSITION_COMMENT)
  411. av_log(NULL, AV_LOG_INFO, " (comment)");
  412. if (st->disposition & AV_DISPOSITION_LYRICS)
  413. av_log(NULL, AV_LOG_INFO, " (lyrics)");
  414. if (st->disposition & AV_DISPOSITION_KARAOKE)
  415. av_log(NULL, AV_LOG_INFO, " (karaoke)");
  416. if (st->disposition & AV_DISPOSITION_FORCED)
  417. av_log(NULL, AV_LOG_INFO, " (forced)");
  418. if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
  419. av_log(NULL, AV_LOG_INFO, " (hearing impaired)");
  420. if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
  421. av_log(NULL, AV_LOG_INFO, " (visual impaired)");
  422. if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
  423. av_log(NULL, AV_LOG_INFO, " (clean effects)");
  424. av_log(NULL, AV_LOG_INFO, "\n");
  425. dump_metadata(NULL, st->metadata, " ");
  426. dump_sidedata(NULL, st, " ");
  427. }
  428. void av_dump_format(AVFormatContext *ic, int index,
  429. const char *url, int is_output)
  430. {
  431. int i;
  432. uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL;
  433. if (ic->nb_streams && !printed)
  434. return;
  435. av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
  436. is_output ? "Output" : "Input",
  437. index,
  438. is_output ? ic->oformat->name : ic->iformat->name,
  439. is_output ? "to" : "from", url);
  440. dump_metadata(NULL, ic->metadata, " ");
  441. if (!is_output) {
  442. av_log(NULL, AV_LOG_INFO, " Duration: ");
  443. if (ic->duration != AV_NOPTS_VALUE) {
  444. int hours, mins, secs, us;
  445. int64_t duration = ic->duration + 5000;
  446. secs = duration / AV_TIME_BASE;
  447. us = duration % AV_TIME_BASE;
  448. mins = secs / 60;
  449. secs %= 60;
  450. hours = mins / 60;
  451. mins %= 60;
  452. av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%02d", hours, mins, secs,
  453. (100 * us) / AV_TIME_BASE);
  454. } else {
  455. av_log(NULL, AV_LOG_INFO, "N/A");
  456. }
  457. if (ic->start_time != AV_NOPTS_VALUE) {
  458. int secs, us;
  459. av_log(NULL, AV_LOG_INFO, ", start: ");
  460. secs = ic->start_time / AV_TIME_BASE;
  461. us = abs(ic->start_time % AV_TIME_BASE);
  462. av_log(NULL, AV_LOG_INFO, "%d.%06d",
  463. secs, (int) av_rescale(us, 1000000, AV_TIME_BASE));
  464. }
  465. av_log(NULL, AV_LOG_INFO, ", bitrate: ");
  466. if (ic->bit_rate)
  467. av_log(NULL, AV_LOG_INFO, "%d kb/s", ic->bit_rate / 1000);
  468. else
  469. av_log(NULL, AV_LOG_INFO, "N/A");
  470. av_log(NULL, AV_LOG_INFO, "\n");
  471. }
  472. for (i = 0; i < ic->nb_chapters; i++) {
  473. AVChapter *ch = ic->chapters[i];
  474. av_log(NULL, AV_LOG_INFO, " Chapter #%d:%d: ", index, i);
  475. av_log(NULL, AV_LOG_INFO,
  476. "start %f, ", ch->start * av_q2d(ch->time_base));
  477. av_log(NULL, AV_LOG_INFO,
  478. "end %f\n", ch->end * av_q2d(ch->time_base));
  479. dump_metadata(NULL, ch->metadata, " ");
  480. }
  481. if (ic->nb_programs) {
  482. int j, k, total = 0;
  483. for (j = 0; j < ic->nb_programs; j++) {
  484. AVDictionaryEntry *name = av_dict_get(ic->programs[j]->metadata,
  485. "name", NULL, 0);
  486. av_log(NULL, AV_LOG_INFO, " Program %d %s\n", ic->programs[j]->id,
  487. name ? name->value : "");
  488. dump_metadata(NULL, ic->programs[j]->metadata, " ");
  489. for (k = 0; k < ic->programs[j]->nb_stream_indexes; k++) {
  490. dump_stream_format(ic, ic->programs[j]->stream_index[k],
  491. index, is_output);
  492. printed[ic->programs[j]->stream_index[k]] = 1;
  493. }
  494. total += ic->programs[j]->nb_stream_indexes;
  495. }
  496. if (total < ic->nb_streams)
  497. av_log(NULL, AV_LOG_INFO, " No Program\n");
  498. }
  499. for (i = 0; i < ic->nb_streams; i++)
  500. if (!printed[i])
  501. dump_stream_format(ic, i, index, is_output);
  502. av_free(printed);
  503. }