BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Streaming video from uv4l to Blynk using nodered

#1
0 Likes

#2

Personally, I’d find it easier if you asked your question directly in this forum rather than linking to a question that you’ve asked elsewhere, but maybe that’s just me being lazy and not wanting to click on external links.

First of all, you need to forget the fact that you’re using Node-Red as far as the video widget is concerned. The video stream (when you’re able to generate one) will go from the video source direct to the Blynk app - not via Node-Red (and I don’t think it even goes via the Blynk server).

If you search THIS forum for information about using the video streaming widget using the RPI camera as a data source then you’ll get some pointers.
You basically need to find a way of generating a data source that’s compatible with the video stream widget and point the widget at that URL.

I’ve done this successfully using a CCTV camera that generates an RTSP stream, in a project where everything else Blynk related is handled via Node-Red (when using the iOS version of the app).

Pete.

1 Like

#3

@PeteKnight, thanks. I’m using uv4l streaming video

##################################

raspicam driver options

##################################
encoding = mjpeg
width = 640
height = 480
framerate = 15

when I type in my browser http://192.168.0.20:8080/stream I can see the streaming video. I have tried lower resolution and lower frame rate. In blynk Video widget I put the same URL address, but I am getting only “error”

Is it incompatible with Blynk Video Stream widget?

0 Likes

#4

solved it, after searching found a solution here Blynk-video streaming with RPI camera by using uv4l . The correct url is in my case http://192.168.0.20:8080/stream/video.mjpeg

1 Like

#5

@PeteKnight, do you have a lag of about 3s on local server and about 5s on cloud server with video streaming like i experience? When streaming on local network without Blynk server it is smooth and fast, no (visible) lag.

0 Likes

#6

Correct, it is just the App picking up what the phone can access via it’s network connection.

Yes, there will be variable lag… Blynk is not a dedicated video viewing App, so much other stuff happening in background.

0 Likes

#7

I only use the cloud server, but the lag should be the same as the data isn’t going via the server.
My lag was around 1 second, but I’d guess it depends on your network, device RSSI, video resolution, RPI processor speed and available memory, Android/iOS device speed/RSSI, and whether you made a sacrifice to the Blynk gods today :zap:

Pete.

0 Likes

#8

@Gunner, @PeteKnight, no good for my application. Is there at least a way to get a video/screen capture on Blynk or another way to stream video on global Internet?

0 Likes

#9

I’m not really clear what you’re asking here.

Yes, there are lots of ways to stream video to the internet. I’ve never tried any, as it’s not a requirement that I’ve ever had. Products like iSpy have all sorts of bells and whistles, but I’d suspect that something which creates an RTSP video steam and a viewer on the other end - with the appropriate ports opened in any firewall you may encounter along the way - should do it. Obviously this will be outside of Blynk - or at best in a Blynk Webpage Button widget.

I’m not sure that you’ll eliminate lag that way though. If anything, once you start pushing data across the internet speeds are likely to slow dramatically compared to viewing the same data across your home network.

Maybe if you explain a bit more about what it is you’re trying to achieve we might come up with an ‘outside of the box’ idea.

Pete.

0 Likes

#10

@PeteKnight, thanks. I will take a snapshot from camera and will try to send it as a picture. My goal is to be able to access remotely from anywhere in the world things in my garden (monitoring and control) and the short real time video would be nice, but for now I will stay with a snapshot (hopefully it will work).
Cheers
Jan

0 Likes

#11

Look at using the Image Widget as referenced in this recent topic.

0 Likes

#12

I’m struggling as well for now. I am able to take a snapshot from Raspicam and have a file snapshot.jpeg. How to send it to Blynk server?

0 Likes

#13

Okay, I think I was a bit confused by the fact that I said:

and you replied:

I thought you were looking for zero lag, but I think now you’re saying that it’s the implied fact that this only works when your RPI and phone are attached to the same network that won’t work for you.
In that case, have you tried port forwarding and a DDNS service?

You’d probably need to create you mjpeg stream on a different port to 8080 - maybe 8081 - then sert up a rule in your router where request for data on port 8081 are re-directed to http://192.168.0.20:8081

Pointing your video widget to [your public IP address]:8081/stream/video.mjpeg should then work when you use 3G data on your phone rather than connecting to your Wi-Fi network.
If it does, then go ahead and set-up a DDNS service such as NoIP.com (assuming you don’t have a static public IP address) and change your video widget so you replace your public IP with the DDNS IP (and set-up an update client to keep the DDNS service updated when your public IP changes).

Pete.

0 Likes

#14

@PeteKnight, thanks for your comprehensive explanation. Currently I’m investigating different possible option. After spending some time, I realized that sending a snapshot with Blynk doesn’t seem to be easy. I can take a snapshot on my RPi, but have no idea how to send it to Blynk server. Has anyone done it?

0 Likes

#15

The image widget is very new and was in beta for a while. Some forum users have been pushing it to the limites, with mixed success, and there have been some improvements to the functionality along the way.

The widget is primarily used for ‘doing what it says on the tin’ and displaying images. These might be a series of animations that show the state of a garage door being raised or lowered, or a simple on/off indicator.

You can programmatically specify the image url and keep updating this, so you can display differently named snapshot images to show the latest image from your series of snapshots.

There are a couple of threads about the experimentation that users have been doing, but be aware that the widget functionality changed several times during these discussions, based on issues identified and ideas that were suggested.

Personally, I don’t think it’s the best soloutuon for your particular situation, but if you search out the image widget threads and read them, then think it sounds like something you’d like to try then by all means give it a go.

Bear in mind that if you’re using the cloud servers then the server needs to be able to ‘see’ the image, so it will have to be in a public ally accessible location.

Pete.

0 Likes

#16

@PeteKnight, can the image url be it’s location on RPi filesystem or should it be a network resource (html server)?

0 Likes

#17

It can be. I use this program on my RPi to “serve” the images, which are stored in their own folder in my Blynk folder on my RPi, just to keep it all together for backup purposes.

https://docs.python.org/2/library/simplehttpserver.html

If you want it accessible outside of your network then that is simple port forwarding in your router.

0 Likes

#18

@Gunner, thanks. I did it with nodered following the instruction from here https://cookbook.nodered.org/http/serve-a-local-file .I see the snapshot in Blynk, but it doesn’t refresh. When I make another snapshot the image URL shows it, but the one in Blynk stays not updated, even if I stop and restart Blynk on my iPhone.

0 Likes

#19

Even if log out or terminate blynk it remembers the old image, even if I delete it and enter URL again. How to fix it?

0 Likes

#20

Reread that last topic I referenced, that user alternated between two image placeholders.

0 Likes