IP Library › Granted Patent US 12,413,739
Granted Patent B2
US 12,413,739 · App. 18/042,733 · Granted Sep 9, 2025

Method and device for dividing group of pictures based on scene switching, and storage medium

Inventors: Dapeng Chen (Guangzhou, CN); Yiyan Feng (Guangzhou, CN)
Assignee: BIGO TECHNOLOGY PTE. LTD.
H04N19/142H04N19/159H04N19/177
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 12,413,739
App. No.
18/042,733
Granted
Sep 9, 2025
Kind
B2
Abstract

A method for dividing a group of pictures (GOP) based on scene switching in encoding a video. The method includes determining whether a scene switching frame is present in a current GOP of received video data. It is then determined whether a last video frame of the current GOP is the scene switching frame. A first scene switching frame of the current GOP is also determined as a target scene switching frame and this target scene switching frame is acquired by traversing the scene switching frames from back to front. The video frame previous to the target scene switching frame is set as the last video frame of the current GOP. A next GOP is determined to include the number of video frames that follow the target scene switching frame and include the target scene switching frame.

Claims (90)

1. A method for dividing a group of pictures based on scene switching in encoding a video, comprising:

determining whether a scene switching frame is present in a current group of pictures of received video data, wherein the current group of pictures comprises a specified number of video frames;

in response to at least two scene switching frames being present in the current group of pictures, determining whether a last video frame of the current group of pictures is the scene switching frame;

in response to the last video frame of the current group of pictures being one of the at least two scene switching frames, determining a first scene switching frame of the current group of pictures as a target scene switching frame of the current group of pictures;

in response to the last video frame of the current group of pictures being not one of the at least two scene switching frames, acquiring the target scene switching frame by traversing the at least two scene switching frames in the current group of pictures from back to front;

determining a previous video frame of the target scene switching frame as the last video frame of the current group of pictures; and

determining the specified number of video frames that follow the target scene switching frame as a next group of pictures, wherein the next group of pictures comprises the target scene switching frame, encoding the target scene switching frames as a key frame of the next group of pictures determining the next group of pictures as the current group of pictures, and returning to the step of determining whether a scene switching frame is present in a current group of pictures of received video data, each group of pictures comprises only one key frame.

2. The method according to claim 1 , further comprising:

upon determining the target scene switching frame, determining video frames in the current group of pictures except for the target scene switching frame as non-scene switching frames.

3. The method according to claim 1 , wherein prior to determining whether the scene switching frame is present in the current group of pictures of the received video data, the method further comprises:

performing a scene switching detection operation on the current group of pictures of the received video data; and

in a case that the scene switching frame is detected to be present in the current group of pictures, generating a scene switching marker for the current group of pictures.

4. The method according to claim 3 , wherein performing the scene switching detection operation on the current group of pictures of the received video data comprises:

traversing video frames following a first video frame in the current group of pictures;

during traversing the video frames, determining whether a current video frame is the scene switching frame relative to the first video frame in the current group of pictures; and

in response to the current video frame being the scene switching frame relative to the first video frame in the current group of pictures, in a case that the current video frame is the scene switching frame relative to a previous video frame of the current video frame, marking the current video frame as the scene switching frame; or

in response to the current video frame being not the scene switching frame relative to the first video frame in the current group of pictures, determining video frames between the current video frame and the first video frame as non-scene switching frames.

5. The method according to claim 4 , wherein performing the scene switching detection operation on the current group of pictures of the received video data further comprises:

in a case the current video frame is marked as the scene switching frame:

calculating a first intra-frame prediction cost of the current video frame and an (n−1) th video frame, wherein n is a position at which the current video frame is in the current group of pictures;

calculating a second intra-frame prediction cost of the (n−1) th video frame and an (n−2) th video frame;

calculating a difference between the first intra-frame prediction cost and the second intra-frame prediction cost; and

in a case that a ratio of the difference to the second intra-frame prediction cost is greater than a predefined threshold, keeping the current video frame being marked as the scene switching frame; or

in a case that the ratio of the difference to the second intra-frame prediction cost is less than the predefined threshold, determining the current video frame as the non-scene switching frame, wherein the intra-frame prediction cost is a residual acquired by subtracting an original value from a prediction value, after the prediction value Is generated using encoded pixels in adjacent pictures.

6. The method according to claim 1 , wherein determining whether the scene switching frame is present in the current group of pictures of the received video data comprises:

determining whether a scene switching marker is present in the current group of pictures of the received video data;

in response to the scene switching marker being present in the current group of pictures of the received video data, determining that at least two scene switching frames are present in the current group of pictures; or

in response to the scene switching marker being not present in the current group of pictures of the received video data, determining that the scene switching frame is not present in the current group of pictures.

7. The method according to claim 1 , wherein upon determining whether the scene switching frame is present in the current group of pictures of the received video data, the method further comprises:

in a case that the scene switching frame is not present in the current group of pictures, determining a next group of pictures as the current group of pictures, and returning to the step of determining whether a scene switching frame is present in a current group of pictures of received video data.

8. The method according to claim 1 , wherein acquiring the target scene switching frame by traversing the scene switching frames in the current group of pictures from back to front comprises:

traversing the scene switching frames in the current group of pictures from back to front;

with respect to a current scene switching frame, determining whether a next video frame of the current scene switching frame, relative to a previous video frame of the current scene switching frame, constitutes scene switching;

in response to the next video frame of the current scene switching frame, relative to the previous video frame of the current scene switching frame, constituting the scene switching, determining the current scene switching frame as the target scene switching frame; and

determining video frames in the current group of pictures except for the current scene switching frame as non-scene switching frames.

9. The method according to claim 8 , wherein determining the current scene switching frame as the target scene switching frame comprises:

calculating a number of video frames between the current scene switching frame and a last video frame of the video data; and

in a case that the number of video frames is less than a predefined number, determining the current scene switching frame as the non-scene switching frame.

10. The method according to claim 1 , wherein prior to determining the first scene switching frame of the current group of pictures as the target scene switching frame of the current group of pictures, the method further comprises:

calculating a number of video frames between the first scene switching frame and a last video frame of the video data; and

in a case that the number of video frames is less than a predefined number, determining the first scene switching frame as non-scene switching frame.

11. The method according to claim 1 , wherein prior to determining whether the last video frame of the current group of pictures is the scene switching frame, the method further comprises:

in a case that the at least two scene switching frames are present in the current group of pictures, determining whether a previous group of pictures is re-divided, wherein the previous group of pictures is a received group of pictures prior to receiving the current group of pictures;

in response to the previous group of pictures being re-divided, not re-dividing the current group of pictures, and receiving a next group of pictures of the current group of pictures as the current group of pictures, and returning to the step of determining whether a scene switching frame is present in a current group of pictures of received video data; or

in response to the previous group of pictures being not re-divided, in a case that the scene switching frame is present in the previous group of pictures, not re-dividing the current group of pictures, and receiving the next group of pictures of the current group of pictures as the current group of pictures, and returning to the step of determining whether a scene switching frame is present in a current group of pictures of received video data; and

in a case that the scene switching frame is not present in the previous group of pictures, returning to the step of determining whether a last video frame of the current group of pictures is the scene switching frame.

12. A method for encoding a video, comprising:

receiving video data;

dividing the video data into a plurality of groups of pictures; and

encoding a first video frame in each of the group of pictures as a key frame;

wherein the plurality of groups of pictures are divided according to the method for dividing the group of pictures based on scene switching as defined in claim 1 .

13. An electronic device for encoding a video, comprising:

at least one processor; and

a memory, configured to store at least one program;

wherein the at least one program, when loaded and run by the at least one processor, causes the at least one processor to perform a method for encoding a video as defined in claim 12 .

14. A non-transitory computer-readable storage medium, storing one or more computer programs, wherein the one or more computer programs, when loaded and run by a processor, cause the processor to perform the method for encoding a video as defined in claim 12 .

15. An electronic device for dividing a group of pictures based on scene switching in encoding a video, comprising:

at least one processor; and

a memory, configured to store at least one program;

wherein the at least one program, when loaded and run by the at least one processor, causes the at least one processor to perform:

determining whether a scene switching frame is present in a current group of pictures of received video data, wherein the current group of pictures comprises a specified number of video frames;

in response to at least two scene switching frames being present in the current group of pictures, determining whether a last video frame of the current group of pictures is the scene switching frame;

in response to the last video frame of the current group of pictures being one of the at least two scene switching frames, determining a first scene switching frame of the current group of pictures as a target scene switching frame of the current group of pictures;

in response to the last video frame of the current group of pictures being not one of the at least two scene switching frames, acquiring the target scene switching frame by traversing the at least one scene switching frame in the current group of pictures from back to front;

determining a previous video frame of the target scene switching frame as the last video frame of the current group of pictures; and

determining the specified number of video frames that follow the target scene switching frame as a next group of pictures, wherein the next group of pictures comprises the target scene switching frame, encoding the target scene switching frame as a key frame of the next group of pictures, determining the next group of pictures as the current group of pictures, and returning to the step of determining whether a scene switching frame is present in a current group of pictures of received video data, each group of pictures comprises only one key frame.

16. The electronic device for dividing the group of pictures based on scene switching in encoding a video according to claim 15 , wherein the at least one program, when loaded and run by the at least one processor, causes the at least one processor to perform:

upon determining the target scene switching frame, determining video frames in the current group of pictures except for the target scene switching frame as non-scene switching frames.

17. The electronic device for dividing the group of pictures based on scene switching in encoding a video according to claim 15 , wherein the at least one program, when loaded and run by the at least one processor, causes the at least one processor to perform:

performing a scene switching detection operation on the current group of pictures of the received video data; and

in a case that the scene switching frame is detected to be present in the current group of pictures, generating a scene switching marker for the current group of pictures.

