-
Notifications
You must be signed in to change notification settings - Fork 503
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
Update FFmpeg presets for Rockchip boards #1203
base: master
Are you sure you want to change the base?
Conversation
@AlexxIT I know you are not able to test these changes. Is there some way we can still implement them? |
I'm busy for the next two weeks |
Hello all,
Even with this I didnt note any inprovement on decoding or encoding on hw for go2rtc...but frigate is using rkrga without problems.
Is there any way to force Go2RTC to use HW for decoding and encoding ? How can I debug it? Another comment: Best regards, |
Hey @bugui2007, do you have a section like:
You are just defining some presets. Do you use them when defining your streams? Do you see any video from go2rtc? If you do this correctly, you force go2rtc to use hw accel. It won't fallback to software. Either it works and uses hardware or it will crash. You can use
Btw. you can use the exec command to start ffmpeg with custom commands. You don't need to mess with the presets:
|
Hello Marca711,
Then I switched back to the standar rtsp command like
And audio is working now. Do you have some recommendations to inprove the exec:ffmpeg command in order to get h265 to h264 transcoding on the fly as well can use audio? Bugui |
Hey @bugui2007 Try to remove the You can use |
Thanks for your work on this @MarcA711. Currently I only use go2rtc to rotate a camera stream 90 degrees. It was previous working on the latest frigate -rk dev container using:
But that wasnt actually using hardware acceleration from what I gather was the point of your PR? I had previously thought it was (any good way to test?) But anyway, the rotated stream ends up with a diagonal line and green stripe on the bottom artifacts like below and I was hoping maybe that would be fixed by using the custom ffmpeg cmdline: I finally got it working using an amalgam of your suggested commands and those at https://github.com/nyanmisaka/ffmpeg-rockchip/wiki/Filter, resulting in:
But the result has the same artifacts in the stream unfortunately. Can you confirm that this should enable hardware acceleration the stream tranposition? Also, I would prefer to keep the rotated stream h265 like the source stream is but I cannot get frigate to connect to it as a camera unless i convert to h264 - maybe that's a limitation of 'preset-rtsp-restream'? Let me know if I am doing something wrong and thanks again for you and everyone elses work on improving rockchip support |
AFAIK, there is no version of frigate that supports hw acceleration using
You can use
There were multiple issues with artifacts in hw accelerated streams. This was mostly due to odd weird resolution. You apperently have 1536x2048, can you try if it works for a standard resolution like 1920x1080? Maybe save a clip from your camera, use software ffmpeg to crop it to 1920x1080 and try if the artifacts still appear.
yes, the command that you provided uses hw acceleration. Two things to consider:
Frigate should be able to process the h265 stream. Did you select the correct hardware acceleration preset (hwaccel_args: preset-rk-h264 or preset-rk-h265)? Are you sure frigate fails to connect to the h265 stream? Because most web browsers don't support h265 since it is not free. If frigate shows no error but your web browser shows some error saying that it cannot play the video, your web browser might not be able to play h265. |
@derzahla @MarcA711 This artifact has been fixed recently. Updating
Also, hardware decoding is not used. It is |
@nyanmisaka Thank you for this info. @derzahla I try to build a new FFmpeg Rockchip binary with the fix. I will write here, when I am done. |
@derzahla I uploaded a new version that should contain the fix. You can download it here: https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/tag/6.1-6 |
see #979
./ffmpeg ...
. No need to install any libraries or dependencies. You need to run linux with up to date kernel drivers though. I recommend ubuntu-rockchip if your board is supported.:force_original_aspect_ratio=0
to the scale command to allow rescaling. No other preset does this afaik, but I know that some frigate users want to change their aspect ratio