Opened 13 years ago

Last modified 13 months ago

#1178 reopened defect

tiff enc: odd-sized yuv410p tiff image decodes in other apps with visible green dots

Reported by: ami_stuff Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: tif
Cc: Jean Delvare Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

not reproducible with -vcodec ffv1 / rawvideo / svq1

C:\>ffmpeg -i yuv410p.avi out.tif
ffmpeg version N-39492-gae3ee72 Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  4 2012 02:19:52 with gcc 4.5.0 20100414 (Fedora MinGW 4.5.0-1.fc
14)
  configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch=
x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min
gw32-gcc' --enable-w32threads --enable-memalign-hack --enable-runtime-cpudetect
--enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 -
lwinmm' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snapshots/buil
d/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/snapshots/b
uild/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3 --enable-n
onfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-libvorbis
--enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-libopencor
e-amrwb --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 66.101 /  2. 66.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, avi, from 'yuv410p.avi':
  Metadata:
    encoder         : Lavf54.3.100
  Duration: 00:00:00.04, start: 0.000000, bitrate: 9856 kb/s
    Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv410p, 323x240, 25 tbr, 25 t
bn, 25 tbc
[buffer @ 0x1db1b20] w:323 h:240 pixfmt:yuv410p tb:1/1000000 sar:0/1 sws_param:f
lags=2
Output #0, image2, to 'out.tif':
  Metadata:
    encoder         : Lavf54.3.100
    Stream #0:0: Video: tiff, yuv410p, 323x240, q=2-31, 200 kb/s, 90k tbn, 25 tb
c
Stream mapping:
  Stream #0:0 -> #0:0 (ffv1 -> tiff)
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:86kB audio:0kB global headers:0kB muxing overhead -100.000000%

Attachments (4)

yuv410p.avi (48.1 KB ) - added by ami_stuff 13 years ago.
out.tif (86.0 KB ) - added by ami_stuff 13 years ago.
out.png (60.6 KB ) - added by ami_stuff 13 years ago.
knoppix.jpg (308.6 KB ) - added by ami_stuff 10 years ago.

Download all attachments as: .zip

Change History (21)

by ami_stuff, 13 years ago

Attachment: yuv410p.avi added

comment:1 by Carl Eugen Hoyos, 13 years ago

Works fine here, could you test with ImageMagick / Gimp or attach out.tif?

comment:2 by ami_stuff, 13 years ago

I get the same result with my old ffmpeg's build and build from the net (9 april) - tested with ImageMagick and IrfanView.

C:\>ffmpeg -i yuv410p.avi out.tif
ffmpeg version N-39645-gc311afc Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  9 2012 02:36:41 with gcc 4.5.0 20100414 (Fedora MinGW 4.5.0-1.fc
14)
  configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch=
x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min
gw32-gcc' --enable-w32threads --enable-memalign-hack --enable-runtime-cpudetect
--enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 -
lwinmm' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snapshots/buil
d/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/snapshots/b
uild/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3 --enable-n
onfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-libvorbis
--enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-libopencor
e-amrwb --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx
  libavutil      51. 45.100 / 51. 45.100
  libavcodec     54. 14.100 / 54. 14.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 67.101 /  2. 67.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, avi, from 'yuv410p.avi':
  Metadata:
    encoder         : Lavf54.3.100
  Duration: 00:00:00.04, start: 0.000000, bitrate: 9856 kb/s
    Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv410p, 323x240, 25 tbr, 25 t
bn, 25 tbc
[buffer @ 0x1dc1c80] w:323 h:240 pixfmt:yuv410p tb:1/1000000 sar:0/1 sws_param:f
lags=2
Output #0, image2, to 'out.tif':
  Metadata:
    encoder         : Lavf54.3.100
    Stream #0:0: Video: tiff, yuv410p, 323x240, q=2-31, 200 kb/s, 90k tbn, 25 tb
c
Stream mapping:
  Stream #0:0 -> #0:0 (ffv1 -> tiff)
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:86kB audio:0kB global headers:0kB muxing overhead -100.000000%

by ami_stuff, 13 years ago

Attachment: out.tif added

comment:3 by ami_stuff, 13 years ago

