*
* Show how to use the libavformat and libavcodec API to demux and
* decode audio and video data.
+ * @example doc/examples/demuxing.c
*/
#include <libavutil/imgutils.h>
video_dst_bufsize = ret;
}
- /* dump input information to stderr */
- av_dump_format(fmt_ctx, 0, src_filename, 0);
-
if (open_codec_context(&audio_stream_idx, fmt_ctx, AVMEDIA_TYPE_AUDIO) >= 0) {
int nb_planes;
}
}
+ /* dump input information to stderr */
+ av_dump_format(fmt_ctx, 0, src_filename, 0);
+
if (!audio_stream && !video_stream) {
fprintf(stderr, "Could not find audio or video stream in the input, aborting\n");
ret = 1;
if (video_stream)
printf("Demuxing video from file '%s' into '%s'\n", src_filename, video_dst_filename);
if (audio_stream)
- printf("Demuxing video from file '%s' into '%s'\n", src_filename, audio_dst_filename);
+ printf("Demuxing audio from file '%s' into '%s'\n", src_filename, audio_dst_filename);
/* read frames from the file */
while (av_read_frame(fmt_ctx, &pkt) >= 0)