# US 12,015,770 B2 · Method for encoding video data, device, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,015,770 B2
- Document ID: US12015770B2
- Status: Granted
- Kind: B2
- Application number: 17/773,276
- Filed: 2020-08-24
- Published: 2023-05-11
- Granted: 2024-06-18
- Earliest claimed: 2019-10-31
- Assignees: Bigo Technology Pte. Ltd.
- Applicants: Bigo Technology Pte. Ltd.
- Inventors: Xinning Wang; Qing Liu; Leju Yan
- Web page: https://patentgrep.com/patent/US12015770B2

## CPC

- H04N 19/115: Selection of the code volume for a coding unit prior to coding
- H04N 19/114: Adapting the group of pictures [GOP] structure, e.g. number of B-frames between two anchor frames (H04N19/107 takes precedence)
- H04N 19/146: Data rate or code amount at the encoder output
- H04N 19/149: by estimating the code amount by means of a model, e.g. mathematical model or statistical model
- H04N 19/177: the unit being a group of pictures [GOP]
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Provided is a method for encoding video data. The method includes: acquiring video data; configuring an encoding parameter of an encoder; determining a first time interval between two adjacent video frames in a group of pictures based on the encoding parameter; and adjusting a number of video frames in the group of pictures based on the first time interval by encoding the video data based on the encoding parameter. A device and a storage medium are also provided.

## Claims

### Claim 1

A method for encoding video data, applicable to an encoder, the method comprising:
acquiring video data;
configuring an encoding parameter of the encoder;
determining a first time interval between two adjacent video frames in a group of pictures (GOP) based on the encoding parameter; and
adjusting a number of video frames in the GOP based on the first time interval by encoding the video data based on the encoding parameter;
wherein configuring the encoding parameter of the encoder comprises:
acquiring a target frame rate, a target bitrate, a target number of frames in the GOP, and an encoding period of the GOP;
calculating a conversion factor using the target frame rate, the target number of frames, and the encoding period; and
acquiring an encoding frame rate and an encoding bitrate by converting the target frame rate and the target bitrate based on the conversion factor.

### Claim 2 (depends on 1)

The method according to claim 1, wherein calculating the conversion factor using the target frame rate, the target number of frames, and the encoding period comprises:
acquiring a first product by calculating a product of the target number of frames and the encoding period; and
acquiring the conversion factor by calculating a ratio of the target frame rate to the first product.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the encoding period is an integral multiple of 1 second.

### Claim 4 (depends on 1)

The method according to claim 1, wherein acquiring the encoding frame rate and the encoding bitrate by converting the target frame rate and the target bitrate based on the conversion factor comprises:
acquiring the encoding frame rate by calculating a ratio of the target frame rate to the conversion factor; and
acquiring the encoding bitrate by calculating a ratio of the target bitrate to the conversion factor.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the encoding parameter comprises the encoding frame rate, and determining the first time interval between the two adjacent video frames in the GOP based on the encoding parameter comprises:
calculating a time interval between the two adjacent video frames in the GOP using the encoding frame rate, and determining the time interval between the two adjacent video frames in the GOP as the first time interval.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the video data comprises a timestamp, the encoding parameter comprises the encoding bitrate, and adjusting the number of video frames in the GOP based on the first time interval by encoding the video data based on the encoding parameter comprises:
acquiring an encoding timestamp by adjusting the timestamp of the video data based on the first time interval; and
encoding the video data based on the encoding bitrate, the encoding period, and the encoding timestamp.

### Claim 7 (depends on 6)

The method according to claim 6, wherein encoding the video data based on the encoding bitrate, the encoding period, and the encoding timestamp comprises:
acquiring encoding time of each video frame in the video data from the encoding timestamp;
determining video frames in the GOP based on the encoding time and the encoding period;
acquiring encoded video data comprising a plurality of GOPs by encoding video frames in the plurality of GOPs based on the encoding bitrate; and
acquiring a timestamp of the encoded video data by adjusting the encoding timestamp.

### Claim 8 (depends on 7)

The method according to claim 7, wherein determining the video frames in the GOP based on the encoding time and the encoding period comprises:
determining a start video frame and an end video frame in the GOP based on the encoding period and the encoding time; and
determining the start video frame, the end video frame, and video frames between the start video frame and the end video frame as the video frames in the GOP.

### Claim 9 (depends on 8)

