Video seek method, system, video playback server and storage medium

By generating temporary video clips and finding the most recent keyframe data packet for decoding, the problem of long-term pause caused by the distance from the seek position during video seek operation is solved, and the user experience is improved.

CN115967842BActive Publication Date: 2025-06-17AFIRSTSOFT CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211652158.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2025-06-17
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

When the existing video seek method is far away from the seek position, the video screen will pause for a long time and the user experience is poor.

Method used

By receiving the user's drag operation, it is determined whether the landing point is in the decoded segment area. If it is not, a temporary video clip is generated and the playback screen is switched to the temporary video clip. At the same time, the nearby video frame data packet is scanned to find the most recent keyframe data packet, thereby decoding the target video frame and subsequent video frames.

Benefits of technology

It effectively reduces the pause time during video seek operation, improves user experience, and avoids waiting anxiety caused by users due to the long-term unmoving of video images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115967842B_ABST
    Figure CN115967842B_ABST
Patent Text Reader

Abstract

The present invention provides a video seek method, system, video playback server and storage medium. When the key frame data packet is not within the first time range near the playback time corresponding to the drop point position of the drag operation, the video seek method of the present invention will collect all the decoded video frames within the time range between the drop point position and the start position of the drag operation to generate a temporary playback video segment; switch the current screen to play the temporary playback video segment, so as to let the user know that the decoding operation is still proceeding normally, avoid the waiting anxiety caused by the long-term immobility of the video screen, and at the same time scan each video frame data packet outside the first time range near the playback time to find the key frame data packet closest to the playback time. After finding the key frame data packet, decode the video frame at the drop point position and the subsequent video frames of a certain time length and then perform a playback switch, solving the problem of poor user experience when the key frame is far from the seek position in the existing video seek method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video decoding and playing, and particularly relates to a video seek method, system, video playing server and storage medium. Background Art

[0002] With the development of multimedia technology, more and more people use devices such as mobile phones and computers to watch videos. Sometimes, they need to go back and watch a certain segment repeatedly, and sometimes they need to drag the progress bar to find a certain interesting picture or segment. Therefore, the function of being able to change the playing position in real time to display the corresponding picture is a very important and basic function. This function operation is called seek. For audio and video playing devices, it is very important to be able to respond to the seek operation accurately and quickly.

[0003] In the existing video seek method, if the key frame is far from the seek position, the number of video frames to be decoded will increase, and the time consumption will also increase accordingly. The corresponding playing picture will be in a paused state for a long time. Once the pause time is long, users may think that there is an abnormality in the device or network, and they will refresh the video frequently, resulting in extremely poor user experience.

[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention

[0005] The main purpose of the present invention is to provide a video seek method, system, device and storage medium to solve the problems of the existing technology described in the background art.

[0006] The first aspect of the present invention provides a video seek method, including the following steps:

[0007] Receive the dragging operation of the user on the video playing progress bar, pause the playing of the current picture and obtain the landing position of the dragging operation;

[0008] Judge whether the landing position is in the decoded segment area;

[0009] If the landing position is not in the decoded segment area, obtain the playing time of the landing position;

[0010] Scan each video frame data packet within the first time range near the playing time. If no key frame data packet is found among the video frame data packets within the first time range near the playing time, collect all the decoded video frames within the time range from the landing position to the starting position of the dragging operation to generate a temporary playing video segment;

[0011] Switch the current screen to play the temporarily buffered video clip, and simultaneously scan each video frame data packet outside the first time range near the playback time to find the key frame data packet closest to the playback time;

[0012] Decode from the key frame data packet to obtain the target video frame at the playback time and subsequent video frames. Among them, for each video data packet between the key frame data packet and the target video frame, only decode the video frame data packet with the attribute of a reference frame;

[0013] When the continuous playback time of the subsequent video frames reaches the first duration, switch the current screen to play the target video frame and sequentially play the subsequent video frames.

[0014] In an optional implementation manner of the first aspect of the present invention, after collecting all the decoded video frames within the time range from the landing position to the starting position of the dragging operation to generate a temporarily buffered video clip, before switching the current screen to play the temporarily buffered video clip, it includes:

[0015] Obtain the total playback duration of the temporarily buffered video clip;

[0016] Judge whether the total playback duration is greater than or equal to the first threshold;

[0017] If the total playback duration is less than the first threshold, reduce the video playback frame rate to the first calculated value, and the first calculated value is the target frame rate value calculated to extend the total playback duration of the temporarily buffered video clip to be greater than or equal to the first threshold.

[0018] In an optional implementation manner of the first aspect of the present invention, after finding the key frame data packet closest to the playback time, before decoding from the key frame data packet to obtain the target video frame at the playback time and subsequent video frames, it includes:

[0019] Obtain the timestamp of the key frame data packet;

[0020] Obtain all the video frame data packets to be decoded from the timestamp to the playback time. All the video frame data packets to be decoded include the key frame data packet, all the video frame data packets with the attribute of a reference frame from the timestamp to the playback time, and the video frame data packet at the playback time;

[0021] Calculate the decoding time value of all the video frame data packets to be decoded based on the decoding rate;

[0022] Add the preset additional value to the decoding time value to obtain the total decoding time value;

[0023] Obtain the remaining playing time value of the temporarily paused video segment;

[0024] If the total time value is less than the remaining playing time value, play the temporarily paused video segment at a multiple speed to reduce the remaining playing time value so that the remaining playing time value approaches equality with the total time value;

[0025] If the total time value is greater than the remaining playing time value, play the temporarily paused video segment at a reduced frame rate to increase the remaining playing time value so that the remaining playing time value approaches equality with the total time value.

[0026] In an optional implementation manner of the first aspect of the present invention, after determining whether the landing position is in the decoded segment area, it further includes:

[0027] If the landing position is in the decoded segment area, obtain the start time and end time of the decoded segment area;

[0028] Calculate a first difference between the playing time of the landing position and the end time;

[0029] Determine whether the first difference is greater than or equal to a second threshold;

[0030] If the first difference is less than the second threshold, sequentially decode each video frame data packet after the end time to extend the end time of the decoded segment area so that the first difference is greater than or equal to the second threshold.

[0031] When the first difference is greater than or equal to the second threshold, play each of the decoded video frames starting from the decoded video frame at the start time.

[0032] In an optional implementation manner of the first aspect of the present invention, scanning each video frame data packet within a first time range near the playing time includes:

[0033] Create a forward scanning process and a reverse scanning process;

[0034] Using the video frame data packet corresponding to the playing time as a starting point, simultaneously scan each video frame data packet within the first time range through the forward scanning process and the reverse scanning process.

[0035] In an optional implementation manner of the first aspect of the present invention, when switching the current screen to play the temporarily paused video segment and simultaneously scanning each video frame data packet outside the first time range near the playing time to find the key frame data packet closest to the playing time includes:

[0036] Switch the current screen to play the temporarily buffered video segment, and at the same time, scan each video frame data packet outside the first time range near the playing time through the reverse scanning process to find the key frame data packet closest to the playing time.

[0037] In an optional implementation manner of the first aspect of the present invention, if a key frame data packet is scanned and obtained within the first time range through the forward scanning process, then adjust the landing position to another determined playing time determined by the key frame data packet; start decoding each video frame data packet from the another determined playing time to obtain video playing data, and when the playing duration of the video playing data is greater than the third threshold, switch the current screen to play the video playing data.

[0038] The second aspect of the present invention provides a video seek system, and the video seek system includes:

[0039] A drag position acquisition module, configured to receive a user's drag operation on a video playing progress bar and acquire the landing position of the drag operation;

[0040] A landing position judgment module, configured to judge whether the landing position is in the decoded segment area. If the landing position is not in the decoded segment area, then acquire the playing time of the landing position;

[0041] A video frame scanning and temporarily buffered video segment generation module, configured to scan each video frame data packet within a first time range near the playing time. If no key frame data packet is found among the video frame data packets within the first time range near the playing time, then collect all the decoded video frames within the time range from the landing position to the starting position of the drag operation to generate a temporarily buffered video segment;

[0042] A video temporary buffering and key frame searching module, configured to switch the current playing screen to play the temporarily buffered video segment, and at the same time, scan each video frame data packet outside the first time range near the playing time to find the key frame data packet closest to the playing time;

[0043] A decoding module, configured to start decoding from the key frame data packet to obtain the target video frame at the playing time and subsequent video frames. Among them, for each video data packet between the key frame data packet and the target video frame, only the video frame data packet with the attribute of a reference frame is decoded;

[0044] A playing screen switching module, configured to switch the current playing screen to play the target video frame and sequentially play the subsequent video frames when the continuous playing time of the subsequent video frames reaches the first duration.

[0045] In a third aspect of the present invention, a video playback server is provided. The video playback server includes: a memory and at least one processor. Instructions are stored in the memory, and the memory and the at least one processor are interconnected by a line;

[0046] The at least one processor invokes the instructions in the memory to cause the video playback server to execute the video seek method as described in any one of the above.

[0047] In a fourth aspect of the present invention, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the video seek method as described in any one of the above is implemented.

[0048] Beneficial effects: The present invention provides a video seek method, a system, a video playback server, and a storage medium. When the key frame data packet is not within the first time range near the playback time corresponding to the drop point position of the drag operation in the video seek method of the present invention, all the decoded video frames within the time range from the drop point position to the start position of the drag operation are collected to generate a temporary playback video segment; the current screen is switched to play the temporary playback video segment to let the user know that the decoding operation is still proceeding normally, avoiding the waiting anxiety of the user due to the long-term immobility of the video screen. At the same time, each video frame data packet outside the first time range near the playback time is scanned to find the key frame data packet closest to the playback time. After finding the key frame data packet, the video frame at the drop point position and subsequent video frames of a certain time length are decoded and then the playback is switched, solving the problem of poor user experience when the key frame in the existing video seek method is far from the seek position. Description of the Drawings

[0049] Figure 1 It is a schematic diagram of an embodiment of a video seek method of the present invention;

[0050] Figure 2 It is a schematic diagram of an embodiment of a video seek system of the present invention;

[0051] Figure 3 It is a schematic diagram of an embodiment of a video playback server of the present invention. Detailed Embodiments

[0052] An embodiment of the present invention provides a video seek method, system, video playback server, and storage medium. Terms such as "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order different from that shown or described herein. In addition, the term "comprising" or "having" and any variation thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0053] Or implemented in a sequence other than that shown or described herein. In addition, the term "comprising" or "having" and any variation thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0054] Referring to Figure 1 , the first aspect of the present invention provides a video seek method, including the following steps:

[0055] S100. Receive the dragging operation of the user on the video playback progress bar, pause the playback of the current screen, and obtain the landing position of the dragging operation; in the present invention, video seek refers to the situation of dragging the progress bar to find an interesting screen or segment in the video. The purpose of the dragging operation is to pause the playback of the current screen so that the user can more intuitively perceive that the effect of dragging the progress bar is effective. After the playback progress bar is dragged, the main thing involved in video playback is the decoding of the video. Before decoding, it is necessary to determine the video frame data packet to be decoded according to the landing position;

[0056] S200. Determine whether the landing position is in the decoded segment area; in the present invention, there are generally two situations for the landing position after dragging the playback progress bar. One is that the landing position is in the decoded segment area, and this situation is the best, just play directly. The other situation is that the landing position is not in the decoded segment area. At this time, it is necessary to find the video frame obtained by decoding the landing position, and the video frame at the landing position may not be an independent frame and needs to depend on other video frames. The technical solution of the present invention mainly aims at the situation where the landing position is not in the decoded segment area;

[0057] S300. If the landing position is not in the decoded segment area, obtain the playback time of the landing position; in the present invention, when the landing position is not in the decoded segment area, the next step is to decode the video frame at the landing position. Since the video frame at the landing position may not be a key frame, it is necessary to first obtain the playback time of the landing position, and then scan each video frame data packet near the playback time to determine whether there is a key frame data packet;

[0058] S400. Scan each video frame data packet within the first time range near the playback time. If no key frame data packet is found among the video frame data packets within the first time range near the playback time, collect all the decoded video frames within the time range from the landing position to the starting position of the drag operation to generate a temporary playback video segment. In the present invention, the main problem to be solved is that during the video decoding process, it is difficult to determine the position of the key frame data packet, which may cause the video picture to stop for a long time. The solution is to make the picture start moving again as soon as possible when encountering a situation that requires waiting for a relatively long time. The main basis for judging whether the waiting time is too long is to check whether a key frame data packet can be found within the first time range near the playback time. If not, a segment of video between the starting position and the landing position of the drag operation needs to be collected and played first. Generally speaking, video playback usually has pre-decoding. This segment of video can be pre-decoded video frames or video frames obtained by multi-point simultaneous segmented decoding during video playback.

[0059] S500. Switch the current screen to play the temporary playback video segment, and at the same time scan each video frame data packet outside the first time range near the playback time to find the key frame data packet closest to the playback time. In the present invention, if the video frames at the landing position have not been decoded within a certain time, the playback system will first play this temporary playback video segment and at the same time scan the video frame data packets outside the first time range near the playback time.

[0060] S600. Decode from the key frame data packet to obtain the target video frame at the playback time and subsequent video frames. Among them, for each video data packet between the key frame data packet and the target video frame, only decode the video frame data packet whose attribute is a reference frame. In the present invention, after finding the key frame data packet, decoding will start from this key frame data packet. After that, for each obtained video frame data packet, judge whether this video frame data packet is a reference frame data packet. If it is, decode it; if not, discard it until the target video frame at the playback time is decoded. For each video frame data packet after the target video frame, each video frame data packet will be decoded. The method for judging whether each video data packet between the key frame data packet and the target video frame is a reference frame data packet is as follows: Taking the video frame data packet in the AVPacket structure as an example, there is a variable named flags in the video frame data packet, which can be used to judge whether it is a reference frame. If the result of the AND operation (&) between flags and AV_PKT_FLAG_DISPOSABLE is not 0, it means it is a non-reference frame.

[0061] S700. When the continuous playing time of the subsequent video frame reaches the first duration, switch the current screen to play the target video frame and sequentially play the subsequent video frames. In the present invention, the video is not played directly after obtaining the target video frame, because directly starting to play after obtaining the target video frame may still cause video playback stuttering due to the decoding speed not keeping up. Therefore, the video will start playing only when the continuous playing time of the decoded subsequent video frame reaches the first duration.

[0062] In an optional implementation manner of the first aspect of the present invention, after collecting all the decoded video frames within the time range from the landing position to the starting position of the dragging operation to generate a temporary playback video segment, before switching the current screen to play the temporary playback video segment, it includes:

[0063] Obtain the total playing duration of the temporary playback video segment; in the present invention, since the specific time for obtaining the key frame data packet cannot be determined, it is best for the temporary playback video segment to reserve sufficient playing duration. Therefore, after generating the temporary playback video segment, it is also necessary to determine whether the duration of the temporary playback video segment meets the requirements;

[0064] Judge whether the total playing duration is greater than or equal to the first threshold; in the present invention, this first threshold can be 1 - 2 minutes, so as to ensure sufficient time to find the key frame data packet and decode from the key frame data packet to the target video frame at the playback time of the landing position;

[0065] If the total playing duration is less than the first threshold, reduce the video playback frame rate to the first calculated value, and the first calculated value is the target frame rate value calculated when extending the total playing duration of the temporary playback video segment to be greater than or equal to the first threshold. In the present invention, if the total playing duration is less than the first threshold, it is necessary to adjust the video playback frame rate. By reducing the video playback frame rate, the temporary playback video segment can be played for a longer time. To obtain the first calculated value, the total number of frames needs to be obtained first. Specifically, first multiply the total playing duration by the default playback frame rate of the video to obtain the total number of playing frames, and then divide the total number of playing frames by the playing duration to which it needs to be extended to obtain the first calculated value.

[0066] In an optional implementation manner of the first aspect of the present invention, after finding the key frame data packet closest to the playback time, before decoding from the key frame data packet to obtain the target video frame and subsequent video frames at the playback time, it includes:

[0067] Obtain the timestamp of the key frame data packet; in the present invention, after determining the position of the key frame data packet, it is also necessary to adapt the remaining playing time of the paused video segment so that the switch from the paused video segment to the video frames at the playing drop point position and thereafter will not be too abrupt;

[0068] Obtain all video frame data packets that need to be decoded from the timestamp to the playing time, where all video frame data packets that need to be decoded include the key frame data packet, all video frame data packets with the attribute of reference frame from the timestamp to the playing time, and the video frame data packet at the playing time; in the present invention, in order to improve the efficiency of decoding the target video frame at the playing time starting from the key frame data packet, for the video data frame packets between the key frame data packet and the target video frame, only the video frame data packets with the attribute of reference frame are decoded;

[0069] Calculate the decoding time value of all video frame data packets that need to be decoded based on the decoding rate; in the present invention, calculating the decoding time value is to divide the size of all video frame data packets that need to be decoded from the timestamp to the playing time by the decoding rate to obtain the required decoding time value;

[0070] Add a preset additional value to the decoding time value to obtain the total decoding time value; in the present invention, for subsequent smooth playing, the present invention does not directly play when decoding the target video frame at the playing time, but will also decode for a period of time, so this decoding time value also needs to add an additional value;

[0071] Obtain the remaining playing time value of the paused video segment; after obtaining the total decoding time value, it is to compare the remaining playing time value of the paused video segment with the total decoding time value, so it is necessary to obtain the remaining playing time value of the paused video segment;

[0072] If the total time value is less than the remaining playing time value, play the paused video segment at a multiple to reduce the remaining playing time value so that the remaining playing time value approaches the total time value; in the present invention, if the total time value is less than the remaining playing time value, it is necessary to further fast forward the paused video segment, so that the paused video segment collected from the starting point position to the drop point position of the drag operation can be fully played, and the picture content will not be particularly abrupt when connected. The calculation of this multiple is also to first multiply the remaining playing time value by the current playing frame rate to obtain the total remaining number of frames, and then divide by the total time value to obtain the frame rate that needs to be adjusted;

[0073] If the total time value is greater than the remaining playing time value, the frame rate of the temporarily played video segment is decreased for playing to increase the remaining playing time value to make the remaining playing time value approach the total time value. In the present invention, if the remaining playing time value of the temporarily played video segment is too long, it is necessary to speed up the playing, while if the remaining playing time value is too short, it is necessary to delay the playing to avoid the problem of a black screen during playing. The principle of calculating the number of frames for playing at a decreased frame rate is the same as that for playing at a multiple frame rate, and thus will not be elaborated herein.

[0074] In an optional implementation manner of the first aspect of the present invention, after determining whether the landing position is in the decoded segment area, it further includes:

[0075] If the landing position is in the decoded segment area, obtain the start time and end time of the decoded segment area; in the present invention, there is also a possibility that the landing position falls into the decoded segment area. Since there are already decoded video frames, direct playing can be performed. However, to avoid stuttering after playing, it is also necessary to determine whether the time length between the playing time of the landing position and the end time of the decoded segment area meets a certain length requirement;

[0076] Calculate a first difference between the playing time of the landing position and the end time; in the present invention, before determining whether the time length between the playing time and the end time meets the requirement, it is necessary to obtain the first difference between the playing time and the end time;

[0077] Determine whether the first difference is greater than or equal to a second threshold; in the present invention, the second threshold may be equal to the additional value mentioned above. If the first difference is greater than or equal to the second threshold, it is considered that the time length between the playing time and the end time meets the requirement; otherwise, it does not meet the requirement;

[0078] If the first difference is less than the second threshold, sequentially decode each video frame data packet after the end time to extend the end time of the decoded segment area to make the first difference greater than or equal to the second threshold; in the present invention, when the time length between the playing time and the end time does not meet the requirement, it is also necessary to further decode each video frame data packet after the end time to extend the end time of the decoded segment area until the requirement is met;

[0079] When the first difference is greater than or equal to the second threshold, start playing each of the decoded video frames from the decoded video frame at the start time. In the present invention, the preferred condition is that the first difference is greater than or equal to the second threshold. When it is equal, start playing the video in the decoded segment area.

[0080] In an alternative embodiment of the first aspect of the present invention, the scanning of each video frame data packet within the first time range near the playback time includes:

[0081] Create a forward scanning process and a reverse scanning process; in the present invention, when scanning each video frame data packet within the first time range near the playback time at the landing point position, two-way scanning is adopted. If the forward scanning process scans the key frame data packet first, the landing point position is preferentially moved to the time of the key frame data packet for decoding and playback. If the reverse scanning process scans it first, the landing point position is not moved.

[0082] Using the video frame data packet corresponding to the playback time as the starting point, scan each video frame data packet within the first time range simultaneously through the forward scanning process and the reverse scanning process. In the present invention, generally, the first time range is obtained by collecting how long the user's daily video pauses before refreshing the video playback. The two-way scanning method adopted in the present invention can find the key frame data packet near the landing point position faster.

[0083] In an alternative embodiment of the first aspect of the present invention, the switching of the current screen to play the temporarily buffered video segment and simultaneously scanning each video frame data packet outside the first time range near the playback time to find the key frame data packet closest to the playback time includes:

[0084] Switch the current screen to play the temporarily buffered video segment, and simultaneously scan each video frame data packet outside the first time range near the playback time through the reverse scanning process to find the key frame data packet closest to the playback time. In the present invention, if no key video frame data packet is scanned within the first time range near the playback time, the forward scanning process will be cancelled, and only the reverse scanning process will be retained. When the reverse scanning process scans, it will directly continue the reverse scanning starting from the previously recorded scanning termination time until a key frame data packet is scanned and then stop. Judging whether a video frame data packet is a key frame data packet mainly depends on the data packet identifier carried by the video frame data packet (for example, the data packet identifier is an I frame).

[0085] In an alternative embodiment of the first aspect of the present invention, if a key frame data packet is scanned and obtained within the first time range through the forward scanning process, the landing position is adjusted to another specified playback time determined by the key frame data packet; starting from the another specified playback time, each video frame data packet is decoded to obtain video playback data. When the playback duration of the video playback data is greater than a third threshold, the current screen is switched to play the video playback data. In the present invention, if a key frame data packet is found within the first time range in the forward direction of the playback time, in order to play more quickly, the playback time is directly moved to the playback time point corresponding to the key frame data packet, and data decoding starts from the playback time point corresponding to the key frame data packet. In this way, it is also necessary to decode the subsequent video frames after the another specified playback time to a certain time length before starting to play, so as to avoid the occurrence of video freezes after starting to play.

[0086] See Figure 2 , the second aspect of the present invention provides a video seek system, and the video seek system includes:

[0087] A drag position acquisition module 10, configured to receive a user's drag operation on a video playback progress bar and acquire the landing position of the drag operation;

[0088] A landing position determination module 20, configured to determine whether the landing position is within a decoded segment area;

[0089] A playback time acquisition module 30, configured to, if the landing position is not within the decoded segment area, acquire the playback time of the landing position;

[0090] A video frame scanning and temporary playback video segment generation module 40, configured to scan each video frame data packet within a first time range near the playback time. If no key frame data packet is found among the video frame data packets within the first time range near the playback time, all decoded video frames within the time range from the landing position to the start position of the drag operation are collected to generate a temporary playback video segment;

[0091] A video temporary playback and key frame search module 50, configured to switch the current playback screen to play the temporary playback video segment, and at the same time scan each video frame data packet outside the first time range near the playback time to find the key frame data packet closest to the playback time;

[0092] A decoding module 60, configured to start decoding from the key frame data packet to obtain the target video frame and subsequent video frames of the playback time. Among them, for each video data packet between the key frame data packet and the target video frame, only the video frame data packet with the attribute of a reference frame is decoded;

[0093] A playback screen switching module 70, configured to switch the current playback screen to play the target video frame and sequentially play the subsequent video frames when the continuous playback time of the subsequent video frames reaches a first duration.

[0094] In an alternative embodiment of the second aspect of the present invention, the video seek system further includes:

[0095] A total playback duration acquisition module, configured to acquire the total playback duration of the temporarily paused video segment;

[0096] A total playback duration determination module, configured to determine whether the total playback duration is greater than or equal to a first threshold;

[0097] A total playback duration extension module, configured to, if the total playback duration is less than the first threshold, reduce the video playback frame rate to a first calculated value, where the first calculated value is a target frame rate value calculated to extend the total playback duration of the temporarily paused video segment to be greater than or equal to the first threshold.

[0098] In an alternative embodiment of the second aspect of the present invention, the video seek system further includes:

[0099] A key frame timestamp acquisition module, configured to acquire the timestamp of the key frame data packet;

[0100] A video frame data packet to be decoded acquisition module, configured to acquire all video frame data packets to be decoded within the timestamp to the playback time, where all video frame data packets to be decoded include the key frame data packet, all video frame data packets with the attribute of a reference frame within the timestamp to the playback time, and the video frame data packet at the playback time;

[0101] A decoding time calculation module, configured to calculate the decoding time value of all video frame data packets to be decoded based on the decoding rate;

[0102] A total time value calculation module, configured to obtain a total decoding time value by adding a preset additional value to the decoding time value;

[0103] A remaining playback time acquisition module, configured to acquire the remaining playback time value of the temporarily paused video segment;

[0104] A playback adjustment module, configured to, if the total time value is less than the remaining playback time value, perform multiple playback on the temporarily paused video segment to reduce the remaining playback time value to make the remaining playback time value approach the total time value; and configured to, if the total time value is greater than the remaining playback time value, perform reduced frame rate playback on the temporarily paused video segment to increase the remaining playback time value to make the remaining playback time value approach the total time value.

[0105] In an alternative embodiment of the second aspect of the present invention, the video seek system further includes:

[0106] A start and end time acquisition module, configured to, if the landing position is in the decoded segment area, acquire the start time and the end time of the decoded segment area;

[0107] A first difference calculation module, configured to calculate a first difference between the playback time of the landing position and the end time;

[0108] A first difference judgment module, configured to judge whether the first difference is greater than or equal to a second threshold;

[0109] A decoded segment extension module, configured to, if the first difference is less than the second threshold, sequentially decode each video frame data packet after the end time to extend the end time of the decoded segment area so that the first difference is greater than or equal to the second threshold;

[0110] A video playback module, configured to, when the first difference is greater than or equal to the second threshold, start playing each of the decoded video frames from the decoded video frame at the start time.

[0111] In an alternative embodiment of the second aspect of the present invention, the temporarily played video segment generation module 40 includes:

[0112] A process creation unit, configured to create a forward scanning process and a reverse scanning process;

[0113] A two-way scanning unit, configured to use the video frame data packet corresponding to the playback time as a starting point, and simultaneously scan each video frame data packet within the first time range through the forward scanning process and the reverse scanning process.

[0114] In an alternative embodiment of the second aspect of the present invention, the video temporary playback and key frame search module 50 is specifically configured to switch the current screen to play the temporarily played video segment, and simultaneously scan each video frame data packet outside the first time range near the playback time through the reverse scanning process to find the key frame data packet closest to the playback time.

[0115] In an alternative embodiment of the second aspect of the present invention, if a key frame data packet is obtained by scanning within the first time range through the forward scanning process, the landing position is adjusted to another determined playback time determined by the key frame data packet; each video frame data packet is decoded from the another determined playback time to obtain video playback data, and when the playback duration of the video playback data is greater than a third threshold, the current screen is switched to play the video playback data.

[0116] Figure 3 It is a schematic diagram of a video playback server provided by an embodiment of the present invention. The video playback server may vary greatly due to different configurations or performances, and may include one or more processors 110 (central processing units, CPUs) (for example, one or more processors) and a memory 120, and one or more storage media 130 for storing applications or data (for example, one or more mass storage devices). Among them, the memory and the storage medium may be transient storage or persistent storage. The program stored in the storage medium may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the video playback server. Further, the processor may be configured to communicate with the storage medium and execute a series of instruction operations in the storage medium on the video playback server.

[0117] The video playback server of the present invention may further include one or more power supplies 140, one or more wired or wireless network interfaces 150, one or more input / output interfaces 160, and / or one or more operating systems, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and so on. Those skilled in the art can understand that Figure 3 The shown video playback server structure does not constitute a specific limitation on the video playback server of the present invention, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0118] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer is caused to execute the steps of the video seek method described above.

