Opened 11 years ago

Closed 11 years ago

#3281 closed defect (fixed)

ffvhuff -context 1 outputs garbled video

Reported by: qyot27 Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: ffvhuff regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
Since I noticed the recent commits extending ffvhuff to experimentally support 4:4:4, et al., I rebuilt FFmpeg from git to test it out.

However, it seems that as part of that patchset, -context 1 broke, as later on I was actually just converting 4:2:0 like I usually do and I ended up finding out that the output was corrupted badly. To its credit, -context 1 also seemed to corrupt 4:4:4 when I tested it there too, but not as badly (4:4:4 output was still in the proper colors as the source video, although there were artifacts; 4:2:0 was awash in rainbow-colored strobing and artifacts).

If I don't use -context 1 at all, then the problem doesn't occur. But then it doesn't enable the adaptive huffman tables.

How to reproduce:
Broken:

ffmpeg -i input -vcodec ffvhuff -context 1 output.avi

Working:

ffmpeg -i input -vcodec ffvhuff output.avi

Attachments (2)

ffvhuff-420-with-context1.avi (2.0 MB ) - added by qyot27 11 years ago.
ffvhuff 4:2:0 -context 1 corrupted output
original.avi (635.9 KB ) - added by qyot27 11 years ago.
Original source, 4:2:0, FFV1 (to get under the 2.5 MB size limit)

Change History (6)

by qyot27, 11 years ago

ffvhuff 4:2:0 -context 1 corrupted output

by qyot27, 11 years ago

Attachment: original.avi added

Original source, 4:2:0, FFV1 (to get under the 2.5 MB size limit)

comment:1 by Carl Eugen Hoyos, 11 years ago

Keywords: regression added
Priority: normalimportant

For future tickets: Please always provide a failing command line together with the complete, uncut console output.

out.avi is broken.

$ ffmpeg -f lavfi -i testsrc -vcodec ffvhuff -context 1 -t 2 out.avi
ffmpeg version N-59661-g243b9fe Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  7 2014 20:37:45 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      52. 62.100 / 52. 62.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.102 / 55. 22.102
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.103 /  4.  0.103
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, lavfi, from 'testsrc':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf55.22.102
    Stream #0:0: Video: ffvhuff (FFVH / 0x48564646), rgb24, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> ffvhuff)
Press [q] to stop, [?] for help
frame=   50 fps=0.0 q=0.0 Lsize=    1770kB time=00:00:02.00 bitrate=7251.2kbits/s
video:1763kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.385304%

comment:2 by qyot27, 11 years ago

I don't know where my mind was not putting that info in, aside from the build including some disparate patches. The patches I'd included in the build didn't touch anything related to ffvhuff, though.

>ffmpeg -i test.avs -vcodec ffvhuff -context 1 test.avi
ffmpeg version r59664 git-a8a9c74 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  7 2014 02:25:46 with gcc 4.8.2 (GCC)
  libavutil      52. 62.100 / 52. 62.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.102 / 55. 22.102
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.103 /  4.  0.103
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, avisynth, from 'test.avs':
  Duration: 00:00:00.83, start: 0.000000, bitrate: 1 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x480, 23.98 fps, 23.98 t
br, 23.98 tbn, 23.98 tbc
Output #0, avi, to 'test.avi':
  Metadata:
    ISFT            : Lavf55.22.102
    Stream #0:0: Video: ffvhuff (FFVH / 0x48564646), yuv420p, 720x480, q=2-31, 200 kb/s, 2
3.98 tbn, 23.98 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> ffvhuff)
Press [q] to stop, [?] for help
frame=   20 fps=2.6 q=0.0 Lsize=    2066kB time=00:00:00.83 bitrate=20293.9kbits/s
video:2060kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.292052%

>ffmpeg -buildconf
ffmpeg version r59664 git-a8a9c74 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  7 2014 02:25:46 with gcc 4.8.2 (GCC)
  libavutil      52. 62.100 / 52. 62.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.102 / 55. 22.102
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.103 /  4.  0.103
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100

  configuration:
    --prefix=/home/qyot27/win32_build
    --cross-prefix=i686-w64-mingw32-
    --enable-gpl
    --enable-version3
    --disable-w32threads
    --enable-avresample
    --disable-doc
    --enable-concise-version
    --enable-fontconfig
    --enable-libfreetype
    --enable-libass
    --enable-libbluray
    --enable-libcaca
    --enable-libcdio
    --enable-openal
    --enable-libquvi
    --enable-librtmp
    --enable-libsoxr
    --enable-libvidstab
    --enable-libflite
    --enable-libgme
    --enable-libgsm
    --enable-libilbc
    --enable-libmp3lame
    --enable-libnut
    --enable-libopencore-amrnb
    --enable-libopencore-amrwb
    --enable-libopenjpeg
    --enable-libopus
    --enable-libschroedinger
    --enable-libshine
    --enable-libspeex
    --enable-libtheora
    --enable-libtwolame
    --enable-libutvideo
    --enable-libvo-aacenc
    --enable-libvo-amrwbenc
    --enable-libvorbis
    --enable-libvpx
    --enable-libwavpack
    --enable-libx264
    --enable-libxavs
    --enable-libxvid
    --enable-avisynth
    --cpu=pentium3
    --extra-cflags='-mfpmath=sse -march=pentium3 -msse -mtune=pentium3 -DPTW32_STATIC_LIB -DCACA_STATIC'
    --extra-ldflags='-mconsole -Wl,--allow-multiple-definition'
    --target-os=mingw32
    --arch=x86
    --pkg-config='pkg-config --static'

comment:3 by Carl Eugen Hoyos, 11 years ago

What's wrong with the command line I posted?

comment:4 by Michael Niedermayer, 11 years ago

Reproduced by developer: set
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.