
Ret = av_frame_get_buffer(converted_frame, 0) Stream->codecpar->format = AV_PIX_FMT_YUV420P ĪVCodecContext* codec_ctx = avcodec_alloc_context3(codec) Ĭodec_ctx->time_base = stream->time_base Ĭodec_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER Ĭonverted_frame->width = codec_ctx->width Ĭonverted_frame->height = codec_ctx->height Stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO If (ret codecpar->codec_id = AV_CODEC_ID_H264 If (ret pb, output_filename.c_str(), AVIO_FLAG_WRITE) Int ret = avformat_alloc_output_context2(&format_ctx, nullptr, nullptr, output_filename.c_str())

This is the function I used to saved the video: void SaveVideo(std::string& output_filename, std::vector video)

I went through it with a debugger and everything seemed to work fine. The code runs without errors but both when I try to open the saved video file with the windows media and adobe Media Encoded they it says that it is in an unsupported format. I am trying to encode a vector of AVFrames to an MP4 file using the h264 codec.