[0119] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described system or system and unit can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0120] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a video playback server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.

[0121] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A video seek method, characterized in that, It includes the following steps: Receive the user's dragging operation on the video playback progress bar, pause the playback of the current screen, and obtain the landing position of the dragging operation; Determine whether the landing position is in the decoded segment area; If the landing position is not in the decoded segment area, obtain the playback time of the landing position; Scan each video frame data packet within the first time range near the playback time. If no key frame data packet is found among the video frame data packets within the first time range near the playback time, collect all the decoded video frames within the time range from the landing position to the starting position of the dragging operation to generate a temporary playback video segment; Switch the current screen to play the temporary playback video segment, and at the same time scan each video frame data packet outside the first time range near the playback time to find the key frame data packet closest to the playback time; Decode from the key frame data packet to obtain the target video frame at the playback time and subsequent video frames. Among them, for each video data packet between the key frame data packet and the target video frame, only decode the video frame data packet with the attribute of a reference frame; When the continuous playback time of the subsequent video frames reaches the first duration, switch the current screen to play the target video frame and sequentially play the subsequent video frames; The scanning of each video frame data packet within the first time range near the playback time includes: creating a forward scanning process and a reverse scanning process; using the video frame data packet corresponding to the playback time as the starting point, and simultaneously scanning each video frame data packet within the first time range through the forward scanning process and the reverse scanning process; if no key frame data packet is scanned within the first time range near the playback time, the forward scanning process will be cancelled, and only the reverse scanning process will be retained. When the reverse scanning process scans, it directly continues to scan reversely from the previously recorded scanning end time until the key frame data packet is scanned and then stops.

2. The video seek method according to claim 1, characterized in that, After collecting all the decoded video frames within the time range from the landing position to the starting position of the dragging operation to generate a temporary playback video segment, before switching the current screen to play the temporary playback video segment, it includes: Obtain the total playback duration of the temporary playback video segment; Determine whether the total playback duration is greater than or equal to the first threshold; If the total playback duration is less than the first threshold, reduce the video playback frame rate to the first calculated value, and the first calculated value is the target frame rate value calculated to extend the total playback duration of the temporary playback video segment to be greater than or equal to the first threshold; 3. The video seek method according to claim 1, characterized in that, After finding the key frame data packet closest to the playback time, before decoding from the key frame data packet to obtain the target video frame at the playback time and subsequent video frames, it includes: Obtain the timestamp of the key frame data packet; Obtain all video frame data packets to be decoded from the timestamp to the playback time, where all video frame data packets to be decoded include the key frame data packet, all video frame data packets with the attribute of reference frame from the timestamp to the playback time, and the video frame data packet at the playback time; Calculate the decoding time values of all video frame data packets to be decoded based on the decoding rate; Obtain the total decoding time value by adding the preset additional value to the decoding time value; Obtain the remaining playback time value of the paused video segment; If the total decoding time value is less than the remaining playback time value, play the paused video segment at a multiple speed to reduce the remaining playback time value to make it approach the total decoding time value; If the total decoding time value is greater than the remaining playback time value, play the paused video segment at a reduced frame rate to increase the remaining playback time value to make it approach the total decoding time value.

