[FFmpeg-trac] #5838(undetermined:new): avcodec_open2 doesn't open raw video codec unles parameters in context are set
FFmpeg
trac at avcodec.org
Sat Sep 10 12:39:52 EEST 2016
#5838: avcodec_open2 doesn't open raw video codec unles parameters in context are
set
-------------------------------------+-------------------------------------
Reporter: veroorzaker | Type:
Status: new | enhancement
Component: | Priority: normal
undetermined | Version: git-
Keywords: | master
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
Summary of the bug:
most examples, including the one for av_codec_open2 itself and also a
bunch of decoding samples like decoding_encoding.c, go like this:
{{{
codec = avcodec_find_decoder(stream->codecpar->id);
context = avcodec_alloc_context3(codec);
avcodec_open2(context, codec, opts);
}}}
However for raw video with AV_CODEC_ID_RAWVIDEO avcodec_open2 fails with
error -22. It does succeed however when copying the codec parameters using
for instance avcodec_parameters_to_context(context, stream->codecpar).
I'm using latest master branch and raw video created using a bunch of
64x64 bmp files:
{{{
ffmpeg -i '%d.bmp' -v:c rawvideo o.avi
}}}
Codecs like x264 do not have this problem. I think it would be nice to
have this clearly mentioned in the documentation somewhere, or else have
avcodec_alloc_context3 set the needed fields
(width/height/extradata/extradata_size).
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5838>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list