-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
0.91.0 - Camera stream recording getting stuck #22741
Comments
This is intended. Currently you can not record the same stream to multiple files at the same time. You need to wait for the previous recording to complete first. |
The issue is that I start a record for 20 seconds with 20 seconds lookback, and 10 minutes later it still tells me that it can not record, as it's still recording.... Look at the timestaps:
|
Oh. That is interesting. I missed it the first time around. Will need to look further in to it. |
Is there any debugging I could turn on to get you better info? :D |
Just tested the new feature and on the first try I get the same problem. |
I can verify I get the same error. Exactly same setup with dafang camera and same settings. |
So I can only reproduce this issue if a stream is actively being recorded, which is intended behavior. After waiting until after the previous recording is completed (file exists in output folder), I am able to call the service again with no problem. @droopanu - It looks like you are calling this with a script, that also has a sleep in there. Can you post your script so I can try to reproduce the error? |
Having the same issues here. 6 recordings went okay but I noticed the lookback function did not work. No file was saved so I had to restart HA to make it work again. Same command now worked without problems. Is the lookback function working for you? I would love to see this work! |
The Preload Stream option is required for lookback to work, as mentioned in the docs. |
I have the preload option enabled. However it only starts recording one or two seconds after I submit the request with lookback 10 as parameter.
[Image]
Outlook voor iOS<https://aka.ms/o0ukef> downloaden
…________________________________
Van: Jason Hunter <[email protected]>
Verzonden: zondag, april 7, 2019 12:54 AM
Aan: home-assistant/home-assistant
CC: Richard; Comment
Onderwerp: Re: [home-assistant/home-assistant] 0.91.0 - Camera stream recording getting stuck (#22741)
The Preload Stream option is required for lookback to work, as mentioned in the docs.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#22741 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGNMwso_hejGIvVqf4ZpJEeupE1GVyWsks5veSWIgaJpZM4cdv1_>.
|
@hunterjm thank you for looking into this issue. Funny enough, saturday morning the record function was stuck in the same situation (could not record anything new), restarted hass and it's been going on without any issues since. Could not reproduce it any more. PS. I must say that the camera stream record and tensorflow are the two most awesome homeassistant features. :) Thank you! Python script: (had to rename it from .py to .txt as it would not allow me to upload .py) |
I think figured out how to reproduce the issue. Today, after almost a week, the issue happened again, and I was not able to record anything from a certain stream until I restarted home assistant. The only thing I did today, I moved the camera from one wifi access point to another. So I realized that the issue might be caused by connectivity issues. So I started a stream record, rebooted the dafang camera (could also block the wifi access for a minute or so) and it got stuck again... Hope this helps narrow down the issue. |
I have the same setup and it is working for me. I still get the errors about headers and stream already recording, but it still records the next clip if I wait 30 seconds. I think dafang has a very low cooldown between motion triggers which is why the stream already recording error is present. |
@hunterjm: have you managed to reproduce the issue? I'm still getting the stuck issue and have to restart my homeassistant a few times a day to get it working again. |
I did more digging and looks like the issue is in the pyav/ffmpeg. This solution only works when using tcp transport for rtsp. I actually managed to fix it in homeassistant by adding the following to "lib/python3.6/site-packages/homeassistant/components/stream/init.py:
This means that next time the camera dies, the stream will also die and next time it's launched the lookback will not be available, but at least it does not require a full homeassistant restart. Also, it might break cameras that can only use UDP for RTSP streaming .... Someone would need to test it Cheers, |
@droopanu - thanks for all your work on that! Would you like to open a PR against Dev to get credit for your work? We only use TCP connections for RTSP anyway (prefer tcp option apparently doesn’t actually fallback to UDP), so i wouldn’t worry about that part. |
Let me see, I've never done a PR :D Would be nice to have the streaming component automatically restart the streaming when it stops if the preloading is enabled. |
Add a TCP timeout of 5 seconds to ffmpeg to fix stream getting stuck when network connectivity is lost home-assistant#22741
@hunterjm Do I need to do anything else for the PR to be merged? :) |
Tag me in it ;) |
Add a TCP timeout of 5 seconds to ffmpeg to fix stream getting stuck when network connectivity is lost #22741
I had similar issue with |
Same error since year. I get |
I am also seeing the same issue here. Might not be the same exact one but it does manifest in the same way: homeassistant.exceptions.HomeAssistantError: Stream already recording to /media/2020-10-16--20:58:54.mp4! Also when this happens the actual camera view gets stuck, too, looping the same content over and over. |
Same |
I am experiencing the same problem with a UniFi Video setup and HASS 0.116.4.
|
There seems to be incoming changes from #42277 related to socket timeouts, so with some luck that will fix this bug as well! |
I am also interesed how can it be that more then one year (as i know, but maybe earlier) this problem till not get fixed. |
Yea seems strange to me too. I know that h.a is made by the devs in their
own time and it is absolutely awesome for free. Not complaining. Just
thought that it would be of way more interest than what it has been lol.
Plus it would make h.a 1000x better if the camera record function was
reliable
…On Wed, 17 Mar 2021, 10:04 pm RestOp, ***@***.***> wrote:
I am also interesed how can it be that more then one year (as i know, but
maybe earlier) this problem till not get fixed.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22741 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANC2MVP6Q72SDDPQYNEVNMTTEBWCHANCNFSM4HDW7V7Q>
.
|
I thing till record do not work as it must, it have to be deleted from release. |
Now now dont be rash hahahaha
…On Thu, 18 Mar 2021, 1:54 am RestOp, ***@***.***> wrote:
I thing till record do not work as it must, it have to be deleted from
release.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22741 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANC2MVJXRSP5D7XCV7CFCL3TECRA3ANCNFSM4HDW7V7Q>
.
|
I mean because really important function, on that i lay hopes, works randomly. |
Yea. Thinking about looking at blue iris fpr recording
…On Thu, 18 Mar 2021, 9:42 am RestOp, ***@***.***> wrote:
I mean because really important function, on that i lay hopes, works
randomly.
In this case better to look for other solutions, than start to using it
and know that it has failed when it was so needed...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22741 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANC2MVPQLCYCGUTDWNPSGH3TEEH4RANCNFSM4HDW7V7Q>
.
|
My 3 cameras were recording ok, but since last night I've been having this issue as well... The camera.record service starts without any errors, but never finishes recording and never saves the file to disk... The only way to make that happen is retriggering the camera.record service to make the previous mp4 file save to disk. Really bummer as this was working perfectly for a month and suddenly it started behaving this way... even after multiple HA restarts. |
Yep, mine has done so from day one. Same as a friends instance - does the
exact same thing. I bet that the problem with camera.record just gets
overlooked as user error but i know for sure that its not lol. Have had no
clues on here or on the fb group as to how to fix it. Just people assuming
that im personally doing something wrong 🙄🙄🙄
Even though im not the only one with this issue
…On Sun, 28 Mar 2021, 5:20 am krue81, ***@***.***> wrote:
My 3 cameras were recording ok, but since last night I've been having this
issue as well... The camera.record service starts without any errors, but
never finishes recording and never saves the file to disk... The only way
to make that happen is retriggering the camera.record service to make the
previous mp4 file save to disk.
Really bummer as this was working perfectly for a month and suddenly it
started behaving this way... even after multiple HA restarts.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22741 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANC2MVOJUFS3EHRMZY5ZHSLTFYAVNANCNFSM4HDW7V7Q>
.
|
I record a number of recordings every day, at least 10 of them. I have not had a single problem lately, probably since the merge mentioned above! I guess there is something special in your setup that makes you see this issue. |
Yep so do i. More like 20 lol. And apl 3 instances i have set up do the
exact same thing. And the automation is simple and works fine but its the
.record function itself that has the error
…On Mon, 29 Mar 2021, 5:44 am John Bäckstrand, ***@***.***> wrote:
I record a number of recordings every day, at least 10 of them. I have not
had a single problem lately, probably since the merge mentioned above!
I guess there is something special in your setup that makes you see this
issue.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22741 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANC2MVOU5S3CIROI4J7JK23TF5TI5ANCNFSM4HDW7V7Q>
.
|
I have 2 raspi with different cameras that i tryed - all the same... |
My setup was working perfectly for a month, then, suddenly, started behaving this way... HA shows no error when calling the camera.record function, but the function does not stop after the configured amount of time (30s in my case). The only way to make the record function to stop and save the mp4 file to disk is to spam HA with the same function call (camera.record) 2 or 3 times, forcing it to show an "camera already recording" error and finally saving the original recording to disk. In my setup, there has not been any changes in camera configuration, HA configuration or network configuration. The issue appeared suddenly.
|
Isnt it funny that people just assume it is the users fault because they
haven't experienced the problem themselves lol. Definitely a bug with the
.record function. Ive seen alot of people with the same issue. The question
is when will it be fixed if ever? Its pretty much useless for security use
or anything remotely important when its unreliable like this.
…On Tue, 30 Mar 2021, 3:59 am krue81, ***@***.***> wrote:
My setup was working perfectly for a month, then, suddenly, started
behaving this way... HA shows no error when calling the camera.record
function, but the function does not stop after the configured amount of
time (30s in my case). The only way to make the record function to stop and
save the mp4 file to disk is to spam HA with the same function call
(camera.record) 2 or 3 times, forcing it to show an "camera already
recording" error and finally saving the original recording to disk.
In my setup, there has not been any changes in camera configuration, HA
configuration or network configuration. The issue appeared suddenly.
I record a number of recordings every day, at least 10 of them. I have not
had a single problem lately, probably since the merge mentioned above!
I guess there is something special in your setup that makes you see this
issue.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22741 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANC2MVLVWKRHYNZGQEU7PKLTGCIWPANCNFSM4HDW7V7Q>
.
|
A year passed, still having the same "Stream already recording to.." every several days and only restarting HA temporary solves the issue.. I'm with 2022.3.5 |
Yea i gave up. The developers obviously dont care about the bug so i moved
on to a different system for cameras
…On Sun, 27 Mar 2022, 11:50 pm radinsky, ***@***.***> wrote:
A year passed, still having the same "Stream already recording to.." every
several days and only restarting HA temporary solves the issue.. I'm with
2022.3.5
—
Reply to this email directly, view it on GitHub
<#22741 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANC2MVPVTIWLJYPRIWRVR4TVCA4P3ANCNFSM4HDW7V7Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Where have you moved? |
Just a off the shelf swann system. Its not perfect but at least it records
video reliably. I can still pull the stream in through h.a but i just use
the box to record if person/movement. Not really what i wanted tbh but oh
well
…On Mon, 28 Mar 2022, 8:50 pm RestOp, ***@***.***> wrote:
Yea i gave up. The developers obviously dont care about the bug so i moved
on to a different system for cameras
… <#m_-6367407614665483774_>
On Sun, 27 Mar 2022, 11:50 pm radinsky, *@*.*> wrote: A year passed,
still having the same "Stream already recording to.." every several days
and only restarting HA temporary solves the issue.. I'm with 2022.3.5 —
Reply to this email directly, view it on GitHub <#22741 (comment)
<#22741 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ANC2MVPVTIWLJYPRIWRVR4TVCA4P3ANCNFSM4HDW7V7Q
<https://github.com/notifications/unsubscribe-auth/ANC2MVPVTIWLJYPRIWRVR4TVCA4P3ANCNFSM4HDW7V7Q>
. You are receiving this because you commented.Message ID: @.*>
Where have you moved?
—
Reply to this email directly, view it on GitHub
<#22741 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANC2MVMWW7AK2H5HV6EIP63VCFQDRANCNFSM4HDW7V7Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Not sure if this helps but I tried adding a random 4 character string to the filename, for example: visitor_5hBl_20230620_093514.mp4, and if I wait like one or two seconds before the next trigger it won't fail. Like as soon as I see the node turning green from yellow, I wait a second, hit it again and there's no error. My only problem is that I have android and cannot display the recording as a notification :( :( |
You would think that the devs wouod have fixed this big by now. Instead
they update things that dont need updated and leave annoying bugs like this
one. I gave up on the camera recording through ha in the end.
…On Wed, 21 Jun 2023, 2:23 am Dániel Diószegi, ***@***.***> wrote:
Not sure if this helps but I tried adding a random 4 character string to
the filename, for example: visitor_5hBl_20230620_093514.mp4, and if I wait
like one or two seconds before the next trigger it won't fail. Like as soon
as I see the node turning green from yellow, I wait a second, hit it again
and there's no error. My only problem is that I have android and cannot
display the recording as a notification :( :(
—
Reply to this email directly, view it on GitHub
<#22741 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANC2MVK7HAIYLGWJSEDF563XMGW6JANCNFSM4HDW7V7Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Home Assistant release with the issue:
0.91.0
Last working Home Assistant release (if known):
NA
Operating environment (Hass.io/Docker/Windows/etc.):
VirtualEnv on NUC
Component/platform:
https://www.home-assistant.io/components/stream/
Description of problem:
From time to time the camera streaming would not start and complain that the steam is already recording.
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Traceback (if applicable):
Additional information:
The text was updated successfully, but these errors were encountered: