-
Notifications
You must be signed in to change notification settings - Fork 112
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
Question about RTSP Stream and ONVIF #414
Comments
Yes, but only while you watch the stream on the app.
If you connectec the cam as ONVIF (not only as RTSP) the PTZ "should" work. |
I really appreciate you taking the time to reply to something not related to the firmware. I have the cameras connected as ONVIF and RSTP and the PTZ is not working. I am not sure if you are familiar with the Truvision NVR. I can upload settings screenshots if you have time or are willing to take a look. If not, thats ok... I can keep playing around with the settings to see why the low resources and bad NVR performance. It might just be a low end crappy NVR that says can handle 8 cameras and not be true. It might be that these cameras do no have the hardware ability even with the modded firmware to perform very well with RTSP and ONVIF. |
When you write ONVIF and RTSP you mean both? Please send me the screenshots of your settings. I use a chinese NVR with my 4 cams and it works correctly, so the cam should not be a problem. |
PTZ for some reason does not work on the NVR. I have change the settings to low quality on all 8 cameras... TL-Hi, Video Quality Highest, Camera stream resolution low 640x360 and I can view all 8. Then less than an hour later the camera stream feed will be frozen or blacked out. The NVR is a TruVision NVR 11 model is TVN1108S with a 2TB hard drive. If I try 1080P on just one camera I start having issues. I would have loved to record all cameras at 1080p. |
This is correct.
Are you able to detect if the stream is frozen cam side or nvr side? |
The stream is frozen on some and blackout on other on the NVR side. If I go on the Yi Home app or Kami app..... all the feeds work fine. If I reboot the NVR, it starts working good..... but it doesnt take long for the feed to start freezing on some and going black on others. According to the NVR specs.... it can handle up to 4/8/16 Full HD cameras in real-time (30fps). I am unsure if the NVR is defective, at fault or a poor quality NVR OR if the yi-hack firmware mod is at fault. Maybe I need to disable the recording to the SD Card and disable the feed to the YI Home servers? Model : TVN-1108S-2T
Camera Support
|
The stream to the app is different from the rtsp stream. If the stream works on the app this doesn't mean that it also works on the rtsp client. |
Are you able to set tcp as a transport protocol? |
Another try you can do.
|
Yes, I have it set to Auto. But I opened the RSTP stream that was blacked out on the NVR in the VLC and the stream was good. So its nothing to do with the RSTP stream feed coming from the camera. I notice that if I go to the edit portion of the camera in the NVR and type the password again and apply..... the feed comes back up. |
How or where do I set those buffer values? Thank you for taking the time to help me out. I haven't tried the disable the cloud and recording to the SD card, since the VLC stream from the camera was good.... basically letting me know it has to do with the NVR. If I dont have a authentication for the ONVIF..... anyone can access the feed if they have the IP and port number, correct? |
So far its working..... Now the PTZ is not working. Do I need to do something in the Yi-Hack to allow the NVR to use PTZ? |
What conf did you change?
PTZ should work automagically when the cam is configured as ONVIF. About buffer values, if you still need it, you can set them entering in the cam with a ssh connection (like putty), logging in with root user, and writing the commands above. |
PTZ is working now after reading and following the update you made on this link: #415 You might want to look into the update process through the web interface on the yi-hack. I did the update from the 0.4.1 to the 0.4.3 through the web interface and the PTZ lines you edited on the link above for the for the ipc_cmd.sh path were still on /tmp and not /home. Do you think I should do a fresh install of the 0.4.3 in case other things might not have updated? Maybe the update may not have been done properly through the web interface and that might be causing some issues with the NVR? |
For this model, the update process overwrite the whole partition. |
Just fixed the outdoor camera by formatting the SD card, installing 0.4.2 first and then doing the web interface upgrade to the 0.4.3. Now the camera is working, but the PTZ file path did not update. Edited both files this time with the correct file path and PTZ is working. Online update is not updating the PTZ file path. I also did the update from 0.4.2 to 0.4.3 by removing the sd card and putting the new files and after the update completed..... path for PTZ was still wrong. |
Got PTZ fixed, still need to test to see if NVR streams are freezing and blacking out. Before I get into the NVR testing.... I am trying to set the MQTT, everything seems to be pre-filled except the IP and Authentication. Do I use the same IP address for the Yi Camera? Client ID can be the camera name ex. backyard? For authentication use the same as the camera login? I tried googling a tutorial online, but did not find one. Will keep looking. Thank you for all your help.... really appreciated. |
Just this morning all the live feed on the NVR was frozen except on two cameras. One of the cameras is a 720p Yi Home cam 27US 1.8.7.0F_201809191400 with alienatedsec/yi-hack-v5 firmware and the other still providing live feed was on of the 1080p on your firmware. I notice comparing those two feeds that the 720p cam live feed had almost no delays, but the 1080p was lagging behind. I did read on your firmware description in regards to performance and you said "The performance of the cam is not so good (CPU, RAM, etc...). If you enable all the services you may have some problems. For example, enabling both rtsp streams is not recommended. Disable cloud is recommended to save resources." I have both feeds on, but the NVR is only using the low quality feed. Will having both on still consume camera resources even when the NVR is only accessing one? The other thing I did notice this morning..... when the feeds are frozen or black, I went to the NVR and re-entered the camera password and the feed came back. I don't seem to be having that issue with the 720p Yi Home camera. This is the first time I notice that and I am guessing it has to do with better camera hardware? Or Firmware? Not sure if by re-entering the password it reconnects to the camera by requesting the feed? I can also reboot the camera and feed comes back. If I reboot the NVR it also fixes the issue. Without restarting the NVR.... Rebooting the camera or re-entering the password restores feed. |
No, only if you consume them. And if you use only low res stream there must be no problem.
I think the problem is that the NVR doesn't restart the stream when there is a corruption.
What about the process when the screen is black?
Wait 10 seconds and try again the commands above to check if the process change the pid (dies and restarts). Finally, kill rRTSPServer process, wait for the restart and check if it works. |
in Putty I ran the command then waited 10 seconds, ran the command again, but nothing happened. After I killed the rRTSPServer process and camera came back from blacked out to live feed. Since the cameras are on WiFi there may be like you say a corruption or the feed went out or stopped for a second and the NVR did not restart the connection. How can I fix that? and what about the delay in video feed? Would the delay be solely on the WiFi connection?
|
I have it on low quality. Is the video feed delay due to WiFi? The 720p yi home has no delays, but all the 1080p Dome do. |
I tried to set the higher buffer values, but it did not work. I notice it said yi-hack-allwinner-v2 and not MStar. I dont know if that has anything to do with it. Set the buffers to a higher value: root@yi-hack-allwinner-v2: |
I was trying to install alienatedsec / yi-hack-v5 on one of the 1080p Dome for testing. The reason was, because the only camera that has no delay and doesn't loose connection from the NVR is the 720p Yi Home 27US 1.8.7.0F_201809191400 and its on the Yi-Hack-v5. I copied the files to the SD card, but after a reboot.... the firmware was the same. Do you know if its possible? |
You are using udp transport.
Delay depends on many factors.
No, wifi is not a problem.
MStar, Allwinner and Allwinner-v2 have the same software.
I don't know. |
I have tried everything except disable the recording to SD card and the cloud. I need the cloud, because the app is useful compare to other apps for android. I wanted to use the NVR to get more recording time and have a monitor setup with the cameras in constant view. I did manage to get the RSTP link from two other cameras I have...... Hiseeu 5x Zoom that I bought from Amazon (https://www.amazon.com/gp/product/B08RHM6VF2). Those two cameras are also WiFi, but can be connected by Ethernet. I have those two cameras on WiFi and they work perfectly with the NVR. I get sound, PTZ, Zoom, Motion Detection without needing to do anything. I wish the Yi Dome camera with this firmware would work flawlessly. Right now the Yi Dome cameras are loosing NVR connection / frozen feed... which turns into a black feed when refreshed. Does this have to do with the live555? |
I don't know. Did you set tcp transport? Meanwhile I pulled out of the closet my old MISECU DVR. |
Yes, all the connections are set to TCP. Mine too works fine for a certain amount of time. After I come back hours later.... the live feed is frozen and when I refresh I get a black screen. Even when I restart the NVR, there is a slight delay on the Yi Dome cameras and it seems to get worst as time passes. The same thing happened to the 720p Yi Home 27US version.... So I don't think its a firmware issue anymore. I have 1GB Fiber Internet connection with WiFi 6 router and can eliminate the WiFi or internet as a problem here. The other two Hiseeu 5x Zoom cameras don't have a lag, freeze or any issues.... But that might be because of better hardware. I guess I will see if you experience the same issue or not. Will try to disable the cloud and sd card recording and see what happens. |
I will send you a feedback in a few days. |
I think you might want to take a look at this post on another Yi-Hack by TheCrypt0 . Just found it and will start looking at it now. Thank you for taking your valuable time to check this issue out. I know you do this on your free time and I greatly appreciated. |
Yes, it prints to stdout/stderr and no, it's not redirected.
Yes. The SD card is needed for v5, not for MStar. |
Thanks. I will check if it breaks, although it has been working for the last 6 hours without a problem. I do not know why it crashed yesterday multiple times and not today (only change being the activation of ONVIF). Regarding v5: do you know if I can directly upgrade from v4 or should I reset to stock firmware and then flash? Thanks! |
No, sorry. I don't know. |
Just in case anyone else guesses: yes, it is possible to upgrade from v4 to v5. It has been running for 15 minutes with the provided RTPS server and seems to be working (we will see how stable it is). I wanted to check the rtsp_server_yi that @roleoroleo shared some comments before (the one for v5) but it does not work for me (Yi Outdoor camera). If manually run from the command line (after killing the other one, if not it would not bind to 554) it seems to be running but when I try to connect with, say, VLC, it just outputs that a client connects and, after a few seconds, that it disconnects. Nothing more, and VLC does not get any image. Can I do something else to try to debug why it is not working on my camera? Thanks! |
Well... It just broke. Around 10 hours working without issue and it crashed 10 minutes after I added a second camera to frigate :/ I just killed the server and the watchdog run it again and everything started working again. The thing is that the process does not die and thus the watchdog does not restart it. It somehow hangs and stops sending data through the feed (or the data is corrupted, I am not sure, I have to analyze the errors on the client... |
If you are able to find the problem we could create a special watchdog. |
Yes. I am running it now interactively to see if something is outputted when the error takes place. I will keep digging into it. |
I am seeing many messages saying: write_buffer failed These messages are not timestamped, but I guess they have appeared at the same time I have seen errors in the client. However, the server, for now, has not crashed. Clients have been able to reconnect... Do you know what could have caused the error message? Maybe a memory problem? Is swap enabled? Should it be? |
I have been peeking into the code and it seems that this message is emitted by the TcpConnection class when it can not write to the buffer. RtspConnection inherits from TcpConnection so it would make sense that the call in line 202 of RtspConnection.cpp is the one causing the error. This problem, from what I see, can arise either when buffer is empty (size < index, given a default value for index of 0) or when the buffer is full. I would like to debug this a little further. Can you give me some clues on how to cross-compile for the OS in the camera? I do not have a Windows machine (just Mac and Linux). Is that ok? I have, however, a very crazy hypothesis of why this is happening. Yesterday the camera was working fine for the whole day. The problems started when the sun started to set and it got darker in that room. I programmed a crontab job in the camera to kill the server every hour and have it respawn by the watchdog. It did, but the server hang almost immediately every single time... until the sun has risen this morning... I do not know the internals of how the video is being grabbed from the kernel memory but: would it be possible that there is some difference when the camera switches to night view? A buffer of different size or even location? I know about correlation and causality, and I will monitor the whole day again, but my problems the last couple of days started by night, when there was no light. Any help to cross-compile the server with some additional printfs is welcome. Thanks! |
It's ok. I'm using a Debian 9 vm. To build only rtsp_server_yi run this script: About your hypothesis, it's possible. |
OK. Thanks. I will give it a try. No crashes since this morning. It seems that it actually might be related to the ir filter... I will update here with my findings. Cheers! |
Any progress or updates? |
Hi @idanny76. Sorry, this week has been impossible to me to have some time for this. My full time work and parenting leave me little spare time. I will try next week. Just to update my experience: it varies; sometimes, it does not crash in a whole day, even with the IR changes when lights are out. Other times, it instantly crashes when I turn out the lights. I have a funny video in which the last frame is me turning the lights switch off :) I will update as soon as I have something. Cheers. |
I also have problems with the RTSP stream, often I only have 10s of live video and then the stream freezes. I suspect it's also often when switching to night mode or when there is a lot of movement in front of the camera, e.g. a hand directly in front of the lens. In the YI Home app, the video is stable. I use the y203c version for my Yi 1080p Home 4FUS camera. |
Is the NVR supposed to record also the Audio? I am not getting any Audio. Truvision NVR 11 Stream Type is grayed out and its only on Video and not Audio & Video. Not sure why. |
Yes, NVR should record also audio. |
I contacted the Camera manufacturer and he says the NVR is also disabling audio in the cameras memory card. In the Yi Cameras I still get audio on the SD Cards, even do the NVR is not recording audio. But on my other Hiseeu PTZ cameras I do not get audio on the SD Card or NVR. Just when you think you have everything working..... you find something else. I didn't notice the NVR had not audio, because I don't usually need the audio and the audio for the live feed was working. But the other day I needed to hear the audio of some suspicious solicitors and the recorded video did not have audio. Now I have an NVR that doesn't record audio and zero support information online on this brand. Interlogix TruVision NVR 11 (TVN 11). So much for an NVR. |
Here is the Data Sheet https://static.interlogix.com/library/gsp-2612-nvr-11-data-sheet-web-v2.pdf for the NVR and it says "Supports 3rd-party cameras via ONVIF Profile S". Looking at some information on Profile S.... It seems it only records AAC audio. I am testing that now. Just switched one Yi camera to AAC. Edit: Just tested it and not getting audio on AAC. |
Does audio work with vlc? |
Sorry, I don't know how to help you. |
No worries.... Just wanted to see if you knew something about it. I can still get audio on the Yi Cam SD cards. The other brand cameras are not recording audio on the SD card and I was told by the seller that the NVR was disabling it on the cameras. So, it seems the NVR is not so good after all. |
Is there a reason why the feed of the Yi Dome goes from 1080p to 640p and not 720p? |
It's the standard configuration made by yi: high and low resolution. |
I decided to look into this again of why the NVR was not recording Audio. I finally found the reason why my NVR is not recording audio, but the video only. The NVR I have only Supports 3rd-party cameras via ONVIF Profile S. So I started looking into ONVIF Profile S and it only streams video and audio and only records video. ONVIF Profile G records and stores video and audio. The NVR is limiting the audio recording if its a third party camera. Picture attached shows the different ONVIF profiles and what they allow or support. https://www.cctvcameraworld.com/onvif-security-camera-compatibility |
I don't know how much you know about the NVR's. It's upsetting that the NVR I have only supports recording video and not Audio for third party cameras. The only audio I get from this NVR on third party cameras is live streaming. Do you know of any hacks or mods for NVR's that are out there? |
I don't know of any hacks. |
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. |
I am using a TruVision NVR that has 8 channels. The performance is not as I would like. Having to run all 8 cameras on the low stream RSTP. If I have the High RSTP some cameras will not work, because of low resources. I am trying to figure this all out. Question: Will it affect the NVR if I am also using the YI Home app at the same time? By having the NVR pulling stream from the cameras at the same time as the app also sending stream to the Yi app make the cameras overload?
I got the NVR free from my brother and just wanted to have the longer recording storage free. But the Yi app has good functionality that the NVR does not. The PTZ function on the NVR does not work. I would also like to have the NVR record on 1080p, but I guess thats too much to ask for. Any suggestion or help will greatly be appreciated, thank you.
The text was updated successfully, but these errors were encountered: