[FFmpeg-trac] #1897(avcodec:open): arbitrary maxval for netpbm image formats (pam, pnm, pgm)

FFmpeg trac at avcodec.org
Wed Nov 7 23:42:42 CET 2012


#1897: arbitrary maxval for netpbm image formats (pam,pnm,pgm)
------------------------------------+-----------------------------------
             Reporter:  richardpl   |                    Owner:
                 Type:  defect      |                   Status:  open
             Priority:  normal      |                Component:  avcodec
              Version:  git-master  |               Resolution:
             Keywords:  pnm         |               Blocked By:
             Blocking:              |  Reproduced by developer:  1
Analyzed by developer:  0           |
------------------------------------+-----------------------------------
Changes (by Cigaes):

 * keywords:   => pnm
 * status:  new => open
 * version:  unspecified => git-master
 * component:  undetermined => avcodec
 * reproduced:  0 => 1


Comment:

 I can reproduce a similar problem with the following commands:
 {{{
 ./ffmpeg_g -f lavfi -i testsrc -vframes 1 /tmp/image.png
 convert /tmp/image.png -depth 7 /tmp/image.ppm
 ./ffmpeg_g -i /tmp/image.ppm /tmp/image2.png
 }}}
 Then display both images: the one converted by ffmpeg is darker.
 Apparently, convert does not want to produce 9-bit. images, it goes
 straight for 16-bits, and ffmpeg is correct.

 There is absolutely nothing interesting in the console output:
 {{{
 ffmpeg version N-46520-g58d1d70 Copyright (c) 2000-2012 the FFmpeg
 developers
   built on Nov  7 2012 23:33:12 with gcc 4.7 (Debian 4.7.1-7)
   configuration: --enable-shared --disable-static --enable-gpl --enable-
 libx264 --enable-libass --enable-libfreetype --assert-level=1
   libavutil      52.  5.100 / 52.  5.100
   libavcodec     54. 71.100 / 54. 71.100
   libavformat    54. 36.100 / 54. 36.100
   libavdevice    54.  3.100 / 54.  3.100
   libavfilter     3. 21.106 /  3. 21.106
   libswscale      2.  1.102 /  2.  1.102
   libswresample   0. 16.100 /  0. 16.100
   libpostproc    52.  1.100 / 52.  1.100
 Input #0, image2, from '/tmp/image.ppm':
   Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: ppm, rgb24, 320x240, 25 tbr, 25 tbn, 25 tbc
 Output #0, image2, to '/tmp/image2.png':
   Metadata:
     encoder         : Lavf54.36.100
     Stream #0:0: Video: png, rgb24, 320x240, q=2-31, 200 kb/s, 90k tbn, 25
 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (ppm -> png)
 Press [q] to stop, [?] for help
 frame=    1 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.04 bitrate=
 0.0kbits/s
 video:2kB audio:0kB subtitle:0 global headers:0kB muxing overhead
 -100.000000%
 }}}

 In {{{pnmdec.c}}}, copying the {{{maxval}}}/{{{upgrade}}} test from the
 {{{GRAY8}}} case to the {{{RGB24}}} case seems to fix the problem.

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


More information about the FFmpeg-trac mailing list