IP Library Granted Patent US 12705895
Granted Patent B2
US 12705895 · App. 17/722,300 · Granted Aug 11, 2026

Video comparison method and apparatus, computer device, and storage medium

Inventors: Jiyang Wu (Shenzhen, CN); Churong Liu (Shenzhen, CN); Rui Guo (Shenzhen, CN); Jiarun Luo (Shenzhen, CN); Yiyang Xu (Shenzhen, CN); Zongxing Xie (Shenzhen, CN)
Assignee: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
G06V20/46G06V10/48G06V10/751G06V10/82H04N19/40
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12705895
App. No.
17/722,300
Granted
Aug 11, 2026
Kind
B2
Abstract

A video comparison method includes: obtaining a first video and a second video; obtaining a first image sequence from the first video, and obtaining a second image sequence from the second video; extracting a first definition feature vector of the first image sequence by using a first feature extraction mechanism of a video comparison model; extracting a second definition feature vector of the second image sequence by using a second feature extraction mechanism of the video comparison model, the first feature extraction mechanism being the same as the second feature extraction mechanism; and determining a definition difference between the first video and the second video based on the first definition feature vector and the second definition feature vector by using a definition difference analysis mechanism of the video comparison model.

Claims (81)

1 . A video comparison method, performed by a computer device, the method comprising:

obtaining a first video and a second video;

obtaining a first image sequence from the first video, and obtaining a second image sequence from the second video;

extracting a first definition feature vector of the first image sequence by using a first feature extraction mechanism of a video comparison model, comprising:

mapping first images in the first image sequence from a pixel space to a target embedding space by inputting the first image sequence into a convolutional neural network (CNN) in a first feature extraction layer of the first feature extraction mechanism, to obtain a first image feature vector of the first image sequence;

performing, based on a quantity of cells and a quantity of neurons of a long short-term memory (LSTM) network in a second feature extraction layer of the first feature extraction mechanism, a deformation operation on the first image feature vector outputted by the CNN, to obtain a reshaped first image feature vector; and

analyzing the first image feature vector based on a time sequence relationship among the first images corresponding to the first image feature vector by inputting the reshaped first image feature vector to the LSTM network in the second feature extraction layer of the first feature extraction mechanism, to obtain the first definition feature vector corresponding to the first image sequence;

extracting a second definition feature vector of the second image sequence by using a second feature extraction mechanism of the video comparison model, the first feature extraction mechanism being the same as the second feature extraction mechanism; and

determining a definition difference between the first video and the second video based on the first definition feature vector and the second definition feature vector by using a definition difference analysis mechanism of the video comparison model, the definition difference indicating whether a video clarity of the first video is higher or lower than a video clarity of the second video and being determined by:

performing a subtraction operation on the first definition feature vector and the second definition feature vector to obtain a subtraction result, and directly using the subtraction result as vector difference between the first definition feature vector and the second definition feature vector; and

using at least one fully connected layer on the vector difference between the first definition feature vector and the second definition feature vector to obtain the definition difference.

2 . The video comparison method according to claim 1 , wherein the obtaining a first video and a second video comprises:

obtaining an original video;

converting the original video according to a first video transcoding manner, to obtain the first video; and

converting the original video according to a second video transcoding manner, to obtain the second video.

3 . The video comparison method according to claim 2 , wherein the converting the original video according to a first video transcoding manner, to obtain the first video comprises:

converting the original video based on the first video transcoding manner provided by a video client, to obtain the first video; and

the converting the original video according to a second video transcoding manner, to obtain the second video comprises:

converting the original video based on the second video transcoding manner provided by a reference video client of the video client, to obtain the second video.

4 . The video comparison method according to claim 2 , wherein the second video transcoding manner is a preset reference video transcoding manner; and

after the determining a definition difference between the first video and the second video based on the first definition feature vector and the second definition feature vector by using a definition difference analysis mechanism of the video comparison model, the method further comprises:

determining a transcoding performance level of the first video transcoding manner compared to the preset reference video transcoding manner based on the definition difference.

5 . The method according to claim 4 , further comprising:

determining to optimize or replace the first video transcoding manner based on the transcoding performance level.

6 . The video comparison method according to claim 1 , wherein the obtaining a first image sequence from the first video, and obtaining a second image sequence from the second video comprises:

extracting a preset quantity of first images from the first video, to form the first image sequence; and

extracting, from the second video, second images having same positions as the first images in the first video, to form the second image sequence.

7 . The video comparison method according to claim 1 , wherein the extracting a second definition feature vector of the second image sequence by using a second feature extraction mechanism of the video comparison model comprises:

