keshavdv / unifi-cam-proxy

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

No live video, snapshots hours behind #144

Closed cvpeck closed 2 years ago

cvpeck commented 2 years ago

Describe the bug No live video. Playback only using snapshots. Snapshots are hours behind in time (e.g. showing daytime snapshots at night)

Camera (please complete the following information): Foscam HD IP Camera, ethernet connected

Additional context Running under macOS natively (no docker)

2022-01-12 22:56:30 Penelope.local RTSPCam[24597] WARNING Snapshot file /var/folders/x9/vlq0wr9d7kn22c6_dq4pckbm0000gn/T/tmpu60s1xhe/screen.jpg is not ready yet, skipping upload 2022-01-12 22:56:37 Penelope.local RTSPCam[24597] INFO Processing [NetworkStatus] message 2022-01-12 22:56:37 Penelope.local RTSPCam[24597] INFO Processing [GetSystemStats] message 2022-01-12 22:56:45 Penelope.local RTSPCam[24597] INFO Processing [GetRequest] message 2022-01-12 22:56:45 Penelope.local RTSPCam[24597] WARNING Snapshot file /var/folders/x9/vlq0wr9d7kn22c6_dq4pckbm0000gn/T/tmpu60s1xhe/screen.jpg is not ready yet, skipping upload 2022-01-12 22:56:47 Penelope.local RTSPCam[24597] INFO Processing [NetworkStatus] message 2022-01-12 22:56:47 Penelope.local RTSPCam[24597] INFO Processing [GetSystemStats] message 2022-01-12 22:56:55 Penelope.local RTSPCam[24597] INFO Processing [GetRequest] message 2022-01-12 22:56:55 Penelope.local RTSPCam[24597] WARNING Snapshot file /var/folders/x9/vlq0wr9d7kn22c6_dq4pckbm0000gn/T/tmpu60s1xhe/screen.jpg is not ready yet, skipping upload

cvpeck commented 2 years ago

I'm using an RTSP stream. Does it matter what model of camera I create in the UniFi protect interface? Should I specify the camera model on the command line when I start up the proxy?

Current startup command - unifi-cam-proxy --ip "192.168.xx.103" --host "192.168.xx.107" --verbose --cert /Users/xx/client.pem --token "xxxx" rtsp -s "rtsp://xxx:xxx@192.168.xx.103:554/videoMain"

cvpeck commented 2 years ago

Xnip2022-01-12_23-27-18

keshavdv commented 2 years ago

Can you share the output of (replace username and password):

ffprobe "rtsp://xxx:xxx@192.168.xx.103:554/videoMain"

The warning about the snapshot file not being ready suggest that the ffmpeg stream is not working correctly which is usually an indicator of an incorrect RTSP source or invalid format

cvpeck commented 2 years ago

Thanks, that was a useful command I didn't know about

ffprobe version 4.4.1 Copyright (c) 2007-2021 the FFmpeg developers built with Apple clang version 13.0.0 (clang-1300.0.29.3) configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4.1_5 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 Input #0, rtsp, from 'rtsp://xxxx:xxxx@192.168.xxx.103:554/videoMain': Metadata: title : videoMain Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1280x720, 10 tbr, 90k tbn, 180k tbc Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s

keshavdv commented 2 years ago

Does your password or username happen to have special characters in it?

cvpeck commented 2 years ago

It does indeed

On 19 Jan 2022, at 2:34 pm, Keshav Varma @.***> wrote:

Does your password or username happen to have special characters in it?

— Reply to this email directly, view it on GitHub https://github.com/keshavdv/unifi-cam-proxy/issues/144#issuecomment-1016059810, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUE5REZGAERWV72WQUNFZTUWYZ57ANCNFSM5LY3XPZA. You are receiving this because you authored the thread.

GhostlyCrowd commented 2 years ago

It does indeed On 19 Jan 2022, at 2:34 pm, Keshav Varma @.***> wrote: Does your password or username happen to have special characters in it? — Reply to this email directly, view it on GitHub <#144 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUE5REZGAERWV72WQUNFZTUWYZ57ANCNFSM5LY3XPZA. You are receiving this because you authored the thread.

the bash/sh system will hit a special character depending on what it is and end up dropping the full argument of the command.

the best work around is to remove and bangs, at's, astrix, or hashes from your password. Typically I set up an account on my cams/system that is a user only so it cannot change settings and then give it a plain text password ex: abcABC123.

