2

I am trying to create a time-lapse video from a set of photos taken by a cheap webcam on my intel/linux machine.

I have figure out how to use vaapi and Intel's hardware acceleration to create such video clip.

The command I use is the following:

ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -pattern_type glob -i '/picture/20220116/*.jpg' -c:v hevc_vaapi output.mp4

However, when I use h264_vaapi or hevc_vaapi, I can NOT attach (video) equalizer on top of it.

I am not trying to do anything fancy, just to tone down the gamma a bit, reduce saturation a bit, and increase contrast by a bit. For encoder such as libx264, I attach the following right before the "output.mp4" without any issue:

-vf eq=gamma=0.8:saturation=0.9:contrast=1.1

My questions are:

  1. can video filter "equalizer" be used along with vaapi?
  2. if yes, what am I missing? I am keep getting the following error when I am trying to combine video filter equalizer and vaapi:
Impossible to convert between the formats supported by the filter 'Parsed_eq_0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0

Thanks in advance

1 Answers1

0

Removing -hwaccel vaapi should make it work.

What's happening is that with both the -hwaccel and -hwaccel_output_format options set, the decoding is done purely in GPU memory. As the filter is done on the CPU there's no opportunity to apply the eq filter.

Removing the -hwaccel option means that the decoded video will be transferred to main memory (and so able to be accessed by the CPU) before re-encoding with hardware accelerated encoding.

Although this will be slightly slower, the decoding part is not normally the slowest step, which is the encoding.

Info taken from https://ffmpeg.org/pipermail/ffmpeg-user/2018-April/039496.html

Danack
  • 24,939
  • 16
  • 90
  • 122