mapping second images in the second image sequence from a pixel space to the target embedding space by using the second feature extraction mechanism, to obtain a second image feature vector of the second image sequence; and

analyzing the second image feature vector based on a time sequence relationship among the second images corresponding to the second image feature vector by using the second feature extraction mechanism, to obtain the second definition feature vector corresponding to the second image sequence.

8 . The video comparison method according to claim 1 , wherein before the extracting a first definition feature vector of the first image sequence by using a first feature extraction mechanism of a video comparison model, the method further comprises:

obtaining training sample pairs, the training sample pairs comprising first image sequence samples and second image sequence samples, first image sequence samples in a same training sample pair being from a same first video sample, second image sequence samples in the same training sample pair being from a same second video sample, and a sample label of the training sample pair comprising an expected definition difference between the first video sample and the second video sample corresponding to the training sample pair;

obtaining a video comparison model to be trained, the video comparison model comprising the first feature extraction mechanism, the second feature extraction mechanism, and the definition difference analysis mechanism;

extracting a first definition feature vector of the first image sequence samples by using the first feature extraction mechanism;

extracting a second definition feature vector of the second image sequence samples by using the second feature extraction mechanism, the first feature extraction mechanism and the second feature extraction mechanism having same network structures and same network parameters;

analyzing the first definition feature vector and the second definition feature vector corresponding to the same training sample pair by using the definition difference analysis mechanism, to determine a predicted definition difference between the first video sample and the second video sample corresponding to the training sample pair; and

performing parameter adjustment on the video comparison model based on the predicted definition difference and the expected definition difference of the training sample pair, until the training of the video comparison model is completed, the first feature extraction mechanism and the second feature extraction mechanism having same parameters after each parameter adjustment.

9 . The video comparison method according to claim 8 , wherein the extracting a first definition feature vector of the first image sequence samples by using the first feature extraction mechanism comprises:

mapping images in the first image sequence samples from a pixel space to a target embedding space by using the first feature extraction mechanism, to obtain a first image feature vector of the first image sequence samples; and

analyzing the first image feature vector based on a time sequence relationship among the images corresponding to the first image feature vector by using the first feature extraction mechanism, to obtain the first definition feature vector of the first image sequence samples; and

the extracting a second definition feature vector of the second image sequence samples by using the second feature extraction mechanism comprises:

mapping images in the second image sequence samples from a pixel space to the target embedding space by using the second feature extraction mechanism, to obtain a second image feature vector of the second image sequence samples; and

analyzing the second image feature vector based on a time sequence relationship among the images corresponding to the second image feature vector by using the second feature extraction mechanism, to obtain the second definition feature vector of the second image sequence samples.

10 . The video comparison method according to claim 8 , wherein the analyzing the first definition feature vector and the second definition feature vector corresponding to the same training sample pair by using the definition difference analysis mechanism, to determine a predicted definition difference between the first video sample and the second video sample corresponding to the training sample pair comprises:

calculating a vector difference between the first definition feature vector and the second definition feature vector corresponding to the same training sample pair by using the definition difference analysis mechanism; and

determining the predicted definition difference between the first video sample and the second video sample corresponding to the training sample pair based on the vector difference of the training sample pair.

11 . The video comparison method according to claim 1 , wherein the first video is obtained by using a first shooting mode of a camera, the second video is obtained by using a second shooting mode of the camera, and the method further comprises:

comparing impacts of the first shooting mode and the second shooting mode on video clarity based on the definition difference.

12 . The method according to claim 1 , wherein using the at least one fully connected layer on the vector difference comprises:

classifying the vector difference between the first definition feature vector and the second definition feature vector by using the at least one fully connected layer to obtain a one-dimensional vector difference; and

performing a normalization operation on the one-dimensional vector difference to obtain the definition difference,

wherein the at least one fully connected layer comprises a first fully connected layer having a same dimension as the first definition feature vector and a one-dimensional fully connected layer.

13 . The method according to claim 1 , wherein the quantity of neurons of the LSTM network corresponds to a quantity of frames in the first image sequence extracted from the first video.

14 . The method according to claim 1 , wherein the first definition feature vector and the second definition feature vector have a same dimension and are both multi-dimensional, and the subtraction operation is a bitwise subtraction.

15 . A video comparison apparatus, comprising: a memory and a processor, the memory storing computer-readable instructions, the processor being configured, when executing the computer-readable instructions, to:

obtain a first video and a second video;

obtain a first image sequence from the first video, and obtain a second image sequence from the second video;

