Sunoo / homebridge-camera-ffmpeg

Homebridge Plugin Providing FFmpeg-based Camera Support
https://sunoo.github.io/homebridge-camera-ffmpeg/
Apache License 2.0
1.08k stars 225 forks source link

v2.0.0 Streaming Issues #554

Closed ex725 closed 4 years ago

ex725 commented 4 years ago

it was working fine before updating.

image

image image

donavanbecker commented 4 years ago

did you update to v2.0.0?

ex725 commented 4 years ago

did you update to v2.0.0?

Yes. became inoperable after updating

MikeDProducer commented 4 years ago

Same.

AtomicLight commented 4 years ago

Same. My cameras just error out in the Home app.

sylwesterr commented 4 years ago

Same here - it does not seem to be loading at all...

vshurygin commented 4 years ago

Same, Two cameras, screenshots give out.

dehness commented 4 years ago

Same here. Two cameras using RTSP stream. Worked fine prior to 2.0.0 update.

thorstenman commented 4 years ago

Same here. Had 6 cameras connected. Worked perfect before updating. Now Homebridge completely stopped working. After deleting the whole plugin related config and adding one camera it works again... adding more let’s it break.

donavanbecker commented 4 years ago

Since this changes everything over to bridged cameras, did you all double check that you were viewing the bridged cameras? vs old non bridged cameras? The old non bridged cameras need to be manually removed.

vshurygin commented 4 years ago

Since this changes everything over to bridged cameras, did you all double check that you were viewing the bridged cameras? vs old non bridged cameras? The old non bridged cameras need to be manually removed.

I even uninstalled and reinstalled the plugin. The cameras of course the old ones were removed.

thorstenman commented 4 years ago

I deleted the camera configs in the config.json, deinstalled the plugin and reinstalled. Same behavior still.

Before v2.0.0 I saw all cameras next to directly to HomeKit integrated ones.

dehness commented 4 years ago

I removed the devices via the GUI. And since the new bridge camera mode doesn’t offer the option to “remove camera”, I’m certain I removed the right ones.

I tried several uninstall/restart/reinstall’s of the plugin and even tried the 2.0.1 beta 4 (I think) but to no avail. However, as soon as I downgraded to 1.3.0 and re-added the cameras they worked perfectly.

thorstenman commented 4 years ago

I downgraded to v1.3.0, re-implemented via old config.json, decoupled again via Homebridge UI prefs, deleted in parallel via Homebridge Camera Ffmpeg plugin GUI all cameras as well as the plugin itself. After that reinstalled v2.0.0. No change. Not even the Homebridge Config UI is accessible...

Is it maybe a problem that the cams are somehow connected via HomeKit basing on the pin integration (instead of QR code)?

bjornand1 commented 4 years ago

Just one more chiming in with the same problem. I have two cameras connected, after the latest update one of them, a KingCam, has stopped responding in HomeKit (it still works fine in the native app).

donavanbecker commented 4 years ago

Just one more chiming in with the same problem. I have two cameras connected, after the latest update one of them, a KingCam, has stopped responding in HomeKit (it still works fine in the native app).

If you are looking at the cameras you had before updating, they will be unresponsive. Homebridge will add the cameras bridged to homebridge. So I would check to see if your cameras are in the same room as your homebridge bridge?

bjornand1 commented 4 years ago

@donavanbecker Thanks for the tip, but I have noticed that. I have removed the old instances and moved the new ones to the correct rooms. One of these still work as before, but one says no response, and in the homebridge log, it says «exited with code 1 and signal null.

donavanbecker commented 4 years ago

@donavanbecker Thanks for the tip, but I have noticed that. I have removed the old instances and moved the new ones to the correct rooms. One of these still work as before, but one says no response, and in the homebridge log, it says «exited with code 1 and signal null.

Can you post your config?

bjornand1 commented 4 years ago

