Encoding method, electronic device, communication system, storage medium, and program product
AssigneeHuawei Technologies Co., Ltd.
InventorWei Sun
Life of this patent
Estimating the term…
Abstract
An encoding method includes that a first device determines an I-frame position of a first image stream and an I-frame position of a second image stream based on a first resolution, a second resolution, an I-frame time interval, and a frame rate; the first device encodes the first image stream based on the I-frame position of the first image stream to obtain a first compressed stream; the first device encodes the second image stream based on the I-frame position of the second image stream to obtain a second compressed stream; and the first device sends the first compressed stream and the second compressed stream to the second device.
Claims20
A method, implemented by a first device, wherein the method comprises:
- receiving, from a second device, a first instruction;
- configuring a first resolution and a second resolution according to the first instruction;
- controlling a first camera and a second camera of the first device to capture images;
- processing first images captured by the first camera to obtain a first image stream, wherein the first image stream comprises the first resolution;
- processing second images captured by the second camera to obtain a second image stream, wherein the second image stream comprises the second resolution;
- encoding the first image stream based on a first I-frame position of the first image stream to obtain a first compressed stream;
- encoding the second image stream based on a second I-frame position of the second image stream to obtain a second compressed stream, wherein the first I-frame position of the first image stream and the second I-frame position of the second image stream is based on the first resolution, the second resolution, an I-frame time interval, and a frame rate, wherein the I-frame time interval is based on a current network bandwidth, a first bandwidth threshold, and a second bandwidth threshold, and wherein the first bandwidth threshold is greater than the second bandwidth threshold;
- using, by the first device and when the current network bandwidth is greater than or equal to the first bandwidth threshold, a first preset interval as the I-frame time interval;
- identifying, by the first device and when the current network bandwidth is greater than the second bandwidth threshold and less than the first bandwidth threshold, the I-frame time interval based on the current network bandwidth, the first bandwidth threshold, the second bandwidth threshold, the first preset interval, and a second preset interval, wherein the second preset interval is greater than the first preset interval;
- and
- sending the first compressed stream and the second compressed stream to the second device.
An encoding method, implemented by a communication system, wherein the method comprises:
- separately sending, by a third device of the communication system, a first instruction to a first device and a second device of the communication system;
- configuring, by the first device, a first resolution according to the first instruction by:
- controlling the first device to capture first images;
- and
- processing the first images captured by the first device to obtain a first image stream, wherein the first resolution is of the first image stream;
- configuring, by the second device, a second resolution according to the first instruction by:
- controlling the second device to capture second images;
- and
- processing the second images captured by the second device to obtain a second image stream, wherein the second resolution is of the second image stream;
- identifying, by the third device, a first I-frame position of the first image stream and a second I-frame position of the second image stream based on the first resolution, the second resolution, an I-frame time interval, and a frame rate, wherein an I-frame position is a frame sequence number of an I-frame, and wherein the identifying, by the third device, the first I-frame position and the second I-frame position comprises:
- using, by the third device, a first frame sequence number of a first frame of image in the first image stream as a second frame sequence number of a first I-frame in the first image stream;
- using, by the third device, a third frame sequence number of a second frame of image in the second image stream as a fourth frame sequence number of a second I-frame in the second image stream;
- identifying, by the third device, a first I-frame position weight of the first image stream and a second I-frame position weight of the second image stream based on the first resolution and the second resolution;
- and
- identifying, by the third device, a fifth frame sequence number of a first nth I-frame in the first image stream and a sixth frame sequence number of a second nth I-frame in the second image stream based on the first I-frame position weight, the second I-frame position weight, the I-frame time interval, and the frame rate, wherein n is greater than or equal to 2;
- sending the first I-frame position to the first device;
- sending the second I-frame position to the second device;
- encoding, by the first device, the first image stream based on the first I-frame position to obtain a first compressed stream;
- sending the first compressed stream to the third device;
- encoding, by the second device, the second image stream based on the second I-frame position to obtain a second compressed stream;
- and
- sending the second compressed stream to the third device.
A first device comprising:
- a first camera and a second camera configured to capture images;
- and
- a processor coupled to the first camera and the second camera and configured to:
- control the first camera and the second camera to capture the images;
- and
- process first images captured by the first camera to obtain a first image stream, wherein the first image stream comprises a first resolution;
- process second images captured by the second camera to obtain a second image stream, wherein the second image stream comprises a second resolution;
- identify a first I-frame position of the first image stream and a second I-frame position of the second image stream based on the first resolution, the second resolution, an I-frame time interval, and a frame rate, wherein the I-frame time interval is based on a current network bandwidth, a first bandwidth threshold, and a second bandwidth threshold, and wherein the first bandwidth threshold is greater than the second bandwidth threshold;
- use, when the current network bandwidth is greater than or equal to the first bandwidth threshold, a first preset interval as the I-frame time interval;
- identify when the current network bandwidth is greater than the second bandwidth threshold and less than the first bandwidth threshold, the I-frame time interval based on the current network bandwidth, the first bandwidth threshold, the second bandwidth threshold, the first preset interval, and a second preset interval, wherein the second preset interval is greater than the first preset interval;
- encode the first image stream based on the first I-frame position to obtain a first compressed stream;
- encode the second image stream based on the second I-frame position to obtain a second compressed stream;
- and
- send the first compressed stream and the second compressed stream to a second device.
Dependencies are inferred from the claim text.