#include <iostream>
extern "C" {
#include <libavformat/avformat.h>
}
#include <string>

int main() {
    std::cout << "Hello, World!" << std::endl;
    AVFormatContext *pFormatContext = avformat_alloc_context();
    std::string path ="/Users/gengen/Downloads/material-design/m1.mp4";
    if(avformat_open_input(&pFormatContext, path.data(), NULL, NULL) != 0) {
        std::cout << "open error" << std::endl;
        return -1; // Couldn't open file
    }

    if (avformat_find_stream_info(pFormatContext, NULL) < 0) {
        return -1; // Couldn't find stream information
    }

    av_dump_format(pFormatContext, 0, path.data(), 0);

//    avformat_close_input(&pFormatContext);
    return 0;
}