18. The electronic device for dividing the group of pictures based on scene switching in encoding a video according to claim 17 , wherein the at least one program, when loaded and run by the at least one processor, causes the at least one processor to perform:

traversing video frames following a first video frame in the current group of pictures;

during traversing the video frames, determining whether a current video frame is the scene switching frame relative to the first video frame in the current group of pictures; and

in response to the current video frame being the scene switching frame relative to the first video frame in the current group of pictures, in a case that the current video frame is the scene switching frame relative to a previous video frame of the current video frame, marking the current video frame as the scene switching frame; or

in response to the current video frame being not the scene switching frame relative to the first video frame in the current group of pictures, determining video frames between the current video frame and the first video frame as non-scene switching frames.

19. The electronic device for dividing the group of pictures based on scene switching in encoding a video according to claim 18 , wherein the at least one program, when loaded and run by the at least one processor, causes the at least one processor to perform:

in a case the current video frame is marked as the scene switching frame:

calculating a first intra-frame prediction cost of the current video frame and an (n−1) th video frame, wherein n is a position at which the current video frame is in the current group of pictures;

calculating a second intra-frame prediction cost of the (n−1) th video frame and an (n−2) th video frame;

calculating a difference between the first intra-frame prediction cost and the second intra-frame prediction cost; and

in a case that a ratio of the difference to the second intra-frame prediction cost is greater than a predefined threshold, keeping the current video frame being marked as the scene switching frame; or

in a case that the ratio of the difference to the second intra-frame prediction cost is less than the predefined threshold, determining the current video frame as the non-scene switching frame, wherein the intra-frame prediction cost is a residual acquired by subtracting an original value from a prediction value, after the prediction value is generated using encoded pixels in adjacent pictures.

20. A non-transitory computer-readable storage medium, storing one or more computer programs, wherein the one or more computer programs, when loaded and run by a processor, cause the processor to perform:

determining whether a scene switching frame is present in a current group of pictures of received video data, wherein the current group of pictures comprises a specified number of video frames;

in response to at least two scene switching frames being present in the current group of pictures, determining whether a last video frame of the current group of pictures is the scene switching frame;

in response to the last video frame of the current group of pictures being one of the at least two scene switching frames, determining a first scene switching frame of the current group of pictures as a target scene switching frame of the current group of pictures;

in response to the last video frame of the current group of pictures being not one of the at least two scene switching frames, acquiring the target scene switching frame by traversing the at least one scene switching frame in the current group of pictures from back to front;

determining a previous video frame of the target scene switching frame as the last video frame of the current group of pictures; and

determining the specified number of video frames that follow the target scene switching frame as a next group of pictures, wherein the next group of pictures comprises the target scene switching frame, encoding the target scene switching frame as a key frame of the next group of pictures, determining the next group of pictures as the current group of pictures, and returning to the step of determining whether a scene switching frame is present in a current group of pictures of received video data, each group of pictures comprises only one key frame.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 23, 2023
From: CHEN, DAPENG; FENG, YIYAN
To: BIGO TECHNOLOGY PTE. LTD.
Reel/Frame 062788/0578 →
Priority Claims (1)
CN 202010879575.0 · Aug 27, 2020 · national
Continuity (1)
Related Publication 20230370608A1 · Nov 16, 2023
References Cited (22)
US 6480540B1 · Guillotel · 2002 [cited by applicant]
US 6959044B1 · Jin et al. · 2005 [cited by applicant]
US 20070247549A1 · Jeong et al. · 2007 [cited by applicant]
US 20110069757A1 · Ammu · 2011 [cited by examiner]
US 20140254660A1 · La · 2014 [cited by applicant]
US 20190182480A1 · Mao et al. · 2019 [cited by applicant]
US 20190260999A1 · Xiong et al. · 2019 [cited by applicant]
US 20210120061A1 · Labrozzi · 2021 [cited by examiner]
CN 101489138A · 2009 [cited by applicant]
CN 102630013A · 2012 [cited by applicant]
CN 103491381A · 2014 [cited by applicant]
CN 106412580A · 2017 [cited by applicant]
CN 107770538A · 2018 [cited by applicant]
CN 112019850A · 2020 [cited by applicant]
JP 2002152683A · 2002 [cited by applicant]
JP 2008182408A · 2008 [cited by applicant]
JP 4650454B2 · 2011 [cited by examiner]
KR 20060052346A · 2006 [cited by applicant]
WO 2017105391A1 · 2017 [cited by applicant]
European Patent Office, Extended European Search Report pursuant to Rule 62 EPC, dated Jan. 22, 2024 in Patent Application No. 21859996.7, which is a foreign counterpart to this U.S. Application. [cited by applicant]
International Search Report of the International Searching Authority for State Intellectual Property Office of the People's Republic of China in PCT application No. PCT/CN2021/108116 issued on Nov. 3, 2021, which is an … [cited by applicant]
The State Intellectual Property Office of People's Republic of China, First Office Action in Patent Application No. CN202010879575.0 issued on Mar. 25, 2022, which is a foreign counterpart application corresponding to t… [cited by applicant]