Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#108 closed defect (fixed)

QT WRAW file decodes incorrectly

Reported by: ami_stuff Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: mov rawvideo
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

attached QT WRAW file does not decode correctly

QT Player says it is: WRAW, 44x41, millions of colors, 15 fps

C:\>ffmpeg -i C:\CarltonMovie2.mov
FFmpeg version git-N-29181-ga304071, Copyright (c) 2000-2011 the FFmpeg develope
rs
  built on Apr 18 2011 21:24:03 with gcc 4.5.2
  configuration: --enable-gpl --enable-version3 --enable-runtime-cpudetect --ena
ble-memalign-hack --enable-avisynth --enable-bzlib --enable-frei0r --enable-libo
pencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --
enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger
 --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enabl
e-libx264 --enable-libxavs --enable-libxvid --enable-zlib --cross-prefix=i686-w6
4-mingw32- --target-os=mingw32 --arch=x86_32 --extra-cflags=-I/home/kyle/softwar
e/ffmpeg/external-libraries/win32/include --extra-ldflags=-L/home/kyle/software/
ffmpeg/external-libraries/win32/lib --pkg-config=pkg-config
  libavutil    50. 40. 1 / 50. 40. 1
  libavcodec   52.120. 0 / 52.120. 0
  libavformat  52.108. 0 / 52.108. 0
  libavdevice  52.  4. 0 / 52.  4. 0
  libavfilter   1. 79. 0 /  1. 79. 0
  libswscale    0. 13. 0 /  0. 13. 0

Seems stream 0 codec frame rate differs from container frame rate: 600.00 (600/1
) -> 15.00 (15/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\CarltonMovie2.mov':
  Metadata:
    creation_time   : 2004-11-23 10:27:38
  Duration: 00:00:03.26, start: 0.000000, bitrate: 656 kb/s
    Stream #0.0(eng): Video: rawvideo, pal8, 44x41, 649 kb/s, 15 fps, 15 tbr, 60
0 tbn, 600 tbc
    Metadata:
      creation_time   : 2004-11-23 10:27:38
At least one output file must be specified

Attachments (1)

CarltonMovie2.mov (261.8 KB ) - added by ami_stuff 11 years ago.

Download all attachments as: .zip

Change History (12)

by ami_stuff, 11 years ago

Attachment: CarltonMovie2.mov added

comment:1 by llogan, 11 years ago

Confirming behavior. Video looks like static for me (assuming of course that's not what the video is supposed to look like):

$ ffplay CarltonMovie2.mov 
ffplay version git-N-29342-ge4253b1, Copyright (c) 2003-2011 the FFmpeg developers
  built on Apr 24 2011 11:05:34 with gcc 4.6.0 20110415 (prerelease)
  configuration: --prefix=/usr --disable-optimizations
  libavutil    51.  0. 0 / 51.  0. 0
  libavcodec   53.  1. 0 / 53.  1. 0
  libavformat  53.  0. 3 / 53.  0. 3
  libavdevice  53.  0. 0 / 53.  0. 0
  libavfilter   2.  0. 0 /  2.  0. 0
  libswscale    0. 13. 0 /  0. 13. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'CarltonMovie2.mov':
  Metadata:
    creation_time   : 2004-11-23 10:27:38
  Duration: 00:00:03.26, start: 0.000000, bitrate: 656 kb/s
    Stream #0.0(eng): Video: rawvideo, pal8, 44x41, 649 kb/s, 15 fps, 15 tbr, 600 tbn, 600 tbc
    Metadata:
      creation_time   : 2004-11-23 10:27:38
[ffsink @ 0x17a3a40] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x17a4b50] w:44 h:41 fmt:pal8 -> w:44 h:41 fmt:yuv420p flags:0x4
   9.20 A-V:  0.000 s:0.0 aq=    0KB vq=    0KB sq=    0B f=0/0   0/0

comment:2 by Carl Eugen Hoyos, 11 years ago

Reproduced by developer: set
Status: newopen
Version: unspecifiedgit

This is reproducible compared with current QuickTime player.

in reply to:  2 comment:3 by llogan, 11 years ago

Replying to cehoyos:

This is reproducible compared with current QuickTime player.

No. QuickTime 7.6.9 (1680.9) on Windows 7 produces a different looking output for me.

http://fakeoutdoorsman.com/ffmpeg/ticket108.png

comment:6 by ami_stuff, 11 years ago

WRAW 8bpp in avi seems to need a flip as well, so my patch posted to libav-devel seems to be correct

http://www.aoc.nrao.edu/events/synthesis/2008/lectures/test-mars.avi

comment:7 by ami_stuff, 11 years ago

*posted to ffmpeg-devel :)

comment:8 by Stefano Sabatini, 11 years ago

Analyzed by developer: set
Component: undeterminedavcodec
Resolution: fixed
Status: openclosed

Fixed in commit:

commit 040e1c67edab57177adb88a7dd1cc9ed38d2b74e
Author: ami_stuff <ami_stuff@o2.pl>
Date: Tue May 24 23:38:01 2011 +0200

rawdec: fix decoding of QT WRAW files


Fix decoding of QT WRAW files.


From some tests it results that:


  1. all of the AVI/MOV WRAW files (at least from the link posted to the trac ticket #108) need to be flipped
  2. mov WRAW files need to use AVI color modes
  3. assigning PAL8 mode by default to WRAW codec is not correct


Fix decoding of file CarltonMovie2.mov, fix trac issue #108.

I tried with all samples, note that ~/samples/nature06421-s4.mov crashes ffplay, this looks like a swscale bug (you can reproduce it with -vf scale=368:233,format=bgra).

Thanks again for the accurate report and the patch :)!

comment:9 by ami_stuff, 11 years ago

@saste

something like this seems to fix "nature06421-s4.mov" here (I test on big-endian)

diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 9702f98..75b1e6e 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -90,8 +90,12 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
 
     if (avctx->codec_tag == MKTAG('r','a','w',' '))
         avctx->pix_fmt = ff_find_pix_fmt(pix_fmt_bps_mov, avctx->bits_per_coded_sample);
-    else if (avctx->codec_tag == MKTAG('W','R','A','W'))
+    else if (avctx->codec_tag == MKTAG('W','R','A','W')){
+       if (avctx->bits_per_coded_sample == 32)
+        avctx->pix_fmt = PIX_FMT_BGRA;
+       else
         avctx->pix_fmt = ff_find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);
+       }
     else if (avctx->codec_tag)
         avctx->pix_fmt = ff_find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag);
     else if (avctx->pix_fmt == PIX_FMT_NONE && avctx->bits_per_coded_sample)

comment:10 by Carl Eugen Hoyos, 11 years ago

Version: gitgit-master

Should be fixed.

comment:11 by Carl Eugen Hoyos, 11 years ago

Keywords: mov rawvideo added
Note: See TracTickets for help on using tickets.