The real problem was camera_proxy in place of camera_proxy_stream.
In my case, the address must be https otherwise it gives me a 401 error.
In my case, the file extension must be .avi. With .mp4 it saves a video that cannot be viewed with VLC or with Windows Media Player.
The saved video is much faster than normal.
For example, with these parameters ffmpeg -i $http_url -s 1600x1200 -t 3 -vcodec copy $folder/$id$extension_file
a 3 seconds video is saved but, actually, it contains frames for about 30/35 seconds.
I am trying to follow your steps but I can’t even get the script to run.
Could you tell me what would be the steps one by one?
Theoretically I have everything right, but it is clear that the script does not run, because it gives an access denied error and the file with the logs is not generated.
hi, I manage to make the all things working, but I still have the same problem as yours…
My output video is really fast, I saw on the log that my input stream is detected as 25fps even if I put 5fps in esphome as parameter. The thing is the FFmpeg wait for 250 frame for 25fpt*10sec and put it in a 10sec container. I have at the end a 10sec movie with 250 frame, but those frame were taken during a much longer time… any idea to solve that?
its much better, let me know if you think ist better or not for you
if you want to save space you can use libx264 but be carefull because it consume CPU. I have an intel NUC8 with a Core I5 and it consume 4% more of CPU with compression. Without my CPU is at 8%, with compression my CPU is at 12%. And when IDLE he is between 5 and 7%.
Imagine if you have a RPI4 and 2 or 3 stream are encoded…your CPU will be at 100%, sure! and probably crash with 3 or more stream to be recorded and compressed at the same time, so, be carefull and check your CPU usage when he record a stream.
Hello Olivier,
Thank you for all the effort and work you put into this post, it has helped me a lot.
I can already record a video, but it is still too fast. I have implemented your recommended change but have not seen any improvement. Have I done something wrong? Here is my shell file:
I have a NUC with a I5 3.6Ghz and the encode and record is really power consuming…so if you a have a “simple” RPI4…that should be the point…just and idea…
Hi, you’re right I’m using an RPI4, but the processor load doesn’t go above 6% when I run the script. I still get a video just not slowed down.
Do you have any other ideas? I was thinking I could adjust the frame rate. Currently it always assumes 25 FPS (25 FPS * 20 seconds recording time = 500 frames). I’ve already thought about overwriting this default value of 25 FPS with the actual FPS. Do you know how to do this?
strange that you consume only 6%…because i was on RPI4 for a couple of years and each time a video is recorded it take almost 60% of my RPI4 CPU, which was a 8Go version and if i encode with recording, it take 80%.