ffmpeg vaapi hardware acceleration with some videos not working

1.3k views Asked by At

I have a problem with transcoding various videos on my Synology NAS. Some videos work, some do not.

ffmpeg command:

sudo /volume1/@appstore/VideoStation/bin/ffmpeg -y -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -i '/path/to/my/video/IMG_8647.MOV' -vf hwupload,scale_vaapi=w=640:h=-1:format=nv12 -c:v h264_vaapi -b:v 2M -movflags +faststart 'path/to/output4.mp4'

After i enter the command above, i get following error output:

ffmpeg version 3.3.7 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 4.9.3 (crosstool-NG 1.20.0) 20150311 (prerelease)
  configuration: --prefix=/usr/pkg --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-version3 --enable-nonfree --enable-encoders --enable-pthreads --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffserver --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-decoder=amrnb --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --extra-cflags=-I/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/pkg/include --extra-ldflags=-L/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/pkg/lib --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc --enable-shared --disable-static --enable-yasm --enable-libx264 --enable-vaapi --enable-encoder=h264_vaapi --enable-encoder=libx264
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /var/packages/VideoStation/target/lib/libva/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/volume1/homes/maisen20/Drive/iPhone Medien Neu/2020/06/Videos/2020-06-28_19-25-54_IMG_8647.MOV':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2020-06-28T17:25:54.000000Z
    com.apple.quicktime.location.ISO6709: +47.1156+009.0640+430.715/
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: iPhone X
    com.apple.quicktime.software: 13.5.1
    com.apple.quicktime.creationdate: 2020-06-28T19:25:54+0200
  Duration: 00:00:25.10, start: 0.000000, bitrate: 50256 kb/s
    Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), 3840x2160, 50115 kb/s, 60.01 fps, 60 tbr, 600 tbn, 600 tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2020-06-28T17:25:54.000000Z
      handler_name    : Core Media Data Handler
      encoder         : HEVC
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 98 kb/s (default)
    Metadata:
      creation_time   : 2020-06-28T17:25:54.000000Z
      handler_name    : Core Media Data Handler
    Stream #0:2(und): Data: none (mebx / 0x7862656D), 26 kb/s (default)
    Metadata:
      creation_time   : 2020-06-28T17:25:54.000000Z
      handler_name    : Core Media Data Handler
    Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
      creation_time   : 2020-06-28T17:25:54.000000Z
      handler_name    : Core Media Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0: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

Unfortunately I do not know that much about transcoding videos. Does anyone know what the problem here could be?

Without hardware support (without -hwaccel_output_format vaapi) it works.

thanks a lot!

0

There are 0 answers