"name": "Camera ffmpeg", "cameras": [ { "name": "KingCam", "videoConfig": { "source": "-rtsp_transport http -i rtsp://xxx.xxx.x.xx/user=Xxxx_password=Xxxxxxx_channel=1_stream=0.sdp?real_stream", "stillImageSource": "-i http://faster_still_image_grab_url/this_is_optional.jpg", "maxStreams": 1, "maxFPS": 15, "maxBitrate": 300, "vcodec": "copy", "audio": false, "debug": true

bjornand1 commented 4 years ago

@donavanbecker Posted now, does it provide any clues?

kontur11 commented 4 years ago

"name": "Camera ffmpeg", "camera": [ { "name": "KingCam", "videoConfig": { "source": "-rtsp_transport http -i rtsp: //xxx.xxx.x.xx/ user = Xxxx_password = Xxxxxxx_channel = 1_stream = 0.sdp? real_stream ", " stillImageSource ":" -i http: //faster_still_image_grab_url/this_is_optional.jpg ", " maxStreams ": 1, " maxFPS ": 15, " maxBitrate ": 15, " maxBitrate ": , "vcodec": "copy", "audio": false, "debug": true

" maxBitrate ": 15, " maxBitrate ": , ????

bjornand1 commented 4 years ago

Something went wrong when pasting, maxbitrate is set at 300, only one entry!

bjornand1 commented 4 years ago

"name": "Camera ffmpeg", "cameras": [ { "name": "KingCam", "videoConfig": { "source": "-rtsp_transport http -i rtsp://xxx.xxx.x.xx/user=xxxxxx_password=xxxxxx_channel=1_stream=0.sdp?real_stream", "stillImageSource": "-i http://faster_still_image_grab_url/this_is_optional.jpg", "maxStreams": 1, "maxFPS": 15, "maxBitrate": 300, "vcodec": "copy", "audio": false, "debug": true

donavanbecker commented 4 years ago

@bjornand1 Can you try setting video processor from config ui? To ffmpeg.

vshurygin commented 4 years ago

@bjornand1 Can you try setting video processor from config ui? To ffmpeg.

It didn't help.

ex725 commented 4 years ago

You can fix the problem by going to the previous version for now.

sudo npm install -g --unsafe-perm homebridge-camera-ffmpeg@1.3.0

MikeDProducer commented 4 years ago

I had the same problem. Yes, i removed the old cameras. The new ones show thumbnails but the streams don’t work. Ffmpeg exits and SIGTERM.

I wonder if the video codec has something to do with it. Has anyone tried not using “copy” as the codec?

tarbychark commented 4 years ago

Same problems here. Snapshots now rarely update and the camera's never go live.

[6/22/2020, 12:38:05 AM] [Camera-ffmpeg] [FFMPEG] ffmpeg exited with code: 1 and signal: null (error)

No issues with the previous version.

bjornand1 commented 4 years ago

I have run the command "sudo npm install -g --unsafe-perm homebridge-camera-ffmpeg@1.3.0" to downgrade, but the plugin remains at version 2.0.0. Is there any advice on how to make the downgrade happen?

ciavez commented 4 years ago

same for me as you can see the image works well with VLC or similar but no way from HOME app.

image

"cameras": [ { "name": "BOXCAM", "manufacturer": "XXX", "motion": false, "videoConfig": { "source": "-rtsp_transport tcp -re -i rtsp://XXXXXX@192.168.8.XXX:554/videoMain", "vcodec": "copy", "additionalCommandline": "-loglevel verbose", "audio": false, "debug": true } } ], "platform": "Camera-ffmpeg"

toshibochan commented 4 years ago

@ciavez I can see your port is 12788 not 554

toshibochan commented 4 years ago

@ciavez What Mac OS you using and what plugins you using for configure your camera? In Mac OS Mojave and catalina I can’t use this plugin anymore. I have to use older Mac for configure the camera.

ciavez commented 4 years ago

@ciavez I can see your port is 12788 not 554 Don’t worry .. that’s normal. Hard to explain but normal.

I’m using a Mac with Catalina but the plugins runs on RPI. Not sure I understand why this could be related

OnePanthera commented 4 years ago

After a bunch of tries and install ffmeg from scratch, the following config worked for me. { "name": "Kitchen", "manufacturer": "Amcrest", "model": "IP8M", "serialNumber": "1XYZ03", "videoConfig": { "source": "-rtsp_transport tcp -i rtsp://admin:mypassword@192.168.0.100:80/cam/realmonitor?channel=2&subtype=1", "maxFPS": 25, "maxBitrate": 16383, "vcodec": "copy" } I also changed from the original: source: -re -i rtsp:// to -rtsp transport tcp -i rtsp://

AtomicLight commented 4 years ago

@OnePanthera I have Amcrest Cameras as well - and I tried using your template and no joy for me. Below is the code I built using your template.

Questions: 1) How do you handle snapshots? Do you not have a line for that? 2) Have you tried using audio? I need that. 3) what about IP of the camera? That's missing from your code

My code that does NOT work:

"name": "Front Drive", "manufacturer": "Amcrest", "model": "IP8M-T2499EW", "serialNumber": "AMXXXXXXXXXX", "videoConfig": { "source": "-rtsp_transport tcp -i rtsp://USER:PASSWORD@10.0.0.230/cam/realmonitor?channel=1&subtype=00&authbasic=", "stillImageSource": "-i http://USER:PASSWORD@10.0.0.230/cgi-bin/snapshot.cgi", "vcodec": "copy", "debug": false, "videoFilter":"None", "maxStreams": 2, "maxWidth": 1920, "maxHeight": 1080, "maxFPS": 15, "maxBitrate": 1200, "audio": true

OnePanthera commented 4 years ago

@OnePanthera I have Amcrest Cameras as well - and I tried using your template and no joy for me. Below is the code I built using your template.

Questions:

  1. How do you handle snapshots? Do you not have a line for that?
  2. Have you tried using audio? I need that.
  3. what about IP of the camera? That's missing from your code

My code that does NOT work:

"name": "Front Drive", "manufacturer": "Amcrest", "model": "IP8M-T2499EW", "serialNumber": "AMXXXXXXXXXX", "videoConfig": { "source": "-rtsp_transport tcp -i rtsp://USER:PASSWORD@10.0.0.230/cam/realmonitor?channel=1&subtype=00&authbasic=", "stillImageSource": "-i http://USER:PASSWORD@10.0.0.230/cgi-bin/snapshot.cgi", "vcodec": "copy", "debug": false, "videoFilter":"None", "maxStreams": 2, "maxWidth": 1920, "maxHeight": 1080, "maxFPS": 15, "maxBitrate": 1200, "audio": true

Hi @AtomicLight - I updated the above post, for some reason the last paste didn't have it included. I left the snapshot line out since I can't find anything on Amcrest for that. I don't have audio so never tried it.

fparrav commented 4 years ago

I wonder if the video codec has something to do with it. Has anyone tried not using “copy” as the codec?

I think the problem is not the codec but the type of camera, I have a camera mjpeg with codech264_omx works without problems on a raspberry pi 3B, although the use of cpu is higher than usual.

Try replacing the copy codec toh264_omx on an rstp camera (in theory it should work) and the problem fuels the same [FFMPEG] ffmpeg exited with code: 1 and signal: null (error), apparently it is a problem with the stream from rstp.

Edit: also try with the option " videoProcessor ":" / usr / local / bin / ffmpeg " also without success.

AtomicLight commented 4 years ago

@OnePanthera I have Amcrest Cameras as well - and I tried using your template and no joy for me. Below is the code I built using your template. Questions:

  1. How do you handle snapshots? Do you not have a line for that?
  2. Have you tried using audio? I need that.
  3. what about IP of the camera? That's missing from your code

My code that does NOT work: "name": "Front Drive", "manufacturer": "Amcrest", "model": "IP8M-T2499EW", "serialNumber": "AMXXXXXXXXXX", "videoConfig": { "source": "-rtsp_transport tcp -i rtsp://USER:PASSWORD@10.0.0.230/cam/realmonitor?channel=1&subtype=00&authbasic=", "stillImageSource": "-i http://USER:PASSWORD@10.0.0.230/cgi-bin/snapshot.cgi", "vcodec": "copy", "debug": false, "videoFilter":"None", "maxStreams": 2, "maxWidth": 1920, "maxHeight": 1080, "maxFPS": 15, "maxBitrate": 1200, "audio": true

Hi @AtomicLight - I updated the above post, for some reason the last paste didn't have it included. I left the snapshot line out since I can't find anything on Amcrest for that. I don't have audio so never tried it.

Thanks. @OnePanthera For snapshot on all my Amcrest cameras I use:

"stillImageSource": "-i http://USER:PASSWORD@10.0.0.230/cgi-bin/snapshot.cgi"

bjornand1 commented 4 years ago

@ex725 Any idea why the command "sudo npm install -g --unsafe-perm homebridge-camera-ffmpeg@1.3.0" does not downgrade the plugin? I have tried running it in the Homebridge Config UI X terminal and my Docker terminal, but the plugin remains at 2.0

OnePanthera commented 4 years ago

@OnePanthera I have Amcrest Cameras as well - and I tried using your template and no joy for me. Below is the code I built using your template.

Questions:

  1. How do you handle snapshots? Do you not have a line for that?
  2. Have you tried using audio? I need that.
  3. what about IP of the camera? That's missing from your code

My code that does NOT work:

"name": "Front Drive", "manufacturer": "Amcrest", "model": "IP8M-T2499EW", "serialNumber": "AMXXXXXXXXXX", "videoConfig": { "source": "-rtsp_transport tcp -i rtsp://USER:PASSWORD@10.0.0.230/cam/realmonitor?channel=1&subtype=00&authbasic=", "stillImageSource": "-i http://USER:PASSWORD@10.0.0.230/cgi-bin/snapshot.cgi", "vcodec": "copy", "debug": false, "videoFilter":"None", "maxStreams": 2, "maxWidth": 1920, "maxHeight": 1080, "maxFPS": 15, "maxBitrate": 1200, "audio": true

Hi @AtomicLight - Did you paste rtsp://USER:PASSWORD@10.0.0.230/cam/realmonitor?channel=1&subtype=00&authbasic= to VLCplayer to see if that works? I don't think you need the "&subtype=00&authbasic="

AtomicLight commented 4 years ago

@OnePanthera I have Amcrest Cameras as well - and I tried using your template and no joy for me. Below is the code I built using your template. Questions:

  1. How do you handle snapshots? Do you not have a line for that?
  2. Have you tried using audio? I need that.
  3. what about IP of the camera? That's missing from your code

My code that does NOT work: "name": "Front Drive", "manufacturer": "Amcrest", "model": "IP8M-T2499EW", "serialNumber": "AMXXXXXXXXXX", "videoConfig": { "source": "-rtsp_transport tcp -i rtsp://USER:PASSWORD@10.0.0.230/cam/realmonitor?channel=1&subtype=00&authbasic=", "stillImageSource": "-i http://USER:PASSWORD@10.0.0.230/cgi-bin/snapshot.cgi", "vcodec": "copy", "debug": false, "videoFilter":"None", "maxStreams": 2, "maxWidth": 1920, "maxHeight": 1080, "maxFPS": 15, "maxBitrate": 1200, "audio": true

Hi @AtomicLight - Did you paste rtsp://USER:PASSWORD@10.0.0.230/cam/realmonitor?channel=1&subtype=00&authbasic= to VLCplayer to see if that works? I don't think you need the "&subtype=00&authbasic="

I did not. I will remove and test.

AtomicLight commented 4 years ago

When I removed &subtype=00&authbasic= I got an error when opening in VLC.

beele commented 4 years ago

Same issue. I'm updating my plugin with this new version. I've done some digging and enabled the underlying debug flags. It appears that data is being sent to my iphone but the stream never updates on screen (spinner never goes away) debug.log If I add the mapvideo back in the output does change quite a bit but still no video stream in the app. debug-2.log

rottylr commented 4 years ago

Hello all. Just started tinkering with homebridge/HOOBS this week. Couldn’t get my amcrest camera to stream. Now I see there’s a bug in the current version of FFmpeg. Since I don’t have a backup to restore, where can I download the previous version?

bjornand1 commented 4 years ago

@rottylr How did you determine there is a bug in ffmpeg? But if that is the case, it means the problem is not the homebridge plugin, which is consistent with me not getting my KingCam camera to work even when setting it up in a new Homebridge instance and using 1.3 of the plugin.

bjornand1 commented 4 years ago

Update, something happened during the night, now my camera works in both plugin version 1.3 and 2.0!

beele commented 4 years ago

I got it working with the following config:

"vcodec": "h264",
"audio": true,
"maxStreams": 2,
"maxWidth": 1920,
"maxHeight": 1080,
"maxFPS": 15,
"mapvideo": "0:1",
"mapaudio": "0:0",
"maxBitrate": 3000,
"packetSize": 188,
"additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp -loglevel verbose"
rottylr commented 4 years ago

@rottylr How did you determine there is a bug in ffmpeg? But if that is the case, it means the problem is not the homebridge plugin, which is consistent with me not getting my KingCam camera to work even when setting it up in a new Homebridge instance and using 1.3 of the plugin.

@bjornand1 To be clear, I meant the homebridge-ffmpeg plugin.

I will try the config recently used by @beele.

vshurygin commented 4 years ago

I got it working with the following config:

"vcodec": "h264",
"audio": true,
"maxStreams": 2,
"maxWidth": 1920,
"maxHeight": 1080,
"maxFPS": 15,
"mapvideo": "0:1",
"mapaudio": "0:0",
"maxBitrate": 3000,
"packetSize": 188,
"additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp -loglevel verbose"

Thanks, it worked. But for some reason the camera gives a stream for a very long time, it used to take 2 seconds, now 10

donavanbecker commented 4 years ago

So just tested this with the following test config. And it works perfectly. If you use the latest beta with homebridge -D enabled. it will output ffmpeg debug more and you can see that output to see what issues ffmpeg is having.

{
            "cameras": [
                {
                    "name": "Test Camera",
                    "manufacturer": "Test",
                    "model": "Camera",
                    "firmwareRevision": "1.23",
                    "videoConfig": {
                        "source": "-re -i http://cdn.nexttvnet.ru/hlsl/10/Russkiy_ekstrim/Russkiy_ekstrim_3/index.m3u8",
                        "stillImageSource": "-i http://cdn.nexttvnet.ru/hlsl/10/Russkiy_ekstrim/Russkiy_ekstrim_3/index.m3u8",
                        "audio": true
                    }
                }
            ],
            "platform": "Camera-ffmpeg"
        }
LeJeko commented 4 years ago

Works again with 2.0.1-beta.32 bit with a bit of lag. For years, snapshot would refresh every 10 seconds and video started in few seconds. Now it's 15-20 for snapshot and 20-30 for video.