Need help installing ustreamer
-
@luckyflyer said in Need help installing ustreamer:
@Dougal1957
Nice looking cam , I would like to buy from a US vendor if possible, is it available here anywhere?I would have thought it would be as it is an official Raspberry device https://www.raspberrypi.org/products/raspberry-pi-high-quality-camera/
and 2 meter long cables are available for cheap as well https://shop.pimoroni.com/products/raspberry-pi-camera-cable?variant=10312200583 don't know what effect they would have mind
-
@gtj0 But don't the mipi cams offer greater programmability and flexibility than usb cams?
A picture of the back of my printer, a 30 cm cable would be perfect, up to the top and out.! -
@luckyflyer I don't really know as I don't have one yet but am considering one with possible a wide angle lens on it not a cheap combination mind
-
Sup. The ustreamer developer here. I am glad that you use my software, but just in case I want to warn those who want to use RPi CSI cameras: it doesn't work with ustreamer. The reason is that these cameras use their own specific non-v4l2 driver. It is possible to configure them as v4l2, but this requires research and I have not yet addressed this issue. So if you don't want any problems, use regular USB cameras.
Quick answers to old questions:
0.0.0.0
is a special address that means "listen all ipv4 interfaces". If you choose this option, you can connect to the streamer via the ip address of your network card orlocalhost
(127.0.0.1
).- You can't listen to port
80
unless you are root or have theCAP_NET_BIND_SERVICE
capability (blah-blah-blah the network magic). If you want to run ustreamer via systemd on port 80 under non-root user, you need to add a parameterAmbientCapabilities=CAP_NET_BIND_SERVICE
to the Service section - Use the HW encoder: almost all cameras support it.
- If you're afraid that someone will see your video, use password authorization. It's better than nothing.
PS: I was just passing by, so if you need any help, go to discord, the link is in the ustreamer repository on github.
-
@mdevaev Thank you very much for that info just saved me a ton of cash
-
Wow, good to know.
-
Still having trouble getting ustreamer to auto start as a service. I have entered @gtj0 revised entries which are,
sudoedit /etc/udev/rules.d/80-ustreamer.rules:
ACTION=="add", KERNEL=="video0", SUBSYSTEM=="video4linux", TAG+="systemd", ENV{SYSTEMD_WANTS}+="ustreamer@%k.service" ACTION=="remove", KERNEL=="video0", SUBSYSTEM=="video4linux", RUN+="/bin/systemctl --no-block stop ustreamer@%k.service"
sudoedit /etc/systemd/system/ustreamer@.service:
[Unit] Description=UStreamer for %I [Service] Type=simple ExecStart=/usr/local/bin/ustreamer --exit-on-parent-death -r 640x480 --static /tmp/ -d /dev/%i --host=0.0.0.0 --port=8080 [Install] WantedBy=multi-user.target
Then rebooted, but no image on pc which is http://192.168.0.181:8080 or on Duet pi
http://0.0.0.0:8080I then tried to manually start the service with,
sudo systemctl start ustreamer@video0.service
and get,
pi@duet3:~ $ sudo systemctl start ustreamer@video0.service Failed to start ustreamer@video0.service: Unit ustreamer@video0.service not found. pi@duet3:~ $
@bearer mentioned this,
*) edit: this assumes the default EDITOR environment variable is set to nano, but if you've changed it you probably know how to use the editor:)
I wondered about this but Raspbian buster comes with nano as the default editor and since I haven't changed editors this shouldn't be an issue. -
@luckyflyer said in Need help installing ustreamer:
@bearer mentioned this,
*) edit: this assumes the default EDITOR environment variable is set to nano, but if you've changed it you probably know how to use the editor:)
I wondered about this but Raspbian buster comes with nano as the default editor and since I haven't changed editors this shouldn't be an issue.only relevant when using
sudoedit
(probably other times as well, but in this context, only for sudoedit) and the instructions for getting out of nano wouldn't work for other editors - but then again, if someone have changed the default I'd wager they know how to use it. -
Hmm, that is what I'm using,
sudoedit /etc/udev/rules.d/80-ustreamer.rules:
sudoedit /etc/systemd/system/ustreamer@.service:
should I use something else? -
@luckyflyer said in Need help installing ustreamer:
Hmm, that is what I'm using, should I use something else?
oh dear; that is the one question you do not ask the internett and live to talk about..
jokes aside, no and yes. occasional editing of small files on debian and derivatives nano is fine. but nano isn't always available when you wander outside the comfort zone, and there are fanatics who will tell you that you won't get into (insert happy after life place) if you use anything but their favourite editor etc.
-
Lol can I buy you a plane ticket to the desert southwest, my guess is you you would have this sorted in about 2 minutes.
So
sudoedit /etc/udev/rules.d/80-ustreamer.rules:
sudoedit /etc/systemd/system/ustreamer@.service:
should work ok for me? -
not so sure about the 2 minutes, systemd isn't my forte.
nor am I 100% sure about the usecase and proposed solution is the best match.
but yeah, the command to edit the files as root is fine, it does the same as sudo nano /etc/.... just without loopholes and it respects the EDITOR env variable for those who have customized their profile.
are you looking for a solution that will autostart when the camera is connected, or a solution that will autostart when the pi starts (with the camera always connected)?
my day is coming to an end, but i think the last bit there might clear up some misconceptions?
-
I normally will keep the camera always connected so the autostart with camera connected would work for me. But either would work ok.
-
(the template thing might do both, idk, if I fidn a camera tomorrow i'll play with it a little in the evening)
-
Sounds good thanks.
-
I notice that line 2 uses a upper case I and line 5 uses a lower case i Don't know if this is anything or not, thought I would mention it.
[Unit] Description=UStreamer for %I [Service] Type=simple ExecStart=/usr/local/bin/ustreamer --exit-on-parent-death -r 640x480 --static /tmp/ -d /dev/%i --host=0.0.0.0 --port=8080 [Install] WantedBy=multi-user.target
-
thats intentional. %I gets escaped so it doesn't contain special characters, which is needed for the name (and i suspect gtj0 would have corrected it if I was mistaken:)
-
@bearer said in Need help installing ustre sure the camera is plugged in.
eamer:thats intentional. %I gets escaped so it doesn't contain special characters, which is needed for the name (and i suspect gtj0 would have corrected it if I was mistaken:)
Correct. It's just in the description anyway.
@luckyflyer start simple...
### Move the rules file out of the way $ sudo mv /etc/udev/rules.d/80-ustreamer.rules /root/ ### Reload systemd $ sudo systemctl daemon-reload ### Enable ustreamer@video0 to start on boot. $ sudo systemctl enable ustreamer@video0 Created symlink /etc/systemd/system/multi-user.target.wants/ustreamer@video0.service → /etc/systemd/system/ustreamer@.service. ### Make sure the camera is plugged in. ### Reboot. $ sudo systemctl reboot ### When the Pi is back up, check the status of the service... $ sudo systemctl status ustreamer@video0
-
@gtj0 Thanks for your help and sorry to be such a pain.
I enter each command and this is what I get.pi@duet3:~ $ sudo mv /etc/udev/rules.d/80-ustreamer.rules /root/ pi@duet3:~ $ sudo systemctl daemon-reload pi@duet3:~ $ sudo systemctl enable ustreamer@video0 Failed to enable unit: Unit file ustreamer@video0.service does not exist.
I have followed the previous steps exactly and several times using copy and paste. I'm using nano3.2 and do ctrl X Yes then enter to save and then reboot. I do this for both of the files. I'm at a loss to for why the service does not exist.
One thing I've noticed is when I go back into the editor the text that I previously entered
ACTION=="add", KERNEL=="video0", SUBSYSTEM=="video4linux", TAG+="systemd", ENV{SYSTEMD_WANTS}+="ustreamer@%k.service" ACTION=="remove", KERNEL=="video0", SUBSYSTEM=="video4linux", RUN+="/bin/systemctl --no-block stop ustreamer@%k.service"
and
[Unit] Description=UStreamer for %I [Service] Type=simple ExecStart=/usr/local/bin/ustreamer --exit-on-parent-death -r 640x480 --static /tmp/ -d /dev/%i --host=0.0.0.0 --port=8080 [Install] WantedBy=multi-user.target
are still there, is this normal? I have the feeling that the files are not being saved. I'm wondering if I don't have permissions set correctly but get no error stating that I don't. Doing research to understand about permissions.
-
@luckyflyer Are you sure the
ustreamer@.service
file is located in/etc/systemd/system
and that it's named exactly that?Try
ls -al /etc/systemd/system
thencat /etc/systemd/system/ustreamer@.service