Created
November 6, 2015 08:16
-
-
Save SergXIIIth/075c2946cdf68b8717af to your computer and use it in GitHub Desktop.
Take metadata from video
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc src/decoder.c -lavcodec -lavformat | |
#include <libavcodec/avcodec.h> | |
#include <libavformat/avformat.h> | |
int main(int argc, char *argv[]) { | |
char *filename = "/home/msa/Videos/Cowspiracy.2014.1080p-EGN.mkv"; | |
av_register_all(); | |
AVFormatContext *pFormatCtx = NULL; | |
int error; | |
if (error = avformat_open_input(&pFormatCtx, filename, NULL, NULL) < 0) { | |
printf("Could not open input file '%s' (error '%i')\n", filename, error); | |
return error; | |
} | |
if ((error = avformat_find_stream_info(pFormatCtx, NULL)) < 0) { | |
fprintf(stderr, "Could not open find stream info (error '%i')\n", error); | |
avformat_close_input(&pFormatCtx); | |
return error; | |
} | |
av_dump_format(pFormatCtx, 0, filename, 0); | |
printf("Done"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment