Digivolution
Posts: 13
Joined: Wed Mar 07, 2018 9:56 pm

Pi V2 Camera to web page for mobile.

Wed Jun 13, 2018 1:19 pm

Hello,
I have managed to stream video to a web page from my PI. But it's in Flash, so mobile phones can't see it.

Is there a way to stream MP4 video to a webpage from a Pi camera V2? Or any other format mobile devices can see?

D.

HermannSW
Posts: 696
Joined: Fri Jul 22, 2016 9:09 pm

Re: Pi V2 Camera to web page for mobile.

Wed Jun 13, 2018 7:46 pm

> Or any other format mobile devices can see?
>
Do you need a webpage, or only want to see video on say Android?

Last night I installed XServer on Android and used JuiceSSH (free) with X11 forwarding (had to pay 5.49€[6.50$] for pro features) so that X11 programs on Pi send their output to Android:
http://sonelli.freshdesk.com/support/so ... forwarding

The first I tried is "eog" image viewer:
Image


Today I played with Raspbian mplayer, it can stream 640x480 videos (.mp4 or other):
Image


But only with 1fps, reason is that XServer is simple, no hardware acceleration and quite some scaling and colorspace conversions:
Image


I mentioned that the XServer I installed based on JuiceSSH link above is a bit simple:
https://play.google.com/store/apps/deta ... de.XServer
(it is open source: http://code.google.com/p/android-xserver/)

When running "eog" image viewer I see these warnings:

Code: Select all

Xlib:  extension "XInputExtension" missing on display ":1"
Result is that neither mouse input (eg. go to next image of collection) nor keyboard input in SSH session work (for "eog").

No problem to get a short preview of Raspberry camera, just executing

Code: Select all

raspistill -md 7 -w 640 -h 480 -o test.jpg -t 100
after having started "mplayer test.jpg" in JuiceSSH before does refresh eog window on smartphone on each execution (takes 1-2s to complete)

Maybe I should try some other Android XServers.

P.S:
Maybe not, just read the open source readme:
The user interface is fairly simple: touch the screen to move the pointer, and use the directional pad to activate the left/middle/right buttons. Update: the volume up/down buttons now work as mouse left/right buttons. Both virtual and physical keyboards are supported.
Volume up is left mouse button, was able to navigate between images (started with "eog Screenshot3*.png") and open menues!
--> Raspberry camera / gstreamer / raspivid / raspiraw (bookmark list):
https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/fork-raspiraw      https://github.com/Hermann-SW/userland      https://twitter.com/HermannSW

Digivolution
Posts: 13
Joined: Wed Mar 07, 2018 9:56 pm

Re: Pi V2 Camera to web page for mobile.

Wed Jun 13, 2018 10:01 pm

I was hoping to imbed streaming video in a webpage on the Pi. That is viewable, with video, in a portable device web browser window.

HermannSW
Posts: 696
Joined: Fri Jul 22, 2016 9:09 pm

Re: Pi V2 Camera to web page for mobile.

Thu Jun 14, 2018 6:55 am

Digivolution wrote:
Wed Jun 13, 2018 10:01 pm
I was hoping to imbed streaming video in a webpage on the Pi. That is viewable, with video, in a portable device web browser window.
There is a .h264 websocket browser player, but it requires to be run on a computer with Intel CPU.
Does what you are looking for, but only on Intel CPU portable devices:
viewtopic.php?f=43&t=204921


There is a gstreamer demo app for Android, but not as .apk.
I asked on gstreamer android forum for the binary:
https://lists.freedesktop.org/archives/ ... 01182.html

I was asked to create a bug on that which I did, but nothing happened since then:
https://bugzilla.gnome.org/show_bug.cgi?id=790372


There are solutions to view Raspberry camera stream on Android, you have to google.
I tried one (don't know which one anymore), worked, but very slow.
--> Raspberry camera / gstreamer / raspivid / raspiraw (bookmark list):
https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/fork-raspiraw      https://github.com/Hermann-SW/userland      https://twitter.com/HermannSW

Digivolution
Posts: 13
Joined: Wed Mar 07, 2018 9:56 pm

Re: Pi V2 Camera to web page for mobile.

Fri Jun 22, 2018 8:17 pm

I tried setting up web RTC with Html 5. But I can't get the code to recognize the Pi camera.

getUserMedia error: NotFoundError

Digivolution
Posts: 13
Joined: Wed Mar 07, 2018 9:56 pm

Re: Pi V2 Camera to web page for mobile.

Sat Jun 23, 2018 4:06 am

I even tried Web RTC, but it wouldn't recognize the Pi camera. And I just got a black window in Chrome. And a getUserMedia error: NotFoundError

benmaynard
Posts: 2
Joined: Sun Jun 24, 2018 6:28 pm

Re: Pi V2 Camera to web page for mobile.

Sun Jun 24, 2018 7:44 pm

Hi, I just made a project that will do what you require: https://github.com/benjamin-maynard/Pi-Camera-in-a-box

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 13 guests