cvpeck commented 2 years ago

Actually, I was incorrect - I have just checked and the test camera I was using has alphanumeric only.

On 19 Jan 2022, at 2:42 pm, GhostlyCrowd @.***> wrote:

It does indeed … <x-msg://6/#> On 19 Jan 2022, at 2:34 pm, Keshav Varma @.***> wrote: Does your password or username happen to have special characters in it? — Reply to this email directly, view it on GitHub <#144 (comment) https://github.com/keshavdv/unifi-cam-proxy/issues/144#issuecomment-1016059810>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUE5REZGAERWV72WQUNFZTUWYZ57ANCNFSM5LY3XPZA https://github.com/notifications/unsubscribe-auth/ABUE5REZGAERWV72WQUNFZTUWYZ57ANCNFSM5LY3XPZA. You are receiving this because you authored the thread.

the bash/sh system will hit a special character depending on what it is and end up dropping the full argument of the command.

the best work around is to remove and bangs, at's, astrix, or hashes from your password. Typically ! set up an account on my cams/system that is a user only so it cannot change settings and then give it a plain text password asbABC123.

— Reply to this email directly, view it on GitHub https://github.com/keshavdv/unifi-cam-proxy/issues/144#issuecomment-1016063521, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUE5RAHTWRHGHJSXF2KPG3UWY2ZHANCNFSM5LY3XPZA. You are receiving this because you authored the thread.

GhostlyCrowd commented 2 years ago

Actually, I was incorrect - I have just checked and the test camera I was using has alphanumeric only. On 19 Jan 2022, at 2:42 pm, GhostlyCrowd @.> wrote: It does indeed … <x-msg://6/#> On 19 Jan 2022, at 2:34 pm, Keshav Varma @.> wrote: Does your password or username happen to have special characters in it? — Reply to this email directly, view it on GitHub <#144 (comment) <#144 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUE5REZGAERWV72WQUNFZTUWYZ57ANCNFSM5LY3XPZA https://github.com/notifications/unsubscribe-auth/ABUE5REZGAERWV72WQUNFZTUWYZ57ANCNFSM5LY3XPZA. You are receiving this because you authored the thread. the bash/sh system will hit a special character depending on what it is and end up dropping the full argument of the command. the best work around is to remove and bangs, at's, astrix, or hashes from your password. Typically ! set up an account on my cams/system that is a user only so it cannot change settings and then give it a plain text password asbABC123. — Reply to this email directly, view it on GitHub <#144 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUE5RAHTWRHGHJSXF2KPG3UWY2ZHANCNFSM5LY3XPZA. You are receiving this because you authored the thread.

can you take the output from the cam proxy specifically "spawning stream" and paste the ffmpeg argument in here. so we can see what the proxy is trying to run as a stream proxy.

cvpeck commented 2 years ago

Thank you for looking at this. Let me know if you need verbose output

