4 4

4kp30 video on Orange Pi Lite and mainline hardware acceleration

Recommended Posts

it's a long time since I build packages on Debian based distro, but wouldn't "sudo apt-get build-dep ffmpeg" help in this case?

Share this post

Link to post
Share on other sites

I was not aware of that option. My bad.

I only had to left out --enable-libopencv because even if installed it cannot be seen. Don't know why.

Anyway, after ffmpeg and mpv rebuilt anything changed.

> ffmpeg
ffmpeg version n4.0.4-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-v4l2-request --enable-libudev
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

The reason is here:

[vd] Trying hardware decoding via h264_v4l2m2m-v4l2m2m-copy.
[vd] Using underlying hw-decoder 'h264_v4l2m2m'
[ffmpeg] h264_v4l2m2m: Could not find a valid device
[ffmpeg] h264_v4l2m2m: can't configure decoder
[vd] Could not open codec.
[vd] Falling back to software decoding.

Please check the attached log for details



Share this post

Link to post
Share on other sites

I'm not sure what to say, most likely your installation of customized ffmpeg didn't replace all ffmpeg libraries installed from repository (likely, because mpv doesn't complain about wrong version). This procedure worked well for me with ALARM rootfs.

Share this post

Link to post
Share on other sites

After a fresh new complete rebuild and reinstall following a clean procedure I got the same troubles.

Giving up for now until I get some grip on the issue. Currently it's just a black box for me.

@jernej Thank you for all your support and patience.


Share this post

Link to post
Share on other sites

I've got ffmpeg working with v4l2_request api on Allwinner H3 (orange pi pc).

It achieved in a few steps:

1. Download FFmpeg https://github.com/xbmc/FFmpeg/archive/4.0.4-Leia-18.4.tar.gz

2. Patch it with https://github.com/LibreELEC/LibreELEC.tv/tree/master/packages/multimedia/ffmpeg/patches

3. Download mainline kernel 5.3.5

4. Patch it with https://github.com/LibreELEC/LibreELEC.tv/tree/master/projects/Allwinner/patches/linux

5. Copy linux headers on rootfs /usr/include after kernel built:

make headers_install ARCH=arm INSTALL_HDR_PATH=/your/path/to/headers

6. Install libdrm-dev and libudev-dev before configuring FFmpeg

7. Configure FFmpeg with:

/configure --enable-v4l2-request --enable-libudev --enable-libdrm --enable-shared --disable-static \
--disable-openssl --disable-gray --disable-vaapi --disable-vdpau --disable-rkmpp

8. Build FFmpeg on the target machine (orange pi pc in my case)

That's it )


ffmpeg -re -hwaccel drm -i Big_Buck_Bunny_720_10s_2MB.mp4 out.avi

FFmpeg perfectly uses HW acceleration on decoding H264.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

4 4