[FFmpeg-user] ffv1 version 3 read_quant_table error

Dave Rice dave at dericed.com
Wed Feb 13 02:51:19 CET 2013


On Feb 12, 2013, at 8:04 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> Dave Rice <dave <at> dericed.com> writes:
> 
>>> (and verify that the files are 
>>> different: one should contain a fiel atom, one not).
>> 
>> This is true. I can find the fiel atom in with_patch.mov 
>> but not in without_patch.mov, but I am only discovering 
>> this with a hexdump of each file. Dumpster doesn't reveal 
>> the fiel atom, nor does mediainfo
>> --inform='Details;1'. Is there another atom parser to use?
> 
> You can remove the comment ("//") in front of #define DEBUG 
> on top of libavformat/mov.c and use -loglevel something

This method also does not reveal the fiel atom. See below. Btw thanks for pointing this feature out, it's very helpful for inspection.

./ffmpeg -i with_patch.mov -loglevel debug -f null -
ffmpeg version N-49846-ge1219cd Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 12 2013 19:06:28 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: 
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.103 / 54. 91.103
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 37.101 /  3. 37.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'with_patch.mov'.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging level) with argument 'debug'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'null'.
Reading option '-' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set libav* logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file with_patch.mov.
Successfully parsed a group of options.
Opening an input file: with_patch.mov.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 70797466 'ftyp' parent:'root' sz: 20 8 2753502
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] ISO: File Type Major Brand: qt  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 65646977 'wide' parent:'root' sz: 8 28 2753502
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 7461646d 'mdat' parent:'root' sz: 2752520 36 2753502
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 766f6f6d 'moov' parent:'root' sz: 954 2752556 2753502
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 6468766d 'mvhd' parent:'moov' sz: 108 8 946
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] time scale = 1000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 6b617274 'trak' parent:'moov' sz: 805 116 946
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 64686b74 'tkhd' parent:'trak' sz: 92 8 797
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 73746465 'edts' parent:'trak' sz: 36 100 797
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 74736c65 'elst' parent:'edts' sz: 28 8 28
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] track[0].edit_count = 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] duration=101 time=0 rate=1.000000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 6169646d 'mdia' parent:'trak' sz: 601 136 797
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 6468646d 'mdhd' parent:'mdia' sz: 32 8 593
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 726c6468 'hdlr' parent:'mdia' sz: 45 40 593
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] ctype= mhlr (0x726c686d)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] stype= vide
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 666e696d 'minf' parent:'mdia' sz: 516 85 593
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 64686d76 'vmhd' parent:'minf' sz: 20 8 508
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 726c6468 'hdlr' parent:'minf' sz: 44 28 508
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] ctype= dhlr (0x726c6864)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] stype= url 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 666e6964 'dinf' parent:'minf' sz: 36 72 508
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 66657264 'dref' parent:'dinf' sz: 28 8 28
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type url  size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 6c627473 'stbl' parent:'minf' sz: 408 108 508
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 64737473 'stsd' parent:'stbl' sz: 300 8 400
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] size=284 4CC= AVdn codec_type=0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] depth 24, ctab id 65535
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 524c4341 'ACLR' parent:'stsd' sz: 24 8 198
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 47525041 'APRG' parent:'stsd' sz: 24 32 198
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 53455241 'ARES' parent:'stsd' sz: 120 56 198
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 0a000000 '' parent:'stsd' sz: 0 176 198
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 73747473 'stts' parent:'stbl' sz: 24 308 400
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] track[0].stts.entries = 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] sample_count=3, sample_duration=1001
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 63737473 'stsc' parent:'stbl' sz: 28 332 400
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] track[0].stsc.entries = 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 7a737473 'stsz' parent:'stbl' sz: 20 360 400
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] sample_size = 917504 sample_count = 3
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 6f637473 'stco' parent:'stbl' sz: 28 380 400
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 74706174 'tapt' parent:'trak' sz: 68 737 797
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] AVIndex stream 0, sample 0, offset 24, dts 0, size 917504, distance 0, keyframe 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] AVIndex stream 0, sample 1, offset e0024, dts 1001, size 917504, distance 0, keyframe 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] AVIndex stream 0, sample 2, offset 1c0024, dts 2002, size 917504, distance 0, keyframe 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 61746475 'udta' parent:'moov' sz: 33 921 946
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] type: 727773a9 '?swr' parent:'udta' sz: 25 8 25
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] lang "und" tag "encoder" value "Lavf54.63.100" atom "?swr" 13 13
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] on_parse_exit_offset=2753502
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] File position before avformat_find_stream_info() is 2753502
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] stream 0, sample 0, dts 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] stream 0, pts 0, dts 0, pos 0x24, duration 1001
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] File position after avformat_find_stream_info() is 917540
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'with_patch.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf54.63.100
  Duration: 00:00:00.10, start: 0.000000, bitrate: 218099 kb/s
    Stream #0:0(eng), 1, 1/30000: Video: dnxhd (AVdn / 0x6E645641), yuv422p, 1920x1080, 1/30000, 219980 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc
    Metadata:
      handler_name    : DataHandler
Successfully opened the file.
Parsing a group of options: output file -.
Applying option f (force format) with argument null.
Successfully parsed a group of options.
Opening an output file: -.
Successfully opened the file.
[buffer @ 0x7f99a9c12c60] Setting entry with key 'video_size' to value '1920x1080'
[buffer @ 0x7f99a9c12c60] Setting entry with key 'pix_fmt' to value '4'
[buffer @ 0x7f99a9c12c60] Setting entry with key 'time_base' to value '1/30000'
[buffer @ 0x7f99a9c12c60] Setting entry with key 'pixel_aspect' to value '0/1'
[buffer @ 0x7f99a9c12c60] Setting entry with key 'sws_param' to value 'flags=2'
[buffer @ 0x7f99a9c12c60] Setting entry with key 'frame_rate' to value '30000/1001'
[graph 0 input from stream 0:0 @ 0x7f99a9c11600] w:1920 h:1080 pixfmt:yuv422p tb:1/30000 fr:30000/1001 sar:0/1 sws_param:flags=2
[dnxhd @ 0x7f99aa00f800] detected 4 logical cores
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf54.63.100
    Stream #0:0(eng), 0, 1/90000: Video: rawvideo (Y42B / 0x42323459), yuv422p, 1920x1080, 1001/30000, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
    Metadata:
      handler_name    : DataHandler
Stream mapping:
  Stream #0:0 -> #0:0 (dnxhd -> rawvideo)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] stream 0, sample 1, dts 33367
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] stream 0, pts 1001, dts 1001, pos 0xe0024, duration 1001
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] stream 0, sample 2, dts 66733
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f99aa00f200] stream 0, pts 2002, dts 2002, pos 0x1c0024, duration 1001
[output stream 0:0 @ 0x7f99a9c12e80] EOF on sink link output stream 0:0:default.
[null @ 0x7f99aa013000] Encoder did not produce proper pts, making some up.
No more output streams to write to, finishing.
frame=    3 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.10 bitrate=N/A    
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead -107.638889%
Statistics: 2786234 bytes read, 2 seeks

> but I prefer hexdump -C

hexdump -C with_patch.mov
[ ... ]
002a0270  50 52 47 30 30 30 31 00  00 00 01 00 00 00 00 00  |PRG0001.........|
002a0280  00 00 78 41 52 45 53 41  52 45 53 30 30 30 31 00  |..xARESARES0001.|
002a0290  00 04 d6 00 00 07 80 00  00 04 38 00 00 00 01 00  |..........8.....|
002a02a0  00 00 00 00 00 00 05 00  00 00 00 00 00 00 00 00  |................|
002a02b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
002a02f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 0a 66  |...............f|
002a0300  69 65 6c 02 0e 00 00 00  10 70 61 73 70 00 00 00  |iel......pasp...|
002a0310  87 00 00 00 b0 00 00 00  18 73 74 74 73 00 00 00  |.........stts...|
002a0320  00 00 00 00 01 00 00 00  03 00 00 03 e9 00 00 00  |................|
002a0330  1c 73 74 73 63 00 00 00  00 00 00 00 01 00 00 00  |.stsc...........|
002a0340  01 00 00 00 01 00 00 00  01 00 00 00 14 73 74 73  |.............sts|

> (I thought ticket #1881 was from you, but I was wrong: 
> It shows that at least Dumpster isn't always useful.)

You might be thinking of http://ffmpeg.org/trac/ffmpeg/ticket/867. I am interested in in24 in mov.

>>> The question is if both can be decoded with QuickTime.
>> 
>> Both appear to operate appropriately and identically 
>> within QuickTime 7.6 and QuickTime X.
> 
> If you could do one more test, search for a svq3 file - 
> Vertical400kbit.sorenson3.mov - remux it with unpatched 
> FFmpeg

ffmpeg -i Vertical400kbit.sorenson3.mov -map 0 -c copy svq3_without_patch.mov
ffmpeg version 1.1.git Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 12 2013 19:07:29 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-ffplay --enable-libopenjpeg --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1/include/openjpeg-1.5 '
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.103 / 54. 91.103
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 37.101 /  3. 37.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f8403036e00] max_analyze_duration 5000000 reached at 5000998 microseconds
Guessed Channel Layout for  Input Stream #0.1 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Vertical400kbit.sorenson3.mov':
  Metadata:
    creation_time   : 2001-03-20 16:17:18
    title           : Vertical Online SV3 Demo
    title-eng       : Vertical Online SV3 Demo
    artist          : Logan Kelsey
    artist-eng      : Logan Kelsey
    copyright       : © Vertical Online 2001
    copyright-eng   : © Vertical Online 2001
    encoder         : Sorenson Video 3
    encoder-eng     : Sorenson Video 3
  Duration: 00:00:43.58, start: 0.000000, bitrate: 580 kb/s
    Stream #0:0(eng): Video: svq3 (SVQ3 / 0x33515653), yuvj420p, 320x240, 391 kb/s, 30.02 fps, 30 tbr, 600 tbn, 600 tbc
    Metadata:
      creation_time   : 2001-03-20 16:17:18
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: adpcm_ima_qt (ima4 / 0x34616D69), 44100 Hz, mono, s16p, 176 kb/s
    Metadata:
      creation_time   : 2001-03-20 16:17:18
      handler_name    : Apple Alias Data Handler
