Opened 10 years ago

Last modified 10 years ago

#3565 new defect

ffmpeg with hwaccel vdpau decode created washed out highlight h.264 video

Reported by: Patrick Dung Owned by:
Priority: normal Component: ffmpeg
Version: 2.2.1 Keywords: h264 vdpau
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Comparing two method of converting a h.264 MOV file to lower bitrate. The h.264 MOV file is straight from my GH3 camera.

Method 1: just use ffmpeg to decode and encode:
No special issue.

Method 2: use -hwaccel vdpau to make use of hardware vdpau decoding:
For the output file, highlight areas (sky/cloud) is clipped.

I have a screen capture on the three files, original one, using plain ffmpeg and using ffmpeg + hwaccel.

How to reproduce:

This is the line for using Nvidia vdpau to convert my origial MOV file.

$ LD_PRELOAD=/mnt-data/vg30/lx-prog/ffmpeg-8bit/libx264.so.142 ffmpeg-8bit -hwaccel vdpau -i P1170736.MOV -movflags +faststart -strict experimental -ar 48000 -b:a 192k -vb 28M -vcodec libx264 -x264opts colorprim=bt709 -x264opts transfer=bt709 -x264opts colormatrix=bt709 P1170736-converted-vdpau.mov

ffmpeg version
On Fedora 20 x64
$ LD_PRELOAD=/mnt-data/vg30/lx-prog/ffmpeg-8bit/libx264.so.142 ffmpeg-8bit -h
ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers

built on Apr 14 2014 02:41:59 with gcc 4.8.2 (GCC) 20131212 (Red Hat 4.8.2-7)
configuration: --enable-nonfree --enable-gpl --disable-ffserver --enable-lto --enable-libx264 --enable-libvpx --enable-ffplay --enable-static --disable-shared --extra-cflags=-static --extra-libs=./libvo-aacenc.a --enable-libfdk-aac --extra-libs=/usr/local/lib/libfdk-aac.a --enable-libvorbis --disable-debug --enable-vaapi --enable-vdpau --enable-vda --enable-hwaccel=h263_vaapi --enable-hwaccel=vc1_vaapi --enable-hwaccel=mpeg2_vaapi --enable-hwaccel=h264_vaapi --enable-hwaccel=mpeg4_vaapi --enable-hwaccel=wmv3_vaapi --enable-hwaccel=h263_vdpau --enable-hwaccel=vc1_vdpau --enable-hwaccel=mpeg2_vdpau --enable-hwaccel=h264_vdpau --enable-hwaccel=mpeg4_vdpau --enable-hwaccel=wmv3_vdpau --enable-lto --disable-inline-asm --enable-opencl --enable-x11grab --enable-avisynth --enable-libfreetype --enable-libopenjpeg --enable-opengl --enable-libschroedinger

Attachments (1)

screencap.zip (502.1 KB ) - added by Patrick Dung 10 years ago.
cap form: original file, using ffmpeg plain, using ffmpeg+hwaccel

Download all attachments as: .zip

Change History (10)

by Patrick Dung, 10 years ago

Attachment: screencap.zip added

cap form: original file, using ffmpeg plain, using ffmpeg+hwaccel

comment:1 by Patrick Dung, 10 years ago

Summary: ffmpeg with hwaccel vdpau decode created washed out highligh h.264 videoffmpeg with hwaccel vdpau decode created washed out highlight h.264 video

comment:2 by Patrick Dung, 10 years ago

Hardware info:
Fedora 20 x64
Nvidia GT 640

$ vdpauinfo
display: :0 screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library 331.49 Wed Feb 12 20:20:12 PST 2014

Video surface:

name width height types


420 4096 4096 NV12 YV12
422 4096 4096 UYVY YUYV

Decoder capabilities:

name level macbs width height


MPEG1 0 65536 4032 4048
MPEG2_SIMPLE 3 65536 4032 4048
MPEG2_MAIN 3 65536 4032 4048
H264_MAIN 41 65536 4032 4080
H264_HIGH 41 65536 4032 4080
VC1_SIMPLE 1 8190 2048 2048
VC1_MAIN 2 8190 2048 2048
VC1_ADVANCED 4 8190 2048 2048
MPEG4_PART2_SP 3 8192 2048 2048
MPEG4_PART2_ASP 5 8192 2048 2048
DIVX4_QMOBILE 0 8192 2048 2048
DIVX4_MOBILE 0 8192 2048 2048
DIVX4_HOME_THEATER 0 8192 2048 2048
DIVX4_HD_1080P 0 8192 2048 2048
DIVX5_QMOBILE 0 8192 2048 2048
DIVX5_MOBILE 0 8192 2048 2048
DIVX5_HOME_THEATER 0 8192 2048 2048
DIVX5_HD_1080P 0 8192 2048 2048

