Ticket #1897 (open defect)
arbitrary maxval for netpbm image formats (pam,pnm,pgm)
| Reported by: | richardpl | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | avcodec |
| Version: | git-master | Keywords: | pnm |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | yes | |
| Analyzed by developer: | no |
Description
Files that are created with pamdepth with maxval argument as 512 for example (from original 255) decodes as black.
Is there some nice way to support this instead of doing insane calculations as it is currently done for grayscale in pnmdec.c (see upgrade arg) ?
Change History
comment:2 Changed 6 months ago by Cigaes
- Keywords pnm added
- Status changed from new to open
- Version changed from unspecified to git-master
- Component changed from undetermined to avcodec
- Reproduced by developer set
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.



Please provide command line and complete, uncut console output.