//
// Created by 崔华根 on 2024/6/14.
//
#include <iostream>
extern "C" {
#include <libavformat/avformat.h>
}
#include <string>

#include <cstdlib>

int main() {
    std::string filename = "video";
    std::string inputPath ="/Users/gengen/Downloads/material-design/"+filename+".mp4";
    std::string outputPath_hvc ="/Users/gengen/Downloads/material-design/out/"+filename+"_hvc_out.mp4";
    std::string outputPath_hevc ="/Users/gengen/Downloads/material-design/out/"+filename+"_hevc_out.mp4";


    std::string ffmpeg_hvc_cmd = "ffmpeg -i "+inputPath+" -vf \"fps=30\" -g 30  -c:v libx264 -c:a copy -y "+outputPath_hvc;
    int result1 = std::system(ffmpeg_hvc_cmd.data());
    if (result1 != 0) {
        // 处理错误
    }
    std::string ffmpeg_hevc_cmd = "ffmpeg -i "+inputPath+" -vf \"fps=30\" -g 30 -c:v libx265 -c:a copy -y "+outputPath_hevc;
    int result2 = std::system(ffmpeg_hevc_cmd.data());
    if (result2 != 0) {
        // 处理错误
    }



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