| CPC G11B 27/031 (2013.01) | 20 Claims |

|
1. A video editing method, applied to an electronic device, wherein the method comprises:
detecting a first operation performed on a first video, wherein a color value of a color channel of a pixel in a first video frame of the first video is a first color value, a bit depth of the first color value is a first bit depth, and the first video frame is any video frame of the first video;
creating an encoder, wherein the encoder is configured to encode a video frame in the first bit depth;
sending, by the encoder, the first video frame to an open graphics library (OpenGL);
generating, by the OpenGL, a second color value based on the first color value;
invoking, by the OpenGL, a graphics processing unit (GPU) to process the first video frame;
generating, by the GPU, N third color values based on the second color value, wherein a bit depth of the N third color values is a second bit depth, the second bit depth is less than the first bit depth, and N is a positive integer greater than 1;
writing, by the GPU, the N third color values into the first memory, to obtain N fifth color values, and a bit depth of a video frame carried in the first memory is the first bit depth;
obtaining, by the encoder, a fourth color value based on the N fifth color values;
generating, by the encoder, a second video frame based on the fourth color value; and
generating, by the encoder, a second video based on the second video frame.
|