~ unifi-cam-proxy --ip “192.168.xx.103" --host “192.168.xx.107" --cert /Users/peckc/Documents/Coding/Ubiquity/certs/client.pem --token "CBLLy8xO3mjbtMf83Xm11bQCDNo9EX16" rtsp -s @.:554/videoMain" 2022-01-19 16:44:37 Penelope.local RTSPCam[45059] INFO Spawning stream for snapshots: ffmpeg -nostdin -y -re -rtsp_transport tcp -i @.:554/videoMain" -vf fps=1 -update 1 /var/folders/x9/vlq0wr9d7kn22c6_dq4pckbm0000gn/T/tmpf90j6yav/screen.jpg 2022-01-19 16:44:37 Penelope.local Core[45059] INFO Creating ws connection to wss://192.168.xx.107:7442/camera/1.0/ws?token=CBLLy8xO3mjbtMf83Xm11bQCDNo9EX16 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Adopting with token [CBLLy8xO3mjbtMf83Xm11bQCDNo9EX16] and mac [AABBCCDDEEFF] 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Processing [ubnt_avclient_hello] message 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Processing [ubnt_avclient_hello] message 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Processing [ubnt_avclient_paramAgreement] message 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Processing [ubnt_avclient_paramAgreement] message 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Processing [StopService] message 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Processing [ChangeVideoSettings] message 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Spawning ffmpeg for video1 (xj0YgG8l7jhCxhIP): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i @.:554/videoMain" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=xj0YgG8l7jhCxhIP -f flv - | @./bin/python3.9 -m unifi.clock_sync | nc 192.168.xx.107 7550 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Processing [ChangeVideoSettings] message 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Spawning ffmpeg for video2 (5HGMH86d7B3h1mej): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i @.:554/videoMain" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=5HGMH86d7B3h1mej -f flv - | @./bin/python3.9 -m unifi.clock_sync | nc 192.168.xx.107 7550 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Processing [ChangeVideoSettings] message 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Spawning ffmpeg for video3 (kn9cUPEgzd5Zizka): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i @.:554/videoMain" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=kn9cUPEgzd5Zizka -f flv - | @./bin/python3.9 -m unifi.clock_sync | nc 192.168.xx.107 7550 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Processing [UpdateFirmwareRequest] message 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Reconnecting... 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Cleaning up instance 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Stopping stream video1 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Stopping stream video2 2022-01-19 16:44:38 Penelope.local RTSPCam[45059] INFO Stopping stream video3 2022-01-19 16:44:38 Penelope.local Core[45059] INFO Backing off connect(...) for 2.0s (True) 2022-01-19 16:44:40 Penelope.local Core[45059] INFO Creating ws connection to wss://192.168.xx.107:7442/camera/1.0/ws?token=CBLLy8xO3mjbtMf83Xm11bQCDNo9EX16 2022-01-19 16:44:40 Penelope.local RTSPCam[45059] INFO Adopting with token [CBLLy8xO3mjbtMf83Xm11bQCDNo9EX16] and mac [AABBCCDDEEFF] 2022-01-19 16:44:40 Penelope.local RTSPCam[45059] INFO Processing [ubnt_avclient_hello] message 2022-01-19 16:44:40 Penelope.local RTSPCam[45059] INFO Processing [ubnt_avclient_hello] message 2022-01-19 16:44:41 Penelope.local RTSPCam[45059] INFO Processing [ubnt_avclient_paramAgreement] message 2022-01-19 16:44:41 Penelope.local RTSPCam[45059] INFO Processing [ubnt_avclient_paramAgreement] message 2022-01-19 16:44:41 Penelope.local RTSPCam[45059] INFO Processing [StopService] message 2022-01-19 16:44:41 Penelope.local RTSPCam[45059] INFO Processing [ChangeDeviceSettings] message 2022-01-19 16:44:41 Penelope.local RTSPCam[45059] INFO Processing [NetworkStatus] message 2022-01-19 16:44:41 Penelope.local RTSPCam[45059] INFO Processing [GetSystemStats] message 2022-01-19 16:44:41 Penelope.local RTSPCam[45059] INFO Processing [NetworkStatus] message 2022-01-19 16:44:41 Penelope.local RTSPCam[45059] INFO Processing [GetSystemStats] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [ChangeIspSettings] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [ChangeOsdSettings] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [ChangeSoundLedSettings] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [ChangeVideoSettings] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [ChangeSmartMotionSettings] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [EnableLogging] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [ChangeDeviceSettings] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [ChangeDeviceSettings] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [SmartMotionTest] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [ChangeVideoSettings] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [UpdateUsernamePassword] message 2022-01-19 16:44:46 Penelope.local RTSPCam[45059] INFO Processing [ChangeVideoSettings] message 2022-01-19 16:44:51 Penelope.local RTSPCam[45059] INFO Processing [NetworkStatus] message 2022-01-19 16:44:51 Penelope.local RTSPCam[45059] INFO Processing [GetSystemStats] message 2022-01-19 16:45:01 Penelope.local RTSPCam[45059] INFO Processing [NetworkStatus] message 2022-01-19 16:45:01 Penelope.local RTSPCam[45059] INFO Processing [GetSystemStats] message

On 19 Jan 2022, at 2:49 pm, GhostlyCrowd @.***> wrote:

