Skip to content
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

Painfully slow stream #1

Open
gothian opened this issue Apr 9, 2017 · 6 comments
Open

Painfully slow stream #1

gothian opened this issue Apr 9, 2017 · 6 comments
Labels

Comments

@gothian
Copy link

gothian commented Apr 9, 2017

I use the HomeKitCam on my computer with a microsoft Cinema camera and it works perfect.
No i try to do the same thing with my raspberry pi and the picam and get painfully slow laggs on the stream i talking about one second in real time takes 20 seconds to watch in the home kit app

I have tried to change the ffmpegCommand params without result. is it really possible to stream with ffmpeg and raspberry pi Model B?

/Adam

@Didel
Copy link
Owner

Didel commented Apr 10, 2017

Hi Adam,

Good to see this solution working fine on a powerful device (like a PC)!

However, the problem you describe is exactly the same problem I'm currently having. I haven't been able to look at it for a while now, but it appears that the Raspberry Pi (even the Pi 3) just isn't powerful enough to handle the streaming video in combination with the encryption needed for HomeKit.

We obviously can't make the Pi more powerful (we can in fact overclock it, but I don't think that would solve this problem and it will potentially harm destroy your Pi), so the remaining solution would be to make the whole process less resource-intensive. I have already tried to cut down the resources to a bare minimum (using ffmpeg/avconv directly to handle the video stream as opposed to e.g. using the VLC-libraries to stream video, using a lower than optimal resolution/bitrate), but to no avail.

There might be something I'm overlooking, so any suggestions / solutions are welcome!

@Didel Didel added the bug label Apr 10, 2017
@gothian
Copy link
Author

gothian commented Apr 11, 2017

Good to hear that it is not just me who have that problem.

I understand that raspi is not the most powerfull device. I was hoping that araspberry pi 3 would solve that issue but according to you even raspi3 have not that much power.
However motion manage to work around that problem somehow. I dont know if that use ffmepg or something else but they manage to squeeze a good picture in 640x480 with a framerate about 5fps.
I tried to add the -r 5 flag to the command but did not anything better. I am not that good with ffmpeg ( or video for that matter ) but maybe you have better luck with the framerate.

@gothian
Copy link
Author

gothian commented Apr 18, 2017

Didel have you trided https://github.com/phoboslab/jsmpeg ?
I have trided https://github.com/waveform80/pistreaming with my raspi and it work good without bigger delays.

@Didel
Copy link
Owner

Didel commented Apr 24, 2017

Thanks for the suggestion! It looks like a nice solution to experiment with anyways!

At this moment though I'm in the middle of moving, so my Pi's are already packed up in moving boxes 📦 Feel free to give it a try and supply a Pull Request if you got something working. I'll do so myself as well, but that probably won't be until the beginning of June.

@theopoon
Copy link

theopoon commented Sep 22, 2017

I tested the code using ffmpeg with h264_omx compiled with a Pi CamModule1 on a Pi3, CPU are greatly spread to 4 cores @ 10~20% load.

I think the delay looks more like the buffering side from the iOS Home app itself than the code of HomeKitCam.

@theopoon
Copy link

theopoon commented Oct 3, 2017

A bit of update, no, it is NOT buffering on iOS Home app side, I do not see much buffer nor delay when I use ffmpeg h264_omx, it is like 0.5s buffer or less.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants