[Ffmpeg-devel] [PATCH] Convert ffmpeg.c to use the swscaleinterface
Wed Aug 2 09:53:49 CEST 2006
On Tue, 2006-08-01 at 23:44 +0200, Michael Niedermayer wrote:
> > So, I think the patch does not introduce any obvious regression... Is it
> > ok for commit?
> do the regression tests pass? if so ive no objections to the patch ...
Opsss... There's a failure in "make libavtest":
--- ./data/libav.regression 2006-08-02 08:14:52.867521352 +0200
+++ /tmp/ffmpeg/tests/libav.regression.ref 2006-08-02 07:36:00.492096312 +0200
@@ -40,7 +40,7 @@
Regression test: Error.
make: *** [libavtest] Error 1
This is happening because libavformat/gif.c is setting the codec pixel
format in gif_write_header(). I do not know if this is valid (in fact,
there is a "XXX: is it allowed ? seems to work so far..." comment in the
code). And since the swscale context is created before writing the
header, the YUV420P ---> RGB24 conversion is lost.
Now, I can see some possible fixes:
1) Deciding the setting the codec pixel format in the format
write_header() function is not allowed. In this case, the pixel format
will have to be set by the user, and gif_write_header() will simply
check pix_fmt == PIX_FMT_RGB24, failing if false (this is what
libavformat/yuv4mpeg.c is doing)
2) Setting the pixel format to PIX_FMT_RGB24 somewhere before
3) modify ffmpeg.c to allocate the sws context after having called
4) repeat the check on enc->pix_fmt every time that we encode a frame,
as ffmpeg.c is currently doing (dynamically allocating a new sws context
5) maybe some other solution that I am not seeing now...
Which one do you prefer?
Copy this in your signature, if you think it is important:
N O W A R ! ! !
More information about the ffmpeg-devel