A method for dividing a group of pictures based on scene switching, comprising: determining (S101) 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 (S102, S204) whether a last video frame of the current group of pictures is one of the at least two scene switching frames; in response to the last video frame of the current group of pictures being one of the at least two scene switching frames, determining (S103, S205) the first scene switching frame from front to back 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 (S105, S210) a previous video frame adjacent to the target scene switching frame as the last video frame of the current group of pictures; and determining (S106, S211) 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 comprising only one key frame. determining (S101) 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 (S102, S204) whether a last video frame of the current group of pictures is one of the at least two scene switching frames; in response to the last video frame of the current group of pictures being one of the at least two scene switching frames, determining (S103, S205) the first scene switching frame from front to back 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 (S105, S210) a previous video frame adjacent to the target scene switching frame as the last video frame of the current group of pictures; and determining (S106, S211) 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 comprising only one key frame. <EOS>