-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get broken pipe exceptio #344
Comments
Hi, I am getting the same error:
|
Same issue here too....
|
Likewise with the above issue. |
Hello same here ... Error writing trailer of pipe:: Broken pipe and also WARNING Previous ffmpeg process for video2 died. I got the same Ip for the camera ( 192.168.1.10) that has nothing to do with current setup. |
Use the dev branch, i tried that yesterday and it was working. |
are you referring to the docker image |
Yep |
Thanks for your efforts. I just pulled the image but I am still facing difficulties with broken pipe. Also i notice that the IP in the unifi setup is still shown as 192.168.1.10.
|
I dont have this broken pipe thing with the dev branch, but there is some weirdness with the camera IP. So i checked the files (main.py) on github, the default is that IP, you can change it with --IP but with Unraid you get some error with you only being able to use that custom IP with user created networks, it worked for me when i used the docker compose manager. |
Could you explain what you did? |
I am still messing around but this is what works with IP change for me.
I have also tested a similar one with just rtsp and not the frigate one, you just need to change after the token to rtsp -s and remove the unnecessary stuff. |
Thanks... I can confirm getting the IP address changed this way successfully. I still do get broken pipe exceptions and then the ffmpeg process dies. But it seems to pick up afterwards quickly again |
Hi there, I have been trying to make a [insert camera model name] on my network and have been having the same issues. I run on a broken pipe in the same way as some others previously :
So far I have G3 flex working on my UniFi software, so I think that side is working correctly, and I have managed to use ffmpeg to save my stream to an mp4 file without any issues. Could there be an issue with the way the clock_sync writes the data to UniFi and unify closing the socket? |
When I use the dev branch of the docker, the camera shows up as online and gives me a snapshot, but then subsequently crashes Unifi Protect for some reason and I have to restart it. Currently using this as posted above:
I have some logs here:
Edit: |
Same issue here, using pi5 + UP docker image from here + hikvision cams https://github.com/markdegrootnl/unifi-protect-arm64/issues |
Using Bare Metal Ubuntu installation Same issues here. BrokenPipe errors. If you look at the command line code repeatedly generated by the script: ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://192.168.190.150:554/Streaming/Channels/2" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=W1lhkzMqd6v6ZXDO -f flv - | /usr/bin/python3 -m unifi.clock_sync | nc 192.168.19.7 7550 It seems there is first a pipe from ffmpeg to clock_sync.py, which inserts timing info into the stream, then clock_sync.py does a stdout pipe to nc which farms it to the NVR. so, two pipes. If you just make the script pipe the stream to clock_sync.pl and then only do stdout to the screen from clock_sync.py (don't continue the pass to nc), the stream fills the screen with the video data encoding data continuously with no broken pipe error, so it's not on the input encoding side. You can see this by just running the command line: ffmpeg -nostdin -loglevel error -y -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -stimeout 15000000 -rtsp_transport tcp -i "rtsp://192.168.190.150:554/Streaming/Channels/2" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=W1lhkzMqd6v6ZXDO -f flv - | /usr/bin/python3 -m unifi.clock_sync (you just take off the final pipe to nc | nc 192.168.19.7 7550) but if you change it back and pipe the clock_sync.py stream onward to nc, it breaks after one frame. I think what's going on here is the NVR server starts to receive the flv data via netcat, but senses something weird is up with it, and rejects the connection, thus nc dies, causing the pipe to break between clock_sync.py and nc. Maybe unify changed something in the codec settings of what it's willing to accept as a live incoming stream that rejects it now. |
I'm running it on Synology NAS, Unifi protect is on UDM SE and I am only getting snapshot. Even with the dev branch. unifi-cam-proxy -H {NVR IP} -i {camera IP} -c /client.pem -t {Adoption token} This is my log output: ffmpeg version 5.1.3 Copyright (c) 2000-2022 the FFmpeg developers |
Now that's interesting. I don't use Docker so can't speak for the dev branch version (still waiting for the dev branch command line version for apt install), but it looks like he was trying to change the flv file format based on a change on Protect.... [flv @ 0x7fb9f1973380] Video codec hevc not compatible with flv I think this is gonna be dead until someone can figure out the new flv requirements for the new version of Protect. |
[flv @ 0x7fb9f1973380] Video codec hevc not compatible with flv Try to change your camera settings to H264, basically make sure the camera settings is configured to what is recommended by Frigate and Scrypted. I dont have this broken pipe thing with the dev branch. |
@simclancy |
Bunch of Hikvision and Reolink cameras, i tried the RTSP way before but now i am using through Frigate. Unraid, using docker compose. |
Ok, I'm trying the Docker version with the dev branch this weekend. I have zero experience using the Docker containers, but have been doing some reading. I'm on a Mac and would prefer to OSX and the Docker Desktop app. Do I just install the make Docker Desktop, then point to the repository and search for it? where does the docker-compose.yaml file fit in? Is that just for Docker Compose, which I assume is an alternative method of creating a container rather than through the Desktop app? |
Well you will have to search yourself if the non linux variants of Docker has the same functionalities, i thought it didnt at least on windows. I did post what i used in this thread, just search for that as a reference. |
Ok, with docker I was able to pull the dev branch and build the container from the docker-compose.yaml file, and the broken pipe errors have gone away, but the stream now updates, but only every 25 or so seconds. I'm not using frigate, just straight rtsp H264, 1920x1080, 20fps feed from the cam (LTS CMIP3502). Tried adding the IP and MAC flags, still no joy. There's apparently a ton of other builds from other people in the repository, I may try some of those instead. Would really love to get this working as we have 35+ quite nice cams I really am not looking forward to replace just to get them all on a common platform. |
Where are the other builds? Pretty sure 35 cams is above what is supported if you are just using a UDM Pro |
Oh man, I've got like over 100 cameras total split over 3 UDM PROs. I've already converted most of our extremely old IPS and analog composite ones to Ubiquity cams, but there's nothing wrong with these newer 30+ LTS ones. Also, I'm having a hard time selling them used. Already finding it impossible with the other 70 older ones I've already replaced even when I included the old proprietary NVRs. And, you can really push the limits depending on resolution. For example, on NVR1 alone I've got (42) G3 Flexs and (2) G4 Domes. All three of my UDM Pros have a full arrays of 8Tb HST drives as well. Granted, most of the cams only record on motion, but the cams on NVR2 and NVR3 record full time but there's less of them on those decks. What I'd like to do is use probably about 5-6 miniMacs (I've already got a bunch of older i7 2012 units laying around) running unifi-cam-proxy for like 5 cams each, as converters to NVR3. I saw the other builds simply doing an image search for unifi-cam-proxy in the Docker Desktop App Search Bar. Heheh... So if you're wondering who's the guy that keeps scooping up all the cameras from the ui store, that would probably be me :) Actually, it's taken me over a year to acquire that many from the store, eBay, etc. This has been a long conversion project. |
I would only want that my one Reolink 811A is working on my UDM SE with two other G4 Instant cameras, and you are messing with 100's of them. :) |
Today I tried to use my other camera (Foscam G2 FullHD) in camera-proxy, and it's working normally. The real question is why Reolink 4K camera don't want to work? |
Not sure if this is the same issue but I've got the camera showing up in the Unifi Protect but its only showing a still image and seemingly refreshing every couple of mins.
|
Latest one, Reolink Duo 1st gen but through Frigate yea. So far so good, in fact i am using a different branch right now GwnDaan:timestamp-modifier from the PR, and that too works good, so far the out of sync issue seems to be better i havent checked all of the cams if they completely fixed the out of sync issue but it is certainly closer than before. |
I got a Reolink 811 AI, what command line would you recommend me to try. I couldn't get the Amcrest camera to work |
|
Don’t have a mqtt server setup. I am going to try an setup one on my synology nas. I also see you are using a different unifi-cam-proxy image and volumes from what I have been using. Does it make a difference which one I use? |
Same issue with Eufy Indoor 2K cam. Stream is 15fps H264 AVC in BT.709. Update: the fork from @zacharee works with livestream in UniFi Protect! and is not showing broken pipe errors for me! To make the change:
@zacharee Is there a particular fix from your branch that you can share with us so we know what was the culprit for this problem in the orginal repo? |
I don't really know. Looking at the changes, it might be related to updating dependencies, but I didn't change any of the default command structures. |
Oh wow! This sounds hopeful. Are you seeing this working for basic rtsp streams directly from cameras (ie: not through frigate)? |
I guest it doesn't work on Docker under Synology Nas. I tried the commands in terminal, keep getting errors in my docker-compose directory. Then when I try to load the container I'm getting errors as well. exec: "git": executable file not found in $PATH |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Does the git clone https://github.com/zacharee/unifi-cam-proxy.git. I keep getting an error "unable to 'git clone' to temporary context directory: error fatching : fatal: couldn't find remote ref master: exit status 128. |
The I can confirm that the broken pipe issue was resolved for me by using @zacharee's fork |
Add #main to the end of the github URL: |
It works on Synology NAS... sort of... You need to install git server from package center. SO deploying works, but configuration is a different beast. |
I was able to get it running under my Synology Nas with the Build command now. I'm using a Amcrest cam 4k with Frigate command line, but as you can see below. I keep getting the 404 error Not Found. +] Running 1/1 |
Does anyone have this working with Frigate, and if so what type of camera are you using? Also, what is the command line you use to get it working please? Don't want to waste anymore time if no one have this work. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
nope |
Same crash. |
Yeah, this is still a problem even with the new Protect 4.1.53. Still getting broken pipe errors. still showing only a still when doing rtsp. I'm using docker and have tried both keshavdv:dev and the zacharee fork. For one brief moment of hope, when using keshavdv:dev I had it pointed to one camera, it did indeed start showing video, but after adding a second cam, both stopped and just show a still and lots of broken pipe errors. Going back to the single camera has since lost the ability and am back to getting broken pipe errors. |
Just wanted to report that I got my Reolink RLC-520A working using @zacharee's fork (off Here is my working
Getting snapshot and live video. Stream is choppy, but I have not tried all possible stream configurations yet. But having tried bare metal and docker using this repo, I could never get past the broken pipe. |
Hi there! Just got my RLC-410W to work smoothly with the settings in the last post of @jeitnier (Using UNVR with Unifi OS 4.0.6). It is in fact very choppy and not really in time with the default settings, but if you put "-s sub" instead of "-s main" and use the default settings for the sub stream (640*360 @ 7fps, 160 for the bitrate and "High" as the H.264 profile), it works very well and without any choppiness. If you don't need stellar quality and fps, it's a good and quick way to make it work. By finding the right ffmpeg arguments I'm sure you could use the camera in high quality, but for now it works for me. Note that if you change the resolution or fps, you'll get lots of "rtsp errors" in the console, and the video will likely not work at all. But I tested to launch the unifi-cam-proxy command with the default settings and THEN increasing the bitrate to the maximum (on sub stream it's 512) and it still works great. The rtsp stream doesn't need to reload so it just takes it without any problem, but note that if you kill your docker container and restart it, you'll need to put the camera back to 160, then wait until you have a smooth stream on Unifi and THEN put it to 512 again. Other than that it works very well if you don't need the maximum quality of your cameras. |
So rumor is onvif support with be coming to unifi protect next month. We will be able to add third party cameras. |
Yes after looking at the
@tmushy yes saw that news on reddit the other day. I am not holding my breathe 🤣 but we shall see. |
Protect 5.0.20 (EA) has ONVIF support, although it's pretty buggy in the initial release: some Protect installs go into a restart loop when enabling it, it's not able to authenticate with cameras from Tapo and some from Reolink, and some adopted cameras randomly drop offline in the dashboard. They're all known and acknowledged issues, and I think there's going to be another Protect release tomorrow to fix at least the restart loops. I've personally gotten a random Aliexpress IP camera working, and aside from an incorrect aspect ratio, streams and playback work smoothly. |
Well, they have released Protect 5.0.21 now. I have 3 Amcrest cameras working on it now, but having found anyway to get notification working on them. The streams are working great and smooth on the 2 4k cameras, but 1 Ultra HD camera stream is choppy. The fps is set at 1, and there isn't anyway to change it. Hopefully all of those issues will get fixed in the stable release. Would like to here if the problems I'm have are just related to Amcrest camera only. On the other hand, I was never able to get the Amcrest cameras working using unifi-cam-proxy. I could get them adopted, but no real stream of any kind. They work find on Frigate using Container Manager on my Synology Nas with a PCI TPU installed. When I would try to integrate the Amcrest cameras using frigate with unifi-cam-proxy. I never was able to get them to adopt into protect. |
Camera
Dafang (Wyze V3
Firmware version of the camera
running on custom firmware /EliasKotlyar/Xiaomi-Dafang-Hacks
Description
Hi,
I managed to get the docker up and running in unraid and it is sporadically updating the video image on the UDM Pro. It is shown as a G3 but strangely with a completely wrong IP address (192.168.1.10 which is nowhere in use in my setup). The camera itself is running under 10.1.100.254.
I see broken ffmpeg messages in the log which are probably the reason the picture is updated sporadically only.
When I view the livestream of the camera via vlc it works fine.
Any pointers as to what I can try to get it up and running smoothly?
cheers, Florian
The text was updated successfully, but these errors were encountered: