kerry_s
Posts: 254
Joined: Thu Jan 30, 2020 7:14 pm

Re: RPi4 video performance

Wed Mar 25, 2020 11:49 am

ThijsDeschildre wrote:
Wed Mar 25, 2020 11:29 am
I wonder why video playback on Raspbian is so crappy. It's the standard OS for the Pi, so it doesn't make much sense.
i don't think it's crappy.
to me it's the user expectation that is all wrong, if you wanted high end video, you should have got something for video. a firetv stick can do great video for the same price, if what you want is video/movies/music. etc....

for me, my rpi 4 4gb works great as a desktop setup. i browse the web, check my mail, practice writing code/scripts, i even watch movies & tv, sometimes i even do 2 things at once.

User avatar
Imperf3kt
Posts: 3375
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: RPi4 video performance

Wed Mar 25, 2020 9:08 pm

ThijsDeschildre wrote:
Wed Mar 25, 2020 11:29 am
I wonder why video playback on Raspbian is so crappy. It's the standard OS for the Pi, so it doesn't make much sense.
Because watching videos is not the aim of the Raspberry Pi Foundation. It's low priority compared to other bugs and updates that require attention.
55:55:44:44:4C
52:4C:52:42:41

pagenotfound
Posts: 102
Joined: Mon Mar 14, 2016 12:44 pm

Re: RPi4 video performance

Thu Mar 26, 2020 8:07 am

I'm puzzled that nine months after the release of the Pi 4 Libreelec is still better at this than Raspbian. I guess we're now at the point where the Pi 4 was originally planned to be released so it's about time.

Rascas
Posts: 624
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: RPi4 video performance

Thu Mar 26, 2020 9:43 am

pagenotfound wrote:
Thu Mar 26, 2020 8:07 am
I'm puzzled that nine months after the release of the Pi 4 Libreelec is still better at this than Raspbian. I guess we're now at the point where the Pi 4 was originally planned to be released so it's about time.
LibreELEC is JEOS (just enough OS) a minimum OS with only the needed to run Kodi. That's just Kodi, you cannot install and run a Desktop, run VLC or any other media player, run Chromium or any other browser, etc, etc.

If you take Raspbian Lite, install Kodi and configure it right (see me my guide about Kodi, that's not that hard), remove the stuff that you don't need for Kodi, you end up with something very close to LibreELEC. The performance is pretty much the same.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25410
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi4 video performance

Thu Mar 26, 2020 10:53 am

pagenotfound wrote:
Thu Mar 26, 2020 8:07 am
I'm puzzled that nine months after the release of the Pi 4 Libreelec is still better at this than Raspbian. I guess we're now at the point where the Pi 4 was originally planned to be released so it's about time.
LibreElec caters for the majority of the playback market, the rest is Chrome/browser based, or VLC. And we have a contractor working on those. VLC has received a big update that make it work much better, and Chrome has had some fixes, with more to come IIRC.

Getting decent video is difficult, especially in the FKMS/KMS world. Unlike OMXPlayer where you can simply get the chip to overlay another video over the top of the current display, you cannot do that with in window video. So there are a LOT of copies, format translation etc having to be done to get from a compressed bitstream to getting it on the display. Making that efficient, especially when dealing with the horror that is Chrome, is a time consuming process. Ands of course, the underlying Mesa drivers which handle some of the path are also under development.

Edit: And here is something else to think about. Even the Pi4 is behind the curve when it comes to performance compared to desktops of probably 4 or 5 years ago. And that long ago was pretty much the start of the 1080p era, with no sign of HEVC for example. So the fact that the Pi4 can playback HEVC 4k and even 1080p60 is remarkable, but it also shows how much effort has to go in to make a slower machine like the Pi capable of doing these modern things - until now, people just threw bigger CPU's and faster memory at the task. Now we need to optimise. And that never comes quickly.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

gkreidl
Posts: 6220
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: RPi4 video performance

Thu Mar 26, 2020 5:51 pm

I'm watching local and web video up to 1080p60 almost since day one of my first Rpi B. You just have to know how to do it.

Browsers are the worst video players.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

dustnbone
Posts: 188
Joined: Tue Nov 05, 2019 2:49 am

Re: RPi4 video performance

Thu Mar 26, 2020 7:43 pm

The good performance of LibreELEC on the Pi4 isn't a random happening either.

It took some work by a team of people with that specific goal to make it happen.

emma1997
Posts: 581
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: RPi4 video performance

Thu Mar 26, 2020 7:52 pm

gkreidl wrote:
Thu Mar 26, 2020 5:51 pm
Browsers are the worst video players.
On Pi4 VLC and Kodi aren't any better. Not 4k either which might be understandable but lo res DVD still jerky and MTS (#1 most common STB container) totally unwatchable. I thought they were complainers here referring to slide show til trying it myself.

Mostly using 3b+ for now because of that and some USB3 and WIFI problems. It's been almost a year since promises to fix. Hopefully these are software issues and not hardware bugs as I'm heavily invested in Pi4.

Things do seem to be slowly getting better so I guess Patience Is A Virtue.

ThijsDeschildre
Posts: 17
Joined: Thu Sep 27, 2012 11:35 pm

Re: RPi4 video performance

Thu Mar 26, 2020 11:20 pm

jamesh wrote:
Thu Mar 26, 2020 10:53 am
And that long ago was pretty much the start of the 1080p era, with no sign of HEVC for example. So the fact that the Pi4 can playback HEVC 4k and even 1080p60 is remarkable, but it also shows how much effort has to go in to make a slower machine like the Pi capable of doing these modern things - until now, people just threw bigger CPU's and faster memory at the task. Now we need to optimise. And that never comes quickly.
Thanks for chiming in, and the insight. Since I started tinkering with the RPi4, I learned how 4K playback is not trivial at all. When it comes to SBC it doesn't seem there's any board out there that offers more performance at an attractive price point, and I certainly wouldn't hope much for anything with better software than the RPi. I would have to get a NUC or anything like it, so I can run Linux. My TV is "smart", it can play movies and music from my NAS, but it allows for very limited flexibility and support. I like the RPi because of the flexibility and widespread support.

gkreidl
Posts: 6220
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: RPi4 video performance

Fri Mar 27, 2020 4:01 am

emma1997 wrote:
Thu Mar 26, 2020 7:52 pm
gkreidl wrote:
Thu Mar 26, 2020 5:51 pm
Browsers are the worst video players.
On Pi4 VLC and Kodi aren't any better. Not 4k either which might be understandable but lo res DVD still jerky and MTS (#1 most common STB container) totally unwatchable. I thought they were complainers here referring to slide show til trying it myself.

Mostly using 3b+ for now because of that and some USB3 and WIFI problems. It's been almost a year since promises to fix. Hopefully these are software issues and not hardware bugs as I'm heavily invested in Pi4.

Things do seem to be slowly getting better so I guess Patience Is A Virtue.
Sorry, but this is simply not true.
I seldom use Kodi and if so, mostly for online content such as DAZN streams. But I have not seen any problems so far.

VLC in full screen mode is perfect (if you use the MMAL X11 splitter).
And there is still omxplayer(GUI), although it is limited to H264 now because of the missing HW codecs. That's something I really miss on the RPi 4. My older RPis play almost anything in perfect quality (except H265) with the additional codec licenses.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

emma1997
Posts: 581
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: RPi4 video performance

Fri Mar 27, 2020 6:59 pm

gkreidl wrote:
Fri Mar 27, 2020 4:01 am
Sorry, but this is simply not true.
Maybe I should have been more clear and mentioned standard Raspbian Buster installation.

After reading your entire thread on that it was still not obvious to me what MMAL X11 or a 'splitter' is. Lots of outdated and conflicting info. Half hour Googling didn't help much either. Admittedly my fault not having exceptional IQ or years of experience with Linux internals so some hints would be appreciated.

Is there a link to basic recipe for installing that don't involve recompiling or takes less than an hour to learn?

gkreidl
Posts: 6220
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: RPi4 video performance

Sat Mar 28, 2020 5:26 am

emma1997 wrote:
Fri Mar 27, 2020 6:59 pm

Maybe I should have been more clear and mentioned standard Raspbian Buster installation.

After reading your entire thread on that it was still not obvious to me what MMAL X11 or a 'splitter' is. Lots of outdated and conflicting info. Half hour Googling didn't help much either. Admittedly my fault not having exceptional IQ or years of experience with Linux internals so some hints would be appreciated.

Is there a link to basic recipe for installing that don't involve recompiling or takes less than an hour to learn?
"MMAL x11 splitter for Raspberry Pi" is one of the video output modes of VLC (on the RPi). If you would ever have tried to configure VLC, you woukd have seen it (Settings, Video).

It means: Render into X11 window while running in window mode and switch to overlay mode (similar to omxplayer) when running in full screen mode.

Although rendering into X11 window is more efficient in VLC than in Chromium, you are still loosing a number of frames when playing a 1080p60 video in window mode, but it will run prefectly when switching to full screen mode.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

ThijsDeschildre
Posts: 17
Joined: Thu Sep 27, 2012 11:35 pm

Re: RPi4 video performance

Sat Mar 28, 2020 2:54 pm

gkreidl wrote:
Sat Mar 28, 2020 5:26 am
"MMAL x11 splitter for Raspberry Pi" is one of the video output modes of VLC (on the RPi). If you would ever have tried to configure VLC, you woukd have seen it (Settings, Video).

It means: Render into X11 window while running in window mode and switch to overlay mode (similar to omxplayer) when running in full screen mode.

Although rendering into X11 window is more efficient in VLC than in Chromium, you are still loosing a number of frames when playing a 1080p60 video in window mode, but it will run prefectly when switching to full screen mode.
okay, that's interesting. I've checked the VLC video settings, but have no clue what to expect from them.
I tried googling vlc + mmal but I mostly find forum threads discussing it. you have to dig around quite a bit, for just one of the countless options (and afaik most video renderers work worse than the standard option)

ThijsDeschildre
Posts: 17
Joined: Thu Sep 27, 2012 11:35 pm

Re: RPi4 video performance

Mon Mar 30, 2020 8:47 pm

I went back to the SD card with Raspbian and enabled MMAL for the video output. on 1920x1080 VLC can now play 4K movies, but at 4K it doesn't play anything (either with MMAL or the standard video output)
Rascas wrote:
Sun Mar 22, 2020 4:40 pm
Code snippets doesn't help... only full logs.
Try LibreELEC.

Code: Select all

VLC media player 3.0.8 Vetinari (revision 3.0.8-0-gf350b6b5a7)
[00754cb8] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[006d5b58] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
qt5ct: using qt5ct plugin
qt5ct: D-Bus global menu: no
qt5ct: D-Bus system tray: no
[0073ba00] main playlist: playlist is empty
[a9f42350] main demux error: option sub-original-fps does not exist
[a9f42430] mmal_avcodec decoder: Looking for HEVC decoder 'hevc'
[00754cb8] main audio output error: module not functional
[a9ff5920] main decoder error: failed to create audio output
[ass] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 2.3.1 (COMPLEX)
[ass] Using font provider fontconfig
[00754cb8] main audio output error: Can't convert non linear input
[b10123e0] main audio filter error: cannot add user audio filter "scaletempo" (skipped)
[00754cb8] main audio output error: Can't convert non linear input
[00754cb8] main audio output error: cannot setup filtering pipeline
[a9ff5920] main decoder error: failed to create audio output
usrvcsm: [vcsm_malloc_cache]: [8719] [VLC frame]: ioctl mem-alloc FAILED [-1] (hdl: 0)
usrvcsm: [vcsm_malloc_cache]: [8719] [VLC frame]: ioctl mem-alloc FAILED [-1] (hdl: 0)
[a9f42430] mmal_avcodec decoder error: CMA buf pool alloc buf failed
rpi_get_display_buffer: Failed to get buffer from pool
[hevc @ 0xa9fcd7a0] Failed to allocate output frame
[hevc @ 0xa9fcd7a0] hardware accelerator failed to decode picture
[a9f42430] mmal_avcodec decoder error: avcodec_send_packet critical error
[a9f42430] main decoder error: buffer deadlock prevented
usrvcsm: [vcsm_malloc_cache]: [8719] [VLC frame]: ioctl mem-alloc FAILED [-1] (hdl: 0)
[a9f42430] mmal_avcodec decoder error: CMA buf pool alloc buf failed
rpi_get_display_buffer: Failed to get buffer from pool
[hevc @ 0xa9fe8020] Failed to allocate output frame
[hevc @ 0xa9fe8020] hardware accelerator failed to decode picture
usrvcsm: [vcsm_malloc_cache]: [8719] [VLC frame]: ioctl mem-alloc FAILED [-1] (hdl: 0)
[a9f42430] mmal_avcodec decoder error: CMA buf pool alloc buf failed
rpi_get_display_buffer: Failed to get buffer from pool
[hevc @ 0xa8f0d110] Failed to allocate output frame
[hevc @ 0xa8f0d110] hardware accelerator failed to decode picture
[a9f42430] main decoder error: buffer deadlock prevented


ThijsDeschildre
Posts: 17
Joined: Thu Sep 27, 2012 11:35 pm

Re: RPi4 video performance

Mon Mar 30, 2020 8:54 pm

could be a chroma subsampling issue, since my TV doesn't support as many modes in 4K
the file I'm playing is 4:2:0 alright.
6by9 wrote:
Mon Mar 23, 2020 8:01 am
ThijsDeschildre wrote:
Sun Mar 22, 2020 9:38 pm
hmm, which field is this exactly?
you can find my edid file here https://pastebin.com/kdvPXci4
dickon wrote:
Sun Mar 22, 2020 9:45 pm
I can't see any 3840x2160 or 4096x2160 modes that are >30Hz in that. You're probably out of luck, unless there's a port that's specifically marked as HDMI 2.0 and your Pi isn't plugged into it.
Based on that your display only supports 4kp60 as YUV4:2:0.
Same answer as to https://www.raspberrypi.org/forums/view ... 4#p1630237

Rascas
Posts: 624
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: RPi4 video performance

Mon Mar 30, 2020 9:02 pm

About VLC I don't know, I only use Kodi to play videos on the RPi.

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

Re: RPi4 video performance

Tue Mar 31, 2020 4:04 pm

ThijsDeschildre wrote:
Mon Mar 30, 2020 8:47 pm

Code: Select all

usrvcsm: [vcsm_malloc_cache]: [8719] [VLC frame]: ioctl mem-alloc FAILED [-1] (hdl: 0)
usrvcsm: [vcsm_malloc_cache]: [8719] [VLC frame]: ioctl mem-alloc FAILED [-1] (hdl: 0)
[a9f42430] mmal_avcodec decoder error: CMA buf pool alloc buf failed
So you're out of memory, either CMA (most likely) or gpu_mem (less likely). 4k video is BIG! Each frame is 12MB, and you're typically after 8 or so reference frames. All decoder and display frames, plus various USB transfer buffers and some audio stuff comes from the CMA heap.

"dmesg | grep cma" should tell you how much CMA heap is allocated - default is 256MB IIRC.

And the display pipeline will happily scale back a 4k image too 1080p output, so it doesn't really matter what your monitor is capable of.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “General discussion”