[FFmpeg-devel] Conversion problem for indeo3 workaround
Diego Bravo Estrada
diegobravoestrada
Sat Jan 31 16:20:28 CET 2009
Hello all,
I was having problems converting an INDEO3 video to FLV (or whatever), getting the following message:
swScaler: Unknown format is not supported as input pixel format
Cannot get resampling context
configuration: --prefix=/home/apache --enable-shared
--enable-libmp3lame --enable-libfaad --enable-libfaac
--enable-libvorbis --enable-gpl --enable-swscale
--extra-cflags=-I/home/apache/include --extra-ldflags=-L/home/apache/lib
I'm not sure if this configuration is right. Other videos got converted without problems.
As a workaround I added a little modification ffmpeg.c:
$ svn diff
Index: ffmpeg.c
===================================================================
--- ffmpeg.c (revision 16905)
+++ ffmpeg.c (working copy)
@@ -2864,6 +2864,14 @@
set_context_opts(enc, avctx_opts[CODEC_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM);
frame_height = enc->height;
frame_width = enc->width;
+ {
+ AVCodec *cdc = avcodec_find_decoder(enc->codec_id);
+ if(cdc != NULL && cdc->name != NULL &&
+ strcmp(cdc->name,"indeo3") == 0) {
+ fprintf(stderr, "Forcing PIX_FMT_YUV410P for indeo3\n");
+ enc->pix_fmt = PIX_FMT_YUV410P;
+ }
+ }
if(ic->streams[i]->sample_aspect_ratio.num)
frame_aspect_ratio=av_q2d(ic->streams[i]->sample_aspect_ratio);
else
This is working now, but I'm pretty sure this is not the correct way to do this work. I suspect that the init routine from indeo3.c is not being called in advance, so the "pix_fmt" is not being set for the swscale working.
BTW, compiling without --enable-swscale just produced a green video output. I'm not sure if I should use swscale at all.
Modified Output:
$ ffmpeg -y -i /tmp/camion.avi o.flv
FFmpeg version SVN-r16884, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/home/apache --enable-shared --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-libvorbis --enable-gpl --enable-swscale --extra-cflags=-I/home/apache/include --extra-ldflags=-L/home/apache/lib
libavutil 49.14. 0 / 49.14. 0
libavcodec 52.11. 0 / 52.11. 0
libavformat 52.25. 0 / 52.25. 0
libavdevice 52. 1. 0 / 52. 1. 0
libswscale 0. 6. 1 / 0. 6. 1
built on Jan 31 2009 01:28:28, gcc: 4.3.2
avcodec_find_decoder: indeo3
Forcing PIX_FMT_YUV410P for indeo3
Input #0, avi, from '/tmp/camion.avi':
Duration: 00:04:40.96, start: 0.000000, bitrate: 4259 kb/s
Stream #0.0: Video: indeo3, yuv410p, 480x360, 25.00 tb(r)
Stream #0.1: Audio: pcm_u8, 11025 Hz, mono, s16, 88 kb/s
Output #0, flv, to 'o.flv':
Stream #0.0: Video: flv, yuv420p, 480x360, q=2-31, 200 kb/s, 25.00 tb(c)
Stream #0.1: Audio: libmp3lame, 11025 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 7024 fps=256 q=31.0 Lsize= 9508kB time=280.96 bitrate= 277.2kbits/s
video:7118kB audio:2196kB global headers:0kB muxing overhead 2.083804%
Original Output:
Input #0, avi, from '/tmp/camion.avi':
Duration: 00:04:40.96, start: 0.000000, bitrate: 4259 kb/s
Stream #0.0: Video: indeo3, 480x360, 25.00 tb(r)
Stream #0.1: Audio: pcm_u8, 11025 Hz, mono, s16, 88 kb/s
swScaler: Unknown format is not supported as input pixel format
Cannot get resampling contextThis also seems to be related to:
http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2008-May/015615.html
regards,
Diego
_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live
http://clk.atdmt.com/MRT/go/119462413/direct/01/
More information about the ffmpeg-devel
mailing list