4. The video seek method according to claim 1, characterized in that, The step of determining whether the landing position is after the decoded segment area further includes: If the landing position is in the decoded segment area, obtain the start time and end time of the decoded segment area; Calculate the first difference between the playback time of the landing position and the end time; Determine whether the first difference is greater than or equal to the second threshold; If the first difference is less than the second threshold, sequentially decode each video frame data packet after the end time to extend the end time of the decoded segment area to make the first difference greater than or equal to the second threshold; When the first difference is greater than or equal to the second threshold, start playing each decoded video frame from the decoded video frame at the start time.

5. The video seek method according to claim 1, characterized in that, The step of switching the current screen to play the paused video segment and simultaneously scanning each video frame data packet outside the first time range near the playback time to find the key frame data packet closest to the playback time includes: Switch the current screen to play the paused video segment, and simultaneously scan each video frame data packet outside the first time range near the playback time through the reverse scanning process to find the key frame data packet closest to the playback time.

6. The video seek method according to claim 1, characterized in that, If a key frame data packet is scanned and obtained within the first time range through the forward scanning process, adjust the landing position to the alternative playback time determined by the key frame data packet; Start decoding each video frame data packet from the alternative playback time to obtain video playback data, and when the playback duration of the video playback data is greater than the third threshold, switch the current screen to play the video playback data.

7. A video seek system, characterized in that, The video seek system includes: A drag position acquisition module, configured to receive a user's drag operation on the video playback progress bar and acquire the landing position of the drag operation; A landing position determination module, configured to determine whether the landing position is in the decoded segment area; A playback time acquisition module, configured to, if the landing position is not in the decoded segment area, acquire the playback time of the landing position; A video frame scanning and temporary playback video segment generation module, which is used to scan each video frame data packet within the first time range near the playback time. If no key frame data packet is found in each video frame data packet within the first time range near the playback time, all decoded video frames within the time range from the landing position to the starting position of the dragging operation are collected to generate a temporary playback video segment; A video temporary playback and key frame searching module, which is used to switch the current playback screen to play the temporary playback video segment, and at the same time scan each video frame data packet outside the first time range near the playback time to find the key frame data packet closest to the playback time; A decoding module, which is used to decode from the key frame data packet to obtain the target video frame at the playback time and subsequent video frames. Among them, for each video data packet between the key frame data packet and the target video frame, only the video frame data packet with the attribute of a reference frame is decoded; A playback screen switching module, which is used to switch the current playback screen to play the target video frame and sequentially play the subsequent video frames when the continuous playback time of the subsequent video frames reaches the first duration; The temporary playback video segment generation module includes: A process creation unit, which is used to create a forward scanning process and a reverse scanning process; A two-way scanning unit, which uses the video frame data packet corresponding to the playback time as the starting point, and simultaneously scans each video frame data packet within the first time range through the forward scanning process and the reverse scanning process; if no key frame data packet is scanned within the first time range near the playback time, the forward scanning process will be cancelled, and only the reverse scanning process will be retained. When the reverse scanning process scans, it directly continues the reverse scanning with the previously recorded scanning termination time as the starting point until the key frame data packet is scanned and then stops.

8. A video playback server, characterized in that, The video playback server includes: a memory and at least one processor, instructions are stored in the memory, and the memory and the at least one processor are interconnected by a line; The at least one processor calls the instructions in the memory to enable the video playback server to execute the video seek method according to any one of claims 1-6; 9. A computer-readable storage medium, on which a computer program is stored, characterized in that, The computer program, when executed by a processor, implements the video seek method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Video code stream switching method and device

    CN102905188A

  • Video seek method and device, terminal and computer readable storage medium

    CN109862423A

  • Video playing method and device, electronic equipment and storage medium

    CN110267096A

  • Video playing method and device and storage medium

    CN110868642A