spinix
Posts: 5
Joined: Thu Jan 19, 2017 2:28 pm

Raspberry Pi laggy video

Thu Jan 19, 2017 2:41 pm

Hello,

For my internship i had a great idea to replace a old pc which is playing a video of the company.
I replaced it with a webpage that contains a news ticker, the weather and the company video and want to run it on my Raspberry Pi 3 with raspbian.

I already configured that the pi will boot with Chromium in full screen and opens the webpage (127.0.0.1)

But i have one problem, and i realy tried everything but the video keeps showing laggy. (Other OS (Ubuntu), OpenGL driver, the raspberry Pi browser, Firefox, rebooting... everything) When i try to open the video directly in VLC player it is playing but is only shows a black screen and sometimes a image of the video..

The HTML page is loading the video with the html5 video tag. And i discovered that youtube is also not playing very smooth

Is there something i can do to fix the lag? this is my last week internship here and i realy like to get this done so they will remember me forever :lol:

Kind regards,
Arjan

Image

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

Re: Raspberry Pi laggy video

Thu Jan 19, 2017 3:03 pm

What is the format of the video file? mediainfo is useful for checking.
Have you tried using omxplayer?

spinix
Posts: 5
Joined: Thu Jan 19, 2017 2:28 pm

Re: Raspberry Pi laggy video

Thu Jan 19, 2017 3:13 pm

Thanks for the quick reply!

Image
When i click on the OmxplayerGUI icon it wont start.

User avatar
R61zt
Posts: 64
Joined: Fri Feb 01, 2013 3:55 pm

Re: Raspberry Pi laggy video

Thu Jan 19, 2017 3:32 pm

Updates creep seems to be removing known-good video codec formats and requiring newer ones which won't work without more than 20x as much memory as before and are not always available to download. For example, look up "youtube John West Salmon Bear" and see if you can find the bears fishing and kung fu advert from almost 20 years ago. That had worked fine on a 400 MHz single core PC with 32 MB of RAM after the newfangled flash media player download. For some reason, updates creep with the Flash code prohibits the 2017 version from being available to 'older' hardware and might not be available at all for the raspberry pi. When I see laggy video of bears fishing, then I can be sure that it is a drivers problem as nobody makes hardware as small as what that first worked on.

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

Re: Raspberry Pi laggy video

Thu Jan 19, 2017 4:50 pm

spinix wrote:When i click on the OmxplayerGUI icon it wont start.
Just rum

Code: Select all

omxplayer 1.mp4
From the command line.
The format of the video looks okay. You may need to increase gpu_mem to 128M (can be done from raspi-config).

spinix
Posts: 5
Joined: Thu Jan 19, 2017 2:28 pm

Re: Raspberry Pi laggy video

Fri Jan 20, 2017 7:20 am

Wow! In omxplayer it is playing very good!
But how can i play this video smooth on my html page?

Code: Select all

<video src="media/1.mp4" autoplay type="video/mp4" id="myvideo" controls muted>
			</video>


That is my current code.

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

Re: Raspberry Pi laggy video

Fri Jan 20, 2017 9:08 am

With omxplayer and similar players (VLC with support for HW acceleration), the decoded video is immediately sent to the video output and displayed in a separate layer.
HW accelerated browsers (chromium-browser, epiphany, kweb3) can use HW decoding by the GPU, but the decoded video has to be copied back into the frame buffer to become part of the browser window. And this is not simply copying a huge amount of data, but includes a colour space conversion (some kind of YUV to RGB(A)) as well.
This means, that HW accelerated video inside browsers is only possible within a limited screen area - a typical youtube 360p video, for example) and never full screen (or covering a large part of the screen).
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

spinix
Posts: 5
Joined: Thu Jan 19, 2017 2:28 pm

Re: Raspberry Pi laggy video

Fri Jan 20, 2017 10:02 am

So there is no way to play a info page with a video (Look at the screenshot @topic)? :(
If their is a way please tell me. :oops:

Thanks for all the quick responses.

Edit:... And IF there is NO way to play a mp4 video on the webpage, is their a way to play youtube in the webpage WITHOUT lagg? (Like this: Image)

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

Re: Raspberry Pi laggy video

Fri Jan 20, 2017 10:52 am

Not with HTML5 video tags.
I have created workarounds, where omxplayer is started from within web pages in any defined area (up to full screen). You need the tools from the kweb suite but these methods can also be used with other browsers (firefox, chromium) as well, not just with kweb (Minimal Kiosk Browser). This includes optional control elements like Start/Stop/Pause buttons, volume and positions sliders etc. And it supports web video from youtube and 600+ other websites.

Note: this requires specially built web pages. You will find the details in the developer's chapter of the omxplayerGUI manual.
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

smokingwheels
Posts: 34
Joined: Sun Dec 25, 2016 3:11 am

Re: Raspberry Pi laggy video

Fri Jan 20, 2017 11:04 am

How often do you do updates?

sudo apt-get update
sudo apt-get -y upgrade

spinix
Posts: 5
Joined: Thu Jan 19, 2017 2:28 pm

Re: Raspberry Pi laggy video

Fri Jan 20, 2017 11:58 am

gkreidl wrote:Not with HTML5 video tags.
I have created workarounds, where omxplayer is started from within web pages in any defined area (up to full screen). You need the tools from the kweb suite but these methods can also be used with other browsers (firefox, chromium) as well, not just with kweb (Minimal Kiosk Browser). This includes optional control elements like Start/Stop/Pause buttons, volume and positions sliders etc. And it supports web video from youtube and 600+ other websites.

Note: this requires specially built web pages. You will find the details in the developer's chapter of the omxplayerGUI manual.
I will try this when i have time, i hope it will work. Thanks for your comment! ;)
smokingwheels wrote:How often do you do updates?

sudo apt-get update
sudo apt-get -y upgrade
Yesterday and did it today again, why?

Edit: I'm trying ChromeOS on the raspberry Pi and with youtube the webpage is loading good, and the video plays good.
The only thing to do is to make it start with a full screen browser and install apache on it.

Return to “Troubleshooting”