On Wed, 7 May 2014 00:37:41 +0200, Alessandro Ghedini <[email protected]>
wrote:
> Hi,
>
> I've been working on merging the GIF encoder from ffmpeg, since libav's
> doesn't
> seem to work very well (in my tests anyway), and my initial approach has been
> to
> simply copy/paste lavc/gif.{c,h} and lavf/gif.c, make them compile and see how
> it goes (I'm using libav.git).
>
> While I've been able to compile the whole thing (with a little bit of work,
> due
> to missing av_copy_packet() and ff_alloc_packet2()), I'm still having problems
> apparently related to pixel formats.
>
> Basically, when I'm using ffmpeg (ffmpeg -i test.mkv test.ffmpeg.gif) it
> selects
> "bgr8" and everything goes fine.
>
I think using av_packet_ref() really should work, there seems to be no reason to
copy it. Can you post the code that fails somewhere?
> > Output #0, gif, to 'test.ffmpeg.gif':
> > Stream #0:0: Video: gif, bgr8, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31,
> > 200 kb/s, 100 tbn, 30 tbc
>
> but when I use avconv, it selects "gray" (which is not what I want):
>
> > Output #0, gif, to 'test.libav.gif':
> > Stream #0.0: Video: gif, gray, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31,
> > 200 kb/s, 100 tbn, 1k tbc
>
> and if I use "-pix_fmt bgr8" the output image is broken.
>
> Compare [0] generated with ffmpeg, and [1] genenerated with "improved" avconv.
>
> I've also tried copying lavu/pixdesc.{c,h} too, but nothing changed, and it
> happens with all the other input files I've tried, so it shouldn't be specific
> to the input file used.
>
> Does anyone have an idea of what may be causing this? (e.g. if there's a
> special
> avconv option I have to use, or if it is a bug in the gif encoder or in other
> parts of libav).
>
> If you want to test this I've setup a fork of libav.git at [2] with my WIP
> patches (they still need to be split in proper commits) in the "gif" branch.
>
Seems vf_format behaves in a rather insane way, which results in this weird
autoselection. Explicitly using -pix_fmt should work though, don't know yet
where the problem is with that. Maybe somewhere in sws. Will try to look into
this more closely.
--
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel