rkrga filter seems not working with yuv420p format. #224

Closed
opened 2025-12-23 10:36:21 +01:00 by backuprepo · 2 comments
Owner

Originally created by @xuc1995 on GitHub (Nov 27, 2025).

Test filter using code below:

sudo ~/ffmpeg-rockchip/ffmpeg -init_hw_device rkmpp=hw -filter_hw_device hw -f lavfi -i testsrc2=s=1920x1080,format=yuv420p
-vf hwupload,scale_rkrga=w=1280:h=720:format=nv12 -c:v h264_rkmpp -b:v 4M -maxrate 4M -vframes 1000 -y ./tmp.mp4

and it pops an error like:

Image

I run this on a rk3588s2 chip: radxa rock 5c, i'm not sure is this propblem comes with chip or ffmpeg-rockchip.

Originally created by @xuc1995 on GitHub (Nov 27, 2025). Test filter using code below: sudo ~/ffmpeg-rockchip/ffmpeg -init_hw_device rkmpp=hw -filter_hw_device hw -f lavfi -i testsrc2=s=1920x1080,format=yuv420p \ -vf hwupload,scale_rkrga=w=1280:h=720:format=nv12 -c:v h264_rkmpp -b:v 4M -maxrate 4M -vframes 1000 -y ./tmp.mp4 and it pops an error like: <img width="1072" height="332" alt="Image" src="https://github.com/user-attachments/assets/3c4ccf64-a959-460c-ad5c-6480790e8e2d" /> I run this on a rk3588s2 chip: radxa rock 5c, i'm not sure is this propblem comes with chip or ffmpeg-rockchip.
backuprepo 2025-12-23 10:36:21 +01:00
  • closed this issue
  • added the
    invalid
    label
Author
Owner

@nyanmisaka commented on GitHub (Nov 27, 2025):

I cannot reproduce this issue. Make sure you have followed the tutorials in the wiki and used the mpp and rga branches I provided.

https://github.com/nyanmisaka/ffmpeg-rockchip/wiki/Compilation

