Transcoding HEVC #337
-
Hi! As my cameras only output HEVC, it would be a real benefit to switch to HW encoding (VAAPI). I'm running a Synology NAS (DS918+), VAAPI works. Docker container has access to the necessary devices. But what are the necessary settings (transcoder)? |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 14 replies
-
There are two spots you need to set up for transcoding as transcoding is a two step process, DecodingThis is configured per camera (different cameras may output different codecs).
Encoding (H264)This is configured globally on the Rebroadcast Plugin's Transcoding settings.
FFmpegIf the provided ffmpeg does not come with the necessary hardware encoder/decoder support, which is common for proprietary codecs, Scrypted can use a custom ffmpeg with the environment variable |
Beta Was this translation helpful? Give feedback.
-
scrypted comes with ffmpeg that supports vaapi. it doesn't use system ffmpeg. |
Beta Was this translation helpful? Give feedback.
-
you can use the environment variable |
Beta Was this translation helpful? Give feedback.
-
Linking ffmpeg with VAAPI statically is impossible. Can I use a custom ffmpeg outside of the container? Or could you possibly supply a docker image with ffmpeg/VAAPI in the future? EDIT |
Beta Was this translation helpful? Give feedback.
-
the file must exist. it works. const f = process.env.SCRYPTED_FFMPEG_PATH;
if (f && fs.existsSync(f))
return f; |
Beta Was this translation helpful? Give feedback.
-
[HomeKit]: Unknown encoder 'h264_vaapi' SCRYPTED_FFMPEG_PATH is set to /var/packages/VideoStation/target/bin/ffmpeg |
Beta Was this translation helpful? Give feedback.
-
needs to be set in the container. |
Beta Was this translation helpful? Give feedback.
-
Almost there, thank you. Maybe helpful? |
Beta Was this translation helpful? Give feedback.
-
I gave up.
If there would be a simple solution I would be very thankful.
… Am 02.08.2023 um 02:23 schrieb VCTGomes ***@***.***>:
I'm having exactly same problem. How did you do?
—
Reply to this email directly, view it on GitHub <#337 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADL7QUH4U74QYPS4VLKHSCDXTGMWTANCNFSM56FPXMFA>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
I was there already as you can read here on GitHub. This is where I failed.
`Almost there, thank you.
Impossible to convert between the formats supported by the filter 'Parsed_hwupload_1' and the filter 'auto_scaler_0'
Maybe helpful?
homebridge-plugins/homebridge-camera-ffmpeg#1223
… Am 02.08.2023 um 13:59 schrieb VCTGomes ***@***.***>:
I tried to replace the current Scrypted ffmpeg installed on /root/.scrypted/node_modules/ffmpeg-static/ffmpeg to my ffmpeg with vaapi enabled and seems to have had a breakthrough. I stopped receiving the error Unknown encoder 'h264_vaapi', but now I'm receiving error Impossible to convert between the formats supported by the filter 'Parsed_scale_0' and the filter 'auto_scale_0'
Even trying to use different outputs on ffmpeg, like -vf 'format=nv12,hwupload' -c:v h264_vaapi, the erro changes and it says the format=nv12,hwupload is unknown.
—
Reply to this email directly, view it on GitHub <#337 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADL7QUHLCUICX3I42BHC5IDXTI6K7ANCNFSM56FPXMFA>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
Thank you, I will give it a try!
No, the CPU usage is fine. Maybe decoding is happening in SW, but in my experience on low power CPUs you'll always see some CPU usage in HW encoding.
… Am 03.08.2023 um 13:08 schrieb VCTGomes ***@***.***>:
Yeah, it does. Actually, I could setup a workaround on Scrypted to do HW transcoding right now.
Instead of using setting up transcoding and decoding as Koush says above, changes the Stream to Ffmpeg (TCP) and insert the commands there.
<https://user-images.githubusercontent.com/2366600/258091224-a5c1227f-5ead-425d-9193-870868113f73.png>
Commands are:
-vaapi_device /dev/dri/renderD128
-filter:v format=nv12|vaapi,hwupload -codec:v h264_vaapi -b:v 2M -f rtsp
This way Scrypted won't send -filter_complex scale, which is broking our ffmpeg. Instead of, Scrypted will use -filter:v format=nv12|vaapi,hwupload, that works!
Doing it, I'm finally able to do transcoding using GPU.
<https://user-images.githubusercontent.com/2366600/258091931-b0b5d135-9700-4e12-b6ad-0074b36544a1.png>
However, I thinking a high CPU consumption for GPU-only transcoding. If it works for you, please tell me about the CPU usage too.
—
Reply to this email directly, view it on GitHub <#337 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADL7QUGL2NTTCD5PURMMPWLXTOBB5ANCNFSM56FPXMFA>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
Hello, can you please share how did you solve the error |
Beta Was this translation helpful? Give feedback.
There are two spots you need to set up for transcoding as transcoding is a two step process,
Decoding
andEncoding
:Decoding
This is configured per camera (different cameras may output different codecs).
Integrations and Extensions
. Select the decoder or enter the arguments manually.Encoding (H264)
This is configured globally on the Rebroadcast Plugin's Transcoding settings.
FFmpeg
…