Replies: 8 comments 3 replies
-
The bridge doesn't do any h264 decoding, it just copies the raw h264 from tutk and passes it on to the rtsp stream. If you want to do any hardware accelerated decoding, I'd suggest trying to do it at the very end where you're consuming the footage. Otherwise, you'd end up wasting resources decoding and encoding the footage an extra time. |
Beta Was this translation helpful? Give feedback.
-
The Synology NAS itself is the very end consuming stream (its NAS+NVR compact).
So the code and NVR depolyed on same platform.
Despite this, decode/encode native raw data before it goes via RTSP protocol (then RTSP simple server code) would result into better performance...assuming HW acceleration could be enabled sure..
So I would like to see if others have successfully could break in Synology HW acceleration..or what I miss.
Thanks,
…________________________________
From: mrlt8 ***@***.***>
Sent: Sunday, November 14, 2021 2:08:01 AM
To: mrlt8/docker-wyze-bridge ***@***.***>
Cc: AdiAbuAli ***@***.***>; Author ***@***.***>
Subject: Re: [mrlt8/docker-wyze-bridge] FFMPEG HW Accelerator -Synology NAS (Discussion #230)
since SW decoding/encoding is consuming high CPU...
The bridge doesn't do any h264 decoding, it just copies the raw h264 from tutk and passes it on to the rtsp stream.
If you want to do any hardware accelerated decoding, I'd suggest trying to do it at the very end where you're consuming the footage. Otherwise, you'd end up wasting resources decoding and encoding the footage an extra time.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#230 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVKRYLIPT5VIKG5234K37NLUL34WDANCNFSM5H7CN5HA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
Actually, and as I remember I did it once using SW, decoding and encoding using FFMPEG decoders will smooth the stream (e.g. setting b:v parameter)...actually the packets generated by the wyze cameras are not proper in size (if you do a trace in FFMPEG log level, you will see huge packets sometimes generated beyound 1400).
So FFMPEG decoders somehow optimize the stream...
For just skip the RTSP simple server, and save files...actuallly if I did such, so I will skip the NVR application in Synology that can be utililzed only via RTSP stream, and cant use its value, like motion detection....it will not analyze already saved files not via NVR itself.
Anyways,I just think if I could reach better stream quality than wyze app stream itself?...It just pop up in my mind while writing this response :)
Thanks,
…________________________________
From: mrlt8 ***@***.***>
Sent: Sunday, November 14, 2021 4:59:04 PM
To: mrlt8/docker-wyze-bridge ***@***.***>
Cc: AdiAbuAli ***@***.***>; Author ***@***.***>
Subject: Re: [mrlt8/docker-wyze-bridge] FFMPEG HW Accelerator -Synology NAS (Discussion #230)
I'm not even sure if you'd see much of a performance boost with HW acceleration to make it worth it over copy unless you're trying to do something special that requires decoding/encoding like consuming the footage on an underpowered smart mirror that requires mjpeg and/or rotation for the doorbells, etc.
Wouldn't it be better to just do the decoding once in the NVR with HW decoding and save your resources for object detection instead?
Another option would be to ditch rtsp-simple-server and have ffmpeg either pipe the h264 directly into your NVR or just write the footage directly to a mapped volume.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#230 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVKRYLIW6XVOHJYTJUH34HLUL7FDRANCNFSM5H7CN5HA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
Am trying to just to copy the stream to file, bypassing the
RTSP_CIMPLE_SERVER, and then confifgure the NVR...
But I can't find a logic how to create a FFMPEG command that append a file
name, and how to specifiy the path...it's simple command but need to append
filename to be camera name (and to specify the path):
…-i - -codec copy path/file.mp4
Any idea?
From: Adi Abuali ***@***.***>
Sent: Sunday, November 14, 2021 5:28 PM
To: mrlt8/docker-wyze-bridge
***@***.***>;
mrlt8/docker-wyze-bridge ***@***.***>
Cc: Author ***@***.***>
Subject: Re: [mrlt8/docker-wyze-bridge] FFMPEG HW Accelerator -Synology NAS
(Discussion #230)
Actually, and as I remember I did it once using SW, decoding and encoding
using FFMPEG decoders will smooth the stream (e.g. setting b:v
parameter)...actually the packets generated by the wyze cameras are not
proper in size (if you do a trace in FFMPEG log level, you will see huge
packets sometimes generated beyound 1400).
So FFMPEG decoders somehow optimize the stream...
For just skip the RTSP simple server, and save files...actuallly if I did
such, so I will skip the NVR application in Synology that can be utililzed
only via RTSP stream, and cant use its value, like motion detection....it
will not analyze already saved files not via NVR itself.
Anyways,I just think if I could reach better stream quality than wyze app
stream itself?...It just pop up in my mind while writing this response :)
Thanks,
_____
From: mrlt8 ***@***.*** ***@***.***> >
Sent: Sunday, November 14, 2021 4:59:04 PM
To: mrlt8/docker-wyze-bridge ***@***.***
***@***.***> >
Cc: AdiAbuAli ***@***.*** ***@***.***> >; Author
***@***.*** ***@***.***> >
Subject: Re: [mrlt8/docker-wyze-bridge] FFMPEG HW Accelerator -Synology NAS
(Discussion #230)
I'm not even sure if you'd see much of a performance boost with HW
acceleration to make it worth it over copy unless you're trying to do
something special that requires decoding/encoding like consuming the footage
on an underpowered smart mirror that requires mjpeg and/or rotation for the
doorbells, etc.
Wouldn't it be better to just do the decoding once in the NVR with HW
decoding and save your resources for object detection instead?
Another option would be to ditch rtsp-simple-server and have ffmpeg either
pipe the h264 directly into your NVR or just write the footage directly to a
mapped volume.
-
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#230 (comment)
nt-1640265> , or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVKRYLIW6XVOHJYTJUH34HLUL
7FDRANCNFSM5H7CN5HA> .
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&m
t=8&pt=524675> or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=u
tm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
<https://github.com/notifications/beacon/AVKRYLNAJ23AEGZNW6WGMI3UL7FDRA5CNFS
M5H7CN5HKYY3PNVWWK3TUL52HS4DFWFCGS43DOVZXG2LPNZBW63LNMVXHJKTDN5WW2ZLOORPWSZG
OAAMQOSI.gif>
|
Beta Was this translation helpful? Give feedback.
-
Is there a way to change the github source for FFMPEG, e.g. FFMPEG for home bridge but with HW accelartion enabled in FfMPEG config for intel/VAAPI? There is many flexibility option with decodef/encoder to explore, rather than copying (am not using Home bridge neither HA)...but this SW decoding/encoding is a bottle neck for CPU |
Beta Was this translation helpful? Give feedback.
-
Many thanks!...this is great.
In advance I need to have to build my own FFMPEG version, or nothing is needed further?
Thanks,
…________________________________
From: mrlt8 ***@***.***>
Sent: Thursday, December 9, 2021 4:13:17 PM
To: mrlt8/docker-wyze-bridge ***@***.***>
Cc: AdiAbuAli ***@***.***>; Author ***@***.***>
Subject: Re: [mrlt8/docker-wyze-bridge] FFMPEG HW Accelerator -Synology NAS (Discussion #230)
Patch the file in your docker-compose.yml?
volumes:
- /path/to/static/build/ffmpeg:/usr/local/bin/ffmpeg
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#230 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVKRYLPBNMVPCA4RBPZ4NQ3UQC2P3ANCNFSM5H7CN5HA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
And if yes FFMPEG build needed, so it should be build inside the container, or its irrelative to docker?
Thanks,
…________________________________
From: Adi Abuali ***@***.***>
Sent: Thursday, December 9, 2021 4:38:40 PM
To: mrlt8/docker-wyze-bridge ***@***.***>; mrlt8/docker-wyze-bridge ***@***.***>
Cc: Author ***@***.***>
Subject: Re: [mrlt8/docker-wyze-bridge] FFMPEG HW Accelerator -Synology NAS (Discussion #230)
Many thanks!...this is great.
In advance I need to have to build my own FFMPEG version, or nothing is needed further?
Thanks,
________________________________
From: mrlt8 ***@***.***>
Sent: Thursday, December 9, 2021 4:13:17 PM
To: mrlt8/docker-wyze-bridge ***@***.***>
Cc: AdiAbuAli ***@***.***>; Author ***@***.***>
Subject: Re: [mrlt8/docker-wyze-bridge] FFMPEG HW Accelerator -Synology NAS (Discussion #230)
Patch the file in your docker-compose.yml?
volumes:
- /path/to/static/build/ffmpeg:/usr/local/bin/ffmpeg
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#230 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVKRYLPBNMVPCA4RBPZ4NQ3UQC2P3ANCNFSM5H7CN5HA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
I built it, but all efforts disappear if I reset from new image...it’s not practical...
From: mrlt8 ***@***.***>
Sent: Thursday, December 9, 2021 5:38 PM
To: mrlt8/docker-wyze-bridge ***@***.***>
Cc: AdiAbuAli ***@***.***>; Author ***@***.***>
Subject: Re: [mrlt8/docker-wyze-bridge] FFMPEG HW Accelerator -Synology NAS (Discussion #230)
Would probably be easier and save space on the container if you build ffmpeg locally and just replace the binary on the container.
FYI, you'll need to make a static build or deal with all the library dependencies on the container.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#230 (reply in thread)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVKRYLN2FFPWL63SZXKXXJLUQDEMFANCNFSM5H7CN5HA> .
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> . <https://github.com/notifications/beacon/AVKRYLJBLYNXQX3U2PA4FQLUQDEMFA5CNFSM5H7CN5HKYY3PNVWWK3TUL52HS4DFWFCGS43DOVZXG2LPNZBW63LNMVXHJKTDN5WW2ZLOORPWSZGOAANSRWI.gif>
|
Beta Was this translation helpful? Give feedback.
-
Hi,
Am trying to use HW Accelerator in FFMPEG, in synology NAS (DS720+), since SW decoding/encoding is consuming high CPU...
I did the following:
in docker file, I define "device" : "/dev/dri:/dev/dri"
then:
apt-get update
apt-get install ffmpeg
Below is the output of the commands (ls -la /dev/dri & vainfo), and see VAAPI enabled.....
But when I try to ffmpeg -init_hw_device vaapi=foo:/dev/dri/renderD128 , I got Cannot allocate memory error
Any body got success to enable HW accelerator in Synology NAS? and body can help how to overcome that error....?
root@mrlt8-wyze-bridge_dev:/# ls -la /dev/dri
total 0
drwxr-xr-x 2 root root 80 Nov 13 23:34 .
drwxr-xr-x 13 root root 13860 Nov 13 23:34 ..
crw------- 1 root root 226, 0 Nov 13 23:34 card0
crw-rw---- 1 root 937 226, 128 Nov 13 23:34 renderD128
root@mrlt8-wyze-bridge_dev:/# vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.4 (libva 2.4.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Gemini Lake - 2.3.0
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
root@mrlt8-wyze-bridge_dev:/# ffmpeg -init_hw_device vaapi=foo:/dev/dri/renderD128
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --pkgconfigdir=/build/workspace/lib/pkgconfig --prefix=/build/workspace --pkg-config-flags=--static --extra-cflags=-I/build/workspace/inc
lude --extra-ldflags=-L/build/workspace/lib --extra-libs='-lpthread -lm' --enable-static --disable-debug --disable-shared --disable-ffplay --disable-doc -
-enable-openssl --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libtheora
--enable-libvorbis --enable-libx264 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb
--enable-filters --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-libspeex --enable-demuxer=rtsp --enable-indev=alsa --enable-outdev
=alsa
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Device creation failed: -12.
Failed to set value 'vaapi=foo:/dev/dri/renderD128' for option 'init_hw_device': Cannot allocate memory
Error parsing global options: Cannot allocate memory
Beta Was this translation helpful? Give feedback.
All reactions