是否有rkmpp的硬件转码例程 #215

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

Originally created by @ZeroKernel798 on GitHub (Sep 15, 2025).

您好,请问有关硬件scale_rkrga缩放以及硬件编解码器的转码例程嘛,我在使用命令行的时候能够正确转码,但编写代码实现的时候,老是遇到问题,不知道我编写的代码问题抑或是其他问题

Originally created by @ZeroKernel798 on GitHub (Sep 15, 2025). 您好,请问有关硬件scale_rkrga缩放以及硬件编解码器的转码例程嘛,我在使用命令行的时候能够正确转码,但编写代码实现的时候,老是遇到问题,不知道我编写的代码问题抑或是其他问题
backuprepo 2025-12-23 10:36:08 +01:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@nyanmisaka commented on GitHub (Sep 15, 2025):

Here is a cpp demo using the rkmpp decoder with the rkrga filter.

https://github.com/cbalint13/ffmpeg-bindings

@nyanmisaka commented on GitHub (Sep 15, 2025): Here is a cpp demo using the rkmpp decoder with the rkrga filter. https://github.com/cbalint13/ffmpeg-bindings
Author
Owner

@CharlesLiaoO commented on GitHub (Oct 12, 2025):

Hi, everyone, I am new to code with ffmpeg API and I am facing the problems with transcoding MJPEG to H264.
The repository nyanmisaka memtioned, https://github.com/cbalint13/ffmpeg-bindings/blob/main/cpp/ffmpeg-read.cpp, unfortunately does not include encoder example.

This is my test repository: https://github.com/CharlesLiaoO/cpp_for_ffmpeg-rockchip
My problem is:

  • jpeg --decode--> drm frame --copy--> cpu frame --encode--> h264 frame [OK]
  • jpeg --decode--> drm frame -------------------------encode--> h264 frame [Not OK]

Thank you. Appreciate if you could help.

@CharlesLiaoO commented on GitHub (Oct 12, 2025): Hi, everyone, I am new to code with ffmpeg API and I am facing the problems with transcoding MJPEG to H264. The repository nyanmisaka memtioned, https://github.com/cbalint13/ffmpeg-bindings/blob/main/cpp/ffmpeg-read.cpp, unfortunately does not include encoder example. This is my test repository: https://github.com/CharlesLiaoO/cpp_for_ffmpeg-rockchip My problem is: - jpeg --decode--> drm frame --copy--> cpu frame --encode--> h264 frame [OK] - jpeg --decode--> drm frame -------------------------encode--> h264 frame [Not OK] Thank you. Appreciate if you could help.
Author
Owner

@nyanmisaka commented on GitHub (Oct 13, 2025):

Hi, everyone, I am new to code with ffmpeg API and I am facing the problems with transcoding MJPEG to H264. The repository nyanmisaka memtioned, cbalint13/ffmpeg-bindings@main/cpp/ffmpeg-read.cpp, unfortunately does not include encoder example.

This is my test repository: CharlesLiaoO/cpp_for_ffmpeg-rockchip My problem is:

  • jpeg --decode--> drm frame --copy--> cpu frame --encode--> h264 frame [OK]
  • jpeg --decode--> drm frame -------------------------encode--> h264 frame [Not OK]

Thank you. Appreciate if you could help.

        // codec_ctx_->pix_fmt = AV_PIX_FMT_DRM_PRIME;  // runtime error: [h264_rkmpp @ 0x55576db7b0] Unsupported input pixel format '(null)'
        codec_ctx_->pix_fmt = AV_PIX_FMT_NV16;  // ok

AVCodecContext.sw_pix_fmt is unset.

@nyanmisaka commented on GitHub (Oct 13, 2025): > Hi, everyone, I am new to code with ffmpeg API and I am facing the problems with transcoding MJPEG to H264. The repository nyanmisaka memtioned, [cbalint13/ffmpeg-bindings@`main`/cpp/ffmpeg-read.cpp](https://github.com/cbalint13/ffmpeg-bindings/blob/main/cpp/ffmpeg-read.cpp?rgh-link-date=2025-10-12T16%3A54%3A35.000Z), unfortunately does not include encoder example. > > This is my test repository: [CharlesLiaoO/cpp_for_ffmpeg-rockchip](https://github.com/CharlesLiaoO/cpp_for_ffmpeg-rockchip?rgh-link-date=2025-10-12T16%3A54%3A35.000Z) My problem is: > > * jpeg --decode--> drm frame --copy--> cpu frame --encode--> h264 frame [OK] > * jpeg --decode--> drm frame -------------------------encode--> h264 frame [Not OK] > > Thank you. Appreciate if you could help. ```c // codec_ctx_->pix_fmt = AV_PIX_FMT_DRM_PRIME; // runtime error: [h264_rkmpp @ 0x55576db7b0] Unsupported input pixel format '(null)' codec_ctx_->pix_fmt = AV_PIX_FMT_NV16; // ok ``` `AVCodecContext.sw_pix_fmt` is unset.
Author
Owner

@CharlesLiaoO commented on GitHub (Oct 14, 2025):

Hi, everyone, I am new to code with ffmpeg API and I am facing the problems with transcoding MJPEG to H264. The repository nyanmisaka memtioned, cbalint13/ffmpeg-bindings@main/cpp/ffmpeg-read.cpp, unfortunately does not include encoder example.
This is my test repository: CharlesLiaoO/cpp_for_ffmpeg-rockchip My problem is:

  • jpeg --decode--> drm frame --copy--> cpu frame --encode--> h264 frame [OK]
  • jpeg --decode--> drm frame -------------------------encode--> h264 frame [Not OK]

Thank you. Appreciate if you could help.

    // codec_ctx_->pix_fmt = AV_PIX_FMT_DRM_PRIME;  // runtime error: [h264_rkmpp @ 0x55576db7b0] Unsupported input pixel format '(null)'
    codec_ctx_->pix_fmt = AV_PIX_FMT_NV16;  // ok

AVCodecContext.sw_pix_fmt is unset.

Fixed my problem with your notes. Appreciate!

@CharlesLiaoO commented on GitHub (Oct 14, 2025): > > Hi, everyone, I am new to code with ffmpeg API and I am facing the problems with transcoding MJPEG to H264. The repository nyanmisaka memtioned, [cbalint13/ffmpeg-bindings@`main`/cpp/ffmpeg-read.cpp](https://github.com/cbalint13/ffmpeg-bindings/blob/main/cpp/ffmpeg-read.cpp?rgh-link-date=2025-10-12T16%3A54%3A35.000Z), unfortunately does not include encoder example. > > This is my test repository: [CharlesLiaoO/cpp_for_ffmpeg-rockchip](https://github.com/CharlesLiaoO/cpp_for_ffmpeg-rockchip?rgh-link-date=2025-10-12T16%3A54%3A35.000Z) My problem is: > > > > * jpeg --decode--> drm frame --copy--> cpu frame --encode--> h264 frame [OK] > > * jpeg --decode--> drm frame -------------------------encode--> h264 frame [Not OK] > > > > Thank you. Appreciate if you could help. > > // codec_ctx_->pix_fmt = AV_PIX_FMT_DRM_PRIME; // runtime error: [h264_rkmpp @ 0x55576db7b0] Unsupported input pixel format '(null)' > codec_ctx_->pix_fmt = AV_PIX_FMT_NV16; // ok > `AVCodecContext.sw_pix_fmt` is unset. Fixed my problem with your notes. Appreciate!
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#215
No description provided.