38 printf(
"%s: pts:%s pts_time:%s dts:%s dts_time:%s duration:%s duration_time:%s stream_index:%d\n",
46 int main(
int argc,
char **argv)
51 const char *in_filename, *out_filename;
55 printf(
"usage: %s input output\n"
56 "API example program to remux a media file with libavformat and libavcodec.\n"
57 "The output format is guessed according to the file extension.\n"
62 in_filename = argv[1];
63 out_filename = argv[2];
68 fprintf(stderr,
"Could not open input file '%s'", in_filename);
73 fprintf(stderr,
"Failed to retrieve input stream information");
81 fprintf(stderr,
"Could not create output context\n");
86 ofmt = ofmt_ctx->oformat;
92 fprintf(stderr,
"Failed allocating output stream\n");
99 fprintf(stderr,
"Failed to copy context from input to output stream codec context\n");
111 fprintf(stderr,
"Could not open output file '%s'", out_filename);
118 fprintf(stderr,
"Error occurred when opening output file\n");
143 fprintf(stderr,
"Error muxing packet\n");
160 fprintf(stderr,
"Error occurred: %s\n",
av_err2str(ret));