68 fprintf(stderr,
"Error decoding video frame\n");
73 printf(
"video_frame%s n:%d coded_n:%d pts:%s\n",
74 cached ?
"(cached)" :
"",
91 fprintf(stderr,
"Error decoding audio frame\n");
96 printf(
"audio_frame%s n:%d nb_samples:%d pts:%s\n",
97 cached ?
"(cached)" :
"",
104 fprintf(stderr,
"Could not allocate audio buffer\n");
137 fprintf(stderr,
"Could not find %s stream in input file '%s'\n",
142 st = fmt_ctx->
streams[*stream_idx];
148 fprintf(stderr,
"Failed to find %s codec\n",
154 fprintf(stderr,
"Failed to open %s codec\n",
167 struct sample_fmt_entry {
169 } sample_fmt_entries[] = {
179 struct sample_fmt_entry *entry = &sample_fmt_entries[i];
180 if (sample_fmt == entry->sample_fmt) {
181 *fmt =
AV_NE(entry->fmt_be, entry->fmt_le);
187 "sample format %s is not supported as output format\n",
192 int main (
int argc,
char **argv)
194 int ret = 0, got_frame;
197 fprintf(stderr,
"usage: %s input_file video_output_file audio_output_file\n"
198 "API example program to show how to read frames from an input file.\n"
199 "This program reads frames from a file, decodes them, and writes decoded\n"
200 "video frames to a rawvideo file named video_output_file, and decoded\n"
201 "audio frames to a rawaudio file named audio_output_file.\n"
214 fprintf(stderr,
"Could not open source file %s\n",
src_filename);
220 fprintf(stderr,
"Could not find stream information\n");
226 video_dec_ctx = video_stream->
codec;
240 fprintf(stderr,
"Could not allocate raw video buffer\n");
262 fprintf(stderr,
"Could not allocate audio data buffers\n");
272 fprintf(stderr,
"Could not find audio or video stream in the input, aborting\n");
279 fprintf(stderr,
"Could not allocate frame\n");
307 printf(
"Demuxing succeeded.\n");
310 printf(
"Play the output video file with the command:\n"
311 "ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n",
321 printf(
"Play the output audio file with the command:\n"
322 "ffplay -f %s -ac %d -ar %d %s\n",