User avatar
yertiz
Posts: 34
Joined: Mon Apr 16, 2012 3:45 pm

uv4l streaming video

Fri Nov 09, 2018 12:15 pm

I think I may be trying the impossible and would appreciate any advice to avoid further frustration.

For years I have used netcat and hello_video.bin to stream one or more live video images from pi(s) to pi.

I wanted to replicate this, but in a browser, so it was platform agnostic. I downloaded uv4l which seems to work perfectly. 192.168.1.n:8080/stream shows the output of the pi camera, with virtually no lag, on Windows, Linux and Android.

I naively thought that if I put together a simple web page with a couple of video tags I should be able to stream from 2 pis to a single page.

Code: Select all

<!DOCTYPE html>

<html>
<head>
	<title>Video Test</title>
	
</head>

<body>
<p>A bit of text above the video to prove the page loaded.</p>

 <video >
 <source src="https://192.168.1.n:8080/stream/video.mjpeg">
 </video>

<p>A bit of text after the video to prove the video element exists.</p>

</body>
</html>
This failed miserably. I can’t even get 1 pi to stream remotely. I have tried with the web page hosted on both the pi using lighttpd and a windows box using Apache.

I have even tried replicating the page source of the uv4l streaming page which uses the img tag but without success for a remote stream.

Code: Select all

<!DOCTYPE html>
<html>
    <head>
        <title>UV4L Stream</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <script>
            function errorFunction() {
                alert('Stream stopped');
            }
        </script>
        <img src="https://192.168.1.n:8080/stream/video.mjpeg" alt="image"  >
    </body>
</html>
The browser reports making a TLS handshake (and doesn’t report any error) so it looks as though contact is made with the server but the server doesn’t switch on the camera and stream.

So, am I trying the impossible or am I missing something simple?

I am sure this post is light on detail so do let me know what additional information is needed to make sense of the issue.


Yertiz

Kazuya
Posts: 1
Joined: Thu May 02, 2019 5:07 pm

Re: uv4l streaming video

Thu May 02, 2019 5:26 pm

Hi.
I was also annoyed same problem.
But I can use <iframe> tag.
As a result, the problem has been resolved.

Code: Select all

<html>
   <body>
        <div class="raspicamera">
            <input type="button" value="load" onclick="window.location.reload();" />
            <iframe class="center" width=100% height=100% src="http://192.168.X.X:8080/stream/video.mjpeg" scrolling="no" border="0" style="border:none;" frameborder="0" id="camera1"></iframe>
            <iframe class="center" width=100% height=100% src="http://192.168.X.X:8080/stream/video.mjpeg" scrolling="no" border="0" style="border:none;" frameborder="0" id="camera2"></iframe>
       </div>
  </body>
</html>


kazuya

Return to “Camera board”