Video Demo#
Overview#
This example demonstrates how to use the K230 video encode/decode modules (VENC/VDEC) to perform video encoding and decoding.
Functional Description#
VENC Features#
The video encoder path provides:
support for formats such as H.264 and H.265
configurable output resolution
bitrate control modes such as CBR and VBR
configurable output frame rate
GOP size configuration
VDEC Features#
The video decoder path provides:
support for formats such as H.264 and H.265
hardware-accelerated decoding
multi-stream decode capability
direct output to VO display
Source Location#
Demo source path: src/rtsmart/examples/mpp/sample_venc
Usage#
Build#
At the root of K230 RTOS SDK, use make menuconfig to enable the Video example in the firmware build, then build the firmware.
Run#
./sample_venc.elf [options]
Parameters#
Parameter |
Description |
Default |
|---|---|---|
codec type |
|
|
width |
image width |
|
height |
image height |
|
frame rate |
output frame rate |
|
bitrate |
encoding bitrate |
|
Expected Result#
After the program starts, it will:
initialize the video encoder
configure the encoding parameters
start the encoding loop
output the encoded bitstream
Example output:
Video Encoder Demo
=================
Initializing VENC module...
VENC initialized successfully
Configuring encoder...
Codec: H.265
Resolution: 1920x1080
Frame rate: 30fps
Bitrate: 4000Kbps
Starting encoding...
Encoding frames...
Frame 1 encoded
Frame 2 encoded
Frame 3 encoded
...
Encoding statistics:
Total frames: 1000
Total bytes: 52428800
Bitrate: 4000Kbps (actual)
Press Ctrl+C to stop.
Tip
Video encode/decode is one of the core parts of the media stack. Choose encoding parameters according to the actual application scenario. For detailed interfaces, refer to the Video Encoder/Decoder API documentation.