Actually, I was incorrect - I have just checked and the test camera I was using has alphanumeric only. … <x-msg://7/#> On 19 Jan 2022, at 2:42 pm, GhostlyCrowd @.> wrote: It does indeed … x-msg://6/# On 19 Jan 2022, at 2:34 pm, Keshav Varma @.> wrote: Does your password or username happen to have special characters in it? — Reply to this email directly, view it on GitHub <#144 https://github.com/keshavdv/unifi-cam-proxy/issues/144 (comment) <#144 (comment) https://github.com/keshavdv/unifi-cam-proxy/issues/144#issuecomment-1016059810>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUE5REZGAERWV72WQUNFZTUWYZ57ANCNFSM5LY3XPZA https://github.com/notifications/unsubscribe-auth/ABUE5REZGAERWV72WQUNFZTUWYZ57ANCNFSM5LY3XPZA https://github.com/notifications/unsubscribe-auth/ABUE5REZGAERWV72WQUNFZTUWYZ57ANCNFSM5LY3XPZA https://github.com/notifications/unsubscribe-auth/ABUE5REZGAERWV72WQUNFZTUWYZ57ANCNFSM5LY3XPZA. You are receiving this because you authored the thread. the bash/sh system will hit a special character depending on what it is and end up dropping the full argument of the command. the best work around is to remove and bangs, at's, astrix, or hashes from your password. Typically ! set up an account on my cams/system that is a user only so it cannot change settings and then give it a plain text password asbABC123. — Reply to this email directly, view it on GitHub <#144 (comment) https://github.com/keshavdv/unifi-cam-proxy/issues/144#issuecomment-1016063521>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUE5RAHTWRHGHJSXF2KPG3UWY2ZHANCNFSM5LY3XPZA https://github.com/notifications/unsubscribe-auth/ABUE5RAHTWRHGHJSXF2KPG3UWY2ZHANCNFSM5LY3XPZA. You are receiving this because you authored the thread.

can you take the output from the cam proxy specifically "spawning stream" and paste the ffmpeg argument in here. so we can see what the proxy is trying to run as a stream proxy.

— Reply to this email directly, view it on GitHub https://github.com/keshavdv/unifi-cam-proxy/issues/144#issuecomment-1016067005, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUE5RGLKDI4FRZU7JVSSCDUWY3WZANCNFSM5LY3XPZA. You are receiving this because you authored the thread.

GhostlyCrowd commented 2 years ago

ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i ***@***.***:554/videoMain" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=xj0YgG8l7jhCxhIP -f flv - | ***@***.***/bin/python3.9 -m unifi.clock_sync | nc 192.168.xx.107 7550

youre pipe out to the clock sync looks mangled/wrong is that a fragment of editing?

it should look similar to this | /usr/bin/python3 -m unifi.clock_sync | nc 192.168.7.245 7550 where how did ***@***.*** get in the pipe to the clock sync

cvpeck commented 2 years ago

Not sure what happened there. Correct output -

Spawning ffmpeg for video3 (kn9cUPEgzd5Zizka): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i @.:554/videoMain" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=kn9cUPEgzd5Zizka -f flv - | @./bin/python3.9 -m unifi.clock_sync | nc 192.168.xx.107 7550

On 20 Jan 2022, at 7:14 am, GhostlyCrowd @.***> wrote:

ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i @.:554/videoMain" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=xj0YgG8l7jhCxhIP -f flv - | @./bin/python3.9 -m unifi.clock_sync | nc 192.168.xx.107 7550

youre pipe out to the clock sync looks mangled/wrong is that a fragment of editing?

— Reply to this email directly, view it on GitHub https://github.com/keshavdv/unifi-cam-proxy/issues/144#issuecomment-1016852797, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUE5RBDDAGKC4MHNMJRRKLUW4PCVANCNFSM5LY3XPZA. You are receiving this because you authored the thread.

GhostlyCrowd commented 2 years ago

your rtsp link is mangled it should look like this example rtsp://username:pwd@IP:port/videoMain note the : between IP and port. it looks as though you're using a . instead, i have no idea who you have ***@***.***/bin/python3.9 it should be simply /bin/python3.9

cvpeck commented 2 years ago

I think that was mangled in pasting. Correct output -

Spawning ffmpeg for video3 (kn9cUPEgzd5Zizka): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i @.:554/videoMain" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=kn9cUPEgzd5Zizka -f flv - | @./bin/python3.9 -m unifi.clock_sync | nc 192.168.xx.107 7550

Sent from my iPad

On 20 Jan 2022, at 2:44 pm, GhostlyCrowd @.***> wrote:

 your rtsp link is mangled it should look like this example @.:port/videoMain note the : between IP and port. it looks as though you're using a . instead, i have no idea who you have @./bin/python3.9 it should be simply /bin/python3.9

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

GhostlyCrowd commented 2 years ago

try the test stream see if it gives you anything replace your rtsp url in the command with rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4

cvpeck commented 2 years ago

Ok, output is below. Result is the same - one thumbnail from the demo feed as camera overview, anything before that on timeline is still showing the thumbnail from my local stream from days ago

2022-01-24 13:38:35 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video3 (kn9cUPEgzd5Zizka): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=kn9cUPEgzd5Zizka -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168..107 7550 2022-01-24 13:38:38 Penelope.local RTSPCam[90835] INFO Processing [NetworkStatus] message 2022-01-24 13:38:38 Penelope.local RTSPCam[90835] INFO Processing [GetSystemStats] message 2022-01-24 13:38:48 Penelope.local RTSPCam[90835] INFO Processing [NetworkStatus] message 2022-01-24 13:38:48 Penelope.local RTSPCam[90835] INFO Processing [GetSystemStats] message 2022-01-24 13:38:50 Penelope.local RTSPCam[90835] INFO Processing [ChangeVideoSettings] message 2022-01-24 13:38:50 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video1 (xj0YgG8l7jhCxhIP): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=xj0YgG8l7jhCxhIP -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168..107 7550 2022-01-24 13:38:50 Penelope.local RTSPCam[90835] INFO Processing [ChangeVideoSettings] message 2022-01-24 13:38:50 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video3 (kn9cUPEgzd5Zizka): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=kn9cUPEgzd5Zizka -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168..107 7550 2022-01-24 13:38:58 Penelope.local RTSPCam[90835] INFO Processing [NetworkStatus] message 2022-01-24 13:38:58 Penelope.local RTSPCam[90835] INFO Processing [GetSystemStats] message 2022-01-24 13:39:05 Penelope.local RTSPCam[90835] INFO Processing [ChangeVideoSettings] message 2022-01-24 13:39:05 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video1 (xj0YgG8l7jhCxhIP): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=xj0YgG8l7jhCxhIP -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168..107 7550 2022-01-24 13:39:05 Penelope.local RTSPCam[90835] INFO Processing [ChangeVideoSettings] message 2022-01-24 13:39:05 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video3 (kn9cUPEgzd5Zizka): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=kn9cUPEgzd5Zizka -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168..107 7550 2022-01-24 13:39:08 Penelope.local RTSPCam[90835] INFO Processing [NetworkStatus] message 2022-01-24 13:39:08 Penelope.local RTSPCam[90835] INFO Processing [GetSystemStats] message 2022-01-24 13:39:18 Penelope.local RTSPCam[90835] INFO Processing [NetworkStatus] message 2022-01-24 13:39:18 Penelope.local RTSPCam[90835] INFO Processing [GetSystemStats] message 2022-01-24 13:39:20 Penelope.local RTSPCam[90835] INFO Processing [ChangeVideoSettings] message 2022-01-24 13:39:20 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video1 (xj0YgG8l7jhCxhIP): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=xj0YgG8l7jhCxhIP -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168..107 7550 2022-01-24 13:39:20 Penelope.local RTSPCam[90835] INFO Processing [ChangeVideoSettings] message 2022-01-24 13:39:20 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video3 (kn9cUPEgzd5Zizka): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=kn9cUPEgzd5Zizka -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168..107 7550 2022-01-24 13:39:28 Penelope.local RTSPCam[90835] INFO Processing [NetworkStatus] message 2022-01-24 13:39:28 Penelope.local RTSPCam[90835] INFO Processing [GetSystemStats] message 2022-01-24 13:39:35 Penelope.local RTSPCam[90835] INFO Processing [ChangeVideoSettings] message 2022-01-24 13:39:35 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video1 (xj0YgG8l7jhCxhIP): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=xj0YgG8l7jhCxhIP -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168..107 7550 2022-01-24 13:39:35 Penelope.local RTSPCam[90835] INFO Processing [ChangeVideoSettings] message 2022-01-24 13:39:35 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video3 (kn9cUPEgzd5Zizka): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=kn9cUPEgzd5Zizka -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168..107 7550 2022-01-24 13:39:38 Penelope.local RTSPCam[90835] INFO Processing [NetworkStatus] message 2022-01-24 13:39:38 Penelope.local RTSPCam[90835] INFO Processing [GetSystemStats] message 2022-01-24 13:39:48 Penelope.local RTSPCam[90835] INFO Processing [NetworkStatus] message 2022-01-24 13:39:48 Penelope.local RTSPCam[90835] INFO Processing [GetSystemStats] message 2022-01-24 13:39:50 Penelope.local RTSPCam[90835] INFO Processing [ChangeVideoSettings] message 2022-01-24 13:39:50 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video1 (xj0YgG8l7jhCxhIP): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=xj0YgG8l7jhCxhIP -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168..107 7550 2022-01-24 13:39:50 Penelope.local RTSPCam[90835] INFO Processing [ChangeVideoSettings] message 2022-01-24 13:39:50 Penelope.local RTSPCam[90835] INFO Spawning ffmpeg for video3 (kn9cUPEgzd5Zizka): ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=kn9cUPEgzd5Zizka -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.***.107 7550

