Ticket #165 (closed defect: fixed)

Opened 2 years ago

Last modified 8 months ago

QT Cinepak - plays in negative

Reported by: ami_stuff Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: cinepak roundup
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

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);

Attachments

play_in_negative.mov Download (701.1 KB) - added by ami_stuff 2 years ago.
patchmovcinepak.diff Download (713 bytes) - added by cehoyos 2 years ago.

Change History

Changed 2 years ago by ami_stuff

comment:1 Changed 2 years ago by ami_stuff

I have created QT Cinepak grayscale files with differen QT versions (Win) and all of the files plays in grayscale, so the question is which software was used to create 256grey.mov.

comment:2 Changed 2 years ago by ami_stuff

*all of the files plays in negative of course

comment:4 Changed 2 years ago by ami_stuff

I propose to reverse r12272 if no one know how to fix this issue

Seems like this patch can't be reverted, because the revert will broke for example decoding of QT BMP 16 grayscale and QT BMP 256 grayscale, so a better solution must be found.

comment:5 Changed 2 years ago by cehoyos

  • Status changed from new to open
  • Version changed from unspecified to git-master
  • Reproduced by developer set

Possible fix attached.

Changed 2 years ago by cehoyos

comment:6 Changed 21 months ago by ami_stuff

fixes the problem for me

comment:7 Changed 20 months ago by michael

  • Status changed from open to closed
  • Resolution set to fixed

comment:8 Changed 17 months ago by cehoyos

  • Keywords cinepak added

comment:9 Changed 8 months ago by cehoyos

  • Keywords roundup added
Note: See TracTickets for help on using tickets.