The method according to claim 8, wherein acquiring the encoded video data comprising the plurality of GOPs by encoding the video frames in the plurality of GOPs based on the encoding bitrate comprises:
in response to encoding the video frames in the plurality of GOPs based on the encoding bitrate, encoding the start video frame as a key frame; and
encoding video frames behind the start video frame in each of the GOPs as predicted frames.

### Claim 10 (depends on 7)

The method according to claim 7, wherein the encoding parameter comprises the target frame rate, and acquiring the timestamp of the encoded video data by adjusting the encoding timestamp comprises:
acquiring a second time interval by calculating a time interval between two adjacent video frames in the encoded video data based on the target frame rate; and
adjusting a time interval between two adjacent video frames in the encoding timestamp to the second time interval, wherein the second time interval is not equal to the first time interval.

### Claim 11

A device for encoding video data, comprising:
one or more processors; and
one or more memories, configured for storing one or more programs;
wherein the one or more processors, when running the one or more programs, are caused to perform a method for encoding video data, the method comprising:
acquiring video data;
configuring an encoding parameter of the encoder;
determining a first time interval between two adjacent video frames in a group of pictures (GOP) based on the encoding parameter; and
adjusting a number of video frames in the GOP based on the first time interval by encoding the video data based on the encoding parameter;
wherein configuring the encoding parameter of the encoder comprises:
acquiring a target frame rate, a target bitrate, a target number of frames in the GOP, and an encoding period of the GOP;
calculating a conversion factor using the target frame rate, the target number of frames, and the encoding period; and
acquiring an encoding frame rate and an encoding bitrate by converting the target frame rate and the target bitrate based on the conversion factor.

### Claim 12 (depends on 11)

The device according to claim 11, wherein calculating the conversion factor using the target frame rate, the target number of frames, and the encoding period comprises:
acquiring a first product by calculating a product of the target number of frames and the encoding period; and
acquiring the conversion factor by calculating a ratio of the target frame rate to the first product.

### Claim 13 (depends on 11)

The device according to claim 11, wherein the encoding period is an integral multiple of 1 second.

### Claim 14 (depends on 11)

The device according to claim 11, wherein acquiring the encoding frame rate and the encoding bitrate by converting the target frame rate and the target bitrate based on the conversion factor comprises:
acquiring the encoding frame rate by calculating a ratio of the target frame rate to the conversion factor; and
acquiring the encoding bitrate by calculating a ratio of the target bitrate to the conversion factor.

### Claim 15 (depends on 11)

The device according to claim 11, wherein the encoding parameter comprises the encoding frame rate, and determining the first time interval between the two adjacent video frames in the GOP based on the encoding parameter comprises:
calculating a time interval between the two adjacent video frames in the GOP using the encoding frame rate, and determining the time interval between the two adjacent video frames in the GOP as the first time interval.

### Claim 16 (depends on 11)

The device according to claim 11, wherein the video data comprises a timestamp, the encoding parameter comprises the encoding bitrate, and adjusting the number of video frames in the GOP based on the first time interval by encoding the video data based on the encoding parameter comprises:
acquiring an encoding timestamp by adjusting the timestamp of the video data based on the first time interval; and
encoding the video data based on the encoding bitrate, the encoding period, and the encoding timestamp.

### Claim 17 (depends on 16)

The device according to claim 16, wherein encoding the video data based on the encoding bitrate, the encoding period, and the encoding timestamp comprises:
acquiring encoding time of each video frame in the video data from the encoding timestamp;
determining video frames in the GOP based on the encoding time and the encoding period;
acquiring encoded video data comprising a plurality of GOPs by encoding video frames in the plurality of GOPs based on the encoding bitrate; and
acquiring a timestamp of the encoded video data by adjusting the encoding timestamp.

### Claim 18

A non-transitory computer-readable storage medium, storing a computer program, wherein the computer program, when run by a processor, causes the processor to perform a method for encoding video data, the method comprising:
acquiring video data;
configuring an encoding parameter of the encoder;
determining a first time interval between two adjacent video frames in a group of pictures (GOP) based on the encoding parameter; and
adjusting a number of video frames in the GOP based on the first time interval by encoding the video data based on the encoding parameter;
wherein configuring the encoding parameter of the encoder comprises:
acquiring a target frame rate, a target bitrate, a target number of frames in the GOP, and an encoding period of the GOP;
calculating a conversion factor using the target frame rate, the target number of frames, and the encoding period; and
acquiring an encoding frame rate and an encoding bitrate by converting the target frame rate and the target bitrate based on the conversion factor.
