AVFormatContext *format_ctx = nullptr;
if (avformat_open_input(&format_ctx, filename.c_str(), nullptr, nullptr) != 0) {
fprintf(stderr, "%s: Error opening file\n", filename.c_str());
AVFormatContext *format_ctx = nullptr;
if (avformat_open_input(&format_ctx, filename.c_str(), nullptr, nullptr) != 0) {
fprintf(stderr, "%s: Error opening file\n", filename.c_str());