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.

567 lines
19KB

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