-
-
Notifications
You must be signed in to change notification settings - Fork 236
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
Reolink standalone cams work #127
Conversation
Ive actually got live view, in mobile app live view and recording all working now. THe issue is i had to edit the code to force in ffmpeg args because of the error above, so i had to make the ffmpeg args
@keshavdv can you please advice how to fix the error im getting trying to pass arguments or if there is a way i can include this as a default in my reolink.py I think alot of people are going to be happy.
Is the new magic for new versions of ffmpeg as -vbsf is depreciated. |
Thanks for figuring out the new bitfilter format! I'd love to figure out exactly which version of ffmpeg supports this style of flags and add some logic to use the correct set of arguments since that will also allow me to fix #55. Do you know when this new format was introduced? |
somewhere between V3.4.X and 4.1.X I have not looked that deep into it yet. I am kind of learning as i go here. Do you have any incite as to why i cannot pass --ffmpeg-args as explained above? ive been having to manually edit the default in base.py each time i want to try new arguments with my PR. Ive also found that |
This looks like https://stackoverflow.com/questions/16174992/cant-get-argparse-to-read-quoted-string-with-dashes-in-it so I'd suggest trying
Can you share ffmpeg output both with and without |
I thought i replied to this already sorry. Turns out I'm a fool I was missing the = in my ffmpef-args so thats working fine. As for the ffmpeg error im no longer on a version of ffmpeg that is an issue. But its been discussed here #31 (comment) and the error is
|
Fix the reolink recommended ffmpeg args
Fixed W293 blank line contains whitespace Fixed B950 line too long (91 > 80 characters)
@keshavdv Here is the output you wanted
And with out the ixed_frame_rate_flag
|
Forgot to update motion det url
Start of work to separate the main and substreams. Channel -c is not valid for stand alone cameras, so its been set to default=0 and required=True has been removed. Leaving it in for the future if its needed. Substreams are now picked with ```--substream, -s``` and choices are main or sub. this is a mandatory argument. ```-s main``` will take main high quality stream, ```-s sub``` will choose the cameras substream. Example: ```unifi-cam-proxy -H 192.168.7.245 -i 192.168.7.100 --mac 'ec:71:db:dc:47:b1' -c client.pem -t 5pSyFxkJy7UYhFVFqZpglSj4IxV7Bgis reolink -u unifiprotect -p 00423600 -s main --ffmpeg-args='-c:v copy -bsf:v "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k'``` and ```unifi-cam-proxy -H 192.168.7.245 -i 192.168.7.100 --mac 'ec:71:db:dc:47:b1' -c client.pem -t 5pSyFxkJy7UYhFVFqZpglSj4IxV7Bgis reolink -u unifiprotect -p 00423600 -s sub --ffmpeg-args='-c:v copy -bsf:v "h264_metadata=tick_rate=60000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k'``` Which spawns the respective substream as seen here: ```ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://unifiprotect:[email protected]:554//h264Preview_01_sub" -c:v copy -bsf:v "h264_metadata=tick_rate=30000/1001:fixed_frame_rate_flag=1" -ar 32000 -ac 2 -codec:a aac -b:a 32k -metadata streamname=VIt3mr7LLdjlN8p7 -f flv - | /usr/bin/python3 -m unifi.clock_sync | nc 192.168.7.245 7550 ``` For the substream take note of the tick_rate. the substream is maximum 15fps can go no higher in the camera settings. Future goal is to spawn the video channels properly so the hi quality and low quality substreams feed their respective counterparts in the Unifi protect system. Reasoning behind this work is the substream is Absolut flawless for preview playback, no lag at all. But one would want the main hi resolution stream for recording purposes.
Added examples of using the main or sub camera substreams for reolink stand alone cams with motion detection.
@keshavdv I'm working on main and substream separation now. Mainly the substream if i use it the web app and mobile app preview and live views are 100% stable. and in reality We should just want full resolution for recording. I see 3 video streams are spawned 1-3 what one is for what? is Video1 say for recording or high rez viewing and Video2 is for ow resolution viewing and preview? and video 3 should never spawn with a snapshot url correct? |
adjusted example command to push no audio to the proxy
the Reolink web UI just suggests it does not
Fat fingers on mobile sorry |
flake8 - ignore B950 line length for this line.
Finally, after a back and forth between flake8 and isort the actions passes and Lint is happy with everything. |
i have tested over three different OS , ubuntu , photonOS and finally debian , with a reolink rlc520a does not work at resolution 2560x1440 , try different bitrates but nothing .... lowest is 1024 continue respawning ffmpeg. |
ok now it's work , the only thing that i have changed is the cam firmware , works with the latest reolink firmware that they have made improvements in the rtsp feed. @GhostlyCrowd i don't think is a VM cpu problem , i have tested on the old and new server , it's not a cpu limit i think. any chance to get onvif alerts? i'm really interested in this project , i'm not a programmer but i can port forward my cam and donate $$ :) |
Link to firmware? Also 1024 and 2048 bit rate is the butter zone for these cameras otherwise with 3 streams open they begin to choke. |
https://reolink.com/download-center/?utm_source=Rdt&utm_medium=Post&utm_campaign=Rdt+Sidebar but my is RLC-520A , the A version have vehicle and person detection |
Work in progress getting Standalone Reolink cams to work more in line with how t he ReolinkNVR parts work.
What's working:
-s main, or -s sub
argument note, is maximum 15fps so usetick_rate-30000/1001
What's not working:
Examples on how to use:
Main camera stream example
Sub camera stream example
(Note: Camera/channel arguments are either -s main, or -s sub. The substream is limited to a maximum 15fps so note the tick_rate in the example)
Possibly a limitation of my VM I'm testing I cannot get smooth Live view on mobile/web if the main streams bitrate is over
1024
The Reolink part of this project seems to not work well any more many of us seem to fail to get it to work. I'm not a pro but this is my small contribution, and I'm learning along the way.