hbiyik / FFmpeg

PLEASE USE https://github.com/nyanmisaka/ffmpeg-rockchip REPO INSTEAD.
https://github.com/nyanmisaka/ffmpeg-rockchip
Other
90 stars 7 forks source link

It seems that hardware decoding does not work for RK3399. #27

Closed daiaji closed 12 months ago

daiaji commented 1 year ago
ffplay -vcodec h264_rkmpp_decoder ~/VID_20230227_163234.mp4
ffplay version n6.0 Copyright (c) 2003-2023 the FFmpeg developers
  built with gcc 12.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-librist --disable-vulkan --enable-rkmpp --host-cflags='"-fPIC"'
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '~/VID_20230227_163234.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2023-02-27T08:32:43.000000Z
    com.android.version: 12
    com.android.manufacturer: Xiaomi
    com.android.model: M2012K11AC
  Duration: 00:00:07.47, start: 0.000000, bitrate: 49993 kb/s
  Stream #0:0[0x1](eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p(pc, bt470bg/bt470bg/smpte170m, progressive), 3840x2160, 50412 kb/s, 30.03 fps, 30.03 tbr, 90k tbn (default)
    Metadata:
      creation_time   : 2023-02-27T08:32:43.000000Z
      handler_name    : VideoHandle
      vendor_id       : [0][0][0][0]
    Side data:
      displaymatrix: rotation of -90.00 degrees
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 320 kb/s (default)
    Metadata:
      creation_time   : 2023-02-27T08:32:43.000000Z
      handler_name    : SoundHandle
      vendor_id       : [0][0][0][0]
[h264_rkmpp_decoder @ 0xffff60064750] Picture format is yuv420p.
[h264_rkmpp_decoder @ 0xffff60064750] Failed to initialize MPP context (code = -1).
[h264_rkmpp_decoder @ 0xffff60064750] Failed to initialize RKMPP Codec.
   3.35 M-A: -0.000 fd=   0 aq=   39KB vq=    0KB sq=    0B f=0/0 
10月 21 10:16:24 ARM mpp[38830]: vcodec_service: open vcodec_service (null) failed
10月 21 10:16:24 ARM mpp[38830]: hal_h264d_api: mpp_dev_init failed ret: -1
10月 21 10:16:24 ARM mpp[38830]: mpp_hal: mpp_hal_init hal h264d_rkdec init failed ret -1
10月 21 10:16:24 ARM mpp[38830]: mpp_hal: mpp_hal_init could not found coding type 7
10月 21 10:16:24 ARM mpp[38830]: mpp_dec: mpp_dec_init could not init hal
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp_time: mpp_clock_put invalid clock (nil)
10月 21 10:16:24 ARM mpp[38830]: mpp: error found on mpp initialization
10月 21 10:16:28 ARM ffplay[38830]: mpp_mem_pool: put_pool found 4 used buffer size 224
v4l2-ctl --list-devices
rockchip,rk3399-vpu-enc (platform:ff650000.video-codec):
        /dev/video1
        /dev/video2
        /dev/media0

rockchip-rga (platform:rga):
        /dev/video0

rkvdec (platform:rkvdec):
        /dev/video3
        /dev/media1
hbiyik commented 1 year ago

It seems like you are using mainline kernel which does not have mpp service

daiaji commented 1 year ago

How do I use ffmpeg for hardware decoding on the mainline kernel?

hbiyik commented 1 year ago

have a look at here. https://github.com/mpv-player/mpv/wiki/V4L2-drmprime-support