6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 13274
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: All about accelerated video on the Raspberry Pi (check my notes)?

Thu Oct 21, 2021 6:29 am

Gavinmc42 wrote:
Thu Oct 21, 2021 1:05 am
but i suspect the DRM api in linux doesnt allow spreading a framebuffer over 2 outputs?
so it might be converting your frame into a 3d texture, and then rendering 2 scenes, one per monitor?
Yep, like I said "magic".
Play half height 4K vids?
I don't have time to watch 4K or low res movies, to busy learning how the Pi's can do it at all.
Hmm, a USB DVD player on the shopping list, purely for testing of course ;)
DRM quite happily lets you set a source rectangle, as that is how X handles extended desktops. It renders the complete desktop as a single buffer, and then tells each DRM device which bit to display.
Gavinmc42 wrote:I don't remember any portable Pi based DVD players.
Ah, MPEG2 and license file, that's why I am clueless re DVD.
As of February 14 2020, MPEG-2 Patents have expired worldwide, with the exception of only Malaysia.
Does that mean Pi's can now play MPEG2s without license?
That codec is old, low res these days, a Zero should be able to play it.
https://github.com/chetbox/raspberry-pi-dvd-player
Non stop learning with Pi's.
A Pi2 decodes SD MPEG2 on the CPU without breaking a sweat - my TV viewing Pi is a Pi3 doing SD MPEG-2 or HD H264 off tvheadend DVB-S2 and DVB-T2.
Pi 0/1 need the codec licence. It is still licenced as otherwise you need to region lock Pis to stop sale in Malaysia where patents still apply. If we could make MPEG2 free to use then we would as it's an admin hassle.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

cleverca22
Posts: 6600
Joined: Sat Aug 18, 2012 2:33 pm

Re: All about accelerated video on the Raspberry Pi (check my notes)?

Thu Oct 21, 2021 10:32 am

from what i know of the hardware, the pi4 is also capable of mpeg2 hw decode

but its so fast that you dont need the hw accel
so its simpler to just run away from that patent fee mess, and disable it in software

User avatar
Gavinmc42
Posts: 6842
Joined: Wed Aug 28, 2013 3:31 am

Re: All about accelerated video on the Raspberry Pi (check my notes)?

Fri Oct 22, 2021 2:10 am

from what i know of the hardware, the pi4 is also capable of mpeg2 hw decode
But disabled, turned off or not used.
When does Malaysian Patents expire?
Turn on MPEG2 decode then?
https://bryanquigley.com/pages/mpeg2-pa ... acker.html
Could be a long wait.

How much power saving is there using the hardware to decode MPEG2?
If MPEG2 support has been remove from Pi4, is it permanent?
Mpeg2 is probably so light in CPU power to decode it won't make much power difference.

A good test for AV1 decoding are these, Meridian plays with a few glitches in Chromium 90
https://linuxreviews.org/AV1
Dollhouse is too much for a 2GHz Pi400, but it did decode some images and sound.
I think 3 CPUs are being used as Meridian runs at about 75% on the CPU usage display.
Chromium is also using libaom not dav1d?

It also looks like VLC is maybe using libaom too.
Might have grab the source and compile it now that I have the latest dav1d installed.
Some configuring needs to be done or is it auto?

Grabbed as many AV players as I could, many are too old to recognized AV1.
Looking for a simple AV player that can handle just the dav1d AV1 decoder.
Might have to make one myself, more learning ;)
That could lead to a small standalone YT AV1 vid player.

Hope AV1 decoding hardware is in the next Pi :D
Broadcom have that tech already, BCM7218X.....
Pi4's get a bit toasty, AV1 in hardware on a Pi5 would make sense.

Interesting white paper on Broadcam, render to 960x540, blit to 940x1080 and then use the hardware scaler to make it 1920x1080.
This makes me wonder how they get 4K on a Pi4.
How to test 4K without 4K screen?
H.264 will do 4K from storage? H.265 will do 8K, 4K steaming, H.266 will do even lower bit rate 4K,8K,16K streaming?

The more I learn about codecs the less I know.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

cleverca22
Posts: 6600
Joined: Sat Aug 18, 2012 2:33 pm

Re: All about accelerated video on the Raspberry Pi (check my notes)?

Fri Oct 22, 2021 2:29 am

Gavinmc42 wrote:
Fri Oct 22, 2021 2:10 am
But disabled, turned off or not used.
If MPEG2 support has been remove from Pi4, is it permanent?
my understanding is that the same hw block is used for vc1, mpeg2, and h264 encode/decode
its purely a matter of the closed-source firmware including the routines needed to drive it in mpeg2 mode, and allowing it on a pi4

User avatar
Gavinmc42
Posts: 6842
Joined: Wed Aug 28, 2013 3:31 am

Re: All about accelerated video on the Raspberry Pi (check my notes)?

Fri Oct 22, 2021 3:09 am

With added H265 hardware block in the VC6.
All secret sauce recipes.
Not sure what the H265 block could be repurposed for.
https://en.wikipedia.org/wiki/High_Effi ... deo_Coding

Hmm DCT/DST are handy math functions for FFTs.
Hellopi/hellofft is/is not using these blocks?
Ahh, that's the old OMX/MMAL.
https://github.com/popcornmix/FFmpeg/tree/2711

Back to Ffmpeg, I tried but ffplay did not like AV1 files.
Looks like ffmpeg source is going on be siting on my SSD :D
libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec. Requires the presence of the libdav1d headers and library during configuration. You need to explicitly configure the build with --enable-libdav1d.
FFmpeg compile time on the weekend.

Messing with that dav1d source Arm assembler to use the H.265 blocks?
Wonder if anyone is doing that?
Documentation for H265?
AV1 seems to be comparable with H266, tweaking it just a bit more for Pi's would be good.
Look at the h265 source part of ffmpeg?
More to learn :lol:
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 6842
Joined: Wed Aug 28, 2013 3:31 am

Re: All about accelerated video on the Raspberry Pi (check my notes)?

Fri Oct 22, 2021 5:15 am

Yippee, time to get serious with Vulkan again.
https://www.phoronix.com/scan.php?page= ... Vulkan-1.1
As far as I know 1.2 is just software, no difference in hardware.
If some of the hardware is emulated in 1.1 it might take some time.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

kleurbleur
Posts: 1
Joined: Sun Feb 06, 2022 9:37 am

Re: STICKY: All about accelerated video on the Raspberry Pi [thanks all contributors!]

Sun Feb 06, 2022 9:46 am

On the RPi4 and the latest Bullseye I am in need of playing back video files smoothly and reliably from Python for exhibitions and other (semi-) permanent installations. The advice that VLC is the way to go might be fine for people trying to watch a movie now and then, the reality is that VLC is not yet where it should be for the kind of playback I need. Problems involve smooth looping playback, fullscreen on second displays and general bugs that make VLC not start at all.
This is on the current 32bit version of Bullseye, on the 64bit it is even worse for the upcoming time to come.

The only solution that worked for me is to switch back to the FKMS driver, do an rpi-update and use omxplayer.

hydra3333
Posts: 286
Joined: Thu Jan 10, 2013 11:48 pm

Re: STICKY: All about accelerated video on the Raspberry Pi [thanks all contributors!]

Tue Mar 08, 2022 7:57 am

Just a reference to updated ffmpeg v4l2m2m encoder code, for those looking: viewtopic.php?p=1933445#p1933445

frog-o
Posts: 3
Joined: Wed May 18, 2022 11:56 am

Re: STICKY: All about accelerated video on the Raspberry Pi [thanks all contributors!]

Thu May 19, 2022 7:52 pm

I don't know if it be any use to you ,but I started a form post at
viewtopic.php?p=2003692#p2003692 . IMHO Knowing how to update the video drivers,firmware and user space library IMHO is very Important for accelerated video, Really IMHO we need a book to cover this completely. I hope it be like and made sticky one day but I am not no LINUS.

egnor
Posts: 84
Joined: Fri Aug 06, 2021 6:04 am

Re: STICKY: All about accelerated video on the Raspberry Pi [thanks all contributors!]

Wed Sep 21, 2022 5:16 pm

kleurbleur wrote:
Sun Feb 06, 2022 9:46 am
On the RPi4 and the latest Bullseye I am in need of playing back video files smoothly and reliably from Python for exhibitions and other (semi-) permanent installations. The advice that VLC is the way to go might be fine for people trying to watch a movie now and then, the reality is that VLC is not yet where it should be for the kind of playback I need. Problems involve smooth looping playback, fullscreen on second displays and general bugs that make VLC not start at all.
It's super early days, but perhaps consider https://github.com/egnor/pivid ?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6154
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: STICKY: All about accelerated video on the Raspberry Pi [thanks all contributors!]

Thu Sep 22, 2022 11:35 am

egnor wrote:
Wed Sep 21, 2022 5:16 pm
It's super early days, but perhaps consider https://github.com/egnor/pivid ?
That does look interesting.

Return to “Graphics programming”