Video playback method and device, electronic device, and storage medium
By acquiring and synchronizing the complete audio and video data and short broadcast data of the video, dividing and playing the video clips, it solves the problem in the existing technology that the video cannot be shortened while ensuring the continuity of the plot, and realizes the efficient shortening of the video and the user-friendliness of the video. Friendly playback experience.
Patent Information
- Application Number
- CN202210338308.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-01
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-04-01
AI Technical Summary
The existing technology cannot effectively shorten the video while ensuring the continuity of the plot, and users need to exit the playback interface to search for the original video when they want to watch the plot of the original video.
Provide a video playback method that obtains the complete audio and video data and short broadcast data of the target video, including short broadcast audio data, point data and audio and video synchronization data, divides the video segments and plays them synchronously in the short broadcast mode until there is no more waiting time. The played video clips ensure the continuity of the plot and restore the complete audio and video data playback when exiting the short broadcast mode.
It achieves the effective shortening of video playback while ensuring the continuity of the plot, avoiding the need for users to exit the playback interface to find the original video, and improving the user experience.
Smart Images

Figure CN114697722B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video playback technology, and in particular to a video playback method and device, electronic equipment, and storage medium. Background Art
[0002] As users' time tends to be fragmented, watching the most exciting content in a limited time without losing the continuity of the plot has become a strong demand of current users. Therefore, how to reasonably shorten long videos to meet the strong needs of users has also become a strategic issue that long video products need to consider.
[0003] There are three main ways to shorten videos. The first is to speed up the video, that is, to play it at a certain speed. The second is to skip other unimportant content and only play the highlights or character clips. The third is to edit a long video into independent short videos and play them directly.
[0004] However, for the first method, although the continuity of the matrix is guaranteed, it still takes a long time to play the entire complete video even at the maximum speed. For the second method, although it can effectively shorten the length of the long video, it loses the continuity of the plot. For editing the video into independent short videos, although it effectively shortens the length of the video, it can ensure the continuity of the plot to a certain extent. However, when the user is more interested in the video and needs to watch the original video plot, he needs to exit the playback interface to find the original complete video for playback. Summary of the invention
[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a video playback method and device, an electronic device, and a storage medium to solve the problem that the prior art cannot effectively shorten the video for playback while ensuring the continuity of the plot, and can easily find the original video.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] The first aspect of the present application provides a video playback method, comprising:
[0008] When requesting to play a target video, the complete audio and video data of the target video and the short broadcast data of the target video are obtained; wherein the complete audio and video data include synchronized complete video data and complete audio data; the short broadcast data include short broadcast audio data, dot data and audio and video synchronization data; the dot data include data for indicating each video segment divided in the complete video data; the audio and video synchronization data include the correspondence between the short broadcast audio segment in the short broadcast audio data and the video segment in the complete video data;
[0009] Play the complete audio and video data of the target video;
[0010] When a short broadcast mode switching instruction is received, the playing of the complete audio and video data of the target video is paused; wherein, when the short broadcast mode is exited, the playing of the complete audio and video data of the target video is resumed;
[0011] Based on the dot data and the audio and video synchronization data, determine the current short broadcast audio segment to be played and its corresponding current video segment to be played from each of the short broadcast audio segments and each of the video segments to be played in sequence;
[0012] Synchronously playing the short audio segment to be played and its corresponding video segment to be played;
[0013] When the current video segment to be played is finished playing, return to execute the process based on the dot data and the audio and video synchronization data, and determine the current short broadcast audio segment to be played and its corresponding current video segment to be played from each of the short broadcast audio segments and each of the video segments to be played in sequence until there are no more video segments to be played.
[0014] Optionally, in the above-mentioned video playback method, the step of determining the current short broadcast audio segment to be played and its corresponding current video segment to be played from each of the short broadcast audio segments and each of the video segments to be played in sequence based on the dot data and the audio and video synchronization data comprises:
[0015] The short broadcast audio segment currently being played is determined as the short broadcast audio segment currently to be played; wherein each of the short broadcast audio segments in the short broadcast audio data is played in sequence;
[0016] Based on the audio and video synchronization data, determining from the dot data a timestamp range corresponding to the timestamp of the short broadcast audio segment to be played;
[0017] The video segment in the complete video data corresponding to the found timestamp range is determined as the current video segment to be played corresponding to the current short-broadcast audio segment to be played.
[0018] Optionally, in the above-mentioned video playing method, before determining the short play audio segment currently being played as the short play audio segment currently to be played, the method further includes:
[0019] Determine whether the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction;
[0020] If it is determined that the short broadcast audio is not being played for the first time after receiving the short broadcast mode switching instruction, the short broadcast audio segment currently being played is determined as the short broadcast audio segment currently to be played;
[0021] If it is determined that the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction, then finding out a timestamp range in the dot data that is closest to the timestamp corresponding to the current playback progress of the complete video data;
[0022] Determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played;
[0023] Based on the audio and video synchronization data, the short broadcast audio segment in the short broadcast audio data corresponding to the current video segment to be played is determined as the current short broadcast audio segment to be played.
[0024] Optionally, in the above-mentioned video playing method, the synchronously playing the short audio segment to be played and its corresponding video segment to be played includes:
[0025] Calculate the timestamp offset between the short audio segment to be played and the video segment to be played;
[0026] The short audio segment to be played currently and the video segment to be played currently are played based on the timestamp offset.
[0027] A second aspect of the present application provides a video playback device, comprising:
[0028] An acquisition unit is used to acquire the complete audio and video data of the target video and the short broadcast data of the target video when requesting to play the target video; wherein the complete audio and video data includes synchronized complete video data and complete audio data; the short broadcast data includes short broadcast audio data, dot data and audio and video synchronization data; the dot data includes data for indicating each video segment divided in the complete video data; the audio and video synchronization data includes the corresponding relationship between the short broadcast audio segment in the short broadcast audio data and the video segment in the complete video data;
[0029] A conventional playback unit, used to play the complete audio and video data of the target video;
[0030] A pause unit, configured to pause the playing of the complete audio and video data of the target video when receiving a short broadcast mode switching instruction; wherein, when exiting the short broadcast mode, the playing of the complete audio and video data of the target video is resumed;
[0031] A segment determination unit, configured to determine the current short broadcast audio segment to be played and its corresponding current video segment to be played from each of the short broadcast audio segments to be played and each of the video segments to be played in sequence based on the dot data and the audio and video synchronization data;
[0032] The short broadcast playing unit is used to synchronously play the short broadcast audio segment to be played and its corresponding video segment to be played; wherein, after the short broadcast playing unit finishes playing the video segment to be played, it returns to the segment determination unit until there is no video segment to be played.
[0033] Optionally, in the above-mentioned video playback device, the segment determination unit includes:
[0034] The first audio determination unit is used to determine the short broadcast audio segment currently being played as the short broadcast audio segment currently to be played; wherein each of the short broadcast audio segments in the short broadcast audio data is played in sequence;
[0035] A first search unit, configured to determine, based on the audio and video synchronization data, from the dot data a timestamp range corresponding to the timestamp of the short-broadcast audio segment to be played;
[0036] The first video determination unit is used to determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played corresponding to the current short broadcast audio segment to be played.
[0037] Optionally, in the above video playback device, it further includes:
[0038] A judging unit is used to judge whether the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction; wherein, if it is judged that the short broadcast audio is not currently being played for the first time after receiving the short broadcast mode switching instruction, the first audio determination unit executes the step of determining the short broadcast audio segment currently being played as the short broadcast audio segment currently to be played;
[0039] The second search unit is used to determine that the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction, and to search for a timestamp range in the dot data that is closest to the timestamp corresponding to the current playback progress of the complete video data;
[0040] A second video determination unit, configured to determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played;
[0041] The second audio determination unit is used to determine the short broadcast audio segment corresponding to the current video segment to be played in the short broadcast audio data as the current short broadcast audio segment to be played based on the audio and video synchronization data.
[0042] Optionally, in the above-mentioned video playback device, the short broadcast playback unit includes:
[0043] A calculation unit, used for calculating the timestamp offset between the short audio segment to be played and the video segment to be played;
[0044] A synchronous playing unit is used to play the short audio segment to be played and the video segment to be played based on the timestamp offset.
[0045] A third aspect of the present application provides an electronic device, including:
[0046] Memory and processor;
[0047] Wherein, the memory is used to store programs;
[0048] The processor is used to execute the program, and when the program is executed, it is specifically used to implement any of the video playback methods described above.
[0049] A fourth aspect of the present application provides a computer storage medium for storing a computer program, which, when executed, is used to implement the video playback method as described in any one of the above.
[0050] The video playback method provided by the present application obtains the complete audio and video data of the target video and the short broadcast data of the target video when requesting to play the target video. Among them, the complete audio and video data includes synchronized complete video data and complete audio data, and the short broadcast data includes short broadcast audio data, dot data and audio and video synchronization data. The dot data includes data for indicating each video segment divided in the complete video data, so as to realize logically dividing the long video into multiple short videos. The audio and video synchronization data includes the correspondence between the short broadcast audio segment in the short broadcast audio data and the video segment in the complete video data, so that the corresponding audio segment and video segment are played synchronously. Then, the complete audio and video data of the target video is played. When the short broadcast mode switching instruction is received, the complete audio and video data of the target video is paused. Based on the dot data and the audio and video synchronization data, the current short broadcast audio segment to be played and its corresponding current video segment to be played are determined in sequence from each short broadcast audio segment and each video segment to be played, and the current short broadcast audio segment to be played and its corresponding current video segment to be played are played synchronously. When the current video clip to be played is finished, the process returns to determine the new current short-broadcast audio clip to be played and its corresponding current video clip to be played, until there is no video clip to be played, thereby effectively shortening the long time while ensuring the continuity of the plot. And when the short-broadcast mode is exited, the complete audio and video data of the target video is restored, so when the user needs the original video plot, there is no need to exit and search for the original complete video to play. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0052] Figure 1 A flowchart of a video playback method provided in an embodiment of the present application;
[0053] Figure 2 A flowchart of a method for determining a short audio segment to be played and its corresponding video segment to be played provided in an embodiment of the present application;
[0054] Figure 3 A flowchart of another method for determining a short audio segment to be played and its corresponding video segment to be played provided in another embodiment of the present application;
[0055] Figure 4 A flowchart of a synchronous playback method provided in an embodiment of the present application;
[0056] Figure 5 A schematic diagram of the offset between a video clip and short broadcast audio data provided in an embodiment of the present application;
[0057] Figure 6 A schematic diagram of the structure of a video playback device provided in an embodiment of the present application;
[0058] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0060] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0061] The present application embodiment provides a video playback method, such as Figure 1 As shown, the following steps are included:
[0062] S101. When a target video is requested to be played, complete audio and video data of the target video and short broadcast data of the target video are obtained.
[0063] The complete audio and video data includes synchronized complete video data and complete audio data.
[0064] The short broadcast data includes short broadcast audio data, dot data and audio and video synchronization data. Since the short broadcast data needs to be preset accurately, in the embodiment of the present application, the target video refers to any video with corresponding short broadcast data.
[0065] Optionally, the short broadcast audio data can be audio recorded in a later stage, for example, an explanation of the main plot of the target video recorded in a later stage, etc., and of course, it can also be composed of audio clipped from the complete audio data. In addition, the short broadcast audio data can be a complete audio data, which is convenient for use and management. However, in order to make the played audio correspond to the played video clip, it is necessary to logically divide the short broadcast audio data into multiple short broadcast audio clips. For example, a 10-minute short broadcast audio data can be divided into a short broadcast audio clip every one minute, specifically divided according to the corresponding relationship with the video clip. Of course, the short broadcast audio data can include multiple independent short broadcast audio data, each short broadcast audio data corresponds to a video clip, for example, each video clip and its corresponding explanation audio, so that the short broadcast data does not need to be logically divided.
[0066] The dot data includes data for indicating each video segment divided in the complete video data. That is, in the embodiment of the present application, each video segment in the complete video is marked by dotting on the complete video, and the complete video data is not edited into multiple independent video segments. Usually, the dot data is the time stamp range corresponding to each video segment in the complete video data.
[0067] It should also be noted that in order to effectively shorten long videos, the video clips in the complete video data indicated by the dot data usually only include highlights, character clips, and clips that play an important role in the continuity of the plot. Therefore, the sum of all the divided video clips is not equal to the complete video data, but only a part of the complete video data.
[0068] The audio and video synchronization data includes the correspondence between the short broadcast audio segment in the short broadcast audio data and the video segment in the complete video data.
[0069] Specifically, when the user needs to play the target video, the client requests the server for the playback address of the target video. At this time, the server will send the complete audio and video data of the target video and the short broadcast data of the target video. Optionally, the complete audio and video data of the target video and the corresponding address of the short broadcast data of the target video are sent, and when needed, they are loaded according to the address.
[0070] S102: Play the complete audio and video data of the target video.
[0071] In the embodiment of the present application, the complete video data of the target video is played by default, so after the complete audio and video data of the target video and the short broadcast data of the target video are obtained, the complete video data and the complete audio data are rendered by default and played synchronously.
[0072] Optionally, if the user has not played the complete audio and video data of the target video before, or has played the complete audio and video data of the target video, the complete audio and video data of the target video is played from the beginning. If the user has played the complete video of the target video before, and has not played the complete video of the target video, the progress of the user's last play can be read, and then the progress of the user's last play can be continued.
[0073] S103: When a short broadcast mode switching instruction is received, the playing of the complete audio and video data of the target video is paused.
[0074] Specifically, when the user switches the short broadcast mode on the client, the short broadcast mode switching instruction is triggered, and the short broadcast mode needs to be entered at this time. Therefore, it is necessary to pause the playback of the complete audio and video data of the target video. It should be noted that, since the video clips in the complete video data will still be played in the short broadcast mode, it is more accurate to say that the complete audio data is paused.
[0075] It should be noted that after switching to the short broadcast mode, the user can exit the short broadcast mode at any time, that is, switch back to the normal mode, at which time the complete audio and video data of the target video will be restored.
[0076] Optionally, when the complete audio and video data of the target video is restored, the progress of the complete audio and video data during the pause can be continued to play. Of course, when the normal mode can be switched back, the progress of the played video clip can be continued to play.
[0077] S104: Based on the dot data and the audio and video synchronization data, determine the current short broadcast audio segment to be played and its corresponding current video segment to be played from the various short broadcast audio segments and video segments to be played in sequence.
[0078] It should be noted that in the embodiment of the present application, the short broadcast audio segment refers to the short broadcast audio segment in the short broadcast audio data of the target video. The video segment refers to each video segment divided by the dot data in the complete video data of the target video.
[0079] The short play audio clip to be played can be a short play audio clip that has not been played after the target video is requested this time. Of course, considering that the user may have played the target video before, and may have played some short play audio clips in the short play mode at that time, the short play audio clip to be played can also refer to the short play audio clip that has not been played since the target video started playing. Similarly, the video clip to be played can be a short play audio that has not been played after the target video is requested this time. Specifically, it can refer to being played in both normal mode and short play mode, or it can simply refer to being not played in short play mode, to avoid users from watching repeatedly. It is configured according to needs.
[0080] Optionally, the short broadcast audio stream may be loaded first. Since both the dot data and the audio and video synchronization data may be classified as short broadcast synchronization script data, the short broadcast synchronization script data may be loaded, and then the short broadcast synchronization script data may be parsed to obtain the dot data and the audio and video synchronization data.
[0081] Since the video clips are not continuous in the complete video, they need to be played in sequence. In order to ensure the continuity of the plot, each video clip to be played and each short audio clip to be played need to be played in sequence.
[0082] It should be noted that if the short broadcast audio data is a complete audio, you only need to play it all the time to play each short broadcast audio segment in order. If the short broadcast audio data consists of multiple independent short broadcast audio segments, the playback order of each short broadcast audio segment can be set in advance. For video segments, the order of the video segments can be determined according to their position in the complete video data or the corresponding timestamp.
[0083] Optionally, in another embodiment of the present application, a specific implementation of step S104 is as follows: Figure 2 As shown, including:
[0084] S201: Determine the short broadcast audio segment currently being played as the short broadcast audio segment currently to be played.
[0085] Among them, each short broadcast audio segment in the short broadcast audio data is played in sequence.
[0086] Since the short broadcast audio segments are played in sequence and continuously, while the video segments are not continuous in the complete video data, when a short broadcast audio segment is played, the next short broadcast audio segment will be played naturally, and what is needed is to determine the corresponding video segment based on the next short broadcast audio segment to be played. Therefore, in the embodiment of the present application, the current short broadcast audio segment to be played is first determined, and then the current video segment to be played corresponding to the current short broadcast audio segment to be played is determined.
[0087] It should be noted that in the embodiment of the present application, after requesting to play the target video, when switching to the short broadcast mode for the first time, the short broadcast audio data is continuously played from the starting position until the short broadcast is played or switched back to the normal mode. For example, if the short broadcast audio data is a complete audio data, the short broadcast audio data is played from the 0th minute, and each short broadcast audio segment will be played in sequence. If there are multiple independent short broadcast audio segments, they will also be played in sequence and uninterruptedly. Therefore, after playing a short broadcast audio segment, a short broadcast audio segment will be played immediately. At this time, the played short broadcast audio segment is determined as the current short broadcast audio segment to be played, so as to match the corresponding video segment for playback.
[0088] Optionally, when the user switches back to the normal mode, the currently played short broadcast audio clip can be recorded and set to be played, so that when the user switches to the short broadcast mode again, the short broadcast audio clip can be played again. In addition, the progress of playing the short broadcast audio clip can be recorded, so that the playback can be continued based on the playback progress. At this time, the progress of the corresponding video clip needs to be adjusted synchronously according to the progress to avoid the user watching repeated content.
[0089] Of course, since the duration of short broadcast audio data is relatively short and the user can manually adjust the progress, it is also possible to play the short broadcast audio clip from the beginning when switching to the short broadcast mode again, or play the short broadcast audio data from the beginning, that is, when switching back to the normal mode, set the status of all short broadcast audio clips to be played, thereby reducing the complexity of the processing logic to a certain extent.
[0090] S202: Based on the audio and video synchronization data, determine from the dot data a timestamp range corresponding to the timestamp of the short audio segment to be played.
[0091] S203: Determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played corresponding to the current short-broadcast audio segment to be played.
[0092] Optionally, in another embodiment of the present application, a specific implementation of step S104 is as follows: Figure 3 As shown, including:
[0093] S301, determining whether it is the first time to play the short broadcast audio after receiving the short broadcast mode switching instruction.
[0094] It should be noted that in order to avoid playing the content that has been watched in the normal mode to the user, in the embodiment of the present application, when playing in the short broadcast mode, it is also necessary to consider the viewing progress in the normal mode. Therefore, it is necessary to first determine whether the current mode has just been switched from the normal mode to the short broadcast mode, that is, to determine whether the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction. If it is determined that the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction, it is necessary to first determine the video clip to be played based on the progress of the playback, so step S302 is executed at this time. If it is determined that the short broadcast audio is not currently being played for the first time after receiving the short broadcast mode switching instruction, that is, after the previous video clip and audio clip are played, the next video clip and audio clip are then determined. At this time, the playback order of the audio clip can be directly determined, so step S305 is executed at this time.
[0095] S302: Find out a timestamp range in the dot data that is closest to the timestamp corresponding to the current playback progress of the complete video data.
[0096] Optionally, when a timestamp is within a timestamp range, the timestamp is closest to the timestamp range, and the time interval between the timestamp and the timestamp range can be considered to be 0. When the timestamp is not within the timestamp range, the timestamp range closest to the timestamp corresponding to the current playback progress can be determined based on the time interval between the timestamp and the lower limit of the timestamp range.
[0097] S303: Determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played.
[0098] S304: Based on the audio and video synchronization data, determine the short broadcast audio segment in the short broadcast audio data corresponding to the current video segment to be played as the current short broadcast audio segment to be played.
[0099] S305: Determine the short broadcast audio segment currently being played as the short broadcast audio segment currently to be played.
[0100] It should be noted that the specific implementation of steps S305 to S307 may also refer to the implementation of steps S201 to S203 accordingly, and will not be repeated here.
[0101] S306: Based on the audio and video synchronization data, determine from the dot data a timestamp range corresponding to the timestamp of the short broadcast audio segment to be played.
[0102] S307: Determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played corresponding to the current short broadcast audio segment to be played.
[0103] S105: Synchronously play the short audio segment to be played and its corresponding video segment to be played.
[0104] Since the short broadcast audio segment is independent of the video data of the target video, in order to ensure that the audio content is consistent with the playback picture, it is necessary to synchronously play the current short broadcast audio segment to be played and its corresponding current video segment to be played.
[0105] Specifically, Figure 4 As shown, a specific implementation method of step S105 includes:
[0106] S401, calculating the timestamp offset between the current short-broadcast audio segment to be played and the current video segment to be played.
[0107] Since the short audio clip to be played is independent of the complete video data of the target video, and the video clip to be played is a part of the complete video data and is not independent, the timestamps of the two are usually inconsistent. If you play directly by the timestamp, the sound and the picture will be inconsistent. Therefore, it is necessary to calculate the offset of the timestamps of the two based on the timestamps of the two. For example, Figure 5 As shown, the timestamp of video segment A starts from 5.00, while the audio segment starts from 0.00, so the offset between the timestamps is offset = 5.00. Primer needs to calculate the offset between the two, and then play the current short audio segment to be played and the current video segment to be played based on the timestamp offset to achieve synchronous playback of the two.
[0108] S402: Play the short audio segment to be played and the video segment to be played based on the timestamp offset.
[0109] S106: After the current video segment to be played is played, determine whether there is another video segment to be played.
[0110] It should be noted that in the short broadcast mode, whenever the current video segment to be played is played, it is determined whether there is a video segment to be played to determine whether to obtain the next video segment to be played for playback. Therefore, if it is determined that there is a video segment to be played, the process returns to step S104. If it is determined that there is no video segment to be played, step S107 is executed. Of course, this is one of the optional methods, and it can also be determined whether the short broadcast audio data has been played. Because the short broadcast audio segment corresponds to the video segment one by one, when determining whether the short broadcast audio data has been played, it can be determined whether there is a video segment to be played.
[0111] S107: Determine that all video clips have been played.
[0112] The video playback method provided by the embodiment of the present application obtains the complete audio and video data of the target video and the short broadcast data of the target video when requesting to play the target video. Among them, the complete audio and video data includes synchronized complete video data and complete audio data, and the short broadcast data includes short broadcast audio data, dot data and audio and video synchronization data. The dot data includes data for indicating each video segment divided in the complete video data, so as to realize logically dividing the long video into multiple short videos. The audio and video synchronization data includes the correspondence between the short broadcast audio segment in the short broadcast audio data and the video segment in the complete video data, so that the corresponding audio segment and video segment are played synchronously. Then, the complete audio and video data of the target video is played. When the short broadcast mode switching instruction is received, the complete audio and video data of the target video is paused. Based on the dot data and the audio and video synchronization data, the current short broadcast audio segment to be played and its corresponding current video segment to be played are determined in sequence from each short broadcast audio segment and each video segment to be played, and the current short broadcast audio segment to be played and its corresponding current video segment to be played are played synchronously. When the current video clip to be played is finished, the process returns to determine the new current short-broadcast audio clip to be played and its corresponding current video clip to be played, until there is no video clip to be played, thereby effectively shortening the long time while ensuring the continuity of the plot. And when the short-broadcast mode is exited, the complete audio and video data of the target video is restored, so when the user needs the original video plot, there is no need to exit and search for the original complete video to play.
[0113] Another embodiment of the present application provides a video playback device, such as Figure 6 As shown, including:
[0114] The acquisition unit 601 is used to acquire the complete audio and video data of the target video and the short broadcast data of the target video when a request is made to play the target video.
[0115] The complete audio and video data includes synchronized complete video data and complete audio data. The short broadcast data includes short broadcast audio data, dot data and audio and video synchronization data. The dot data includes data for indicating each video segment divided in the complete video data. The audio and video synchronization data includes the correspondence between the short broadcast audio segment in the short broadcast audio data and the video segment in the complete video data.
[0116] The conventional playback unit 602 is used to play the complete audio and video data of the target video.
[0117] The pause unit 603 is used to pause playing the complete audio and video data of the target video when receiving a short broadcast mode switching instruction.
[0118] When the short broadcast mode is exited, the complete audio and video data of the target video is resumed.
[0119] The segment determination unit 604 is used to determine the current short broadcast audio segment to be played and its corresponding current video segment to be played from the short broadcast audio segments and video segments to be played in sequence based on the dot data and the audio and video synchronization data.
[0120] The short broadcast playing unit 605 is used to synchronously play the short broadcast audio segment currently to be played and its corresponding video segment currently to be played.
[0121] When the short broadcast playing unit finishes playing the current video segment to be played, it returns to the segment determination unit until there is no video segment to be played.
[0122] Optionally, in a video playback device provided in another embodiment of the present application, the segment determination unit includes:
[0123] The first audio determination unit is used to determine the short broadcast audio segment currently being played as the short broadcast audio segment currently to be played.
[0124] Among them, each short broadcast audio segment in the short broadcast audio data is played in sequence.
[0125] The first search unit is used to determine, based on the audio and video synchronization data, a timestamp range corresponding to the timestamp of the short broadcast audio segment to be played from the dot data.
[0126] The first video determination unit is used to determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played corresponding to the current short broadcast audio segment to be played.
[0127] Optionally, the video playback device provided in another embodiment of the present application further includes:
[0128] The judging unit is used to judge whether it is the first time to play the short broadcast audio after receiving the short broadcast mode switching instruction.
[0129] If it is determined that the short broadcast audio is not being played for the first time after receiving the short broadcast mode switching instruction, the first audio determination unit determines the short broadcast audio segment currently being played as the short broadcast audio segment to be played.
[0130] The second search unit is used to determine that the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction, and to search for a timestamp range in the dot data that is closest to the timestamp corresponding to the current playback progress of the complete video data.
[0131] The second video determination unit is used to determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played.
[0132] The second audio determination unit is used to determine the short broadcast audio segment corresponding to the current video segment to be played in the short broadcast audio data as the current short broadcast audio segment to be played based on the audio and video synchronization data.
[0133] Optionally, in a video playback device provided in another embodiment of the present application, the short broadcast playback unit includes:
[0134] The calculation unit is used to calculate the timestamp offset between the short audio segment to be played and the video segment to be played.
[0135] The synchronous playing unit is used to play the short audio segment to be played and the video segment to be played based on the timestamp offset.
[0136] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the corresponding steps in the above method embodiments, which will not be repeated here.
[0137] Another embodiment of the present application provides an electronic device, such as Figure 7 As shown, including:
[0138] Memory 701 and processor 702 .
[0139] The memory 701 is used to store programs.
[0140] The processor 702 is used to execute the program stored in the memory 701. When the program is executed, it is specifically used to implement the video playback method provided by any one of the above embodiments.
[0141] Another embodiment of the present application provides a computer storage medium for storing a computer program. When the computer program is executed, it is used to implement the video playback method provided in any of the above embodiments.
[0142] Computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0143] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0144] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A video playback method, characterized in that: include: When requesting to play a target video, the complete audio and video data of the target video and the short broadcast data of the target video are obtained; wherein the complete audio and video data include synchronized complete video data and complete audio data; the short broadcast data include short broadcast audio data, dot data and audio and video synchronization data; the dot data include data for indicating each video segment divided in the complete video data; the audio and video synchronization data include the correspondence between the short broadcast audio segment in the short broadcast audio data and the video segment in the complete video data; Play the complete audio and video data of the target video; When a short broadcast mode switching instruction is received, the playing of the complete audio and video data of the target video is paused; wherein, when the short broadcast mode is exited, the playing of the complete audio and video data of the target video is resumed; Based on the dot data and the audio and video synchronization data, determine the current short broadcast audio segment to be played and its corresponding current video segment to be played from each of the short broadcast audio segments and each of the video segments to be played in sequence; Synchronously playing the short audio segment to be played and its corresponding video segment to be played; When the current video segment to be played is finished, returning to the step of determining the current short broadcast audio segment to be played and its corresponding current video segment to be played from each of the short broadcast audio segments to be played and each of the video segments to be played in sequence based on the dot data and the audio and video synchronization data, until there is no video segment to be played; The method of determining the current short broadcast audio segment to be played and its corresponding current video segment to be played from each of the short broadcast audio segments and each of the video segments to be played in sequence based on the dot data and the audio and video synchronization data includes: The short broadcast audio segment currently being played is determined as the short broadcast audio segment currently to be played; wherein each of the short broadcast audio segments in the short broadcast audio data is played in sequence; Based on the audio and video synchronization data, determining from the dot data a timestamp range corresponding to the timestamp of the short broadcast audio segment to be played; The video segment in the complete video data corresponding to the found timestamp range is determined as the current video segment to be played corresponding to the current short-broadcast audio segment to be played.
2. The method according to claim 1, characterized in that Before determining the currently played short broadcast audio segment as the currently played short broadcast audio segment to be played, the method further includes: Determine whether the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction; If it is determined that the short broadcast audio is not being played for the first time after receiving the short broadcast mode switching instruction, determining the short broadcast audio segment currently being played as the short broadcast audio segment currently to be played; If it is determined that the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction, then finding out the timestamp range in the dot data that is closest to the timestamp corresponding to the current playback progress of the complete video data; Determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played; Based on the audio and video synchronization data, the short broadcast audio segment in the short broadcast audio data corresponding to the current video segment to be played is determined as the current short broadcast audio segment to be played.
3. The method according to claim 1, characterized in that The synchronously playing the short audio segment to be played and its corresponding video segment to be played, comprises: Calculate the timestamp offset between the short audio segment to be played and the video segment to be played; The short audio segment to be played currently and the video segment to be played currently are played based on the timestamp offset.
4. A video playback device, characterized in that: include: An acquisition unit is used to acquire the complete audio and video data of the target video and the short broadcast data of the target video when requesting to play the target video; wherein the complete audio and video data includes synchronized complete video data and complete audio data; the short broadcast data includes short broadcast audio data, dot data and audio and video synchronization data; the dot data includes data for indicating each video segment divided in the complete video data; the audio and video synchronization data includes the corresponding relationship between the short broadcast audio segment in the short broadcast audio data and the video segment in the complete video data; A conventional playback unit, used to play the complete audio and video data of the target video; A pause unit, configured to pause the playing of the complete audio and video data of the target video when receiving a short broadcast mode switching instruction; wherein, when exiting the short broadcast mode, the playing of the complete audio and video data of the target video is resumed; A segment determination unit, configured to determine the current short broadcast audio segment to be played and its corresponding current video segment to be played from each of the short broadcast audio segments to be played and each of the video segments to be played in sequence based on the dot data and the audio and video synchronization data; A short broadcast playing unit, used for synchronously playing the short broadcast audio segment to be played and its corresponding video segment to be played; wherein, after playing the video segment to be played, the short broadcast playing unit returns to the segment determination unit until there is no video segment to be played; Wherein, the fragment determination unit includes: The first audio determination unit is used to determine the short broadcast audio segment currently being played as the short broadcast audio segment currently to be played; wherein each of the short broadcast audio segments in the short broadcast audio data is played in sequence; A first search unit, configured to determine, based on the audio and video synchronization data, from the dot data a timestamp range corresponding to the timestamp of the short-broadcast audio segment to be played; The first video determination unit is used to determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played corresponding to the current short broadcast audio segment to be played.
5. The device according to claim 4, characterized in that Also includes: A judging unit is used to judge whether the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction; wherein, if it is judged that the short broadcast audio is not currently being played for the first time after receiving the short broadcast mode switching instruction, the first audio determination unit executes the step of determining the short broadcast audio segment currently being played as the short broadcast audio segment currently to be played; The second search unit is used to determine that the short broadcast audio is currently being played for the first time after receiving the short broadcast mode switching instruction, and to search for a timestamp range in the dot data that is closest to the timestamp corresponding to the current playback progress of the complete video data; A second video determination unit, configured to determine the video segment in the complete video data corresponding to the found timestamp range as the current video segment to be played; The second audio determination unit is used to determine the short broadcast audio segment corresponding to the current video segment to be played in the short broadcast audio data as the current short broadcast audio segment to be played based on the audio and video synchronization data.
6. The device according to claim 4, characterized in that The short broadcast playing unit comprises: A calculation unit, used for calculating the timestamp offset between the short audio segment to be played and the video segment to be played; A synchronous playing unit is used to play the short audio segment to be played and the video segment to be played based on the timestamp offset.
7. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the video playback method as described in any one of claims 1 to 3.
8. A computer storage medium, characterized in that: Used to store a computer program, which, when executed, is used to implement the video playback method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Audio and video coding method and playing method for shortening waiting time before on demand playing
CN102170453A
Audio and video synchronous playing method and terminal
CN106658133A
Video music matching method and device, electronic equipment and computer readable medium
CN110677711A
Courseware making and editing method of multi-source content and server
CN111581938A
Competition video editing method and system and computer readable storage medium
CN111770359A