$ ./ffmpeg -init_hw_device rkmpp=hw -filter_hw_device hw -f lavfi -i testsrc2=s=1920x1080,format=yuv420p -vf hwupload,scale_r
krga=w=1280:h=720:format=nv12 -c:v h264_rkmpp -b:v 4M -maxrate 4M -vframes 1000 -y ./tmp.mp4
ffmpeg version 7.1.2-Jellyfin Copyright (c) 2000-2025 the FFmpeg developers
  built with gcc 15.2.0 (crosstool-NG 1.28.0.1_403899e)
  configuration: --prefix=/ffbuild/prefix --pkg-config=pkg-config --pkg-config-flags=--static --cross-prefix=aarch64-ffbuild-linux-gnu- --arch=aarch64 --cpu=armv8-a --target-os=linux --extra-version=Jellyfin --extra-cflags= --extra-cxxflags= --extra-ldflags= --extra-ldexeflags=-pie --extra-libs=-ldl --enable-gpl --enable-version3 --disable-ffplay --disable-debug --disable-doc --disable-sdl2 --disable-libxcb --disable-xlib --enable-lto=auto --enable-iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-libxml2 --enable-openssl --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --enable-chromaprint --enable-libdav1d --enable-libfdk-aac --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libopenmpt --enable-rkmpp --enable-rkrga --enable-libsrt --enable-libsvtav1 --enable-libdrm --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libzimg --enable-libzvbi
  libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.101 / 61. 19.101
  libavformat    61.  7.100 / 61.  7.100
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  4.100 / 10.  4.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.100
Input #0, lavfi, from 'testsrc2=s=1920x1080,format=yuv420p':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: wrapped_avframe, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (h264_rkmpp))
Press [q] to stop, [?] for help
rga_api version 1.10.4_[1]
Output #0, mp4, to './tmp.mp4':
  Metadata:
    encoder         : Lavf61.7.100
  Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), drm_prime(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 4000 kb/s, 25 fps, 12800 tbn
      Metadata:
        encoder         : Lavc61.19.101 h264_rkmpp
[out#0/mp4 @ 0xaaaaeebcb3e0] video:19270KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.026241%
frame= 1000 fps=474 q=21.0 Lsize=   19275KiB time=00:00:39.96 bitrate=3951.5kbits/s speed=  19x
@nyanmisaka commented on GitHub (Nov 27, 2025): I cannot reproduce this issue. Make sure you have followed the tutorials in the wiki and used the mpp and rga branches I provided. https://github.com/nyanmisaka/ffmpeg-rockchip/wiki/Compilation ``` $ ./ffmpeg -init_hw_device rkmpp=hw -filter_hw_device hw -f lavfi -i testsrc2=s=1920x1080,format=yuv420p -vf hwupload,scale_r krga=w=1280:h=720:format=nv12 -c:v h264_rkmpp -b:v 4M -maxrate 4M -vframes 1000 -y ./tmp.mp4 ffmpeg version 7.1.2-Jellyfin Copyright (c) 2000-2025 the FFmpeg developers built with gcc 15.2.0 (crosstool-NG 1.28.0.1_403899e) configuration: --prefix=/ffbuild/prefix --pkg-config=pkg-config --pkg-config-flags=--static --cross-prefix=aarch64-ffbuild-linux-gnu- --arch=aarch64 --cpu=armv8-a --target-os=linux --extra-version=Jellyfin --extra-cflags= --extra-cxxflags= --extra-ldflags= --extra-ldexeflags=-pie --extra-libs=-ldl --enable-gpl --enable-version3 --disable-ffplay --disable-debug --disable-doc --disable-sdl2 --disable-libxcb --disable-xlib --enable-lto=auto --enable-iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-libxml2 --enable-openssl --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --enable-chromaprint --enable-libdav1d --enable-libfdk-aac --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libopenmpt --enable-rkmpp --enable-rkrga --enable-libsrt --enable-libsvtav1 --enable-libdrm --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libzimg --enable-libzvbi libavutil 59. 39.100 / 59. 39.100 libavcodec 61. 19.101 / 61. 19.101 libavformat 61. 7.100 / 61. 7.100 libavdevice 61. 3.100 / 61. 3.100 libavfilter 10. 4.100 / 10. 4.100 libswscale 8. 3.100 / 8. 3.100 libswresample 5. 3.100 / 5. 3.100 libpostproc 58. 3.100 / 58. 3.100 Input #0, lavfi, from 'testsrc2=s=1920x1080,format=yuv420p': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: wrapped_avframe, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn Stream mapping: Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (h264_rkmpp)) Press [q] to stop, [?] for help rga_api version 1.10.4_[1] Output #0, mp4, to './tmp.mp4': Metadata: encoder : Lavf61.7.100 Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), drm_prime(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 4000 kb/s, 25 fps, 12800 tbn Metadata: encoder : Lavc61.19.101 h264_rkmpp [out#0/mp4 @ 0xaaaaeebcb3e0] video:19270KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.026241% frame= 1000 fps=474 q=21.0 Lsize= 19275KiB time=00:00:39.96 bitrate=3951.5kbits/s speed= 19x ```
Author
Owner

@xuc1995 commented on GitHub (Nov 27, 2025):

I cannot reproduce this issue. Make sure you have followed the tutorials in the wiki and used the mpp and rga branches I provided.

https://github.com/nyanmisaka/ffmpeg-rockchip/wiki/Compilation

$ ./ffmpeg -init_hw_device rkmpp=hw -filter_hw_device hw -f lavfi -i testsrc2=s=1920x1080,format=yuv420p -vf hwupload,scale_r
krga=w=1280:h=720:format=nv12 -c:v h264_rkmpp -b:v 4M -maxrate 4M -vframes 1000 -y ./tmp.mp4
ffmpeg version 7.1.2-Jellyfin Copyright (c) 2000-2025 the FFmpeg developers
  built with gcc 15.2.0 (crosstool-NG 1.28.0.1_403899e)
  configuration: --prefix=/ffbuild/prefix --pkg-config=pkg-config --pkg-config-flags=--static --cross-prefix=aarch64-ffbuild-linux-gnu- --arch=aarch64 --cpu=armv8-a --target-os=linux --extra-version=Jellyfin --extra-cflags= --extra-cxxflags= --extra-ldflags= --extra-ldexeflags=-pie --extra-libs=-ldl --enable-gpl --enable-version3 --disable-ffplay --disable-debug --disable-doc --disable-sdl2 --disable-libxcb --disable-xlib --enable-lto=auto --enable-iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-libxml2 --enable-openssl --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --enable-chromaprint --enable-libdav1d --enable-libfdk-aac --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libopenmpt --enable-rkmpp --enable-rkrga --enable-libsrt --enable-libsvtav1 --enable-libdrm --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libzimg --enable-libzvbi
  libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.101 / 61. 19.101
  libavformat    61.  7.100 / 61.  7.100
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  4.100 / 10.  4.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.100
Input #0, lavfi, from 'testsrc2=s=1920x1080,format=yuv420p':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: wrapped_avframe, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (h264_rkmpp))
Press [q] to stop, [?] for help
rga_api version 1.10.4_[1]
Output #0, mp4, to './tmp.mp4':
  Metadata:
    encoder         : Lavf61.7.100
  Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), drm_prime(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 4000 kb/s, 25 fps, 12800 tbn
      Metadata:
        encoder         : Lavc61.19.101 h264_rkmpp
[out#0/mp4 @ 0xaaaaeebcb3e0] video:19270KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.026241%
frame= 1000 fps=474 q=21.0 Lsize=   19275KiB time=00:00:39.96 bitrate=3951.5kbits/s speed=  19x

Thanks a lot, i currently use code below to compile ffmpeg-rockchip:

Image (not following your wiki)

I will try to compile mpp and rga my self.

@xuc1995 commented on GitHub (Nov 27, 2025): > I cannot reproduce this issue. Make sure you have followed the tutorials in the wiki and used the mpp and rga branches I provided. > > https://github.com/nyanmisaka/ffmpeg-rockchip/wiki/Compilation > > ``` > $ ./ffmpeg -init_hw_device rkmpp=hw -filter_hw_device hw -f lavfi -i testsrc2=s=1920x1080,format=yuv420p -vf hwupload,scale_r > krga=w=1280:h=720:format=nv12 -c:v h264_rkmpp -b:v 4M -maxrate 4M -vframes 1000 -y ./tmp.mp4 > ffmpeg version 7.1.2-Jellyfin Copyright (c) 2000-2025 the FFmpeg developers > built with gcc 15.2.0 (crosstool-NG 1.28.0.1_403899e) > configuration: --prefix=/ffbuild/prefix --pkg-config=pkg-config --pkg-config-flags=--static --cross-prefix=aarch64-ffbuild-linux-gnu- --arch=aarch64 --cpu=armv8-a --target-os=linux --extra-version=Jellyfin --extra-cflags= --extra-cxxflags= --extra-ldflags= --extra-ldexeflags=-pie --extra-libs=-ldl --enable-gpl --enable-version3 --disable-ffplay --disable-debug --disable-doc --disable-sdl2 --disable-libxcb --disable-xlib --enable-lto=auto --enable-iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-libxml2 --enable-openssl --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --enable-chromaprint --enable-libdav1d --enable-libfdk-aac --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libopenmpt --enable-rkmpp --enable-rkrga --enable-libsrt --enable-libsvtav1 --enable-libdrm --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libzimg --enable-libzvbi > libavutil 59. 39.100 / 59. 39.100 > libavcodec 61. 19.101 / 61. 19.101 > libavformat 61. 7.100 / 61. 7.100 > libavdevice 61. 3.100 / 61. 3.100 > libavfilter 10. 4.100 / 10. 4.100 > libswscale 8. 3.100 / 8. 3.100 > libswresample 5. 3.100 / 5. 3.100 > libpostproc 58. 3.100 / 58. 3.100 > Input #0, lavfi, from 'testsrc2=s=1920x1080,format=yuv420p': > Duration: N/A, start: 0.000000, bitrate: N/A > Stream #0:0: Video: wrapped_avframe, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn > Stream mapping: > Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (h264_rkmpp)) > Press [q] to stop, [?] for help > rga_api version 1.10.4_[1] > Output #0, mp4, to './tmp.mp4': > Metadata: > encoder : Lavf61.7.100 > Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), drm_prime(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 4000 kb/s, 25 fps, 12800 tbn > Metadata: > encoder : Lavc61.19.101 h264_rkmpp > [out#0/mp4 @ 0xaaaaeebcb3e0] video:19270KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.026241% > frame= 1000 fps=474 q=21.0 Lsize= 19275KiB time=00:00:39.96 bitrate=3951.5kbits/s speed= 19x > ``` Thanks a lot, i currently use code below to compile ffmpeg-rockchip: <img width="1228" height="273" alt="Image" src="https://github.com/user-attachments/assets/29b52623-f4a5-4f87-9c1f-1d4f3f3ba996" /> (not following your wiki) I will try to compile mpp and rga my self.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/ffmpeg-rockchip#224
No description provided.