Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge-2l:applications:hardware-decoding

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
products:sbc:edge-2l:applications:hardware-decoding [2026/05/11 01:55]
nick ↷ Page moved from local:users:gray:products:sbc:edge-2l:applications:hardware-decoding to products:sbc:edge-2l:applications:hardware-decoding
products:sbc:edge-2l:applications:hardware-decoding [2026/05/11 02:46] (current)
nick
Line 1: Line 1:
 ====== Edge-2L hardware decoding ====== ====== Edge-2L hardware decoding ======
  
-===== Introduction ===== +{{page>products:sbc:edge2:applications:hardware-decoding&noheader}}
- +
-This document explains how to utilize hardware-accelerated video decoding on the Edge-2L using the Rockchip MPP (Media Process Platform) framework. +
- +
-===== Decoding ===== +
- +
-<WRAP important > +
-If you encounter a permission error, try prefixing the commands with ''sudo''+
-</WRAP> +
- +
-1. Verify available MPP decoders. +
- +
-First, check that the GStreamer MPP plugins are installed and recognized: +
- +
-```shell +
-khadas@Khadas:~$ gst-inspect-1.0 | grep mpp +
-rockchipmpp mpph264encRockchip Mpp H264 Encoder +
-rockchipmpp:  mpph265enc: Rockchip Mpp H265 Encoder +
-rockchipmpp:  mppjpegdec: Rockchip's MPP JPEG image decoder +
-rockchipmpp:  mppjpegenc: Rockchip Mpp JPEG Encoder +
-rockchipmpp:  mppvideodec: Rockchip's MPP video decoder +
-rockchipmpp:  mppvp8enc: Rockchip Mpp VP8 Encoder +
-typefindfunctions: audio/x-musepack: mpc, mpp, mp+ +
-``` +
- +
-2. Decode a raw H264 file. +
- +
-Decode a raw H264 elementary stream file (test.h264) to a raw YUV file (test.yuv): +
- +
-```shell +
-khadas@Khadas:~$ gst-launch-1.0 filesrc location=./test.h264 ! h264parse ! mppvideodec ! video/x-raw,format=NV12 ! filesink location=test.yuv +
-Setting pipeline to PAUSED ... +
-Pipeline is PREROLLING ... +
-Pipeline is PREROLLED ... +
-Setting pipeline to PLAYING ... +
-Redistribute latency... +
-New clock: GstSystemClock +
-0:00:01.2 / 1:04:25.7 (0.0 %) +
-0:00:02.2 / 1:33:57.6 (0.0 %) +
-``` +
- +
-3. Decoding with MP4 file. +
- +
-Extract and decode the H264 video stream from an MP4 file: +
-```shell +
-khadas@Khadas:~$ gst-launch-1.0 filesrc location=./test.mp4 ! qtdemux name=d d.video_0 ! h264parse ! mppvideodec ! video/x-raw,format=NV12 ! filesink location=test.yuv +
-Setting pipeline to PAUSED ... +
-Pipeline is PREROLLING ... +
-Pipeline is PREROLLED ... +
-Setting pipeline to PLAYING ... +
-Redistribute latency... +
-New clock: GstSystemClock +
-0:00:01.8 / 0:10:34.5 (0.3 %) +
-``` +
- +
-You can play the resulting raw YUV file (test.yuv) using ffplay with the correct resolution and pixel format parameters. +
- +
-4. Decode and preview an RTSP stream. +
- +
-  * Preview on Wayland desktop: +
- +
-Use ''waylandsink'' to display the decoded video directly on the Ubuntu desktop (Wayland session): +
- +
-```shell +
-gst-launch-1.0 rtspsrc location=rtsp://USERNAME:PASSWD@192.168.xxx.xxx/snl/live/1/1 ! rtph264depay ! h264parse ! mppvideodec ! video/x-raw,format=NV12 ! waylandsink +
-``` +
- +
-  * Monitor decoding performance: +
- +
-Add fpsdisplaysink to overlay the current frames-per-second on the video: +
- +
-```shell +
-gst-launch-1.0 -v rtspsrc location=rtsp://USERNAME:PASSWD@192.168.xxx.xxx/snl/live/1/1 ! rtph264depay ! h264parse ! mppvideodec ! video/x-raw,format=NV12 ! fpsdisplaysink video-sink=waylandsink sync=false text-overlay=false +
-``` +
- +
-  * Preview using FFmpeg: +
- +
-Alternatively, use ''ffplay'' with the ''h264_rkmpp'' hardware decoder directly: +
- +
-```shell +
-ffplay -vcodec h264_rkmpp rtsp://USERNAME:PASSWD@192.168.xxx.xxx/snl/live/1/+
-``` +
- +
-<WRAP tip > +
-Remember to replace ''rtsp://USERNAME:PASSWORD@192.168.xxx.xxx/your_stream'' with your actual RTSP stream URL, username, and password. +
-</WRAP>+
  
  
  
Last modified: 2026/05/11 01:55 by nick