WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: piCore64 ffmpeg/gstreamer hw acceleration  (Read 2206 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14785
piCore64 ffmpeg/gstreamer hw acceleration
« on: July 06, 2021, 04:57:00 AM »
With the recent changes to the graphics/v4l-dev-KERNEL extensions, bcm2835-codec loads automatically enabling hardware accelerated codecs for ffmpeg and gstreamer.

Code: [Select]
$ ffplay -i video.mp4 -vcodec h264_v4l2m2m
Code: [Select]
gst-launch-1.0 -v filesrc location=video.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 ! autovideosink

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14785
Re: piCore64 ffmpeg/gstreamer hw acceleration
« Reply #1 on: August 16, 2021, 09:49:34 AM »
mpv added to play video via ffmpeg - works in both x11 and wayland.

Note that on RPi4 only h264 hw acceleration works, hevc seems to be a work in progress.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14785
Re: piCore64 ffmpeg/gstreamer hw acceleration
« Reply #2 on: August 17, 2021, 09:36:37 AM »
With the update to sdl2, ffplay now works in x11 and wayland.

Totem works in both, but only if dbus and/or pulseaudio is used

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14785
Re: piCore64 ffmpeg/gstreamer hw acceleration
« Reply #3 on: September 14, 2021, 06:57:01 AM »
Using the forked ffmpeg from: https://github.com/jc-kynesim/rpi-ffmpeg

hevc hardware acceleration works:
Code: [Select]
$ ffmpeg -no_cvt_hw -hwaccel drm -vcodec hevc -i ~/Downloads/jellyfish-25-mbps-hd-hevc.mkv -f vout_egl /dev/null