Hardware decoding for video not enabled on A7A

Hardware acceleration for media playback not enabled on A7A, Radxa team must fix it.

@feng Hello sir, please do something to this problem

What format of video file are you playing? Additionally, what media player or playback method are you using

At chromium browser, at 1080p frame dropped, at 4k video lagging. Also chromium showing that hardware acceleration not enabled.

@feng Sir, the video file format is mp4

Allwinner has feedback that the browser hardware decoding support is still under development. You can first use GStreamer to play video files encoded in H264, H265, VP9, or AVS formats as a test.

@feng I’m trying to use the hardware decoder for RTSP stream with ffmpeg which I’ve installed but it was not able to decode the RTSP stream video frames which is H264/H265 encoded . I tried with media pipe example given ( MediaPipe Examples | Radxa Docs ) with just replaced the image source as RTSP URL but it didn’t work . Can you route me to the right direction please . it’s better if I can use the media pipe to pull rtsp stream and view it with cv2 first .

Regards,

Amir

you can also use dragonplayer “dragon <videopath.mp4>” But I doubt whether it’s hardware decoding or not . I was not able to use CV2 yet for RTSP stream to pull read docode and show .

Finally , I have managed to make it work . Here’s how .

Install gstreamer and ffmpeg

sudo apt update
sudo apt install gstreamer1.0-tools gstreamer1.0-libav
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad
ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev

Install gstreamer python3 libraries

sudo apt install -y python3-gi python3-gst-1.0 gstreamer1.0-python3-plugin-loader

add user group and permission to /dev/cedra_dev

sudo usermod -aG video radxa
sudo chmod 666 /dev/cedar_dev
logout
login

Python3 script: gst_rtsp_pull.py

import gi
gi.require_version(“Gst”, “1.0”)
from gi.repository import Gst
import numpy as np
import cv2

Gst.init(None)

pipeline_str = (
"rtspsrc location=rtsp://example.com:554/live/0 protocols=tcp latency=100 ! "
"rtph265depay ! h265parse ! "
"omxhevcvideodec ! "
"videoconvert ! "
"video/x-raw,format=BGR ! "
“appsink name=appsink emit-signals=true drop=true max-buffers=1 sync=false”
)

pipeline = Gst.parse_launch(pipeline_str)
appsink = pipeline.get_by_name(“appsink”)

pipeline.set_state(Gst.State.PLAYING)

print(“? GStreamer HW decode started”)

while True:
sample = appsink.emit(“pull-sample”)
buffer = sample.get_buffer()
caps = sample.get_caps()

width = caps.get_structure(0).get_value("width")
height = caps.get_structure(0).get_value("height")

success, mapinfo = buffer.map(Gst.MapFlags.READ)
if not success:
    continue

frame = np.ndarray(
    (height, width, 3),
    dtype=np.uint8,
    buffer=mapinfo.data
)

cv2.imshow("RTSP HW Decode", frame)
buffer.unmap(mapinfo)

if cv2.waitKey(1) & 0xFF == 27:
    break

pipeline.set_state(Gst.State.NULL)
cv2.destroyAllWindows()

Open Terminal & export display port to help OpenCV environment variable

export DISPLAY=:1
export XDG_RUNTIME_DIR=/run/user/$(id -u)
xhost +local:root

Execute the python3 script to pull rtsp stream → Hardware Decode → show on screen

sudo -E python3 gst_rtsp_pull.py