[FFmpeg-trac] #2190(avformat:open): yuv4mpegpipe does not preserve interlaced settings

FFmpeg trac at avcodec.org
Sat Jan 26 19:55:55 CET 2013


#2190: yuv4mpegpipe does not preserve interlaced settings
------------------------------------+------------------------------------
             Reporter:  ulatekh     |                    Owner:
                 Type:  defect      |                   Status:  open
             Priority:  normal      |                Component:  avformat
              Version:  git-master  |               Resolution:
             Keywords:  yuv4mpeg    |               Blocked By:
             Blocking:              |  Reproduced by developer:  1
Analyzed by developer:  0           |
------------------------------------+------------------------------------

Comment (by ulatekh):

 Your command lines work for me too.  Thanks!
 Perhaps ffmpeg should error out if one tries to put unsupported types of
 raw video into a .mov container.

 Now, to backport this to 0.10.6!  Your changes integrated in just fine,
 but I can't seem to find a pixel format that'll work with a .mov container
 and the rawvideo codec.  I just get "[mov @ 0x96b1530] Tag
 RGB[24]/0x18424752 incompatible with output codec id '14'", as in:


 {{{
 ffmpeg version 0.10.6 Copyright (c) 2000-2012 the FFmpeg developers
   built on Jan 26 2013 08:47:56 with gcc 4.7.2 20120921 (Red Hat 4.7.2-2)
   configuration: --prefix=/usr --bindir=/usr/bin
 --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib
 --mandir=/usr/share/man --arch=athlon --extra-cflags='-O2 -g -pipe -Wall
 -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-
 size=4 -m32 -march=athlon -fasynchronous-unwind-tables' --enable-bzlib
 --disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio
 --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-
 libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-
 libopenjpeg --enable-libpulse --enable-librtmp --enable-libschroedinger
 --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2
 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
 --enable-avfilter --enable-postproc --enable-pthreads --disable-static
 --enable-shared --enable-gpl --disable-debug --disable-stripping
 --shlibdir=/usr/lib --cpu=athlon --enable-runtime-cpudetect
   libavutil      51. 35.100 / 51. 35.100
   libavcodec     53. 61.100 / 53. 61.100
   libavformat    53. 32.100 / 53. 32.100
   libavdevice    53.  4.100 / 53.  4.100
   libavfilter     2. 61.100 /  2. 61.100
   libswscale      2.  1.100 /  2.  1.100
   libswresample   0.  6.100 /  0.  6.100
   libpostproc    52.  0.100 / 52.  0.100
 [yuv4mpegpipe @ 0x879f110] Estimating duration from bitrate, this may be
 inaccurate
 Input #0, yuv4mpegpipe, from 'clip.yuv':
   Duration: N/A, bitrate: N/A
     Stream #0:0: Video: rawvideo (Y41B / 0x42313459), yuv411p, 720x480,
 SAR 10:11 DAR 15:11, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
 [buffer @ 0x87a50a0] w:720 h:480 pixfmt:yuv411p tb:1/1000000 sar:10/11
 sws_param:
 [buffersink @ 0x87a6670] auto-inserting filter 'auto-inserted scale 0'
 between the filter 'src' and the filter 'out'
 [scale @ 0x87a6ad0] w:720 h:480 fmt:yuv411p -> w:720 h:480 fmt:rgb24
 flags:0x4
 [mov @ 0x87a5530] no pixel formats
 [mov @ 0x87a5530] Tag RGB[24]/0x18424752 incompatible with output codec id
 '14'
 Output #0, mov, to 'clip.mov':
     Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 720x480
 [SAR 10:11 DAR 15:11], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo -> rawvideo)
 Could not write header for output file #0 (incorrect codec parameters ?)
 }}}


 I tried to patch the source code to print the available pixel formats,
 like so:


 {{{
 --- ffmpeg-0.10.6/libavformat/utils.c   2012-10-25 14:21:52.000000000
 -0700
 +++ ffmpeg-0.10.6-sb/libavformat/utils.c        2013-01-26
 11:48:06.581453848 -0700
 @@ -31,6 +31,7 @@
  #include "libavutil/opt.h"
  #include "libavutil/dict.h"
  #include "libavutil/pixdesc.h"
 +#include "libavutil/pixfmt.h"
  #include "metadata.h"
  #include "id3v2.h"
  #include "libavutil/avassert.h"
 @@ -3165,6 +3166,18 @@
                      av_get_bits_per_sample(st->codec->codec_id) >> 3;
              break;
          case AVMEDIA_TYPE_VIDEO:
 +               {
 +                       const enum PixelFormat *pix_fmts =
 st->codec->codec->pix_fmts;
 +                       if (!pix_fmts)
 +                               av_log (s, AV_LOG_WARNING, "no pixel
 formats\n");
 +                       else
 +                       {
 +                               while ((*pix_fmts) != -1)
 +                               {
 +                                       av_log (s, AV_LOG_WARNING, "pixel
 format supported: %s\n", av_get_pix_fmt_name (*pix_fmts));
 +                                       ++pix_fmts;
 +                               }
 +                       }
              if(st->codec->time_base.num<=0 ||
 st->codec->time_base.den<=0){ //FIXME audio too?
                  av_log(s, AV_LOG_ERROR, "time base not set\n");
                  ret = AVERROR(EINVAL);
 @@ -3183,6 +3196,7 @@
                  goto fail;
              }
              break;
 +               }
          }

          if(s->oformat->codec_tag){

 }}}

 But all I get is "[mov @ 0x87a5530] no pixel formats"; see the dump of the
 command-output above.

 I hope that trying to get this backported to 0.10.6 isn't too much to
 ask...there are a LOT of dependencies on ffmpeg on my machine, and
 recompiling all of them to work with latest ffmpeg is going to take
 F*O*R*E*V*E*R...I hope you can sympathize with that.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2190#comment:5>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list