Opened 6 years ago

Last modified 5 years ago

#7392 new task

Filter "sharpen" on Vaapi encoding

Reported by: jEsuSdA Owned by:
Priority: normal Component: ffmpeg
Version: unspecified Keywords: vaapi, sharpen
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I want to apply a sharpen (or unsharp) filter to a video encoding using vaapi, but I tried a lot of parameters without any success.

How to reproduce:

This is my ffmpeg command to convert a video to x264 with vaapi

ffmpeg -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -i test.mp4 -acodec libmp3lame -ar 44100 -ab 128k -ac 2 -vf 'format=nv12|vaapi,hwupload,scale_vaapi=w=640:h=360'  -threads 0  -r 30 -c:v h264_vaapi -profile:v high -level:v 3 -qp 15   -y test.mkv


It works fine, but with these other lines I can convert a video to x264 with a much better quality (thanks, in part, to a sharpen filter):

ffmpeg -i "test.mp4" -an -pass 1 -vcodec libx264 -r 30 -preset slow -s 640x360 -b:v 750k -bt:v 850k -vf unsharp=5:5:1.0:5:5:1.0 -threads 0 "test.mkv"

ffmpeg -i "test.mp4" -acodec libmp3lame -ar 44100 -ab 128k -ac 2 -pass 2 -vcodec libx264 -r 30 -preset slow -s 640x360 -b:v "750k -bt:v 850k -vf unsharp=5:5:1.0:5:5:1.0 -threads 0  -y "test.mkv"

The difference between the 2 ways (GPU vs CPU) is really huge. The second way generates much better visual quality videos than the first one.

It is possible to do 2pass conversion with vaapi?
It is possible to apply a sharpen filter with vaappi?

Thanks a lot.

Change History (2)

comment:1 by Carl Eugen Hoyos, 6 years ago

Could you point me to the part of the vaapi documentation where a sharpen filter is mentioned?

comment:2 by haihao, 5 years ago

Sorry for slow response. You should use 'sharpness_vaapi' filter in your command line,
and you may check the options by running ffmpeg -h filter=sharpness_vaapi

BTW could you try the iHD driver (https://github.com/intel/media-driver) if possible.

Note: See TracTickets for help on using tickets.