FFmpeg-tutorial-samples
FFmpeg-tutorial-samples copied to clipboard
missing pointer inistialisation
I think the avformatcontextpointer should be initialisez with avformat_alloc_context or declaring a simple int will create a segfault (i don't know exactly why)
I also noticed the same. I am using ffmpeg 2.0 build from source.
http://ffmpeg.org/doxygen/trunk/group__lavf__core.html#gac7a91abf2f59648d995894711f070f62 - says that ".. avformat_alloc_context() can be used to free the context and everything allocated by the framework within it.."
Edit: A gdb trace shows that the SIGSEGV signal came from here : avformat_open_input(...) calls avformat_alloc_context() at line 469 in libavformat/utils.c (see the code here - https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/utils.c#L469 )
if (!s && !(s = avformat_alloc_context())) return AVERROR(ENOMEM);
In the case when AVFormatContext is neither initialized nor assigned to NULL, "s" gets assigned to some random address location and hence it passes the above check.
And it is used in the next line as below - and hence causes SIGSEGV
if (!s->av_class){ ... }
Hi guys, Have anyone know about convert file using ffmpeg? I need you guys help to convert video file with custom profile level, profile type ( maybe it means transcoding )
Thanks.