keshavdv commented 2 years ago

Do you have netcat installed and no firewalls between the device running the proxy and the NVR?

cvpeck commented 2 years ago

➜ ~ nc usage: nc [-46AacCDdEFhklMnOortUuvz] [-K tc] [-b boundif] [-i interval] [-p source_port] [--apple-recv-anyif] [--apple-awdl-unres] [--apple-boundif ifbound] [--apple-no-cellular] [--apple-no-expensive] [--apple-no-flowadv] [--apple-tcp-timeout conntimo] [--apple-tcp-keepalive keepidle] [--apple-tcp-keepintvl keepintvl] [--apple-tcp-keepcnt keepcnt] [--apple-tclass tclass] [--tcp-adp-rtimo num_probes] [--apple-initcoproc-allow] [--apple-tcp-adp-wtimo num_probes] [--setsockopt-later] [--apple-no-connectx] [--apple-delegate-pid pid] [--apple-delegate-uuid uuid] [--apple-kao] [--apple-ext-bk-idle] [--apple-netsvctype svc] [---apple-nowakefromsleep] [--apple-notify-ack] [--apple-sockev] [--apple-tos tos] [--apple-tos-cmsg] [-s source_ip_address] [-w timeout] [-X proxy_version] [-x proxy_address[:port]] [hostname] [port[s]] /0.1s ➜ ~

Nothing reported as being blocked anywhere

cvpeck commented 2 years ago

Also I have run it on a different host (pi / ubuntu) rather than Mac, same results

keshavdv commented 2 years ago

Can you try running this directly (replace the masked out IP with your original):

fmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=xj0YgG8l7jhCxhIP -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.x.107 7550

Based on the logs, I think you're probably hitting #55. Please try the docker image or downgrade ffmpeg for the moment and give it a go.

cvpeck commented 2 years ago

~ ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4" -c:v copy -ar 32000 -ac 1 -codec:a aac -b:a 32k -metadata streamname=xj0YgG8l7jhCxhIP -f flv - | /usr/local/opt/python@3.9/bin/python3.9 -m unifi.clock_sync | nc 192.168.xxx.107 7550 ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers built with Apple clang version 13.0.0 (clang-1300.0.29.3) configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4.1_5 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 Input #0, rtsp, from 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4': Metadata: title : BigBuckBunny_115k.mp4 Duration: 00:10:34.63, start: 0.000000, bitrate: N/A Stream #0:0: Audio: aac (LC), 12000 Hz, stereo, fltp Stream #0:1: Video: h264 (High), yuv420p(progressive), 240x160 [SAR 32:27 DAR 16:9], 24 fps, 24 tbr, 90k tbn, 48 tbc Stream mapping: Stream #0:1 -> #0:0 (copy) Stream #0:0 -> #0:1 (aac (native) -> aac (native)) Output #0, flv, to 'pipe:': Metadata: title : BigBuckBunny_115k.mp4 streamname : xj0YgG8l7jhCxhIP encoder : Lavf58.76.100 Stream #0:0: Video: h264 (High) ([7][0][0][0] / 0x0007), yuv420p(progressive), 240x160 [SAR 32:27 DAR 16:9], q=2-31, 24 fps, 24 tbr, 1k tbn, 90k tbc Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 32000 Hz, mono, fltp, 32 kb/s Metadata: encoder : Lavc58.134.100 aac [flv @ 0x7ff43c035400] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly [flv @ 0x7ff43c035400] Packet is missing PTS av_interleaved_write_frame(): Invalid argument [flv @ 0x7ff43c035400] Failed to update header with correct duration. [flv @ 0x7ff43c035400] Failed to update header with correct filesize. frame= 2 fps=0.0 q=-1.0 Lsize= 1kB time=00:00:00.04 bitrate= 153.5kbits/s speed=3.88x video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown [aac @ 0x7ff43c036000] Qavg: 8004.057 Conversion failed!

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.