Output #0, mov, to 'svq3_without_patch.mov':
  Metadata:
    encoder-eng     : Sorenson Video 3
    title           : Vertical Online SV3 Demo
    title-eng       : Vertical Online SV3 Demo
    artist          : Logan Kelsey
    artist-eng      : Logan Kelsey
    copyright       : © Vertical Online 2001
    copyright-eng   : © Vertical Online 2001
    encoder         : Lavf54.63.100
    Stream #0:0(eng): Video: svq3 (SVQ3 / 0x33515653), yuvj420p, 320x240, q=2-31, 391 kb/s, 30.02 fps, 19200 tbn, 600 tbc
    Metadata:
      creation_time   : 2001-03-20 16:17:18
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: adpcm_ima_qt (ima4 / 0x34616D69), 44100 Hz, mono, 176 kb/s
    Metadata:
      creation_time   : 2001-03-20 16:17:18
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1308 fps=0.0 q=-1.0 Lsize=    3121kB time=00:00:43.57 bitrate= 586.7kbits/s    
video:2085kB audio:997kB subtitle:0 global headers:0kB muxing overhead 1.250231%

> and verify that video still plays with QuickTime, 

For Vertical400kbit.sorenson3.mov
QuickTime 7.6: video plays fine, audio plays fine
QuickTime X: video plays fine, audio plays fine

For svq3_without_patch.mov
QuickTime 7.6: video plays fine, audio does not play
QuickTime X: gives error "The document 'svq3_without_patch.mov' could not be opened. This media may be damaged."

> then use my patch and replace movenc.c line 1135 
> ("if (track->enc->field_order != AV_FIELD_UNKNOWN)") 
> with something like "track->enc->field_order = AV_FIELD_BB" 
> and remux again.

./ffmpeg -i Vertical400kbit.sorenson3.mov -map 0 -c copy svq3_with_patch.mov
ffmpeg version N-49847-g4f12791 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 12 2013 20:48:24 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: 
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.103 / 54. 91.103
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 37.101 /  3. 37.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbff380f200] max_analyze_duration 5000000 reached at 5000998 microseconds
Guessed Channel Layout for  Input Stream #0.1 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Vertical400kbit.sorenson3.mov':
  Metadata:
    creation_time   : 2001-03-20 16:17:18
    title           : Vertical Online SV3 Demo
    title-eng       : Vertical Online SV3 Demo
    artist          : Logan Kelsey
    artist-eng      : Logan Kelsey
    copyright       : © Vertical Online 2001
    copyright-eng   : © Vertical Online 2001
    encoder         : Sorenson Video 3
    encoder-eng     : Sorenson Video 3
  Duration: 00:00:43.58, start: 0.000000, bitrate: 580 kb/s
    Stream #0:0(eng): Video: svq3 (SVQ3 / 0x33515653), yuvj420p, 320x240, 391 kb/s, 30.02 fps, 30 tbr, 600 tbn, 600 tbc
    Metadata:
      creation_time   : 2001-03-20 16:17:18
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: adpcm_ima_qt (ima4 / 0x34616D69), 44100 Hz, mono, s16p, 176 kb/s
    Metadata:
      creation_time   : 2001-03-20 16:17:18
      handler_name    : Apple Alias Data Handler
Output #0, mov, to 'svq3_with_patch.mov':
  Metadata:
    encoder-eng     : Sorenson Video 3
    title           : Vertical Online SV3 Demo
    title-eng       : Vertical Online SV3 Demo
    artist          : Logan Kelsey
    artist-eng      : Logan Kelsey
    copyright       : © Vertical Online 2001
    copyright-eng   : © Vertical Online 2001
    encoder         : Lavf54.63.100
    Stream #0:0(eng): Video: svq3 (SVQ3 / 0x33515653), yuvj420p, 320x240, q=2-31, 391 kb/s, 30.02 fps, 19200 tbn, 600 tbc
    Metadata:
      creation_time   : 2001-03-20 16:17:18
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: adpcm_ima_qt (ima4 / 0x34616D69), 44100 Hz, mono, 176 kb/s
    Metadata:
      creation_time   : 2001-03-20 16:17:18
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1308 fps=0.0 q=-1.0 Lsize=    3121kB time=00:00:43.57 bitrate= 586.7kbits/s    
video:2085kB audio:997kB subtitle:0 global headers:0kB muxing overhead 1.250547%

For svq3_with_patch.mov
QuickTime 7.6: video plays fine, audio does not play
QuickTime X: gives error "The document 'svq3_without_patch.mov' could not be opened. This media may be damaged."

Same result before and after line 1135.

> If the file changed but still decodes, the patch should 
> really be sufficiently tested;-)

:-P

Dave


More information about the ffmpeg-user mailing list