HOME
Shop
  • English
  • 简体中文
HOME
Shop
  • English
  • 简体中文
  • Product Series

    • FPGA+ARM

      • GM-3568JHF

        • Introduction

          • GM-3568JHF Introduction
        • Quick Start

          • Preface
          • Environment Setup
          • Compilation Notes
          • Flashing Guide
          • Debugging Tools
          • Software Update
          • Viewing System Information
          • Test Commands
          • Application Compilation
          • Source Code Access
        • Peripherals & Interfaces

          • USB
          • Display and Touch
          • Ethernet
          • WIFI
          • Bluetooth
          • TF-Card
          • Audio
          • Serial Port
          • CAN
          • RTC
        • Application Development

          • UART Read/Write Demo
          • Key Detection Demo
          • LED Blink Demo
          • MIPI Screen Detection Demo
          • Read USB Device Information Demo
          • FAN Detection Demo
          • FPGA FSPI Communication Demo
          • FPGA DMA Read/Write Demo
          • GPS Debugging Demo
          • Ethernet Test Demo
          • RS485 Read/Write Demo
          • FPGA I2C Read/Write Demo
          • PN532 NFC Card-Reading Demo
          • TF Card Read/Write Demo
        • QT Development

          • ARM64 Cross-Compiler Environment Setup
          • Adding a QT Program to Boot Auto-Start
        • RKNN_NPU Development

          • RK3568 NPU Overview
          • Development Environment Setup
          • Run the Official YOLOv5 Example
        • FPGA Development

          • ARM and FPGA Communication
          • FPGA Development Manual
        • Others

          • Modifying the Root Filesystem
          • System Auto-Start Services
        • Downloads

          • Downloads
      • MB-E30P

        • Introduction

          • MB-E30P Introduction
        • Quick Start

          • Preface
          • Environment Setup
          • Compilation Instructions
          • Flashing Guide
          • Debugging Tools
          • Software Update
          • Viewing Information
          • Test Commands
          • Application Compilation
          • Source Code Acquisition
        • Peripherals & Interfaces

          • USB
          • Display and Touch
          • Ethernet
          • WIFI
          • Bluetooth
          • TF-Card
          • Audio
          • RTC
        • Application Development

          • Key Detection Demo
          • LED Blink Demo
          • MIPI Screen Detection Demo
          • Read USB Device Information Demo
          • FAN Detection Demo
          • FPGA FSPI Communication Demo
          • FPGA DMA Read/Write Demo
          • Ethernet Test Demo
          • FPGA IIC Read/Write Demo
          • PN532 NFC Card Reading Demo
          • TF Card Read/Write Demo
        • QT Development

          • ARM64 Cross-Compiler Environment Setup
          • Adding a QT Program to the Boot Auto-Start Service
        • RKNN_NPU Development

          • RK3568 NPU Overview
          • Development Environment Setup
          • Run the Official YOLOv5 Example
          • Model Conversion In Detail
          • Run Custom Models on the Board
        • FPGA Development

          • ARM and FPGA Communication
          • FPGA Development Manual
        • Others

          • Modifying the Root Filesystem
          • System Auto-Start Service
        • Downloads

          • Downloads
    • ShimetaPi

      • M4-R1

        • Introduction

          • M4-R1 Introduction
        • Quick Start

          • OpenHarmony Overview
          • Image Burning
          • Application Development Quick Start
          • Device Development Quick Start
        • Application Development

          • ArkUI

            • ArkTS Language Overview
            • UI Components - Row Container Introduction
            • UI Components - Column Container Introduction
            • UI Components - Text Component
            • UI Components - Toggle Component
            • UI Components - Slider Component
            • UI Components - Animation Component & Transition Component
          • Documentation

            • OpenHarmony Official Materials
          • Development Notes

            • Full-SDK Replacement Tutorial
            • Introducing and Using Third-Party Libraries
            • HDC Debugging
            • Restore Factory Mode via Command Line
            • Upgrade App to System Permission
          • First App

            • Build Your First ArkTS Application - HelloWorld
          • Demos

            • Serial-Debug-Assistant Application Demo
            • Writing-Board Application Demo
            • Digital Clock Application Demo
            • Wi-Fi Information Acquisition Application Demo
        • Device Development

          • Ubuntu Development

            • Environment Setup
            • Download Source Code
            • Compile Source Code
          • DevEco Device Tool

            • Tool Introduction
            • Development Environment Construction
            • Import the SDK
            • HUAWEI DevEco Tool Function Introduction
        • Kernel Peripherals & Interfaces

          • Guide
          • Device Tree Introduction
          • NAPI Introduction
          • ArkTS Introduction
          • NAPI Development Hands-on Demo
          • GPIO Introduction
          • I2C Communication
          • SPI Communication
          • PWM Control
          • UART Communication
          • TF Card (MicroSD)
          • Screen (Display)
          • Touch
          • Ethernet
          • M.2 SSD
          • Audio
          • WIFI & BT
          • Camera
        • Downloads

          • Downloads
      • M5-R1

        • Introduction

          • M5-R1 Development Docs
        • Quick Start

          • Image Burning
          • Environment Setup
          • Download Source Code
        • Peripherals & Interfaces

          • Raspberry Pi Interfaces
          • GPIO Interface
          • I2C Interface
          • SPI Communication
          • PWM Control
          • Serial Port Communication
          • TF Card
          • Display
          • Touch
          • Audio
          • RTC
          • Ethernet
          • M.2
          • MINI-PCIE
          • Camera
          • WIFI & BT
        • Downloads

          • Downloads
      • Pico-G1

        • Product Overview

          • Product Introduction
          • SDK Version Information
        • Quick Start

          • Development Environment Setup
          • Image Build
          • Image Flashing
          • System Login
          • Network Configuration
          • File Transfer
          • SDK Directory Structure
          • Deploying Your First Application
          • Deploying Your First Driver
          • Mounting an SD Card
        • Peripherals & Interfaces

          • GPIO Control
          • UART Serial Communication
          • I2C Communication
          • SPI Communication
        • MPP Media Development

          • MPP Media Processing Software
          • Image Processing Chain
          • Video Input
          • Image Encoding
        • NPU & AI

          • NPU Driver and Runtime Library Architecture
          • .xmm Model Loading
          • SVP Video Processing
          • AI Noise Reduction (AI_NR)
        • Application Samples

          • Encryption/Decryption Application
          • ADC Acquisition Application
          • Low-Power Application
          • Audio Processing Application
          • Video Encoding Application
          • Video Input Application
          • Video Graphics Subsystem (VGS) Application
          • 08 Region Overlay Application
          • 09 Intelligent Video Engine Application
          • 10 UVC Webcam Application
          • 11 All-in-One Quickstart Application
          • 12 FPN Correction Application
          • 13 Regional Motion Detection Application
          • 14 MTCNN Face Detection Application
        • Expansion Board Peripheral Examples

          • 00 - Pico Expansion Board Peripheral Examples Overview
          • 01 - OLED Display Application
          • 02 - TFT Display Application
          • 03 - MPU6050 Gyroscope Application
          • 04 - ADC Acquisition Application
          • 05 - Passive Buzzer Application
          • 06 - MQ Gas Sensor Application
          • 07 - GPS Positioning Application
          • 08 - SHT20 Temperature & Humidity Application
          • 09 - Ultrasonic Ranging Application
          • 10 - SpO2 Sensor Application
          • 11 - DC Motor Control Application
          • 12 - Servo Control Application
    • OpenHarmony

      • SC-3568HA

        • Introduction

          • SC-3568HA Overview
        • Quick Start Guide

          • OpenHarmony Overview
          • Image Flashing
          • Setting Up the Development Environment
          • Hello World Application and Deployment
        • Application Development

          • ArkUI

            • Introduction to ArkTS Language
            • Introduction to UI Components and Practical Applications (Part 1)
            • Introduction to UI Components and Practical Applications (Part 2)
            • Introduction to UI Components and Practical Applications (Part 3)
          • Expand

            • Getting Started Guide
            • Referencing and Using Third-Party Libraries
            • Application Compilation and Deployment
            • Command-Line Factory Reset
            • System Debugging -- HDC Debugging
            • APP Stability Testing
            • Chapter 7 Application Testing
        • Device Development

          • Environment Setup
          • Download Source Code
          • Compiling Source Code
        • Peripheral And Interface

          • Raspberry Pi interface
          • GPIO Interface
          • I2C Interface
          • SPI communication
          • PWM (Pulse Width Modulation) control
          • Serial port communication
          • TF Card
          • Display Screen
          • Touch
          • Audio
          • RTC
          • Ethernet
          • M.2
          • MINI-PCIE
          • Camera
          • WIFI&BT
          • Raspberry Pi expansion board
        • Downloads

          • Downloads
      • M-K1HSE

        • Introduction

          • M-K1HSE Introduction
        • Quick Start

          • Development environment construction
          • Source code acquisition
          • Compilation Notes
          • Burning Guide
        • Application Development

          • Application Development Environment Setup
          • First Application - Hello World
        • Peripherals and interfaces

          • 01 Audio
          • 02 RS485
          • 03 Display
        • System customization development

          • System transplant
          • System customization
          • Driver Development
          • System Debugging
          • OTA Update
        • Downloads

          • Downloads
    • HVS Camera

      • Quick Start

        • SDK Overview
        • Downloads
        • Your First C++ Program
        • Python Data Analysis
        • MultiVision Studio
      • Development

        • Programming Guides

          • Open Camera
          • Read Events
          • Recording & Replay
          • Event Processing (Denoising)
          • Display & Visualization
          • Tuning
          • Capture APS Image
        • Toolkit SDK

          • Hybrid Vision Toolkit
          • Quick Start
          • C++ API
          • Python API
        • Algorithm

          • Hybrid Vision Algo
          • Hybrid Vision Algo API
          • Windows Algo SDK
        • Samples Overview
        • Applications
      • Fundamentals

        • Event Camera Fundamentals
        • HVS Hybrid Vision
        • Event Visualization
        • Data Formats Reference
        • Glossary
        • Bias & Tuning
        • Video Tutorials
      • USB Cameras

        • HVS Camera Quick Start
        • Networking Capabilities

          • HVS Camera System Architecture
          • EVS Network Server
          • EVS Time Sync
          • Web Window
        • HVS Camera Compatibility Matrix
        • FAQ & Troubleshooting Guide
        • Products

          • CF-NRS1 (Lingguang No.1 Hybrid Vision Camera)
      • MIPI Modules

        • MIPI Module Quick Start
        • Carrier Boards

          • RDK X5 Carrier Board Adaptation
          • Raspberry Pi Carrier Board Adaptation
          • Digua Pi Carrier Board Adaptation
          • ShimeTai Board Carrier Board Adaptation
        • MIPI Module Compatibility Matrix
        • Products

          • EVS_003 Sensor Module
    • AI-model

      • 1684XB-32T

        • Introduction

          • AIBOX-1684XB-32 Introduction
        • Quick Start

          • First Use
          • Network Configuration
          • Disk Usage
          • Memory Allocation
          • Fan Control Strategy
          • Firmware Upgrade
          • Cross Compilation
          • Model Quantization
        • Application Development

          • Development Overview

            • Sophgo SDK Development
            • Sophgo Demo Introduction
          • Large Language Models

            • Deploying Llama3 Example
            • Sophon LLM_api_server Development
            • Deploying MiniCPM-V-2_6
            • Qwen-2-5-VL Image and Video Recognition Demo
            • Qwen3-chat Demo
            • Qwen3-Qwen Agent-MCP Development
            • Qwen3-langchain-AI Agent
          • Deep Learning

            • ResNet (Image Classification)
            • LPRNet (License Plate Recognition)
            • SAM (General Image Segmentation Foundation Model)
            • YOLOv5 (Object Detection)
            • OpenPose (Human Keypoint Detection)
            • PP-OCR (Optical Character Recognition)
        • Downloads

          • Downloads
      • 1684X-416T

        • Introduction

          • AIBOX-1684X-416 Introduction
        • Demo Quick Guide

          • ShimeTai Intelligent Monitoring Demo Quick Usage Guide
      • RDK-X5

        • Introduction

          • RDK-X5 Hardware Introduction
        • Quick Start

          • RDK-X5 Quick Start
        • Application Development

          • AI Online Model Development

            • Experiment 01 - Access Volcengine Doubao AI
            • Experiment 02 - Image Analysis
            • Experiment 03 - Multimodal Visual Analysis & Localization
            • Experiment 04 - Multimodal Image-Text Comparison
            • Experiment 05 - Multimodal Document/Table Analysis
            • Experiment 06 - Camera-based AI Visual Analysis
          • Large Language Models

            • Experiment 01 - Speech Recognition
            • Experiment 02 - Voice Conversation
            • Experiment 03 - Multimodal Image Analysis - Voice
            • Experiment 04 - Multimodal Image Comparison - Voice
            • Experiment 05 - Multimodal Document Analysis - Voice
            • Experiment 06 - Multimodal Vision Application - Voice
          • ROS2 Basics

            • Experiment 01 - Environment Setup
            • Experiment 02 - Create & Build a Workspace Package
            • Experiment 03 - Run ROS2 Topic Communication Node
            • Experiment 04 - ROS2 Camera Application
          • 40-pin IO Development

            • Experiment 01 - GPIO Output (LED Blink)
            • Experiment 02 - GPIO Input
            • Experiment 03 - Button-controlled LED
            • Experiment 04 - PWM Output
            • Experiment 05 - Serial Output
            • Experiment 06 - I2C Experiment
            • Experiment 07 - SPI Experiment
          • USB Module Usage

            • Experiment 01 - USB Voice Module Usage
            • Experiment 02 - Sound Source Localization Module
          • Machine Vision Practice

            • Experiment 01 - Open USB Camera
            • Experiment 02 - Color Recognition
            • Experiment 03 - Gesture Recognition
            • Experiment 04 - YOLOv5 Object Detection
      • RDK-S100

        • Introduction

          • RDK-S100 Hardware Introduction
        • Quick Start

          • RDK-S100 Quick Start
        • Application Development

          • AI Online Model Development

            • Experiment 01 - Access Volcengine Doubao AI
            • Experiment 02 - Image Analysis
            • Experiment 03 - Multimodal Visual Analysis & Localization
            • Experiment 04 - Multimodal Image-Text Comparison
            • Experiment 05 - Multimodal Document/Table Analysis
            • Experiment 06 - Camera-based AI Visual Analysis
          • Large Language Models

            • Experiment 01 - Speech Recognition
            • Experiment 02 - Voice Conversation
            • Experiment 03 - Multimodal Image Analysis - Voice
            • Experiment 04 - Multimodal Image Comparison - Voice
            • Experiment 05 - Multimodal Document Analysis - Voice
            • Experiment 06 - Multimodal Vision Application - Voice
          • ROS2 Basics

            • Experiment 01 - Environment Setup
            • Experiment 02 - Create & Build a Workspace Package
            • Experiment 03 - Run ROS2 Topic Communication Node
            • Experiment 04 - ROS2 Camera Application
          • 40-pin IO Development

            • Experiment 01 - GPIO Output (LED Blink)
            • Experiment 02 - GPIO Input
            • Experiment 03 - Button-controlled LED
            • Experiment 04 - PWM Output
            • Experiment 05 - Serial Output
            • Experiment 06 - I2C Experiment
            • Experiment 07 - SPI Experiment
          • USB Module Usage

            • Experiment 01 - USB Voice Module Usage
            • Experiment 02 - Sound Source Localization Module
          • Machine Vision Practice

            • Experiment 01 - Open USB Camera
            • Experiment 02 - Image Processing Basics
            • Experiment 03 - Object Detection
            • Experiment 04 - Image Segmentation
      • RK1828

        • Introduction

          • M5-182X-A1 AI Edge Box - Product Introduction
          • M5-182X-A1 Hardware Specifications
          • M5-182X-A1 Usage & Safety
        • Quick Start

          • M5-182X-A1 Image Flashing
          • RK182X Hardware Installation & Verification
          • RK182X Development Environment Quick Setup
          • RK182X SDK Overview
          • RK182X Environment Setup in Detail
          • RK182X Quick Start
          • Vendor SDK Data Extraction Record
        • Development Guide

          • ClawChips Architecture and Principles
          • SKILL User Manual
          • RK182X Series LLM Inference (RK1828 Model)
          • RK182X Series CNN Inference (RK1828 Model)
          • Model Conversion
          • RK182X AI Agent Application Development Guide
          • RK182X Industrial Anomaly Detection Application
        • SDK Reference

          • RKNN3-SDK Overview

            • RKNN3 SDK Overview
          • RKNN3-Toolkit

            • RKNN3 Toolkit Installation and Usage
          • RKLLM

            • RKLLM On-Device LLM Inference
          • RK182X Series NPU Overview and Architecture (RK1828 Model)
          • RK182X INT8 Quantized Inference Deployment
          • RK182X MPP Multimedia Framework
          • MPP Details

            • RK182X Video Decoding
            • RK182X Video Encoding
          • NPU Details

            • RKNN Model Conversion
            • RK182X NPU INT8 Quantized Inference
            • RK182X Multi-Model Parallel Inference
          • RGA Details

            • RK182X RGA 2D Graphics Acceleration
          • VPU Details

            • RK182X VPU Codec
        • Hardware Reference

          • RK182X Series Hardware Architecture Overview (RK1828 Model)
          • RK182X Pin Definitions and Multiplexing Configuration
          • RK182X Pin Definitions
          • RK182X Power Management
          • RK182X Clock and PLL Configuration
          • RK182X Clock and Frequency Configuration
        • Tutorials

          • Hello World
          • Hello RK1828 - The First Program
          • RTSP Streaming
          • RTSP Streaming + AI Analysis
          • ShiMetaPi AI Lobster One-Click Deployment
          • PaddleOCR-VL Text Recognition
          • Qwen3-1.7B LLM Text Chat
          • AI Multi-View Inspection (Qwen3-VL Wrapper)
          • YOLOv5 Object Detection
        • Downloads

          • Downloads
        • FAQ

          • FAQ
    • Core-Board

      • C-3568BQ

        • Introduction

          • C-3568BQ Overview
      • C-3588LQ

        • Introduction

          • C-3588LQ Overview
      • GC-3568JBAF

        • Introduction

          • GC-3568JBAF Overview
      • C-K1BA

        • Introduction

          • C-K1BA Overview
    • Software Platform

      • ShiMetaPi Workbench

        • Introduction

          • Product Overview
          • Core Architecture
          • Feature Entries
          • Supported Hardware
          • Release Notes
        • Quick Start

          • Install & Login
          • Connect the Device
          • Set Up the Environment
          • Connect to AIHub
          • First Inference
        • User Guide

          • Workspace Overview
          • Device Manager
          • Model Market
          • One-Click Deploy
          • Vision — SVP
          • Vision - Custom Models
          • shimeta-py IDE
          • Terminal
          • Agent Debug Assistant
          • Settings and Resources
        • FAQ

          • Installation & Login
          • Device Connection
          • Models & Deployment
          • Vision & Runtime
          • Settings & Other
      • ShimetaPi Repository

        • Introduction

          • ShimetaPi Software Repository
        • Pico G1 (GK7206)

          • Quick Start

            • Installation & First Inference
            • shimeta_infer — Image Inference
            • shimeta_camera — Real-time Camera Inference
            • SVP Scene Detection
            • File Transfer & Built-in Model Reference
            • FAQ
          • HTTP API & Python SDK

            • HTTP API Reference
      • Model Fine-tuning Platform

        • Introduction

          • Model Training Platform
        • Quick Start

          • Register & Login
          • Create Your First Model (30-Minute Quick Experience)
        • Training Guide

          • Data Preparation & Annotation
          • Training Parameter Configuration
          • Start & Monitor Training
          • Model Evaluation & Testing
        • Model Deployment

          • Export Model
          • Deploy to Edge Device

