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
Any plans to impl rkmpp video encoder in ffmpeg? #4
Comments
I also have this request. |
1/ sorry, the company has no further plan for ffmpeg due to license issue (there's a workable downstream rkmppenc patch in buildroot sdk through, you can check my github rockchip_mirrors repo's buildroot branch for it) 2/ 3588's rga is kind of unusable for now, it has more limits(alignment and function) and new api that is broken in most of common usages. so i would prefer to use gpu if you know how to do it. 3/ enc and dec are running on different hardware modules, so i think so(might affect each other by ddr performane) 4/ don't know much about the enc, but 3588 has multiple dec hardware modules, so guessing multiple dec sessions would take advantage of that. @herman would know better about the hardware and performance. |
i would prefer to use gstreamer. the ffmpeg here is just for some special usage(official chrome/firefox/mpv) |
Thanks for your info. |
@nyanmisaka Hi, I have tested the gstreamer with the official patch on RK3568, the decode and encode all run well. I also want to use the hardware transcoding for the Jellyfin Server running on the RK3568 chip. Is it possible to replace the ffmpeg with gstreamer in the Jellyfin code, so that the Jellyfin Server could transcode with the gstreamer? I consider the parameters of ffmpeg are so many and complex that the replacement would also be complex. |
Where did you get the RK3568 board? I ordered the Rock 5 a few months ago, but it's scheduled to ship in October. gstreamer is not as versatile as ffmpeg in terms of VOD streaming, so pure code replacement doesn't seem realistic. The decoder and encoder need to be implemented in ffmpeg for transcoding to work. |
@nyanmisaka I got it from the taobao. The rockchip official don't support the ffmpeg on encoding. Do you have plan to implement in ffmpeg for transcoding to work ? If you have the plan, I could share my board. |
Where is gstreamer patches(?) or whatever for rockchip then? At least ffmpeg patches are easy to find and somewhat easy to build, but gstreamer looks like a complete unsupported mess. |
Here's a ffmpeg fork that contains |
I am using that. scale_rga (besides lacking documentation, so I have no idea what I'm doing) isn't working.
|
Well... I tried with a mpeg2 source and it fails too with the same logs but it works fine with h264 source. edit: You can also try updating librga to the latest 1.8.1 and see if it helps. |
Here are examples https://github.com/jjm2473/ffmpeg-rk/wiki/%E7%BC%96%E8%A7%A3%E7%A0%81 . And detail parameters decribe here https://github.com/jjm2473/ffmpeg-rk/wiki/RGA%E6%BB%A4%E9%95%9C . |
I'm aware of this, however, even with default settings and hardware frame coming from RK decoder and going into RK encoder, scale_rga just errors out with stuff similar to the post above. |
What device you'r using? Did you check |
@trollcop can you share the video file, and the command you'r using? |
Hi,
On Sat, Nov 26, 2022 at 5:33 PM 练亮斌 ***@***.***> wrote:
scale_rga filter will output hardware frame, if you want to pass it to a
software encoder, you must append
I'm aware of this, however, even with default settings and hardware frame
coming from RK decoder and going into RK encoder, scale_rga just errors out
with stuff similar to the post above.
What device you'r using?
Firefly AIO-3399J
Did you check /dev/rga,/dev/dri existed?
This is default ubuntu20 install (later followed by a custom image with dts
to enable IEP which was disabled for some reason).
I will boot the board later and check.
I would imagine these should be enabled in default install.
—
… Reply to this email directly, view it on GitHub
<#4 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABDM5WD2LZQ3REVU4JCVEO3WKHDMJANCNFSM5ZYSZCLQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@trollcop can you share the video file, and the command you'r using?
Source is ISDB-T mpeg2 transport stream, received live.
ffmpeg -re -i udp://127.0.0.1:1234 -map 0:p:57352:v -map 0:p:57352:a
-acodec copy -vcodec h264_rkmpp -b:v 4M -f mpegts udp://
127.0.0.1:5000?pkt_size=1316
/dev/dri and /dev/rga seem to exist.
example with scaler_rga
ffmpeg -i udp://127.0.0.1:1234 -map 0:p:1064:v -map 0:p:1064:a -vf
scale_rga=1280:720 -acodec copy -vcodec h264_rkmpp -b:v 4M -bufsize 6000K
-f mpegts -muxrate 5000K udp://127.0.0.1:5000?pkt_size=1316
|
Just tried it again with a booted board. The above line works to encode (there are issues related to MPP library version, but that's unrelated). dmesg:
ffmpeg-rk:
|
I don't have a 3399 device to test. rga_api version 1.7.0? What the 1.7.0 from? |
This is all from default images provided by firefly: https://en.t-firefly.com/doc/download/page/id/31.html I have no idea, its preinstalled:
|
Here is log from rk3568
can you try librga-dev-rk356x and librga2-rk356x ? |
I am based on this RGA version https://github.com/JeffyCN/rockchip_mirrors/tree/linux-rga#%E9%80%82%E7%94%A8%E8%8A%AF%E7%89%87%E5%B9%B3%E5%8F%B0 |
What do you mean "try" ? I have to rebuild ffmpeg, etc? Your sample file is H264 in, H264 out. |
Here is prebuilt mpp,rga,ffmpeg for debian https://github.com/jjm2473/ffmpeg-rk/releases/tag/v1.0 And this is jellyfin docker image supports MPP, try it https://hub.docker.com/repository/docker/jjm2473/jellyfin-mpp |
@trollcop Is the ffmpeg you are using comes from official package? I don't think the official ffmpeg has 'scale_rga' filter |
No, it's built from source from your repository: https://github.com/jjm2473/ffmpeg-rk/ that... |
You should build libRGA from this tree https://github.com/JeffyCN/rockchip_mirrors/tree/linux-rga#%E9%80%82%E7%94%A8%E8%8A%AF%E7%89%87%E5%B9%B3%E5%8F%B0 , it supports RK3399 as document says, and ffmpeg-rk is based on that rga version. |
If you can run docker, just test jellyfin-mpp, docker container is not depends on your libRGA version |
Hey nice, thank you that fixed it! I guess I don't need to rebuild RGA after all. Is there any reason https://github.com/jjm2473/ffmpeg-rk/ has issues disabled? There's other stuff I'd like to figure out (seems to be libmpp version differences too) but I feel bad spamming unrelated project with it. |
@trollcop Oh, I have never noticed that, maybe github auto disable issues when forked, enable it now |
Thank you for your help, I will move to the other project with further issues! |
Folks, sorry for updating this thread, but @jjm2473 is unresponsive in his repo, and his repo is NOT working on my NanoPI R5C (RK3568B2). I really wish to build ffmpeg to support this architecture, but it seems amazingly complex and undocumented. ANY help would be greatly appreciated, as official friendlyarm email channels are also unresponsive. (3 weeks constantly pinging them without any single reply). @trollcop: did you solved this on which device? Thank you. |
@danergo you should check your kernel config first. check if you have truble with compile FFmpeg, try this docker image first https://hub.docker.com/r/jjm2473/jellyfin-mpp |
@danergo I have add some english docs https://github.com/jjm2473/ffmpeg-rk/wiki#eng |
@jjm2473: thank you. How can I check the kernel config? I have installed friendlyarms Debian Bullseye core from official website. Those files are existing on my system. Ffmpeg is building now without libx264 I'm gonna test this later. Thank you for English versions, I appreciate it. |
This is crazy. I compiled with this:
--disable-libx264 !! But when I run:
|
Still missing libx264.so.155 !!! I had to manually copy my libx264.so.160 to libx264.so.155 to run your ffmpeg:
Failed to initialize MPP context (code = -1). !!!
I don't have / want docker. I just want an ffmpeg can use this *** architecture's hw. |
You realize, you're OPENING it with mpp decoder, right? Last I checked that was kinda buggy and needed RGA support. |
If I use sw decode and HW encode, I'd lose a lot of resource IMHO. Is there any ffmpeg-fork which can use Rockchip's architecture fluid, and correct? |
No, because ffmpeg license is too retarded
Apparently you can use this stuff with gstreamer, but nobody actually uses
gstreamer so there's zero info about it.
Very typical of opensores project.
…On Wed, Apr 26, 2023 at 3:37 AM danergo ***@***.***> wrote:
If I use sw decode and HW encode, I'd lose a lot of resource IMHO. Is
there any ffmpeg-fork which can use Rockchip's architecture fluid, and
correct?
—
Reply to this email directly, view it on GitHub
<#4 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABDM5WFZEWEOFUDCPRLIM6DXDAKWDANCNFSM5ZYSZCLQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@JeffyCN Hi! I'm planning to add video transcoding support for our open source Jellyfin media server on rockchip SBC, in addition to our Intel, AMD and Nvidia graphics card support. We have maintained many custom patches here for our ffmpeg.
Seeing that librga is introduced with this commit, any plans to implement rkmpp's video encoder to ffmpeg? Or is there a staging patch in the mailing list?
rockchip-linux/mpp#157
There used to have a ffmpeg fork for encoder but it have been removed.
Also, to make librgba can be accepted by upstream, it should be used as a filter to chain with decoders and encoders. Such as
scale_librga=w=1280:h=720:format=yuv420p
.We need at least hardware accelerated:
It would be awesome If deinterlacing and HDR2SDR tonemapping are also supported via librga. Thus we can minimize the memory copy-back and the cpu usage. Any not supported hardware fix-functions can be compensated by using OpenCL, which can import memory directly from drm prime via Arm's extension.
I have to say that RK3588 is a beast when it comes to multi-way video tasks comparing with my already sold Raspberry pi 4. I've ordered a Rock 5b but it will still take several months before shipping. Hope it won't let me down.
Here are two more questions about RK3588:
The text was updated successfully, but these errors were encountered: