[Libav-user] ffmpeg @ 2.0.X has a bogus FFV1 codec?

André Anjos andre.dos.anjos at gmail.com
Fri Oct 25 09:35:27 CEST 2013


After some more investigation and a good debugging session, it seems the
problem comes from the initialisation of the AVFrame rather than the
AVCodecContext (as one may misunderstand from the thread).

To fix the example code, one has to insert 3 lines of code *just after* the
"frame = avcodec_alloc_frame()" call inside "open_video()":

/* new code to make FFV1 codec work well - does not
disturb other codecs, so you can leave it there */
frame->format = c->pix_fmt;
frame->width = c->width;
frame->height = c->height;

If you do this, then the example muxing application will work again.

Could anyone fix the example code in ffmpeg so it reflects these
modifications?

Best, André


On Tue, Oct 22, 2013 at 3:42 PM, André Anjos <andre.dos.anjos at gmail.com>wrote:

> Another question:
>
> From my investigations, the program aborts at a failed attempt to encode a
> new frame (using avcodec_encode_video2()). If the problem is on the
> initialisation, how can I check the codec is ready before attempting an
> encode?
>
> Thanks, André
>
>
> On Tue, Oct 22, 2013 at 2:49 PM, André Anjos <andre.dos.anjos at gmail.com>wrote:
>
>> Thanks for this reply. Could you please share a fix for the program that
>> makes it work?
>>
>> André
>>
>>
>> On Tue, Oct 22, 2013 at 10:29 AM, Paul B Mahol <onemda at gmail.com> wrote:
>>
>>> On 10/22/13, Andre Anjos <andre.dos.anjos at gmail.com> wrote:
>>> > Hello,
>>> >
>>> > I'm using a MacPorts build of ffmpeg 2.0.2. It passes most of our
>>> tests,
>>> > except the one using the FFV1 codec. This seems independent of the file
>>> > format chosen.
>>> >
>>> > How to reproduce the problem:
>>> >
>>> > 1) Download the muxing example from the ffmpeg doxygen documentation (
>>> > http://ffmpeg.org/doxygen/2.0/doc_2examples_2muxing_8c-example.html)
>>> >
>>> > 2) By the end of the application, replace the code:
>>> >
>>> > if (fmt->video_codec != AV_CODEC_ID_NONE) {
>>> > video_st = add_stream(oc, &video_codec, fmt->video_codec);
>>> > }
>>> >
>>> > With:
>>> >
>>> > video_st = add_stream(oc, &video_codec, AV_CODEC_ID_FFV1)
>>> >
>>> > So, that the FFV1 codec is forced.
>>> >
>>> > 3) Compile the program (on OSX, that would be):
>>> >
>>> > clang -I/opt/local/include test.c -L/opt/local/lib -lavutil
>>> > -lavcodec -lavformat -lswscale -lswresample -o ffmpeg_test
>>> >
>>> > 4) Run the program:
>>> >
>>> > ./ffmpeg_test foo.avi
>>> >
>>> > to get:
>>> >
>>> > [libmp3lame @ 0x7fa7d201f200] Channel layout not specified
>>> >  Output #0, avi, to 'test.avi':
>>> >      Stream #0:0: Video: ffv1, yuv420p, 352x288, q=2-31, 400 kb/s, 90k
>>> tbn,
>>> >  25 tbc
>>> >      Stream #0:1: Audio: mp3 (libmp3lame), 44100 Hz, 2 channels, fltp,
>>> 64
>>> >  kb/s
>>> >  Error encoding video frame: Invalid argument
>>> >
>>> > Result: Bogus file, with error
>>> >
>>> > Expected result: clean file with no errors.
>>> >
>>> > Can anyone confirm this or provide some light on what I could possibly
>>> be
>>> > doing wrong? A developer from MacPorts has confirmed the problem - it
>>> does
>>> > not happen on 1.2.x. It does happen with 2.0.1 and 2.0.2 (
>>> > https://trac.macports.org/ticket/40829).
>>> >
>>> > Thanks in advance, A
>>>
>>> FFmpeg 2.0.X does not have bogus FFV1 codec.
>>>
>>> The examples code is of very low quality.
>>>
>>> FFV1 encoder have been changed in its initialization to abort when
>>> width/height is not set.
>>> _______________________________________________
>>> Libav-user mailing list
>>> Libav-user at ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/libav-user
>>>
>>
>>
>>
>> --
>> André Anjos
>> http://andreanjos.org
>>
>
>
>
> --
> André Anjos
> http://andreanjos.org
>



-- 
André Anjos
http://andreanjos.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131025/7ce7ae72/attachment.html>


More information about the Libav-user mailing list