output attached

comment:4 by Carl Eugen Hoyos, 13 years ago

out.tif looks fine with current ImageMagick (I tested 6.5.4-8 and 6.7.6-4) and an old Gimp version (2.6.8).

How does the result of convert out.tif out.png look for you?

by ami_stuff, 13 years ago

Attachment: out.png added

in reply to:  4 comment:5 by ami_stuff, 13 years ago

Replying to cehoyos:

out.tif looks fine with current ImageMagick (I tested 6.5.4-8 and 6.7.6-4) and an old Gimp version (2.6.8).

How does the result of convert out.tif out.png look for you?

Output attached (version 6.7.6-5).

comment:6 by Carl Eugen Hoyos, 13 years ago

Resolution: worksforme
Status: newclosed

I get a bit-identical out.tif with FFmpeg and out.tif looks fine with Gimp, ImageMagick and Okular, so I assume there is no FFmpeg-bug.
(I get a different, correct result with convert out.tif out.png)

comment:7 by ami_stuff, 10 years ago

It's really interesting why I get these dots and you don't.

by ami_stuff, 10 years ago

Attachment: knoppix.jpg added

comment:8 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavcodec
Keywords: tif added
Reproduced by developer: set
Resolution: worksforme
Status: closedreopened
Version: unspecifiedgit-master

If I knew on which computer I originally tested...

comment:9 by Elon Musk, 9 years ago

I assume we lavc is correct and all others are broken.

comment:10 by Jean Delvare, 9 years ago

Cc: jdelvare@suse.de added

I am seeing a similar issue. The following command generates a file with some green in the bottom right hand side corner, instead of the expected white:

% ffmpeg -f lavfi -i "color=color=white:size=20x20" -frames:v 1 -vf "format=yuv410p" -f image2 20x20_yuv410p.tiff

Note that 20 isn't odd, it's even a multiple of 4, which should be yuv410p-friendly. The bug also shows up for 18x18, 19x19 and 21x21, but not 17x17 nor 22x22. It doesn't show up when writing to JPEG instead of TIFF. It doesn't show up with format=yuv411p.

The green spot shows up with eog, evince, gimp and "display". When opening the suspect TIFF files with evince, gimp or "display", they complain with: "discarding 8 bytes to avoid buffer overrun." I suppose that the discarded bytes are creating the corruption.

in reply to:  10 comment:11 by Carl Eugen Hoyos, 9 years ago

Cc: Jean Delvare added

Replying to khali:

I am seeing a similar issue.

(Is it possible that you did not test the sample attached here?)

This issue is about libavcodec encoding yuv410p input to tiff and ImageMagick and FFmpeg disagreeing on how to display / encode the rightmost pixels if the tiff file has odd width (and gimp agreeing with ImageMagick). It is only related to a specific part of the tiff specification (and its interpretation) afaict.
The issue you just reported is related to libswscale (and unrelated to tiff apart from the fact that it is easier to reproduce with tiff input).

comment:12 by Jean Delvare, 9 years ago

Cc: jdelvare@suse.de removed

comment:13 by Carl Eugen Hoyos, 8 years ago

Also reproducible with tiff2rgba from libtiff v4.0.6.

comment:14 by ami_stuff, 13 months ago

Resolution: fixed
Status: reopenedclosed

it looks like something has fixed this issue, but

there is now a green line with

ffmpeg -i yuv410p.avi -vcodec svq1 svq1.mov
ffmpeg -i svq1.mov out.bmp

conversion

oh well

comment:15 by ami_stuff, 13 months ago

Resolution: fixed
Status: closedreopened
Summary: tiff enc: visible green dots with odd width and -pix_fmt yuv410ptiff enc: odd-sized yuv410p tiff image decodes in other apps with visible green dots

actually this issue is not fixed, because this ticket is not about how ffmpeg decodes "out.tif" file, but how other apps like tiff2rgba and gimp decodes it, and green dots are still visible there

comment:16 by Balling, 13 months ago

How can you be sure it is not their bug?

comment:17 by ami_stuff, 13 months ago

this i'm not sure - could be a bug here or there

Note: See TracTickets for help on using tickets.