Radxa 8m 219 gstreamer resolution

Im using a Radxa Zero 3w with a Radxa 8m 219 camera attached.

Overlay for 8m is enabled.

If i use the test cmd

gst-launch-1.0 v4l2src num-buffers=512 device=/dev/video0 io-mode=4 ! videoconvert ! video/x-raw, format=NV12, width=1920, height=1080, framerate=30/1 ! tee name=t ! queue ! mpph264enc ! queue ! h264parse ! mpegtsmux ! filesink location=/home/radxa/file.name.mp4

I get a video saved .

If i try to get 4k output ( as advertised by Radxa ) with

gst-launch-1.0 v4l2src num-buffers=512 device=/dev/video0 io-mode=4 ! videoconvert ! video/x-raw, format=NV12, width=3820, height=2464, framerate=30/1 ! tee name=t ! queue ! mpph264enc ! queue ! h264parse ! mpegtsmux ! filesink location=/home/radxa/file.name.mp4

I get

Setting pipeline to PLAYING …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
New clock: GstSystemClock
Additional debug info:
…/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.002009663
Setting pipeline to NULL …
Freeing pipeline …

Any help or advice would be greatly appreciated.

Thanks

Can you post a download link for the software you are using?

You could try changing the width=3820, height=2464 parameter in the command to width=3840, height=2160 and see if you still have problems!

I’m testing with ffmpeg to youtube

ffmpeg -re -f v4l2 -video_size 384
0x2160 -i /dev/video0 -c:v h264 -preset veryfast -b:v 8000k -maxrate 8000k -bufsize 16000k -
rc_mode 0 -level 30 -pix_fmt yuv420p -f flv “rtmp://a.rtmp.youtube.com/live2/…”

gives me about 0.2 fps

[video4linux2,v4l2 @ 0xaaaafd953100] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device
[video4linux2,v4l2 @ 0xaaaafd953100] ioctl(VIDIOC_G_PARM): Inappropriate ioctl for device
[video4linux2,v4l2 @ 0xaaaafd953100] Time per frame unknown

If i use your suggested resolution it hangs here, 4k will continue…

Duration: N/A, start: 29145.357268, bitrate: N/A
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 3840x2160, 1000k tbr, 1000k tbn
[out#0/flv @ 0xaaab0cd6c6b0] Codec AVOption preset (Set the encoding preset (cf. x264 --fullhelp)) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_rkmpp_encoder))
Press [q] to stop, [?] for help
[h264_rkmpp_encoder @ 0xaaab0cd6d1d0] Picture format is yuv420p.
[h264_rkmpp_encoder @ 0xaaab0cd6d1d0] Rate Control mode is set to VBR
[h264_rkmpp_encoder @ 0xaaab0cd6d1d0] Bitrate Target/Min/Max is set to 8000000/500000/8500000
[h264_rkmpp_encoder @ 0xaaab0cd6d1d0] Profile is set to HIGH
[h264_rkmpp_encoder @ 0xaaab0cd6d1d0] 8x8 Transform is enabled
[h264_rkmpp_encoder @ 0xaaab0cd6d1d0] Level is set to 30
[h264_rkmpp_encoder @ 0xaaab0cd6d1d0] Coder is set to CABAC
[h264_rkmpp_encoder @ 0xaaab0cd6d1d0] Quality Min/Max is set to 50%(Quant=30) / 100%(Quant=10)

@Mitchell , through further experimentation I have found that 4k will only give me 15fps, if I follow this tutorial

https://docs.radxa.com/en/zero/zero3/app-development/rtsp?target=ffmpeg

and drop the input resolution to 1920x1080 ffmpeg tells me i get 30 / 60 fps depending on what my ouput fps is set to .

Thanks

Hi, I think you are not using the GPU encoder.
You should check wich ones have hardware accel.
mpph264enc dont have

@fdalto, you may well be right . I thought the mpp encoders used hardware. I’ll look further into it. Thank you.

ffmpeg HW Encoders:

 V..... h264_rkmpp           Rockchip MPP (Media Process Platform) H264 encoder (codec h264)
 V..... hevc_rkmpp           Rockchip MPP (Media Process Platform) HEVC encoder (codec hevc)
 V..... mjpeg_rkmpp          Rockchip MPP (Media Process Platform) MJPEG encoder (codec mjpeg)

I also added -hwaccel rkmpp before my camera input to use hardencoder there as well.

Have you tried to run apt update && apt upgrade ? Radxa released new IQ files in the beginning of September and they contain 4k resolution. The previous version didn’t contain it so 4k didn’t work.