CN116095417B - Video on demand method, device, equipment and storage medium - Google Patents
Video on demand method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN116095417B CN116095417B CN202310017725.0A CN202310017725A CN116095417B CN 116095417 B CN116095417 B CN 116095417B CN 202310017725 A CN202310017725 A CN 202310017725A CN 116095417 B CN116095417 B CN 116095417B
- Authority
- CN
- China
- Prior art keywords
- video
- segment
- target
- terminal
- original
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/472—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
- H04N21/47202—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/239—Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
- H04N21/2393—Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The invention provides a video-on-demand method, a device, equipment and a storage medium, which comprise the steps that a server can timely determine a target video set containing corresponding video fragments when receiving a video-on-demand request, accurately judge whether the video fragments contained in the target video set are complete or not by comparing the duration of an original video corresponding to the video-on-demand request with the duration of the target video set, and can rapidly intercept the video fragments lacking in the target video set from the original video and add the video fragments to the target video set when determining that the video fragments contained in the target video set are incomplete, so that the target video set can contain the complete video fragments of the original video, and the terminal can display complete video content by sequentially playing the video fragments in the target video set.
Description
Technical Field
The present disclosure relates to the technical field of video data processing, and in particular, to a video on demand method, apparatus, device, and storage medium.
Background
Existing video players have limitations on the size of the video played, and therefore often require converting a larger video into a plurality of smaller video clips, which the video player presents the complete video content by playing in turn. However, during both the generation and subsequent management of the video clips, the video clips may be omitted, resulting in a failure to properly use the video clips to present the complete video content.
Disclosure of Invention
The present disclosure provides a video-on-demand method, apparatus, device, and storage medium.
According to a first aspect of the present disclosure, there is provided a video-on-demand method, including:
receiving a video-on-demand request sent by a terminal, and determining a target video set corresponding to the video-on-demand request from a video database, wherein the target video set comprises a plurality of continuous video fragments in an original video;
Calculating the total playing time length of the target video set based on the playing time length of each video segment in the target video set, calculating the original playing time length of the original video based on the starting time stamp and the ending time stamp of the original video, and comparing the total playing time length with the original playing time length;
determining that the number of video clips in the target video set is complete in response to the total playing time being equal to the original playing time, and returning the total playing time to the terminal so as to enable the user to select the initial playing time in the total playing time, or
In response to the total playing time length not being equal to the original playing time length, determining that the number of video clips in the target video set is incomplete, intercepting video clips lacking in the target video set from the original video, adding the video clips into the target video set, calculating the total playing time length of the target video set again based on the playing time length of each video clip in the target video set, and returning the total playing time length to the terminal;
Receiving initial playing time returned by the terminal, and determining initial video clips corresponding to the initial playing time from the target video set, wherein the initial playing time is selected from total playing time displayed by a user at the terminal;
And sequentially sending the video streams of the initial video segment and other video segments after the initial video segment to the terminal, so that the terminal displays the corresponding video content.
In some embodiments of the present disclosure, the plurality of consecutive video segments in the original video are obtained by:
Playing the original video and starting recording the original video;
when the time length of the currently recorded video clip reaches the preset time length or the capacity of the currently recorded video clip reaches the preset capacity, storing the currently recorded video clip and starting to record the next video clip;
and selecting one key video frame from a plurality of video frames corresponding to the video clips in the original video for marking every time one video clip is saved, and recording the key frame number of the key video frame in the header information of the video clip.
In some embodiments of the present disclosure, capturing video clips from an original video that are missing in a target video set and adding to the target video set, comprising:
Analyzing a key frame number from the head information of each video segment in the target video set, and determining a plurality of marked key video frames from the original video;
matching the key frame number with the key video frame, and determining a target key video frame which is not matched with the corresponding key frame number from a plurality of key video frames;
determining a previous key video frame and a next key video frame adjacent to the target key video frame;
Determining a first video segment corresponding to a previous key video frame and a second video segment corresponding to a next key video frame from a plurality of video segments contained in a target video set;
based on the ending time stamp of the first video segment and the starting time stamp of the second video segment, video segments lacking in the target video set are intercepted from the original video and added to the target video set.
In some embodiments of the present disclosure, sequentially transmitting video streams of a start video clip and other video clips following the start video clip to a terminal includes:
Forming a video queue to be transmitted according to the time sequence of the video streams of the initial video segment and other video segments behind the initial video segment;
Transmitting the data stream of the (n+i) th video segment to the terminal according to the time sequence from the video queue, and loading the header information of the (n+i+1) th video segment during the transmission of the video stream of the (n+i) th video segment, wherein N is the sequence number of the initial video segment, and i is an integer not less than 0;
determining whether the (n+i+1) th video clip is damaged based on the header information of the (n+i+1) th video clip;
in response to determining that the (n+i+1) th video clip is not damaged, continuing to transmit the data stream of the (n+i+1) th video clip to the terminal after the video stream transmission of the (n+i) th video clip is completed.
In some embodiments of the present disclosure, the video on demand method further comprises:
And transmitting file damage prompt information to the terminal in response to the fact that the (N+i+1) th video clip is damaged.
In some embodiments of the present disclosure, the video on demand method further comprises:
in response to determining that the (n+i+1) th video clip is damaged, sending a wait for repair request to the terminal;
In response to receiving a confirmation message of the terminal for waiting for a repair request, loading header information of an (n+i+2) th video segment, and determining whether the (n+i+2) th video segment is damaged or not based on the header information of the (n+i+2) th video segment, wherein the confirmation message is generated by the terminal based on a confirmation operation of a user for waiting for the repair request;
In response to determining that the (n+i+2) th video segment is not corrupted, deleting the (n+i+1) th video segment, intercepting a new (n+i+1) th video segment from the original video based on the ending timestamp of the (n+i) th video segment and the starting timestamp of the (n+i+2) th video segment, and transmitting the data stream of the new (n+i) th video segment to the terminal.
In some embodiments of the present disclosure, the video on demand method further comprises:
in response to determining that the (n+i+1) th video clip is damaged, sending a wait for repair request to the terminal;
And in response to receiving a confirmation message of the terminal for waiting for the repair request, deleting the (N+i+1) th video fragment under the condition that the (N+i+1) th video fragment is determined to be the last video fragment in the video queue, intercepting a new (N+i+1) th video fragment from the original video based on the ending time stamp of the (N+i) th video fragment, and transmitting the data stream of the new (N+i) th video fragment to the terminal.
According to a second aspect of the present disclosure, there is provided a video-on-demand apparatus, including a target video determining module, a duration comparing module, a total time feedback module, a start video determining module, and a video transmitting module;
the target video determining module is used for receiving the video-on-demand request sent by the terminal, and determining a target video set corresponding to the video-on-demand request from the video database, wherein the target video set comprises a plurality of continuous video fragments in an original video;
The time length comparison module is used for calculating the total playing time length of the target video set based on the playing time length of each video segment in the target video set, calculating the original playing time length of the original video based on the starting time stamp and the ending time stamp of the original video, and comparing the total playing time length with the original playing time length;
The total time feedback module is used for determining that the number of video clips in the target video set is complete in response to the total playing time length being equal to the original playing time length, and returning the total playing time length to the terminal so as to enable a user to select initial playing time in the total playing time length;
The initial video determining module is used for receiving initial playing time returned by the terminal, and determining initial video fragments corresponding to the initial playing time from the target video set, wherein the initial playing time is selected from total playing time displayed by the terminal by a user;
The video sending module is used for sequentially sending the video streams of the initial video segment and other video segments after the initial video segment to the terminal, so that the terminal displays corresponding video content.
In some embodiments of the present disclosure, the video on demand apparatus further includes a video clip obtaining module that obtains a plurality of consecutive video clips in the original video by:
Playing the original video and starting recording the original video;
when the time length of the currently recorded video clip reaches the preset time length or the capacity of the currently recorded video clip reaches the preset capacity, storing the currently recorded video clip and starting to record the next video clip;
and selecting one key video frame from a plurality of video frames corresponding to the video clips in the original video for marking every time one video clip is saved, and recording the key frame number of the key video frame in the header information of the video clip.
In some embodiments of the present disclosure, the total time feedback module, when used to intercept video segments missing in the target video set from the original video and add to the target video set, is specifically used to:
Analyzing a key frame number from the head information of each video segment in the target video set, and determining a plurality of marked key video frames from the original video;
matching the key frame number with the key video frame, and determining a target key video frame which is not matched with the corresponding key frame number from a plurality of key video frames;
determining a previous key video frame and a next key video frame adjacent to the target key video frame;
Determining a first video segment corresponding to a previous key video frame and a second video segment corresponding to a next key video frame from a plurality of video segments contained in a target video set;
based on the ending time stamp of the first video segment and the starting time stamp of the second video segment, video segments lacking in the target video set are intercepted from the original video and added to the target video set.
In some embodiments of the present disclosure, the video sending module, when configured to send the video streams of the initial video segment and other video segments that follow the initial video segment to the terminal in sequence, is specifically configured to:
Forming a video queue to be transmitted according to the time sequence of the video streams of the initial video segment and other video segments behind the initial video segment;
Transmitting the data stream of the (n+i) th video segment to the terminal according to the time sequence from the video queue, and loading the header information of the (n+i+1) th video segment during the transmission of the video stream of the (n+i) th video segment, wherein N is the sequence number of the initial video segment, and i is an integer not less than 0;
determining whether the (n+i+1) th video clip is damaged based on the header information of the (n+i+1) th video clip;
in response to determining that the (n+i+1) th video clip is not damaged, continuing to transmit the data stream of the (n+i+1) th video clip to the terminal after the video stream transmission of the (n+i) th video clip is completed.
In some embodiments of the present disclosure, the video transmission module is further configured to:
And transmitting file damage prompt information to the terminal in response to the fact that the (N+i+1) th video clip is damaged.
In some embodiments of the present disclosure, the video transmission module is further configured to:
in response to determining that the (n+i+1) th video clip is damaged, sending a wait for repair request to the terminal;
In response to receiving a confirmation message of the terminal for waiting for a repair request, loading header information of an (n+i+2) th video segment, and determining whether the (n+i+2) th video segment is damaged or not based on the header information of the (n+i+2) th video segment, wherein the confirmation message is generated by the terminal based on a confirmation operation of a user for waiting for the repair request;
In response to determining that the (n+i+2) th video segment is not corrupted, deleting the (n+i+1) th video segment, intercepting a new (n+i+1) th video segment from the original video based on the ending timestamp of the (n+i) th video segment and the starting timestamp of the (n+i+2) th video segment, and transmitting the data stream of the new (n+i) th video segment to the terminal.
In some embodiments of the present disclosure, the video transmission module is further configured to:
in response to determining that the (n+i+1) th video clip is damaged, sending a wait for repair request to the terminal;
And in response to receiving a confirmation message of the terminal for waiting for the repair request, deleting the (N+i+1) th video fragment under the condition that the (N+i+1) th video fragment is determined to be the last video fragment in the video queue, intercepting a new (N+i+1) th video fragment from the original video based on the ending time stamp of the (N+i) th video fragment, and transmitting the data stream of the new (N+i) th video fragment to the terminal.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the video-on-demand method provided in the first aspect above.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the video-on-demand method provided in the above first aspect.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
The beneficial effects that this disclosure provided technical scheme brought are:
According to the video-on-demand method, when the video-on-demand request is received, the server can timely determine the target video set containing the corresponding video fragments, accurately judge whether the video fragments contained in the target video set are complete or not by comparing the time length of the original video corresponding to the video-on-demand request with the time length of the target video set, and can rapidly intercept the video fragments lacking in the target video set from the original video when determining that the video fragments contained in the target video set are incomplete, so that the terminal can display complete video content by sequentially playing the video fragments in the target video set.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flow chart of a video-on-demand method according to an embodiment of the disclosure;
FIG. 2 is a flow chart of a method for capturing a plurality of consecutive video clips according to an embodiment of the present disclosure;
Fig. 3 is a schematic flow chart of a video on demand device according to an embodiment of the disclosure;
fig. 4 is a schematic flow chart of another video on demand apparatus according to an embodiment of the disclosure;
Fig. 5 shows a schematic block diagram of an example electronic device that may be used to implement the video-on-demand method provided by embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Existing video players have limitations on the size of the video played, and therefore often require converting a larger video into a plurality of smaller video clips, which the video player presents the complete video content by playing in turn. However, during both the generation and subsequent management of the video clips, the video clips may be omitted, resulting in a failure to properly use the video clips to present the complete video content.
The video on demand method, device, equipment and storage medium provided by the embodiments of the present disclosure aim to solve at least one of the above technical problems in the prior art.
Fig. 1 shows a flow chart of a video-on-demand method provided by an embodiment of the present disclosure, where an execution subject of the video-on-demand method is a server, as shown in fig. 1, the method may mainly include the following steps:
S110, receiving a video-on-demand request sent by a terminal, and determining a target video set corresponding to the video-on-demand request from a video database.
The target video set comprises a plurality of continuous video segments in an original video, and in particular, the plurality of continuous video segments can be obtained by performing segmented recording on the original video. The specific process of obtaining a plurality of consecutive video clips will be further described herein.
The method comprises the steps that a player is deployed in a terminal, the terminal displays a video-on-demand interface by running the player, and then a video-on-demand request is generated and sent to a server in response to video selection operation of a user in the video-on-demand interface. Here, the video on demand request includes identity information of an original video desired to be requested by the user, and the server may parse the identity information from the video on demand request, and determine a target video set corresponding to the video on demand request from the video database based on the identity information.
S120, calculating the total playing time length of the target video set based on the playing time length of each video segment in the target video set, calculating the original playing time length of the original video based on the starting time stamp and the ending time stamp of the original video, and comparing the total playing time length with the original playing time length.
Here, the total playing time length of the target video set refers to the sum of the playing time lengths of the video clips in the target video set. It should be noted that, each video clip in the target video set has header information, and the header information may include information such as a start time stamp, an end time stamp, and a playing duration of the video clip. In S120, header information of each video clip in the target video set may be parsed to obtain a play duration of each video clip, and the play durations of the video clips may be added to obtain a total play duration of the target video set.
It can be understood that if the number of video clips in the target video set is complete, the total playing time period of the target video set should be equal to the original playing time period of the original video, and if the number of video clips in the target video set is incomplete, the total playing time period of the target video set should be less than the original playing time period of the original video. Here, it may be determined to perform S130 or S140 based on the comparison result of the total play duration and the original play duration.
S130, determining that the number of video clips in the target video set is complete in response to the total playing time length being equal to the original playing time length, and returning the total playing time length to the terminal.
After receiving the total playing time, the terminal can display the total playing time according to a preset form, so that a user can select the initial playing time from the total playing time. For example, the terminal displays the total playing time length as 1 hour in the form of a progress bar, and the user can select the 3 rd minute 20 second as the initial playing time. Specifically, the terminal may determine the start play time from the total play time length in response to a time selection operation of the user.
S140, determining that the number of video clips in the target video set is incomplete in response to the total playing time length not being equal to the original playing time length, intercepting video clips which are lack in the target video set from the original video, adding the video clips into the target video set, calculating the total playing time length of the target video set again based on the playing time length of each video clip in the target video set, and returning the total playing time length to the terminal.
When the number of video clips in the target video set is determined to be incomplete, the video clips in the target video set can be compared with the original video, so that the video clips which are lack in the target video set are determined, then the video clips which are lack in the target video set are intercepted in the original video and added into the target video set, and the total playing time length of the target video set is calculated again based on the playing time length of each video clip in the target video set and returned to the terminal. After receiving the total playing time, the terminal can display the total playing time according to a preset form, so that a user can select the initial playing time from the total playing time. For example, the terminal displays the total playing time length as 1 hour in the form of a progress bar, and the user can select the 3 rd minute 20 second as the initial playing time. Specifically, the terminal may determine the start play time from the total play time length in response to a time selection operation of the user. It should be noted that, a specific process of determining the video segments missing in the target video set will be described in detail later.
And S150, receiving the initial playing time returned by the terminal, and determining an initial video clip corresponding to the initial playing time from the target video set.
The terminal may determine the start play time from the total play time in response to a user's time selection operation, and then start the play time, so that the server receives the start play time. The server may determine a video clip containing the start play time from the target video set, and take the video clip containing the start play time as the start video clip.
And S160, sequentially sending the video streams of the initial video clip and other video clips after the initial video clip to the terminal.
After the start video clip is determined, a video stream in the start video clip after the start play time may be transmitted to the terminal. For other video clips after the initial video clip, the video clips can be sequentially sent to the terminal according to the time sequence of each video clip, and the terminal sequentially receives the video streams of the initial video clip and other video clips after the initial video clip sent by the service and displays corresponding video content.
According to the video-on-demand method, when the video-on-demand request is received, the server can timely determine the target video set containing the corresponding video fragments, accurately judge whether the video fragments contained in the target video set are complete or not by comparing the time length of the original video corresponding to the video-on-demand request with the time length of the target video set, and can rapidly intercept the video fragments lacking in the target video set from the original video when determining that the video fragments contained in the target video set are incomplete, so that the terminal can display complete video content by sequentially playing the video fragments in the target video set.
Fig. 2 is a schematic flow chart of capturing a plurality of continuous video clips according to an embodiment of the disclosure, and as shown in fig. 2, the flow may mainly include the following steps:
And S210, playing the original video and starting recording the original video.
And S220, when the time length of the currently recorded video clip reaches the preset time length or the capacity of the currently recorded video clip reaches the preset capacity, storing the currently recorded video clip and starting to record the next video clip.
For example, the preset duration may be set to 10 seconds, one video clip may be obtained after each pair of original videos is recorded for 10 seconds, the 10 seconds of video clip is saved and the next video clip is started to be recorded, or the preset capacity may be set to 4G, and when the capacity of the recorded video clip reaches 4G, the 4G of video clip is saved and the next video clip is started to be recorded. And repeating the recording process to obtain a plurality of video clips of the original video.
And S230, selecting one key video frame from a plurality of video frames corresponding to the video clips in the original video to mark each video clip, and recording the key frame number of the key video frame in the header information of the video clip.
Here, the frame number of the selected key video frame may be determined according to actual design requirements. For example, a first video frame may be determined in a video clip, a video frame in the original video corresponding to the first video frame is marked as a key video frame, a key frame number of the key video frame is recorded in header information of the video clip, or an intermediate video frame may be determined in the video clip, a video frame in the original video corresponding to the intermediate video frame is marked as a key video frame, and a key frame number of the key video frame is recorded in header information of the video clip.
On the basis of the key frame numbers of the key video frames of the original video recorded in the head information records of the video clips, in S140, the key frame numbers can be resolved from the head information of each video clip in the target video set, a plurality of marked key video frames are determined from the original video, the key frame numbers and the key video frames are matched, the target key video frames which are not matched with the corresponding key frame numbers are determined from the key video frames, the previous key video frame and the next key video frame adjacent to the target key video frame are determined, the first video clip corresponding to the previous key video frame and the second video clip corresponding to the next key video frame are determined from the video clips contained in the target video set, and the video clips which are lack in the target video set are intercepted from the original video and added into the target video set on the basis of the end time stamp of the first video clip and the start time stamp of the second video clip.
It will be appreciated that if the number of video segments in the target video set is complete, then the key frame number in the header information of the video segments and the key video frames in the original video should be in one-to-one correspondence. If a certain key video frame in the original video is not matched with the corresponding key frame number, the video segment containing the key video frame is ensured to be contained in the target video set, and then the video segment containing the key video frame needs to be intercepted from the original video and added to the target video set. Specifically, in order to accurately intercept a required video segment, a key video frame that is not matched with a corresponding key frame number may be defined as a target key video frame, a previous key video frame and a next key video frame adjacent to the target key video frame are determined, a video segment in the target video set that includes the previous key video frame is defined as a first video segment, a video segment in the target video set that includes the next key video frame is defined as a second video segment, and then a video segment between the first video segment and the second video segment is a video segment that is missing in the target video set, where the missing video segment should include the target key video frame. On the basis, the ending time stamp of the first video segment can be used as a new starting time stamp, the starting time stamp of the second video segment can be used as a new ending time stamp, and the video segment is intercepted from the original video based on the new starting time stamp and the new ending time stamp, so that the video segment which is absent from the target video set is obtained.
Optionally, in S160, the server may form a video queue to be transmitted from the video stream of the starting video segment and the video streams of other video segments after the starting video segment in time sequence, transmit the data stream of the (n+i) -th video segment from the video queue to the terminal in time sequence, and load header information of the (n+i+1) -th video segment during the transmission of the video stream of the (n+i) -th video segment, determine whether the (n+i+1) -th video segment is damaged based on the header information of the (n+i+1) -th video segment, and in response to determining that the (n+i+1) -th video segment is not damaged, continue transmitting the data stream of the (n+i+1) -th video segment to the terminal after the transmission of the video stream of the (n+i) -th video segment is completed. Here, N is a sequence number of the starting video clip, i is an integer not less than 0, and it is understood that when i is 0, the (n+i) th video clip represents the starting video clip.
Alternatively, if the (n+i+1) th video clip is damaged, the server may transmit a file damage hint information to the terminal in response to determining that the (n+i+1) th video clip is damaged. After receiving the file damage prompt information, the terminal can display corresponding text contents in the interface of the player, wherein the text contents are used for prompting the damaged video contents and temporarily failing to continue playing.
Alternatively, if the (n+i+1) th video clip is damaged, the server may transmit a wait repair request to the terminal in response to determining that the (n+i+1) th video clip is damaged. After receiving the request for waiting for repair, the terminal may display corresponding query content, where the query content is used to query the user that the user can wait for repair of the video file, if the user is willing to wait for repair of the video file, a confirmation operation (such as clicking a confirmation control) may be completed in the interface for the request for waiting for repair, and the terminal generates a confirmation message for the request for waiting for repair in response to the confirmation operation, and then sends the confirmation message to the server. The server responds to the received confirmation message of the terminal for waiting for the repair request, loads the head information of the (N+i+2) th video fragment, and determines whether the (N+i+2) th video fragment is damaged or not based on the head information of the (N+i+2) th video fragment.
It may be understood that the (n+i+2) th video clip is the next video clip of the (n+i+1) th video clip, if the (n+i+2) th video clip is not damaged, it is only necessary to repair the (n+i+1) th video clip, without consuming too much time, without seriously affecting the viewing experience of the user, specifically, the server deletes the (n+i+1) th video clip in response to determining that the (n+i+2) th video clip is not damaged, intercepts a new (n+i+1) th video clip from the original video based on the end timestamp of the (n+i) th video clip and the start timestamp of the (n+i+2) th video clip, and sends the data stream of the new (n+i) th video clip to the terminal. Here, the ending time stamp of the (n+i) th video clip is the starting time stamp of the (n+i+1) th video clip, the starting time stamp of the (n+i+2) th video clip is the ending time stamp of the (n+i+1) th video clip, and the video clip cut out based on the determined starting time stamp and ending time stamp is the new (n+i+1) th video clip.
Alternatively, if the (n+i+1) th video clip is damaged, the server may transmit a wait repair request to the terminal in response to determining that the (n+i+1) th video clip is damaged. After receiving the request for waiting for repair, the terminal may display corresponding query content, where the query content is used to query the user that the user can wait for repair of the video file, if the user is willing to wait for repair of the video file, a confirmation operation (such as clicking a confirmation control) may be completed in the interface for the request for waiting for repair, and the terminal generates a confirmation message for the request for waiting for repair in response to the confirmation operation, and then sends the confirmation message to the server. And the server responds to the received confirmation message of the terminal for waiting for the repair request, and deletes the (N+i+1) th video fragment under the condition that the (N+i+1) th video fragment is determined to be the last video fragment in the video queue, intercepts a new (N+i+1) th video fragment from the original video based on the ending time stamp of the (N+i) th video fragment, and sends the data stream of the new (N+i) th video fragment to the terminal.
Based on the same principle as the video on demand method described above, the embodiment of the present disclosure provides a video on demand device, and fig. 3 shows a schematic diagram of a video on demand device provided by the embodiment of the present disclosure, and as shown in fig. 3, the video on demand device 300 includes a target video determining module 310, a duration comparing module 320, a total time feedback module 330, a start video determining module 340, and a video transmitting module 350.
The target video determining module 310 is configured to receive a video-on-demand request sent by a terminal, and determine a target video set corresponding to the video-on-demand request from a video database, where the target video set includes a plurality of continuous video segments in an original video;
the duration comparison module 320 is configured to calculate a total playing duration of the target video set based on the playing duration of each video segment in the target video set, calculate an original playing duration of the original video based on the start timestamp and the end timestamp of the original video, and compare the total playing duration with the original playing duration;
The total time feedback module 330 is configured to determine that the number of video segments in the target video set is complete in response to the total playing time length being equal to the original playing time length, and return the total playing time length to the terminal so that the user can select the initial playing time in the total playing time length;
The initial video determining module 340 is configured to receive an initial playing time returned by the terminal, and determine an initial video segment corresponding to the initial playing time from the target video set, where the initial playing time is selected from total playing time displayed by the user at the terminal;
The video sending module 350 is configured to send the video streams of the initial video clip and other video clips after the initial video clip to the terminal in sequence, so that the terminal displays the corresponding video content.
The video on demand device provided by the disclosure can timely determine the target video set containing the corresponding video segments when receiving the video on demand request, accurately judge whether the video segments contained in the target video set are complete by comparing the duration of the original video corresponding to the video on demand request with the duration of the target video set, and rapidly intercept the video segments lacking in the target video set from the original video when determining that the video segments contained in the target video set are incomplete, so that the terminal can display complete video content by sequentially playing the video segments in the target video set.
Fig. 4 is a schematic diagram of another video on demand apparatus according to an embodiment of the present disclosure, where, as shown in fig. 4, the video on demand apparatus 300 further includes a video segment acquisition module 360, where the video segment acquisition module 360 obtains a plurality of consecutive video segments in an original video by:
Playing the original video and starting recording the original video;
when the time length of the currently recorded video clip reaches the preset time length or the capacity of the currently recorded video clip reaches the preset capacity, storing the currently recorded video clip and starting to record the next video clip;
and selecting one key video frame from a plurality of video frames corresponding to the video clips in the original video for marking every time one video clip is saved, and recording the key frame number of the key video frame in the header information of the video clip.
In some embodiments of the present disclosure, the total time feedback module 330, when used to intercept video segments missing in the target video set from the original video and add to the target video set, is specifically used to:
Analyzing a key frame number from the head information of each video segment in the target video set, and determining a plurality of marked key video frames from the original video;
matching the key frame number with the key video frame, and determining a target key video frame which is not matched with the corresponding key frame number from a plurality of key video frames;
determining a previous key video frame and a next key video frame adjacent to the target key video frame;
Determining a first video segment corresponding to a previous key video frame and a second video segment corresponding to a next key video frame from a plurality of video segments contained in a target video set;
based on the ending time stamp of the first video segment and the starting time stamp of the second video segment, video segments lacking in the target video set are intercepted from the original video and added to the target video set.
In some embodiments of the present disclosure, the video sending module 350, when configured to send the video streams of the initial video segment and other video segments that follow the initial video segment to the terminal sequentially, is specifically configured to:
Forming a video queue to be transmitted according to the time sequence of the video streams of the initial video segment and other video segments behind the initial video segment;
Transmitting the data stream of the (n+i) th video segment to the terminal according to the time sequence from the video queue, and loading the header information of the (n+i+1) th video segment during the transmission of the video stream of the (n+i) th video segment, wherein N is the sequence number of the initial video segment, and i is an integer not less than 0;
determining whether the (n+i+1) th video clip is damaged based on the header information of the (n+i+1) th video clip;
in response to determining that the (n+i+1) th video clip is not damaged, continuing to transmit the data stream of the (n+i+1) th video clip to the terminal after the video stream transmission of the (n+i) th video clip is completed.
In some embodiments of the present disclosure, the video transmission module 350 is further configured to:
And transmitting file damage prompt information to the terminal in response to the fact that the (N+i+1) th video clip is damaged.
In some embodiments of the present disclosure, the video transmission module 350 is further configured to:
in response to determining that the (n+i+1) th video clip is damaged, sending a wait for repair request to the terminal;
In response to receiving a confirmation message of the terminal for waiting for a repair request, loading header information of an (n+i+2) th video segment, and determining whether the (n+i+2) th video segment is damaged or not based on the header information of the (n+i+2) th video segment, wherein the confirmation message is generated by the terminal based on a confirmation operation of a user for waiting for the repair request;
In response to determining that the (n+i+2) th video segment is not corrupted, deleting the (n+i+1) th video segment, intercepting a new (n+i+1) th video segment from the original video based on the ending timestamp of the (n+i) th video segment and the starting timestamp of the (n+i+2) th video segment, and transmitting the data stream of the new (n+i) th video segment to the terminal.
In some embodiments of the present disclosure, the video transmission module 350 is further configured to:
in response to determining that the (n+i+1) th video clip is damaged, sending a wait for repair request to the terminal;
And in response to receiving a confirmation message of the terminal for waiting for the repair request, deleting the (N+i+1) th video fragment under the condition that the (N+i+1) th video fragment is determined to be the last video fragment in the video queue, intercepting a new (N+i+1) th video fragment from the original video based on the ending time stamp of the (N+i) th video fragment, and transmitting the data stream of the new (N+i) th video fragment to the terminal.
It can be understood that the above modules of the vod apparatus in the embodiments of the disclosure have functions of implementing the corresponding steps of the vod method. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules may be software and/or hardware, and each module may be implemented separately or may be implemented by integrating multiple modules. For the functional description of each module of the vod apparatus, reference may be specifically made to the corresponding description of the vod method, which is not repeated herein.
In the technical scheme of the disclosure, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user accord with the regulations of related laws and regulations, and the public order colloquial is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
FIG. 5 illustrates a schematic block diagram of an example electronic device that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the apparatus 500 includes a computing unit 501 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, ROM502, and RAM503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The various components in the device 500 are connected to an I/O interface 505, including an input unit 506, e.g., a keyboard, a mouse, etc., an output unit 507, e.g., various types of displays, speakers, etc., a storage unit 508, e.g., a magnetic disk, optical disk, etc., and a communication unit 509, e.g., a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as a video-on-demand method. For example, in some embodiments, the video-on-demand method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM502 and/or the communication unit 509. When the computer program is loaded into RAM503 and executed by computing unit 501, one or more steps of the video-on-demand method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the video-on-demand method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be a special or general purpose programmable processor, operable to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user, for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback), and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a Local Area Network (LAN), a Wide Area Network (WAN), and the Internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310017725.0A CN116095417B (en) | 2023-01-06 | 2023-01-06 | Video on demand method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310017725.0A CN116095417B (en) | 2023-01-06 | 2023-01-06 | Video on demand method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116095417A CN116095417A (en) | 2023-05-09 |
CN116095417B true CN116095417B (en) | 2025-05-13 |
Family
ID=86202013
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310017725.0A Active CN116095417B (en) | 2023-01-06 | 2023-01-06 | Video on demand method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116095417B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102210147A (en) * | 2008-11-12 | 2011-10-05 | 思科技术公司 | Processing of a video [aar] program having plural processed representations of a [aar] single video signal for reconstruction and output |
CN110913240A (en) * | 2019-12-02 | 2020-03-24 | 广州酷狗计算机科技有限公司 | Video interception method, device, server and computer readable storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018125590A1 (en) * | 2016-12-30 | 2018-07-05 | Tivo Solutions Inc. | Advanced trick-play modes for streaming video |
CN111309632B (en) * | 2020-03-20 | 2023-08-18 | 北京达佳互联信息技术有限公司 | Application program testing method and device, computer equipment and storage medium |
CN111342966B (en) * | 2020-05-22 | 2020-08-25 | 支付宝(杭州)信息技术有限公司 | A data storage method, data recovery method, device and equipment |
-
2023
- 2023-01-06 CN CN202310017725.0A patent/CN116095417B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102210147A (en) * | 2008-11-12 | 2011-10-05 | 思科技术公司 | Processing of a video [aar] program having plural processed representations of a [aar] single video signal for reconstruction and output |
CN110913240A (en) * | 2019-12-02 | 2020-03-24 | 广州酷狗计算机科技有限公司 | Video interception method, device, server and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN116095417A (en) | 2023-05-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112994980B (en) | Delay test methods, devices, electronic equipment and storage media | |
CN114223189B (en) | Duration statistics method, device, electronic device and computer readable medium | |
CN113542888B (en) | Video processing method and device, electronic equipment and storage medium | |
CN112738418A (en) | Video acquisition method, device and electronic device | |
CN113596488A (en) | Display method and device of live broadcast room, electronic equipment and storage medium | |
CN112764988B (en) | Data segment acquisition method and device | |
CN116842205A (en) | Game playback method, device and storage medium | |
CN114245229B (en) | A short video production method, device, equipment and storage medium | |
CN116095417B (en) | Video on demand method, device, equipment and storage medium | |
CN114071192A (en) | Information acquisition method, terminal, server, electronic device and storage medium | |
CN116149951B (en) | Topology information acquisition method and device of basic input/output system | |
CN118075531A (en) | Multi-screen spliced synchronous display method and device, electronic equipment and storage medium | |
CN115499707B (en) | Video similarity determination method and device | |
US20230063599A1 (en) | Edge computing network, data transmission method and apparatus, device and storage medium | |
CN114501084B (en) | Playing method, device, equipment and medium of player | |
CN117119211A (en) | Live broadcast pushing method and device, electronic equipment and storage medium | |
CN114493809A (en) | Auction message processing method, apparatus, server, device, medium and product | |
CN115599634A (en) | Data processing method, device, equipment and storage medium | |
CN113438428A (en) | Method, apparatus, device and computer-readable storage medium for automated video generation | |
CN113852835A (en) | Live audio processing method, device, electronic device and storage medium | |
CN119363926B (en) | Network video conference data processing method, device and storage medium | |
CN116017062B (en) | Video playing method and device, electronic equipment and storage medium | |
CN118250341B (en) | Form request processing method, device, equipment and storage medium | |
CN112559926B (en) | Online processing method, device, equipment, medium and product for search display items | |
CN119484956A (en) | Video generation method, device, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |