Video acquisition and transmission method of 5G network based on Android

By using the Camera2 API and MediaCodec on the Android platform for video acquisition and encoding, and using the RTP protocol for data transmission, it solves the problem of transmission delay and signal unstable in HD video communication. Essence

CN119363944APending Publication Date: 2025-01-24CRSC COMM & INFORMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411687313.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The prior art is difficult to ensure video quality while reducing transmission delays in high-definition video communication, especially in high-speed mobile scenarios, which poses challenges to real-time transmission.

Method used

Provide a 5G network -based video collection, coding and transmission method based on Android. Video data is collected through Camera2 API, using MediaCodec for hardware to accelerate, compress the data to H.264 format, and use the RTP protocol Fine data processing under 5G networks to reduce the packet loss rate and delay.

Benefits of technology

The complete process from video collection, coding, packaging, packaging to transmission, improves the transmission efficiency and stability of high -definition video, reduces the delay and packaging rate, and ensure the smoothness and quality of video communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363944A_ABST
    Figure CN119363944A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of video data transmission, in particular to an Android-based 5G network video acquisition and transmission method, which comprises the following steps of: acquiring video data on the basis of an Android platform; encoding the collected video data; packing the coded video data into a network transmission format; and video data transmission is carried out in a 5G network environment. Compared with the prior art, a complete process of video acquisition, data coding, data packaging and data transmission is realized. Under the 5G network, due to the improvement of the bandwidth, the high-definition video transmission is smoother and more efficient. For a high-speed moving scene, the packet loss rate and delay can be effectively reduced by refining the data processing step, and the stability and smoothness of video communication are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video data transmission, and in particular to a video acquisition, encoding and transmission method and system based on an Android-based 5G network. Background Art

[0002] In the field of high-definition video communication, the high bandwidth and low latency brought by 5G networks provide unprecedented opportunities for the transmission of video data. As video resolution increases, the amount of video data also increases significantly. How to reduce transmission latency while ensuring video quality has become a research focus. Especially in high-speed mobile scenarios such as high-speed rail, unstable signals pose more challenges to the real-time transmission of high-definition video.

[0003] Most existing implementations only focus on simple local video playback or basic video call functions, lacking systematic research and implementation of the entire process of video data acquisition, encoding, and transmission. Therefore, it is difficult to meet the needs of high-quality video communication. Summary of the invention

[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a video acquisition and transmission method and system based on Android 5G network.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] A video acquisition and transmission method based on a 5G network of Android, comprising the following steps:

[0007] Collect video data based on Android platform;

[0008] Encode the collected video data;

[0009] Pack the encoded video data into a format for network transmission;

[0010] Transmit video data in a 5G network environment.

[0011] As a preferred technical solution, the video data collection based on the Android platform is specifically: on the Android platform, the video data is collected through the Camera2 API to obtain the image data in YUV format.

[0012] As a preferred technical solution, when encoding the video data, MediaCodec is used for hardware accelerated encoding, and the YUV data is compressed into H.264 format.

[0013] As a preferred technical solution, the encoded video data is packaged using the real-time transport protocol RTP, and each package contains sequence number and timestamp information.

[0014] As a preferred technical solution, the specific steps of performing video data transmission in a 5G network environment include:

[0015] Check the validity of the incoming data and perform preprocessing;

[0016] Slice the video data;

[0017] Configure the payload type before sending data;

[0018] Record and track the sent data by calculating the time interval between sending data packets and updating the timestamp;

[0019] Error checking and logging are performed throughout the data transfer process.

[0020] As a preferred technical solution, the validity of the data is specifically as follows: checking whether the first 4 bytes are the start code of the H.264NALU unit; if not, directly exiting the transmission.

[0021] As a preferred technical solution, the preprocessing of the incoming data is specifically: parsing and segmenting the incoming data, and transmitting the data in packets through the RTP protocol; and processing the data separately according to the frame type of H.264.

[0022] As a preferred technical solution, the video data is segmented as follows: for NALU data whose length exceeds a certain threshold, after adding a segmentation mark, it is cut into multiple RTP packets for sending;

[0023] The receiving end assembles the complete data according to the segmentation markers.

[0024] As a preferred technical solution, the configuration of the payload type specifically includes: ensuring that the RTP data packet header matches the expected payload type of the H.264 video data.

[0025] As a preferred technical solution, the error checking includes: checking whether the NALU start code is correct; checking the data validity and checking whether the RTP session is available.

[0026] Compared with the prior art, the present invention has the following beneficial effects:

[0027] The efficient video communication method based on 5G network provided by the present invention realizes the complete process from video acquisition, data encoding, data packaging and data transmission based on Android platform and 5G network. Under the 5G network, due to the improvement of bandwidth, high-definition video transmission can be smoother and more efficient. In the face of high-speed mobile scenarios, by refining the data processing steps, the packet loss rate and delay can be effectively reduced, ensuring the stability and fluency of video communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 This is a flow chart of the video acquisition and transmission method based on Android 5G network of the present invention;

[0029] Figure 2 This is a schematic diagram of the basic structure of the RTP packet header. DETAILED DESCRIPTION

[0030] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0031] Example 1

[0032] As a first aspect of the present invention, an embodiment provides a video acquisition, encoding and transmission method based on Android for 5G network, which is based on Android platform and 5G network, and obtains video data from the camera, data encoding, data packaging and data transmission complete process, so as to realize the efficient transmission scheme of high-definition video, such as Figure 1 As shown, the specific steps are as follows:

[0033] Step S1: Video Capture

[0034] On the Android platform, the video data is collected through the Camera2 API. Camera2 provides a more flexible control interface and can directly obtain image data in YUV format, which is convenient for subsequent encoding.

[0035] Step S2: Data encoding

[0036] The collected video data needs to be encoded before it can be effectively transmitted. In the present invention, MediaCodec is used for hardware accelerated encoding, which greatly improves the encoding efficiency. MediaCodec supports compressing YUV data into H.264 format, which is an efficient encoding format widely used in video communications. In this process, we set the encoding format to H.264, and specified key parameters such as the encoding bit rate and frame rate. The adjustment of bit rate and frame rate strikes a balance between video quality and bandwidth occupancy, ensuring the stability and clarity of transmission in a 5G environment with limited bandwidth.

[0037] Step S 3. Data Packaging

[0038] After the video data is encoded, it needs to be packaged into a format suitable for network transmission. In this project, RTP (Real-time Transport Protocol) is used to package the encoded data. Each packet contains information such as sequence number and timestamp to ensure that the receiving end can correctly reassemble the data and play it in sequence. The basic structure of the RTP packet header is as follows Figure 2 As shown:

[0039] Step S 4. Data transmission

[0040] In the 5G network environment, video data transmission faces challenges such as high-speed movement, frequent switching, and signal attenuation. Therefore, the transmission strategy is crucial to ensure the quality and stability of video communication.

[0041] Step S 4.1 Preprocessing

[0042] First, check the validity of the input data and check whether the first 4 bytes are 0x00000001, that is, check whether it is the start code of the H.264NALU unit. If not, exit the transmission directly to prevent invalid data from being sent. Before sending the data, the program will parse and split the incoming data and transmit it in packets through the RTP protocol. Different processing methods are adopted according to the H.264 frame type (such as SPS, PPS, I frame, P frame, etc.).

[0043] Step S 4.2 Fragmentation and Retransmission

[0044] Due to frequent switching and signal fluctuations in 5G networks, some data packets may be lost or delayed. Therefore, dividing the video data into small segments for transmission can reduce the data loss rate. For NALU data whose length exceeds a certain threshold, after adding a segmentation marker, it is cut into multiple RTP packets for transmission. The receiving end can completely assemble the data according to the segmentation marker.

[0045] Step S 4.3 Matching load type

[0046] Configure the payload type (PAYLOAD) before sending, ensuring that the RTP packet header matches the payload type of the expected H.264 video data.

[0047] Step S 4.4 Data tracking

[0048] By calculating the time interval between sending data packets and updating the timestamp, it is used to record and track the data sent. Step S 4.5 Error handling and logging

[0049] During the entire data transmission process, the program has multiple error checking and logging points. Check whether the NALU start code is correct, check data validity, check whether the RTP session is available, and other steps to assist in judgment.

[0050] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A video acquisition and transmission method based on 5G network of Android, characterized in that the steps include: Collect video data based on Android platform; Encode the collected video data; Pack the encoded video data into a format for network transmission; Transmit video data in a 5G network environment.

2. According to a video acquisition and transmission method based on a 5G network of Android according to claim 1, it is characterized in that: The video data acquisition based on the Android platform is specifically as follows: on the Android platform, the video data is acquired through the Camera2 API to obtain the image data in YUV format.

3. According to a video acquisition and transmission method based on a 5G network of Android according to claim 2, it is characterized in that: When encoding the video data, MediaCodec is used for hardware accelerated encoding, and the YUV data is compressed into H.264 format.

4. According to a video acquisition and transmission method based on a 5G network of Android according to claim 1, it is characterized in that: The encoded video data is packaged using the real-time transport protocol RTP, and each package contains sequence number and timestamp information.

5. The video acquisition and transmission method based on the 5G network of Android according to claim 1, characterized in that: The specific steps of performing video data transmission in the 5G network environment include: Check the validity of the incoming data and perform preprocessing; Slice the video data; Configure the payload type before sending data; Record and track the sent data by calculating the time interval between sending data packets and updating the timestamp; Error checking and logging are performed throughout the data transfer process.

6. The video acquisition and transmission method based on the 5G network of Android according to claim 5 is characterized in that: The validity of the data is specifically as follows: checking whether the first 4 bytes are the start code of the H.264NALU unit; if not, directly exiting the transmission.

7. The video acquisition and transmission method based on the 5G network of Android according to claim 5 is characterized in that: The preprocessing of the incoming data specifically includes: parsing and segmenting the incoming data, and transmitting the data in packets through the RTP protocol; and processing the data separately according to the frame type of H.

264.

8. The video acquisition and transmission method based on the 5G network of Android according to claim 5 is characterized in that: The video data is segmented as follows: for NALU data whose length exceeds a certain threshold, after adding a segmentation mark, it is cut into multiple RTP packets for sending; The receiving end assembles the complete data according to the segmentation markers.

9. The video acquisition and transmission method based on the 5G network of Android according to claim 5, characterized in that: The configuration of the effective load type specifically includes: ensuring that the RTP data packet header matches the expected effective load type of the H.264 video data.

10. The video acquisition and transmission method based on 5G network of Android according to claim 5, characterized in that: The error checking includes: checking whether the NALU start code is correct; checking the data validity and checking whether the RTP session is available.