

OutStream->avg_frame_rate= av_inv_q(OutStream->time_base) OutStream->time_base = ID.CodecContext->time_base ID.CodecContext->flags |= AV_CODEC_FLAG_GLOBAL_HEADER

If( Result oformat->flags & AVFMT_GLOBALHEADER ) Result = avcodec_open2( ID.CodecContext, Encoder, nullptr ) ID.CodecContext->pix_fmt = ID.PixelFormat ID.CodecContext->pix_fmt = Encoder->pix_fmts ID.CodecContext->time_base = av_inv_q(ID.Framerate) ID.CodecContext->sample_aspect_ratio = ID.AspectRatio Result = avcodec_parameters_to_context( ID.CodecContext, CodecParams ) If( Result time_base = av_inv_q(ID.Framerate) ĪVCodecParameters* CodecParams = OutStream->codecpar ĬodecParams->format = AV_PIX_FMT_YUV420P ĬodecParams->codec_type = AVMEDIA_TYPE_VIDEO ĬodecParams->profile = FF_PROFILE_H264_MAIN Int Result = avformat_alloc_output_context2( &ID.FormatContext, nullptr, nullptr, ID.Path.c_str() ) ID.PixelFormat = IsBGR ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_RGB24 ĬameraStreamError OutputStream::Initialize()Īv_log_set_callback( &InputStream::LogCallback ) OutputStream::OutputStream( const std::string& Path, unsigned int Width, unsigned int Height, int Framerate, bool IsBGR ) Neither of them give a video duration.ĭoes anyone have any ideas what's happening here? I assume my solution is close to working as I'm getting a good chunk of valid frames coming through. The second method's file displays a single black frame then hides the video output. VLC cannot play files from either method. Nan M-V: nan fd= 1 aq= 0KB vq= 0KB sq= 0B f=0/0 concealing 102 DC, 102 AC, 102 MV errors in I frame error while decoding MB 31 22, bytestream -65 Stream #0:0: Video: h264 (Main), yuv420p(progressive), 672x380, 25 fps, 25 tbr, 1200k tbn, 50 tbcįfplay can mostly play this file until it gets towards the end, when it outputs: Input #0, h264, from 'X:\Diagnostics.mp4': 0KB sq= 0B f=0/0 If I instead swap it out for a call to avio_write, ffprobe instead outputs: Input #0, h264, from 'X:\Diagnostics.mp4': X:\Diagnostics.mp4: Invalid data found when processing inputįfplay is unable to play the file generated using this method. If I use av_interleaved_write_frame to write the encoded packets to the output then ffprobe outputs the following: moov atom not found0
MOOV ATOM NOT FOUND FFMPEG PATCH
I've been struggling to find a good example for this as the examples still seem to be using deprecated functions, so I've attempted to patch this using the documentation in the headers and by referring to a few github repos that seem to be using the new version. I am attempting to put together a class that can take arbitrary frames and construct a video from it using the ffmpeg 3.3.3 API.