extract a first definition feature vector of the first image sequence by using a first feature extraction mechanism of a video comparison model, comprising:

mapping first images in the first image sequence from a pixel space to a target embedding space by inputting the first image sequence into a convolutional neural network (CNN) in a first feature extraction layer of the first feature extraction mechanism, to obtain a first image feature vector of the first image sequence;

performing, based on a quantity of cells and a quantity of neurons of a long short-term memory (LSTM) network in a second feature extraction layer of the first feature extraction mechanism, a deformation operation on the first image feature vector outputted by the CNN, to obtain a reshaped first image feature vector; and

analyzing the first image feature vector based on a time sequence relationship among the first images corresponding to the first image feature vector by inputting the reshaped first image feature vector to the LSTM network in the second feature extraction layer of the first feature extraction mechanism, to obtain the first definition feature vector corresponding to the first image sequence;

extract a second definition feature vector of the second image sequence by using a second feature extraction mechanism of the video comparison model, the first feature extraction mechanism being the same as the second feature extraction mechanism; and

determine a definition difference between the first video and the second video based on the first definition feature vector and the second definition feature vector by using a definition difference analysis mechanism of the video comparison model, the definition difference indicating whether a video clarity of the first video is higher or lower than a video clarity of the second video and being determined by:

performing a subtraction operation on the first definition feature vector and the second definition feature vector to obtain a subtraction result, and directly using the subtraction result as vector difference between the first definition feature vector and the second definition feature vector; and

using at least one fully connected layer on the vector difference between the first definition feature vector and the second definition feature vector to obtain the definition difference.

16 . The apparatus according to claim 15 , wherein the processor is further configured to: obtain an original video; convert the original video according to a first video transcoding manner, to obtain the first video; and convert the original video according to a second video transcoding manner, to obtain the second video.

17 . The apparatus according to claim 16 , wherein the processor is further configured to: convert the original video based on the first video transcoding manner provided by a video client, to obtain the first video; and convert the original video based on the second video transcoding manner provided by a reference video client of the video client, to obtain the second video.

18 . The apparatus according to claim 15 , wherein the processor is further configured to: extract a preset quantity of first images from the first video, to form the first image sequence; and extract, from the second video, second images having same positions as the first images in the first video, to form the second image sequence.

19 . The video comparison method according to claim 15 , wherein the processor is further configured to:

map second images in the second image sequence from a pixel space to the target embedding space by using the second feature extraction mechanism, to obtain a second image feature vector of the second image sequence; and analyze the second image feature vector based on a time sequence relationship among the second images corresponding to the second image feature vector by using the second feature extraction mechanism, to obtain the second definition feature vector corresponding to the second image sequence.

20 . A non-transitory storage medium storing computer-readable instructions, the computer-readable instructions, when executed by one or more processors, causing the one or more processors to perform:

obtaining a first video and a second video;

obtaining a first image sequence from the first video, and obtaining a second image sequence from the second video;

extracting a first definition feature vector of the first image sequence by using a first feature extraction mechanism of a video comparison model, comprising:

mapping first images in the first image sequence from a pixel space to a target embedding space by inputting the first image sequence into a convolutional neural network (CNN) in a first feature extraction layer of the first feature extraction mechanism, to obtain a first image feature vector of the first image sequence;

performing, based on a quantity of cells and a quantity of neurons of a long short- term memory (LSTM) network in a second feature extraction layer of the first feature extraction mechanism, a deformation operation on the first image feature vector outputted by the CNN, to obtain a reshaped first image feature vector; and

analyzing the first image feature vector based on a time sequence relationship among the first images corresponding to the first image feature vector by inputting the reshaped first image feature vector to the LSTM network in the second feature extraction layer of the first feature extraction mechanism, to obtain the first definition feature vector corresponding to the first image sequence;

extracting a second definition feature vector of the second image sequence by using a second feature extraction mechanism of the video comparison model, the first feature extraction mechanism being the same as the second feature extraction mechanism; and

determining a definition difference between the first video and the second video based on the first definition feature vector and the second definition feature vector by using a definition difference analysis mechanism of the video comparison model, the definition difference indicating whether a video clarity of the first video is higher or lower than a video clarity of the second video and being determined by:

performing a subtraction operation on the first definition feature vector and the second definition feature vector to obtain a subtraction result, and directly using the subtraction result as vector difference between the first definition feature vector and the second definition feature vector; and

using at least one fully connected layer on the vector difference between the first definition feature vector and the second definition feature vector to obtain the definition difference.