Stream Video from 2 Raspberry Pi's in different networks to webserver
I want to send a live video stream from two Raspberry Pi's, that are in different networks (one connected via WIFI and one via 5G) to a server to compare the latency between both connections. I've only found partial solutions and videos on how to stream in the same network or. Does anyone have a possible solution or idea? Thanks in advance!
do you know?
how many words do you know
See also questions close to this topic
How to create an app to control a raspberry pi?
I would like to create a Cross-Platform app to control my raspberry pi.
I am new with app developing, but as I was reading more about it, I noticed that Kotlin or Flutter are good options to create an app for both iOS and android.
Does anyone have any recommendations on which to use? Also, do both Kotlin or Flutter allow raspberry pi connections?
Streaming RTSP Locally through HTML5
I am attempting to host a local website on my RaspberryPi using raspivid, and HTML 5. So far, I have managed to get the RTSP link, and view this live stream on VLC player across various devices. The link looks as follows:
Now attempting to embed this stream into the server site, I have tried the video tag;
<video src="rtsp://1XX.1XX.X.1XX:PORT"> Your browser does not support the VIDEO tag and/or RTP streams. </video>
which returns the error:
Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
I have also tried the to directly embed the VLC player;
<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" width="640" height="480" id="vlc" events="True"> <param name="Src" value="rtsp://1XX.1XX.X.1XX:PORT" /> <param name="ShowDisplay" value="True" /> <param name="AutoLoop" value="False" /> <param name="AutoPlay" value="True" /> <embed id="vlcEmb" type="application/x-google-vlc-plugin" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="no" width="640" height="480" target="rtsp://1XX.1XX.X.1XX:PORT" ></embed> </OBJECT>
this method displays 'plug in not supported' on chrome, and doesn't show at all on safari. I would preferably like to find a method of embedding this stream, without requiring specific browser plug-ins, as the server will be accessed by various devices and browsers on the network.
If anyone has any advice or ideas on how to get this up and running, or if this is possible at all, I'd be super grateful, as I've spent a couple of days on this now, and can't seem to find any relevant/up-to-date guidance on this anywhere.
If possible, I would like to avoid any port forwarding. I am happy to implement simple APIs if necessary, however I want to keep the project fairly 'bare bones', and not overcomplicate things. The website is static, and I'd prefer to not require any backend/PHP type stuff.
Why do my arguments given in the terminal not get parsed by argparse correctly?
I have a question about my code in python. I am supposed to define an input pin and an output pin in the command line. When the input pin gets an input (High or Low), it is supposed to pass it to the output pin. To test my code, I connected a button to my input pin and an LED to my output pin. I want to define my input pin and output pin in the command line using argparse, so I do not have to change the pins in the code every time I change the pins physically. My code worked before using argparse, but now after implementing argparse it does not do what it is supposed to (does nothing). My code looks like this:
import RPi.GPIO as GPIO import argparse parser = argparse.ArgumentParser() parser.add_argument('pin_in', type = int, help = 'Possible output pins: 3, 5, 7, 8, 10, 11, 12, 13, 15, 16, 18, 19, 21, 22, 23, 24, 26, 29, 31, 32, 33, 35, 36, 37, 38, 40') parser.add_argument('pin_out', type = int, help = 'Possible input pins: 3, 5, 7, 8, 10, 11, 12, 13, 15, 16, 18, 19, 21, 22, 23, 24, 26, 29, 31, 32, 33, 35, 36, 37, 38, 40') args = parser.parse_args() GPIO.setmode(GPIO.BOARD) #set pin numbering style GPIO.setup(args.pin_out,GPIO.OUT) #set pin_out as output pin GPIO.setup(args.pin_in,GPIO.IN, pull_up_down = GPIO.PUD_UP) #set pin_in as input pin def inputToOutput(pin_in, pin_out): #this method is supposed to read pin_in status (HIGH or LOW) and pass it to the output pin pin_out if GPIO.input(pin_in) == GPIO.LOW: GPIO.output(pin_out, GPIO.LOW) else: GPIO.output(pin_out, GPIO.HIGH) if __name__ == '__main__': GPIO.add_event_detect(args.pin_in, GPIO.BOTH, callback = lambda x: inputToOutput(args.pin_in, args.pin_out)) #this detects either a falling or rising edge and if an edge is detected, calls the inputToOutput method; #add_event_detect syntax is (input channel, rising/falling/both edges, callback function)
Name of my file is PinMonitor_argparse.py and I run the file in the terminal by:
python3 PinMonitor_argparse.py --pin_in 35 --pin_out 15
I first tried to pass the 35 and 15 without writing --pin_in and --pin_out first like
python3 PinMonitor_argparse.py 35 15
and got the notification in the terminal:
usage: PinMonitor_argparse.py [-h] [--pin_in PIN_IN] [--pin_out PIN_OUT]
So I added the --pin_in and --pin_out and the error
error: unrecognized arguments: 35 15
was gone. Now I do not get any error notification, but the code is still not changing the output pin status depending on the input pin status.
I am thankful for any suggestion in advance!
- How check if current network connected is WIFI 5G?
5G modem search operator
(3,"China Unicom","CU-GSM","46001","590904",11), when I use AT+COPS=? to search operator, that one of operators it returns, the last number 11 means NR connected to 5GCN, I don't understand why GSM connected to 5GCN enter image description here