ffmpeg-hello/hello.c
2014-12-08 16:57:44 -05:00

32 lines
664 B
C

#include <stdio.h>
#include <libavformat/avformat.h>
int main(int argc, char * argv[])
{
if (argc < 2)
{
fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
return 1;
}
AVFormatContext * context = NULL;
av_register_all();
if (avformat_open_input(&context, argv[1], NULL, NULL) != 0)
{
fprintf(stderr, "Error opening input stream %s\n", argv[1]);
return 1;
}
if (avformat_find_stream_info(context, NULL) < 0)
{
fprintf(stderr, "Error finding stream info\n");
return 1;
}
av_dump_format(context, 0, argv[1], 0);
avformat_close_input(&context);
return 0;
}