Note

This is the documentation for the latest development branch and may refer to features that are not available in released versions. If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

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

h264 / h265

h265

width

image width

1920

height

image height

1080

frame rate

output frame rate

30

bitrate

encoding bitrate

4000

Expected Result#

After the program starts, it will:

  1. initialize the video encoder

  2. configure the encoding parameters

  3. start the encoding loop

  4. 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.

Comments list
Comments
Log in