Video Encoding Application

This chapter describes the GK7206 video encoding application example — sample_venc. The application demonstrates complete video encoding functionality, including H.265/H.264/MJPEG encoding, RTSP streaming, multiple rate control modes, QP Map, ROI, JPEG snapshots, and other advanced features.

The application source code is located in the SDK directory sample/venc/. It serves as a reference template for developing video encoding and streaming applications.

Important note (updated 2026-07-24)

The sample_venc source code has been modified so that all save paths changed from "." to "/sd_card" (8 places in total). It now writes to /sd_card directly no matter which directory it is run from — no cd /sd_card needed. The prerequisite is that the SD card is mounted at /sd_card.

1 Application Overview

1.1 Features

  • Multiple encoding formats: H.265, H.264, MJPEG, JPEG
  • Multiple stream modes: main stream + sub stream, MJPEG stream + JPEG snapshot
  • Multiple rate control modes: CBR, VBR, AVBR, FixQP
  • RTSP streaming: built-in RTSP server for real-time stream pushing
  • Advanced encoding features:
    • QP Map (quantization parameter map)
    • ROI (region of interest encoding)
    • Ring-buffer low-latency encoding
    • JPEG snapshot split-and-zoom encoding
  • File encoding: supports encoding a YUV file into a stream file
  • Automatic save path: all output files are saved to /sd_card automatically

1.2 Technical Specifications

ParameterValue
Encoding formatsH.265, H.264, MJPEG, JPEG
ResolutionPer the sensor configuration (e.g. 2560×1440)
Frame rateDetermined by the sensor (usually 30 FPS)
Rate control modesCBR, VBR, AVBR, FixQP
GOP modesNORMALP, SMARTP
RTSP port554
Output path/sd_card (hard-coded in the source)
Memory footprintRelatively high (requires a sensor)

1.3 Test Case List

indexNameTest commandExpected behavior (success)Possible failure cause
0Low-latency ring buffer./sample_venc 0Prints rtsp://<ip>:554/livestream/0, .../1; any key other than q captures a pictureOutput written to /tmp → Killed (OOM)
1Main + sub stream./sample_venc 1Same dual RTSP streams as aboveSame as above
2qpmap./sample_venc 2qpmap encoding over RTSPsensor/VB failure
3roi./sample_venc 3roi encoding over RTSPSame as above
4mjpeg+snap./sample_venc 4MJPEG stream + key-triggered JPEG captureSame as above
5snap zoom./sample_venc 5snap split-and-zoom encodingSame as above
FileYUV→stream./sample_venc /sd_card/in.yuv 1920 1080 h264Generates an encoded stream fileWrong YUV file/format

1.4 Directory Structure

sample/venc/
├── Makefile              # Build script
└── sample_venc.c         # Main program

2 Build and Deployment

2.1 Prerequisites

Before building this application, make sure the following preparations have been completed:

  1. SDK environment is set up: follow SDK Compilation to set up the cross-compilation toolchain and SDK configuration
  2. Sensor is connected: an SC465SL or compatible image sensor must be connected

2.2 Build the Application

# Enter the sample directory
cd <SDK_PATH>/sample

# Build the venc sample
make -C venc clean && make -C venc

Or build from the top level:

make -C sample all

2.3 Deploy to the Board

# Mount the SD card
mkdir -p /sd_card
mount -t vfat /dev/mmcblk1p1 /sd_card

# Transfer to the development board via SCP
scp sample/venc/sample_venc root@<board IP>:/sd_card/

# Or download via TFTP
tftp -g -r sample_venc <board IP>

Warning

The SD card must be mounted at /sd_card, otherwise the program cannot save the captured pictures.

2.4 Run the Application

# Add execute permission
chmod +x /sd_card/sample_venc

# Run (index 0: low-latency ring buffer)
./sample_venc 0

# Interactively select the rate control mode
c  # Select CBR

# Interactively select the GOP mode
0  # Select NORMALP

2.5 Expected Output

Index 0: Low-latency ring buffer

Startup flow:

please input choose rc mode!
         c) cbr.
         v) vbr.
         a) avbr.
         f) fixQp
c
please input choose gop mode!
         0) NORMALP.
         1) SMARTP.
0
[SENSOR][Func]:sc465sl_set_slave_addr [Line]:1637 [Info]:Sensor dev [0] set slave addr 0x60 success.
[SENSOR][Func]:sc465sl_i2c_init [Line]:1664 [Info]:====== i2c[1] init success!=======
[SENSOR][Func]:sc465sl_set_wdr_mode [Line]:487 [Info]:linear mode
[sample_comm_isp_sensor_init]-368: sensor i2c_id = 1, clk_id = 1
[SENSOR][Func]:sc465sl_get_ae_common_default [Line]:858 [Info]:man_ratio_enable: 0
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 30.000000
[ISP]isp_init[1113]: isp[0] init success
[ISP]isp_run[771]: isp run.
[sample_comm_vi_start_dev]-1066: mipi_rate: 864.
[ISP]isp_start[503]: isp0 start.
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:952 [Info]:============================================================================
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:953 [Info]:=== SC465SL_27MInput_MIPI_4lane_12bit_30fps_2560x1440_linear init success! =
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:954 [Info]:============================================================================

rtsp://192.168.49.17:554/livestream/0
rtsp://192.168.49.17:554/livestream/1
[venc] save path = /sd_card (orig '.', readonly rootfs)
---press 'q' to exit or any other key to capture pic---
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 25.000000
^C[ISP]isp_stop[522]: isp0 stop.
[ISP]isp_exit[1183]: isp0 start exit
[ISP]isp_exit[1218]: isp0 exit success
[main]-1772: program exit normally!

Interactive selection of the rate control mode:

please input choose rc mode!
	 c) cbr.
	 v) vbr.
	 a) avbr.
	 f) fixQp
c

Interactive selection of the GOP mode:

please input choose gop mode!
	 0) NORMALP
	 1) SMARTP
0

Success indicators:

  • The RTSP addresses are displayed: rtsp://<ip>:554/livestream/0 and livestream/1
  • [venc] save path = /sd_card indicates the save path is correct
  • The sensor initialized successfully: SC465SL_27MInput_MIPI_4lane_12bit_30fps_2560x1440_linear init success!
  • The interactive prompt ---press 'q' to exit or any other key to capture pic--- is displayed

Fixed and variable parts

  • Fixed parts: the sensor model (SC465SL), resolution (2560x1440), frame rates (25/30 fps), MIPI rate (864), and save path hint
  • Variable parts: the IP address in the RTSP URLs (varies with the board's network configuration)

Index 1: Main + sub stream

Expected output:

please input choose rc mode!
         c) cbr.
         v) vbr.
         a) avbr.
         f) fixQp
c
please input choose gop mode!
         0) NORMALP.
         1) SMARTP.
0
[SENSOR][Func]:sc465sl_set_slave_addr [Line]:1637 [Info]:Sensor dev [0] set slave addr 0x60 success.
[SENSOR][Func]:sc465sl_i2c_init [Line]:1664 [Info]:====== i2c[1] init success!=======
[SENSOR][Func]:sc465sl_set_wdr_mode [Line]:487 [Info]:linear mode
[sample_comm_isp_sensor_init]-368: sensor i2c_id = 1, clk_id = 1
[SENSOR][Func]:sc465sl_get_ae_common_default [Line]:858 [Info]:man_ratio_enable: 0
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 30.000000
[ISP]isp_init[1113]: isp[0] init success
[ISP]isp_run[771]: isp run.
[sample_comm_vi_start_dev]-1066: mipi_rate: 864.
[ISP]isp_start[503]: isp0 start.
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:952 [Info]:============================================================================
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:953 [Info]:=== SC465SL_27MInput_MIPI_4lane_12bit_30fps_2560x1440_linear init success! =
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:954 [Info]:============================================================================

rtsp://192.168.49.17:554/livestream/0
rtsp://192.168.49.17:554/livestream/1
[venc] save path = /sd_card (orig '.', readonly rootfs)
---------------press any key to exit!---------------
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 25.000000
^C[ISP]isp_stop[522]: isp0 stop.
[ISP]isp_exit[1183]: isp0 start exit
[ISP]isp_exit[1218]: isp0 exit success
[main]-1772: program exit normally!

Success indicator: two RTSP stream addresses are displayed — the main stream (0) and the sub stream (1).

Fixed and variable parts

  • Fixed parts: the sensor model, resolution, frame rates, MIPI rate, and save path hint
  • Variable parts: the IP address in the RTSP URLs, and the interactive prompt (---press 'q' to exit vs ---------------press any key to exit!---------------)

Index 2: qpmap

Expected output:

please input choose gop mode!
         0) NORMALP.
         1) SMARTP.
0
[SENSOR][Func]:sc465sl_set_slave_addr [Line]:1637 [Info]:Sensor dev [0] set slave addr 0x60 success.
[SENSOR][Func]:sc465sl_i2c_init [Line]:1664 [Info]:====== i2c[1] init success!=======
[SENSOR][Func]:sc465sl_set_wdr_mode [Line]:487 [Info]:linear mode
[sample_comm_isp_sensor_init]-368: sensor i2c_id = 1, clk_id = 1
[SENSOR][Func]:sc465sl_get_ae_common_default [Line]:858 [Info]:man_ratio_enable: 0
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 30.000000
[ISP]isp_init[1113]: isp[0] init success
[ISP]isp_run[771]: isp run.
[sample_comm_vi_start_dev]-1066: mipi_rate: 864.
[ISP]isp_start[503]: isp0 start.
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:952 [Info]:============================================================================
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:953 [Info]:=== SC465SL_27MInput_MIPI_4lane_12bit_30fps_2560x1440_linear init success! =
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:954 [Info]:============================================================================

rtsp://192.168.49.17:554/livestream/0
rtsp://192.168.49.17:554/livestream/1
[venc] save path = /sd_card (orig '.', readonly rootfs)
---------------press any key to exit!---------------
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 25.000000
^C[ISP]isp_stop[522]: isp0 stop.
[ISP]isp_exit[1183]: isp0 start exit
[ISP]isp_exit[1218]: isp0 exit success
[main]-1772: program exit normally!

Success indicator: qpmap initializes successfully and the RTSP addresses are displayed.

Fixed and variable parts

  • Fixed parts: the sensor model, resolution, frame rates, MIPI rate, and save path hint
  • Variable parts: the IP address in the RTSP URLs

Index 3: roi

Expected output:

please input choose rc mode!
         c) cbr.
         v) vbr.
         a) avbr.
         f) fixQp
c
please input choose gop mode!
         0) NORMALP.
         1) SMARTP.
0
[SENSOR][Func]:sc465sl_set_slave_addr [Line]:1637 [Info]:Sensor dev [0] set slave addr 0x60 success.
[SENSOR][Func]:sc465sl_i2c_init [Line]:1664 [Info]:====== i2c[1] init success!=======
[SENSOR][Func]:sc465sl_set_wdr_mode [Line]:487 [Info]:linear mode
[sample_comm_isp_sensor_init]-368: sensor i2c_id = 1, clk_id = 1
[SENSOR][Func]:sc465sl_get_ae_common_default [Line]:858 [Info]:man_ratio_enable: 0
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 30.000000
[ISP]isp_init[1113]: isp[0] init success
[ISP]isp_run[771]: isp run.
[sample_comm_vi_start_dev]-1066: mipi_rate: 864.
[ISP]isp_start[503]: isp0 start.
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:952 [Info]:============================================================================
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:953 [Info]:=== SC465SL_27MInput_MIPI_4lane_12bit_30fps_2560x1440_linear init success! =
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:954 [Info]:============================================================================

