[FFmpeg-trac] #165(undetermined:new): QT Cinepak - plays in negative

FFmpeg trac at avcodec.org
Sun May 8 12:18:55 CEST 2011


#165: QT Cinepak - plays in negative
--------------------------+--------------------------
 Reporter:  ami_stuff     |        Type:  defect
   Status:  new           |    Priority:  normal
Component:  undetermined  |     Version:  unspecified
 Keywords:                |  Blocked By:
 Blocking:                |  Reproduced:  0
 Analyzed:  0             |
--------------------------+--------------------------
 Issue 1067

 {{{
 Author: ami_stuff       Date: 2009-05-09.23:48:26

 Attached video plays in negative.

 The video plays correctly with "VLC media player" and "Media Player
 Classic".

 --------


 C:\>ffmpeg -i play_in_negative.mov
 FFmpeg version SVN-r18709, Copyright (c) 2000-2009 Fabrice Bellard, et al.
   configuration: --enable-memalign-hack --prefix=/mingw --cross-
 prefix=i686-ming
 w32- --cc=ccache-i686-mingw32-gcc --target-os=mingw32 --arch=i686
 --cpu=i686 --e
 nable-avisynth --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm
 --enabl
 e-libfaac --enable-libfaad --enable-pthreads --enable-libvorbis --enable-
 libtheo
 ra --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-
 libxvid -
 -enable-libschroedinger --enable-libx264
   libavutil     50. 3. 0 / 50. 3. 0
   libavcodec    52.27. 0 / 52.27. 0
   libavformat   52.32. 0 / 52.32. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libswscale     0. 7. 1 /  0. 7. 1
   built on Apr 28 2009 04:04:42, gcc: 4.2.4

 Seems stream 1 codec frame rate differs from container frame rate:
 1000000.00 (1
 000000/1) -> 24.00 (1000000/41667)
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'play_in_negative.mov':
   Duration: 00:00:05.95, start: 0.000000, bitrate: 963 kb/s
     Stream #0.0(eng): Audio: pcm_alaw, 11025 Hz, mono, s16, 88 kb/s
     Stream #0.1(eng): Video: cinepak, pal8, 192x128, 24 tbr, 1000k tbn,
 1000k tb
 c
 At least one output file must be specified
 }}}

 {{{
 bcoudurier      Date: 2009-05-10.03:56:06

 Problem is the palette. Palette stored in stsd in .mov must reversed, ie
 palette[0] must be 0 and not 255 as it is currently computed.

 Question remains wether we should fix palette handling first :>
 I don't know much about cinepak, so I cannot say if it would be better to
 compute palette in decoder instead.

 How is it stored in .avi ?
 }}}

 {{{
 Author: ami_stuff       Date: 2011-01-17.13:32:40

 regression since r12272

 Author: bcoudurier
 Date: Thu Feb 28 17:05:19 2008
 New Revision: 12272

 Log:
 set codec bps to grayscale bits, fix 256grey.mov

 Modified:
    trunk/libavformat/mov.c

 Modified: trunk/libavformat/mov.c
 ==============================================================================
 --- trunk/libavformat/mov.c     (original)
 +++ trunk/libavformat/mov.c     Thu Feb 28 17:05:19 2008
 @@ -725,7 +725,8 @@ static int mov_read_stsd(MOVContext *c,

              st->codec->bits_per_sample = get_be16(pb); /* depth */
              st->codec->color_table_id = get_be16(pb); /* colortable id */
 -
 +            dprintf(c->fc, "depth %d, ctab id %d\n",
 +                   st->codec->bits_per_sample,
 st->codec->color_table_id);
              /* figure out the palette situation */
              color_depth = st->codec->bits_per_sample & 0x1F;
              color_greyscale = st->codec->bits_per_sample & 0x20;
 @@ -735,6 +736,7 @@ static int mov_read_stsd(MOVContext *c,
                  (color_depth == 8)) {
                  if (color_greyscale) {
                      /* compute the greyscale palette */
 +                    st->codec->bits_per_sample = color_depth;
                      color_count = 1 << color_depth;
                      color_index = 255;
                      color_dec = 256 / (color_count - 1);
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/165>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list