keshavdv / unifi-cam-proxy

Enable non-Ubiquiti cameras to work with Unifi NVR
MIT License
1.68k stars 235 forks source link

ffmpeg unknown parameter -stimeout #55

Closed saschawerner closed 2 years ago

saschawerner commented 3 years ago

Liveview / Recording does not work.

Traced this back to the parameter -stimeout that my ffmpeg version does not support.

ffmpeg version git-2021-07-16-cf12a47

Any suggestions?

keshavdv commented 3 years ago

It looks like newer versions of ffmpeg have renamed this option to "timeout", but older versions use that for something else which makes this tricky to handle. Can you try using the Docker image instead as a workaround?

saschawerner commented 3 years ago

Can you try using the Docker image instead as a workaround?

I have amended the code locally as a temporary fix (base.py line 873). Maybe you can add a switch (--new_timeout) for compatibility?

stale[bot] commented 3 years ago

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.

stale[bot] commented 2 years ago

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.

GhostlyCrowd commented 2 years ago

It looks like newer versions of ffmpeg have renamed this option to "timeout", but older versions use that for something else which makes this tricky to handle. Can you try using the Docker image instead as a workaround?

Interestingly enough in my testing with V4.3.3 while trouble shooting my PR for Reolink cams, -stimeout does not throw an error and seems to work.

ConnorMcDonough commented 2 years ago

Hi, I have liveview / recording does not work issues as well. Does it have something to do with -stimeout?

here is part of my console output unifi-cam-proxy_1 | 2022-01-06 00:20:58 25d059baeee0 RTSPCam[1] INFO Processing [GetRequest] message unifi-cam-proxy_1 | 2022-01-06 00:21:04 25d059baeee0 RTSPCam[1] INFO Processing [ChangeVideoSettings] message unifi-cam-proxy_1 | 2022-01-06 00:21:04 25d059baeee0 RTSPCam[1] INFO Spawning ffmpeg for video2 (bk8EsEJIbg5wgKGG): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp:/{ip}/VideoInput/1/mpeg4/1" -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -metadata streamname=bk8EsEJIbg5wgKGG -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc {ip-nvr} 7550

and my docker-compose file:

`version: "3.9" services: unifi-cam-proxy: restart: unless-stopped image: keshavdv/unifi-cam-proxy volumes:

I have also tried the default docker-compose file as well.

Any recommendation on how to fix this?

thanks

keshavdv commented 2 years ago

This is fixed in the latest main branch, but isn't a part of any official release just yet.