Output surface:

name width height nat types


B8G8R8A8 16384 16384 y Y8U8V8A8 V8U8Y8A8
R10G10B10A2 16384 16384 y Y8U8V8A8 V8U8Y8A8

Bitmap surface:

name width height


B8G8R8A8 16384 16384
R8G8B8A8 16384 16384
R10G10B10A2 16384 16384
B10G10R10A2 16384 16384
A8 16384 16384

Video mixer:

feature name sup


DEINTERLACE_TEMPORAL y
DEINTERLACE_TEMPORAL_SPATIAL y
INVERSE_TELECINE y
NOISE_REDUCTION y
SHARPNESS y
LUMA_KEY y
HIGH QUALITY SCALING - L1 y
HIGH QUALITY SCALING - L2 -
HIGH QUALITY SCALING - L3 -
HIGH QUALITY SCALING - L4 -
HIGH QUALITY SCALING - L5 -
HIGH QUALITY SCALING - L6 -
HIGH QUALITY SCALING - L7 -
HIGH QUALITY SCALING - L8 -
HIGH QUALITY SCALING - L9 -

parameter name sup min max


VIDEO_SURFACE_WIDTH y 1 4096
VIDEO_SURFACE_HEIGHT y 1 4096
CHROMA_TYPE y
LAYERS y 0 4

attribute name sup min max


BACKGROUND_COLOR y
CSC_MATRIX y
NOISE_REDUCTION_LEVEL y 0.00 1.00
SHARPNESS_LEVEL y -1.00 1.00
LUMA_KEY_MIN_LUMA y
LUMA_KEY_MAX_LUMA y

comment:3 by Carl Eugen Hoyos, 10 years ago

Keywords: h264 added; hwaccel highlight h.264 removed
Priority: importantnormal

Is this a regression?

Please test current git head to make this a valid ticket.

comment:4 by Patrick Dung, 10 years ago

Tested with git and it seems no problem for using with or without vdpau.

in reply to:  description comment:5 by Carl Eugen Hoyos, 10 years ago

Replying to dkt:

--enable-lto --disable-inline-asm

Could you elaborate on this?
Did you test the performance of your ffmpeg binary or are you using these options just to debug some specific options? This is important for us because it is expected that your binary is very slow, so if you are doing this on purpose, we would like to know the reason.

Sorry, I did not yet find time to try to reproduce this ticket.

comment:6 by Patrick Dung, 10 years ago

In this ticket, it is about the washed out highlight after conversion. The problem should be gone in the git-master.

comment:7 by Carl Eugen Hoyos, 10 years ago

I understand.

Could you explain why you are using --enable-lto --disable-inline-asm? Is this just a mistake on your side or is there a reason for these options (that I expect to make the FFmpeg binaries significantly slower)?

comment:8 by Patrick Dung, 10 years ago

  1. I use this setting because when I tried to enable '--enable-lto', I could not compile the ffmpeg. So I searched and found this: https://trac.ffmpeg.org/ticket/2941

I enable this option a few months ago.

  1. For this ticket: https://trac.ffmpeg.org/ticket/3597:

I just tried to combile ffmpeg git-master without '--enable-lto --disable-inline-asm' and fastdecode. Using ffplay to playback the output file, there is still lag issue after the transition from the black screen at the beginning to video.

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

Replying to dkt:

  1. I use this setting because when I tried to enable '--enable-lto', I could not compile the ffmpeg. So I searched and found this: https://trac.ffmpeg.org/ticket/2941

I enable this option a few months ago.

I am not a native speaker but tried to explain there that the work-around should not be used because it leads to slow (broken) binaries.
Sorry if I wasn't clear enough there.

  1. For this ticket: https://trac.ffmpeg.org/ticket/3597:

I just tried to combile ffmpeg git-master without '--enable-lto --disable-inline-asm' and fastdecode. Using ffplay to playback the output file, there is still lag issue after the transition from the black screen at the beginning to video.

ffplay is meant to be a testing application.
Use either vlc or MPlayer to playback media files (imo), as said MPlayer can decode your file here in real-time (although it needs fast hardware).

Note: See TracTickets for help on using tickets.