rtsp://192.168.49.17:554/livestream/0
rtsp://192.168.49.17:554/livestream/1
[venc] save path = /sd_card (orig '.', readonly rootfs)
---------------press any key to exit!---------------
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 25.000000
^C[ISP]isp_stop[522]: isp0 stop.
[ISP]isp_exit[1183]: isp0 start exit
[ISP]isp_exit[1218]: isp0 exit success
[main]-1772: program exit normally!

Success indicator: roi initializes successfully and the RTSP addresses are displayed.

Fixed and variable parts

  • Fixed parts: the sensor model, resolution, frame rates, MIPI rate, and save path hint
  • Variable parts: the IP address in the RTSP URLs

Index 4: mjpeg+snap

Expected output:

please input choose rc mode!
         c) cbr.
         v) vbr.
         a) avbr.
         f) fixQp
c
[SENSOR][Func]:sc465sl_set_slave_addr [Line]:1637 [Info]:Sensor dev [0] set slave addr 0x60 success.
[SENSOR][Func]:sc465sl_i2c_init [Line]:1664 [Info]:====== i2c[1] init success!=======
[SENSOR][Func]:sc465sl_set_wdr_mode [Line]:487 [Info]:linear mode
[sample_comm_isp_sensor_init]-368: sensor i2c_id = 1, clk_id = 1
[SENSOR][Func]:sc465sl_get_ae_common_default [Line]:858 [Info]:man_ratio_enable: 0
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 30.000000
[ISP]isp_init[1113]: isp[0] init success
[ISP]isp_run[771]: isp run.
[sample_comm_vi_start_dev]-1066: mipi_rate: 864.
[ISP]isp_start[503]: isp0 start.
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:952 [Info]:============================================================================
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:953 [Info]:=== SC465SL_27MInput_MIPI_4lane_12bit_30fps_2560x1440_linear init success! =
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:954 [Info]:============================================================================
[venc] save path = /sd_card (orig '.', readonly rootfs)
---press 'q' to exit or any other key to capture pic---
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 25.000000
^C[ISP]isp_stop[522]: isp0 stop.
[ISP]isp_exit[1183]: isp0 start exit
[ISP]isp_exit[1218]: isp0 exit success
[main]-1772: program exit normally!

Success indicator: the MJPEG stream address is displayed and JPEG pictures can be captured by pressing keys.

Fixed and variable parts

  • Fixed parts: the sensor model, resolution, frame rates, MIPI rate, and save path hint
  • Variable parts: no RTSP URL (this mode does not output an RTSP stream)

Index 5: snap zoom

Expected output:

[SENSOR][Func]:sc465sl_set_slave_addr [Line]:1637 [Info]:Sensor dev [0] set slave addr 0x60 success.
[SENSOR][Func]:sc465sl_i2c_init [Line]:1664 [Info]:====== i2c[1] init success!=======
[SENSOR][Func]:sc465sl_set_wdr_mode [Line]:487 [Info]:linear mode
[sample_comm_isp_sensor_init]-368: sensor i2c_id = 1, clk_id = 1
[SENSOR][Func]:sc465sl_get_ae_common_default [Line]:858 [Info]:man_ratio_enable: 0
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 30.000000
[ISP]isp_init[1113]: isp[0] init success
[ISP]isp_run[771]: isp run.
[sample_comm_vi_start_dev]-1066: mipi_rate: 864.
[ISP]isp_start[503]: isp0 start.
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:952 [Info]:============================================================================
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:953 [Info]:=== SC465SL_27MInput_MIPI_4lane_12bit_30fps_2560x1440_linear init success! =
[SENSOR][Func]:sc465sl_4lane_linear_2560x1440_init [Line]:954 [Info]:============================================================================
---press 'q' to exit or any other key to capture pic---
[SENSOR][Func]:sc465sl_calc_fps [Line]:1358 [Info]:sc465sl set fps = 25.000000
^C[ISP]isp_stop[522]: isp0 stop.
[ISP]isp_exit[1183]: isp0 start exit
[ISP]isp_exit[1218]: isp0 exit success
[main]-1772: program exit normally!

Success indicator: the snap split-and-zoom encoding information and the RTSP addresses are displayed.

Fixed and variable parts

  • Fixed parts: the sensor model, resolution, frame rates, MIPI rate, and interactive prompt
  • Variable parts: no RTSP URL (this mode does not output an RTSP stream)

File encoding mode

Command: ./sample_venc /sd_card/in.yuv 1920 1080 h264

Expected output:

sample_venc file encode running
input file: /sd_card/in.yuv
width: 1920
height: 1080
codec: h264
...
encode completed, output: /sd_card/in.264

Success indicator: an encoded stream file is generated, such as in.264, in.265, or in.mjpg.

Error cases

open file[./chn2_snap_0.jpg] err!

Cause: the SD card is not mounted or the path is wrong Solution: confirm the SD card is mounted at /sd_card

Killed

Cause: out of memory (OOM); the output was written to the /tmp memory disk Solution: confirm the SD card is mounted and check that /sd_card is writable

2.6 Access from a Browser/Player

Use VLC or ffplay to pull the stream:

# Pull the main stream
ffplay rtsp://<board IP>:554/livestream/0

# Pull the sub stream
ffplay rtsp://<board IP>:554/livestream/1

3 Internal Execution Logic in Detail

3.1 Application Architecture

The application uses the following architecture:

Sensor → VI → VPSS → VENC → RTSP streaming
                  ↓
                 MJPEG stream
                  ↓
               JPEG snapshot

3.2 Video Pipeline Initialization Flow

// Step 1: System initialization (configures the VB memory pool)
sample_comm_sys_init(&sys_config);

// Step 2: ISP initialization
sample_comm_isp_init();

// Step 3: Start VI
sample_comm_vi_start(...);

// Step 4: Start VPSS
sample_comm_vpss_start(...);

// Step 5: Start VENC
sample_comm_venc_start(...);

// Step 6: Bind the modules
xmedia_bind_vi_to_vpss(...);
xmedia_bind_vpss_to_venc(...);

// Step 7: RTSP streaming
sample_comm_livestream_create(...);

3.3 RTSP Streaming Implementation

RTSP streaming uses the built-in live_rtsp_server library:

// Create an RTSP session
sample_comm_livestream_create(venc_chn, livestream_type);

// Start the RTSP service
sample_comm_livestream_start();

3.4 Snapshot Function

The snapshot function is triggered by key presses:

// Wait for user input
c = getchar();

if (c != 'q') {
    // Generate a JPEG snapshot
    sample_venc_snap_process(venc_chn, snap_cnt);

    // Print the save path
    printf("[venc] save path = /sd_card/chn2_snap_%d.jpg\n", snap_cnt);
}

3.5 Source Code Changes (2026-07-24)

8 save paths in the source changed from "." to "/sd_card":

// Original code (line comment kept)
// snprintf(snap_path, sizeof(snap_path), "./chn%d_snap_%d.jpg", chn, cnt);

// New code
snprintf(snap_path, sizeof(snap_path), "/sd_card/chn%d_snap_%d.jpg", chn, cnt);
printf("[venc] save path = %s\n", snap_path);

Where the changes are located:

  • start_get_stream() function: 5 places
  • capture_jpeg() function: 2 places
  • splicing function: 1 place

4 Key Programming Points

4.1 Selecting the Rate Control Mode

The application provides interactive selection of the rate control mode:

sample_rc sample_venc_get_rc_mode(void)
{
    char c;
    printf("please input choose rc mode!\n");
    printf("\t c) cbr.\n");
    printf("\t v) vbr.\n");
    printf("\t a) avbr.\n");
    printf("\t f) fixQp\n");

    c = getchar();
    switch(c) {
        case 'c': return SAMPLE_RC_CBR;
        case 'v': return SAMPLE_RC_VBR;
        case 'a': return SAMPLE_RC_AVBR;
        case 'f': return SAMPLE_RC_FIXQP;
        default:  goto begin_get;
    }
}

4.2 Encoding Channel Configuration

// H.265 main stream
venc_chn_attr[0].type = XMEDIA_PT_H265;
venc_chn_attr[0].max_width = 2560;
venc_chn_attr[0].max_height = 1440;
venc_chn_attr[0].rc_mode = VENC_RC_MODE_H265CBR;

// H.264 sub stream
venc_chn_attr[1].type = XMEDIA_PT_H264;
venc_chn_attr[1].max_width = 640;
venc_chn_attr[1].max_height = 480;
venc_chn_attr[1].rc_mode = VENC_RC_MODE_H264CBR;

// JPEG snapshot
venc_chn_attr[2].type = XMEDIA_PT_JPEG;
venc_chn_attr[2].max_width = 2560;
venc_chn_attr[2].max_height = 1440;

4.3 Error Handling

Check the return value of every API call:

ret = sample_comm_sys_init(&sys_config);
if (ret != XMEDIA_SUCCESS) {
    printf("sys init failed!\n");
    goto exit0;
}

ret = sample_comm_isp_init();
if (ret != XMEDIA_SUCCESS) {
    printf("isp init failed!\n");
    goto exit1;
}

5 Troubleshooting

ProblemPossible causeSolution
Killed (OOM)Output written to the /tmp memory diskConfirm the SD card is mounted at /sd_card
open file[./chn2_snap_0.jpg] err!Old source with the "." path on a read-only rootfsUpdate to the new source and rebuild
Cannot pull the RTSP streamSensor initialization failedCheck the sensor connection and configuration
Encoding failureInsufficient VB memoryAdjust the VB pool configuration
Snapshot failureJPEG channel not configuredCheck the VENC channel configuration

6 Memory and Path Management

6.1 Memory Limits

The board has 128 MB of DDR in total, of which about 26 MB is available to Linux. Video encoding uses a lot of memory, so it is recommended to:

  1. Mount the SD card at /sd_card
  2. Write all output files to the SD card
  3. Free memory before testing: sync; echo 3 > /proc/sys/vm/drop_caches

6.2 Path Management

Tips

The save path is hard-coded to /sd_card in the source, so there is no need to cd /sd_card. But the SD card must be mounted first.

7 References

  • MPP Media Processing Platform
  • Image Coding
  • SDK Compilation Guide
  • Video Input Application
  • Video Graphics Subsystem Application
Edit this page on GitHub
Prev
Audio Processing Application
Next
Video Input Application