Video on demand method, device, equipment and storage medium
By determining and supplementing video clips in the video on demand system, the problem of missing video clips is solved, the ability to display complete video content at the terminal is realized, and the user experience is improved.
Patent Information
- Application Number
- CN202310017725.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-06
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2043-01-06
AI Technical Summary
When existing video players play larger videos, they need to convert them into multiple smaller video clips. However, in the process of generating and managing video clips, it is easy to miss video clips, resulting in the inability to display the complete video content normally.
By receiving the video on demand request from the terminal, it is determined whether the number of video clips in the target video collection is complete. If it is incomplete, the missing video clips are intercepted from the original video and added to the target video collection to ensure that the number of video clips is complete.
The ability to display complete video content on the terminal is realized, avoiding the problem of missing video clips, and ensuring the integrity of video playback and user experience.
Smart Images

Figure CN116095417B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of video data processing, and in particular to a video on demand method, device, equipment and storage medium. Background Art
[0002] Existing video players have a limit on the size of the video they play, so they usually need to convert a larger video into multiple smaller video clips, and the video player displays the complete video content by playing the multiple smaller video clips in sequence. However, in the process of generating and subsequently managing video clips, it is possible that video clips are missed, resulting in the inability to properly use video clips to display the complete video content. Summary of the invention
[0003] The present disclosure provides a video on demand method, apparatus, device and storage medium.
[0004] According to a first aspect of the present disclosure, a video on demand method is provided, comprising:
[0005] 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 includes a plurality of continuous video segments in an original video;
[0006] Calculate the total playback time of the target video set based on the playback time of each video clip in the target video set, calculate the original playback time of the original video based on the start timestamp and end timestamp of the original video, and compare the total playback time with the original playback time;
[0007] In response to the total playback time being equal to the original playback time, determining that the number of video segments in the target video set is complete, returning the total playback time to the terminal so that the user can select a start playback time in the total playback time; or
[0008] In response to the total playback time not being equal to the original playback time, determining that the number of video segments in the target video set is incomplete, extracting the missing video segments in the target video set from the original video and adding them to the target video set, recalculating the total playback time of the target video set based on the playback time of each video segment in the target video set, and returning the total playback time to the terminal;
[0009] The starting playback time returned by the receiving terminal is determined from the target video set, and a starting video segment corresponding to the starting playback time is determined, wherein the starting playback time is selected by the user from the total playback time displayed on the terminal;
[0010] The video streams of the starting video segment and other subsequent video segments are sent to the terminal in sequence, so that the terminal displays the corresponding video content.
[0011] In some embodiments of the present disclosure, multiple continuous video segments in the original video are obtained by:
[0012] Play the original video and start recording the original video;
[0013] When it is determined that the duration of the currently recorded video segment reaches a preset duration, or the capacity of the currently recorded video segment reaches a preset capacity, saving the currently recorded video segment and starting to record the next video segment;
[0014] Each time a video segment is saved, a key video frame is selected from a plurality of video frames corresponding to the video segment in the original video for marking, and the key frame number of the key video frame is recorded in the header information of the video segment.
[0015] In some embodiments of the present disclosure, extracting video segments missing from a target video set from an original video and adding the segments to the target video set includes:
[0016] Parsing the key frame number from the header information of each video clip in the target video set, and determining a plurality of marked key video frames from the original video;
[0017] Matching the key frame number with the key video frame, and determining a target key video frame that is not matched to a corresponding key frame number from a plurality of key video frames;
[0018] Determine a previous key video frame and a next key video frame adjacent to the target key video frame;
[0019] Determine, from the plurality of video segments included in the target video set, a first video segment corresponding to a previous key video frame and a second video segment corresponding to a next key video frame;
[0020] Based on the end timestamp of the first video segment and the start timestamp of the second video segment, the video segments missing from the target video set are extracted from the original video and added to the target video set.
[0021] In some embodiments of the present disclosure, sending video streams of a starting video segment and other subsequent video segments to a terminal in sequence includes:
[0022] The video streams of the starting video segment and other video segments thereafter are formed into a video queue to be sent in chronological order;
[0023] Sending a data stream of the (N+i)th video segment from the video queue to the terminal in chronological order, and loading header information of the (N+i+1)th video segment during the video stream sending of the (N+i)th video segment, where N is the sequence number of the starting video segment and i is an integer not less than 0;
[0024] Determine whether the (N+i+1)th video segment is damaged based on the header information of the (N+i+1)th video segment;
[0025] In response to determining that the (N+i+1)th video segment is not damaged, after the video stream of the (N+i)th video segment is sent, the data stream of the (N+i+1)th video segment continues to be sent to the terminal.
[0026] In some embodiments of the present disclosure, the video on demand method further includes:
[0027] In response to determining that the (N+i+1)th video segment is damaged, file damage prompt information is sent to the terminal.
[0028] In some embodiments of the present disclosure, the video on demand method further includes:
[0029] In response to determining that the (N+i+1)th video segment is damaged, sending a waiting for repair request to the terminal;
[0030] In response to receiving a confirmation message from the terminal for the waiting-for-repair request, loading header information of the (N+i+2)th video segment, and determining whether the (N+i+2)th video segment is damaged 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 the user for the waiting-for-repair request;
[0031] In response to determining that the (N+i+2)th video segment is not damaged, the (N+i+1)th video segment is deleted, a new (N+i+1)th video segment is cut out from the original video based on the end timestamp of the (N+i)th video segment and the start timestamp of the (N+i+2)th video segment, and the data stream of the new (N+i)th video segment is sent to the terminal.
[0032] In some embodiments of the present disclosure, the video on demand method further includes:
[0033] In response to determining that the (N+i+1)th video segment is damaged, sending a waiting for repair request to the terminal;
[0034] In response to receiving a confirmation message from the terminal regarding the waiting repair request, when it is determined that the (N+i+1)th video segment is the last video segment in the video queue, the (N+i+1)th video segment is deleted, a new (N+i+1)th video segment is cut out from the original video based on the end timestamp of the (N+i)th video segment, and the data stream of the new (N+i)th video segment is sent to the terminal.
[0035] According to a second aspect of the present disclosure, a video on demand device is provided, the video on demand device comprising a target video determination module, a duration comparison module, a total time feedback module, a start video determination module and a video sending module;
[0036] The target video determination module is used 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, wherein the target video set includes multiple continuous video clips in an original video;
[0037] The duration comparison module is used to calculate the total playback duration of the target video set based on the playback duration of each video segment in the target video set, calculate the original playback duration of the original video based on the start timestamp and end timestamp of the original video, and compare the total playback duration with the original playback duration;
[0038] The total time feedback module is used to determine that the number of video segments in the target video set is complete in response to the total playback time being equal to the original playback time, and return the total playback time to the terminal so that the user can select the starting playback time in the total playback time; or, in response to the total playback time not being equal to the original playback time, determine that the number of video segments in the target video set is incomplete, extract the missing video segments in the target video set from the original video and add them to the target video set, recalculate the total playback time of the target video set based on the playback time of each video segment in the target video set, and return the total playback time to the terminal;
[0039] The starting video determination module is used to receive the starting playback time returned by the terminal, and determine the starting video segment corresponding to the starting playback time from the target video set, wherein the starting playback time is selected by the user from the total playback time displayed on the terminal;
[0040] The video sending module is used to send the video streams of the starting video segment and other subsequent video segments to the terminal in sequence, so that the terminal displays the corresponding video content.
[0041] In some embodiments of the present disclosure, the video on demand device further includes a video segment acquisition module, which obtains a plurality of continuous video segments in the original video in the following manner:
[0042] Play the original video and start recording the original video;
[0043] When it is determined that the duration of the currently recorded video segment reaches a preset duration, or the capacity of the currently recorded video segment reaches a preset capacity, saving the currently recorded video segment and starting to record the next video segment;
[0044] Each time a video segment is saved, a key video frame is selected from a plurality of video frames corresponding to the video segment in the original video for marking, and the key frame number of the key video frame is recorded in the header information of the video segment.
[0045] In some embodiments of the present disclosure, when the total time feedback module is used to extract the video segments missing from the target video set from the original video and add them to the target video set, it is specifically used to:
[0046] Parsing the key frame number from the header information of each video clip in the target video set, and determining a plurality of marked key video frames from the original video;
[0047] Matching the key frame number with the key video frame, and determining a target key video frame that is not matched to a corresponding key frame number from a plurality of key video frames;
[0048] Determine a previous key video frame and a next key video frame adjacent to the target key video frame;
[0049] Determine, from the plurality of video segments included in the target video set, a first video segment corresponding to a previous key video frame and a second video segment corresponding to a next key video frame;
[0050] Based on the end timestamp of the first video segment and the start timestamp of the second video segment, the video segments missing from the target video set are extracted from the original video and added to the target video set.
[0051] In some embodiments of the present disclosure, when the video sending module is used to sequentially send the video streams of the starting video segment and other subsequent video segments to the terminal, it is specifically used to:
[0052] The video streams of the starting video segment and other video segments thereafter are formed into a video queue to be sent in chronological order;
[0053] Sending a data stream of the (N+i)th video segment from the video queue to the terminal in chronological order, and loading header information of the (N+i+1)th video segment during the video stream sending of the (N+i)th video segment, where N is the sequence number of the starting video segment and i is an integer not less than 0;
[0054] Determine whether the (N+i+1)th video segment is damaged based on the header information of the (N+i+1)th video segment;
[0055] In response to determining that the (N+i+1)th video segment is not damaged, after the video stream of the (N+i)th video segment is sent, the data stream of the (N+i+1)th video segment continues to be sent to the terminal.
[0056] In some embodiments of the present disclosure, the video sending module is further used to:
[0057] In response to determining that the (N+i+1)th video segment is damaged, file damage prompt information is sent to the terminal.
[0058] In some embodiments of the present disclosure, the video sending module is further used to:
[0059] In response to determining that the (N+i+1)th video segment is damaged, sending a waiting for repair request to the terminal;
[0060] In response to receiving a confirmation message from the terminal for the waiting-for-repair request, loading header information of the (N+i+2)th video segment, and determining whether the (N+i+2)th video segment is damaged 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 the user for the waiting-for-repair request;
[0061] In response to determining that the (N+i+2)th video segment is not damaged, the (N+i+1)th video segment is deleted, a new (N+i+1)th video segment is cut out from the original video based on the end timestamp of the (N+i)th video segment and the start timestamp of the (N+i+2)th video segment, and the data stream of the new (N+i)th video segment is sent to the terminal.
[0062] In some embodiments of the present disclosure, the video sending module is further used to:
[0063] In response to determining that the (N+i+1)th video segment is damaged, sending a waiting for repair request to the terminal;
[0064] In response to receiving a confirmation message from the terminal regarding the waiting repair request, when it is determined that the (N+i+1)th video segment is the last video segment in the video queue, the (N+i+1)th video segment is deleted, a new (N+i+1)th video segment is cut out from the original video based on the end timestamp of the (N+i)th video segment, and the data stream of the new (N+i)th video segment is sent to the terminal.
[0065] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0066] at least one processor; and a memory communicatively coupled to the at least one processor;
[0067] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the video-on-demand method provided by the first aspect above.
[0068] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the video-on-demand method provided by the first aspect.
[0069] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description.
[0070] The beneficial effects of the technical solution provided by the present disclosure are:
[0071] The video on demand method provided by the present disclosure can, when a server receives a video on demand request, promptly determine a target video set containing corresponding video clips, and accurately determine whether the video clips 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, when it is determined that the video clips contained in the target video set are incomplete, the missing video clips in the target video set can be quickly intercepted from the original video, so that the terminal can display the complete video content by playing the video clips in the target video set in sequence. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0073] Figure 1 A schematic diagram showing a flow chart of a video on demand method provided by an embodiment of the present disclosure;
[0074] Figure 2 A schematic diagram of a process for obtaining multiple continuous video clips provided by an embodiment of the present disclosure is shown;
[0075] Figure 3 A schematic diagram of a process of a video on demand device provided by an embodiment of the present disclosure is shown;
[0076] Figure 4 A schematic diagram showing a process flow of another video on demand device provided by an embodiment of the present disclosure is shown;
[0077] Figure 5A schematic block diagram of an example electronic device that can be used to implement the video-on-demand method provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0078] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0079] Existing video players have a limit on the size of the video they play, so they usually need to convert a larger video into multiple smaller video clips, and the video player displays the complete video content by playing the multiple smaller video clips in sequence. However, in the process of generating and subsequently managing video clips, it is possible that video clips are missed, resulting in the inability to properly use video clips to display the complete video content.
[0080] The video on demand method, apparatus, device and storage medium provided by the embodiments of the present disclosure are intended to solve at least one of the above technical problems in the prior art.
[0081] Figure 1 FIG. 1 shows a flow chart of a video on demand method provided by an embodiment of the present disclosure. The execution subject of the video on demand method is a server. Figure 1 The method may mainly include the following steps:
[0082] 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.
[0083] The target video set includes multiple continuous video segments in an original video. Specifically, the multiple continuous video segments can be obtained by recording the original video in segments. Here, the specific process of obtaining the multiple continuous video segments will be further introduced later.
[0084] A player is deployed in the terminal, and the terminal displays a video-on-demand interface by running the player. Then, in response to the user's video selection operation in the video-on-demand interface, a video-on-demand request is generated and sent to the server. Here, the video-on-demand request includes the identity information of the original video that the user wants to watch on demand. The server can parse the identity information from the video-on-demand request and determine the target video set corresponding to the video-on-demand request from the video database based on the identity information.
[0085] S120: Calculate the total playback time of the target video set based on the playback time of each video segment in the target video set, calculate the original playback time of the original video based on the start timestamp and end timestamp of the original video, and compare the total playback time with the original playback time.
[0086] Here, the total play time of the target video set refers to the sum of the play time of each video segment in the target video set. It should be noted that each video segment in the target video set has header information, and the header information may include information such as the start timestamp, end timestamp, and play time of the video segment. In S120, the header information of each video segment in the target video set may be parsed to obtain the play time of each video segment, and the play time of each video segment may be added to obtain the total play time of the target video set.
[0087] It is understandable that if the number of video clips in the target video set is complete, then the total playback time of the target video set should be equal to the original playback time of the original video; if the number of video clips in the target video set is incomplete, then the total playback time of the target video set should be less than the original playback time of the original video. Here, based on the comparison result of the total playback time and the original playback time, it can be determined to execute S130 or S140.
[0088] S130: In response to the total playback duration being equal to the original playback duration, determining that the number of video segments in the target video set is complete, and returning the total playback duration to the terminal.
[0089] After receiving the total playback time, the terminal can display the total playback time in a preset format so that the user can select a starting playback time from the total playback time. For example, the terminal displays the total playback time as 1 hour in the form of a progress bar, and the user can select 3 minutes and 20 seconds as the starting playback time. Specifically, the terminal can determine the starting playback time from the total playback time in response to the user's time selection operation.
[0090] S140: In response to the total playback time not being equal to the original playback time, determining that the number of video segments in the target video set is incomplete, extracting the missing video segments in the target video set from the original video and adding them to the target video set, recalculating the total playback time of the target video set based on the playback time of each video segment in the target video set, and returning the total playback time to the terminal.
[0091] When it is determined that the number of video clips in the target video set is incomplete, the video clips in the target video set can be compared with the original video to determine the missing video clips in the target video set, and then the missing video clips in the target video set are cut out from the original video and added to the target video set, so as to recalculate the total playback time of the target video set based on the playback time of each video clip in the target video set and return it to the terminal. After receiving the total playback time, the terminal can display the total playback time in a preset form so that the user can select the starting playback time in the total playback time. For example, the terminal displays the total playback time as 1 hour in the form of a progress bar, and the user can select the 3rd minute and 20 seconds as the starting playback time. Specifically, the terminal can determine the starting playback time in the total playback time in response to the user's time selection operation. It should be noted here that the specific process of determining the missing video clips in the target video set will be described in detail later.
[0092] S150: receiving the start playback time returned by the terminal, and determining a start video segment corresponding to the start playback time from the target video set.
[0093] The terminal can determine the start playback time in the total playback time in response to the user's time selection operation, and then send the start playback time to the server so that the server receives the start playback time. The server can determine a video segment including the start playback time from the target video set, and use the video segment including the start playback time as the start video segment.
[0094] S160: Send the video streams of the starting video segment and other subsequent video segments to the terminal in sequence.
[0095] After determining the starting video segment, the video stream after the starting playback time in the starting video segment can be sent to the terminal. Other video segments after the starting video segment can be sent to the terminal in sequence according to the time sequence of each video segment, and the terminal sequentially receives the video streams of the starting video segment and other video segments thereafter sent by the service and displays the corresponding video content.
[0096] The video on demand method provided by the present disclosure can, when a server receives a video on demand request, promptly determine a target video set containing corresponding video clips, and accurately determine whether the video clips 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, when it is determined that the video clips contained in the target video set are incomplete, the missing video clips in the target video set can be quickly intercepted from the original video, so that the terminal can display the complete video content by playing the video clips in the target video set in sequence.
[0097] Figure 2 FIG. 4 shows a flow chart of obtaining a plurality of continuous video clips provided by an embodiment of the present disclosure, such as Figure 2 As shown, the process can mainly include the following steps:
[0098] S210: Play the original video and start recording the original video.
[0099] S220: When it is determined that the duration of the currently recorded video segment reaches a preset duration, or the capacity of the currently recorded video segment reaches a preset capacity, the currently recorded video segment is saved and the next video segment is started to be recorded.
[0100] For example, the preset duration can be set to 10 seconds, and each time the original video is recorded for 10 seconds, a video clip can be obtained, and the 10-second video clip is saved and the next video clip is recorded; or the preset capacity can be set to 4G, and when the capacity of the recorded video clip reaches 4G, the 4G video clip is saved and the next video clip is recorded. By repeating the above recording process, multiple video clips of the original video can be obtained.
[0101] S230: Each time a video segment is saved, a key video frame is selected from a plurality of video frames corresponding to the video segment in the original video for marking, and a key frame number of the key video frame is recorded in the header information of the video segment.
[0102] Here, the frame number of the selected key video frame can be determined according to actual design requirements. For example, the first video frame can be determined in the video segment, and the video frame corresponding to the first video frame in the original video is marked as a key video frame, and the key frame number of the key video frame is recorded in the header information of the video segment; or, the middle video frame can be determined in the video segment, and the video frame corresponding to the middle video frame in the original video is marked as a key video frame, and the key frame number of the key video frame is recorded in the header information of the video segment.
[0103] Based on the key frame number of the key video frame of the original video recorded in the header information of the video clip, in S140, the key frame number can be parsed from the header information of each video clip in the target video set, and multiple marked key video frames can be determined from the original video; the key frame number and the key video frame are matched, and the target key video frame that does not match the corresponding key frame number is determined from multiple key video frames; the previous key video frame and the next key video frame adjacent to the target key video frame are determined; from the multiple video clips included in the target video set, 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; based on the end timestamp of the first video clip and the start timestamp of the second video clip, the video clip missing from the target video set is cut out from the original video and added to the target video set.
[0104] It is understandable that if the number of video clips in the target video set is complete, then the key frame number in the header information of the video clip should correspond to the key video frame in the original video. If a key video frame in the original video does not match the corresponding key frame number, it means that the target video set is guaranteed to contain the video clip of the key video frame, so it is necessary to cut out the video clip containing the key video frame from the original video and add it to the target video set. Specifically, in order to accurately cut out the required video clip, the key video frame that does not match the corresponding key frame number can be defined as the target key video frame, and the previous key video frame and the next key video frame adjacent to the target key video frame are determined, and the video clip containing the previous key video frame in the target video set is defined as the first video clip, and the video clip containing the next key video frame in the target video set is defined as the second video clip, then the video clip between the first video clip and the second video clip is the missing video clip in the target video set, and the missing video clip should contain the target key video frame. On this basis, the end timestamp of the first video clip can be used as a new start timestamp, the start timestamp of the second video clip can be used as a new end timestamp, and the video clip can be cut out from the original video based on the new start timestamp and the new end timestamp, so as to obtain the video clip missing in the target video set.
[0105] Optionally, in S160, the server may form a video queue to be sent by chronologically arranging the video streams of the starting video segment and other video segments thereafter; send the data stream of the (N+i)th video segment from the video queue to the terminal in chronological order, and load the header information of the (N+i+1)th video segment during the sending 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; in response to determining that the (N+i+1)th video segment is not damaged, after the sending of the video stream of the (N+i)th video segment is completed, continue to send the data stream of the (N+i+1)th video segment to the terminal. Here, N is the serial number of the starting video segment, and i is an integer not less than 0. It can be understood that when i is 0, the (N+i)th video segment represents the starting video segment.
[0106] Optionally, if the (N+i+1)th video segment is damaged, the server may send a file damage prompt message to the terminal in response to determining that the (N+i+1)th video segment is damaged. After receiving the file damage prompt message, the terminal may display corresponding text content in the player interface, and the text content is used to prompt that the video content is damaged and cannot be played temporarily.
[0107] Optionally, if the (N+i+1)th video segment is damaged, the server may send a waiting for repair request to the terminal in response to determining that the (N+i+1)th video segment is damaged. After receiving the waiting for repair request, the terminal may display a corresponding inquiry content, which is used to inquire whether the user is willing to wait for the video file to be repaired. If the user is willing to wait for the video file to be repaired, the user may complete a confirmation operation for the waiting for repair request in the interface (such as clicking a confirmation control). The terminal generates a confirmation message for the waiting for repair request in response to the confirmation operation, and then sends the confirmation message to the server. In response to receiving the confirmation message for the waiting for repair request from the terminal, the server loads the header information of the (N+i+2)th video segment, and determines whether the (N+i+2)th video segment is damaged based on the header information of the (N+i+2)th video segment.
[0108] It can be understood that the (N+i+2)th video segment is the next video segment of the (N+i+1)th video segment. If the (N+i+2)th video segment is not damaged, it means that only the (N+i+1)th video segment needs to be repaired, which does not take too much time and will not seriously affect the user's viewing experience. Specifically, in response to determining that the (N+i+2)th video segment is not damaged, the server deletes the (N+i+1)th video segment, extracts a new (N+i+1)th video segment from the original video based on the end timestamp of the (N+i)th video segment and the start timestamp of the (N+i+2)th video segment, and sends the data stream of the new (N+i)th video segment to the terminal. Here, the end timestamp of the (N+i)th video segment is the start timestamp of the (N+i+1)th video segment, the start timestamp of the (N+i+2)th video segment is the end timestamp of the (N+i+1)th video segment, and the video segment captured based on the determined start timestamp and end timestamp is the new (N+i+1)th video segment.
[0109] Optionally, if the (N+i+1)th video segment is damaged, the server may send a waiting for repair request to the terminal in response to determining that the (N+i+1)th video segment is damaged. After receiving the waiting for repair request, the terminal may display a corresponding inquiry content, which is used to inquire whether the user is willing to wait for the video file to be repaired. If the user is willing to wait for the video file to be repaired, the user may complete a confirmation operation (such as clicking a confirmation control) for the waiting for repair request in the interface. The terminal generates a confirmation message for the waiting for repair request in response to the confirmation operation, and then sends the confirmation message to the server. In response to receiving the confirmation message for the waiting for repair request from the terminal, the server deletes the (N+i+1)th video segment in the case of determining that the (N+i+1)th video segment is the last video segment in the video queue, cuts out a new (N+i+1)th video segment from the original video based on the end timestamp of the (N+i)th video segment, and sends the data stream of the new (N+i)th video segment to the terminal.
[0110] Based on the same principle as the above-mentioned video on demand method, the embodiment of the present disclosure provides a video on demand device. Figure 3 A schematic diagram of a video on demand device provided by an embodiment of the present disclosure is shown. Figure 3 As shown, the video-on-demand device 300 includes a target video determination module 310 , a duration comparison module 320 , a total time feedback module 330 , a start video determination module 340 and a video sending module 350 .
[0111] The target video determination module 310 is used 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, wherein the target video set includes multiple continuous video segments in an original video;
[0112] The duration comparison module 320 is used to calculate the total playback duration of the target video set based on the playback duration of each video segment in the target video set, calculate the original playback duration of the original video based on the start timestamp and end timestamp of the original video, and compare the total playback duration with the original playback duration;
[0113] The total time feedback module 330 is used to determine that the number of video segments in the target video set is complete in response to the total playback time being equal to the original playback time, and return the total playback time to the terminal so that the user can select the starting playback time in the total playback time; or, in response to the total playback time not being equal to the original playback time, determine that the number of video segments in the target video set is incomplete, extract the missing video segments in the target video set from the original video and add them to the target video set, recalculate the total playback time of the target video set based on the playback time of each video segment in the target video set, and return the total playback time to the terminal;
[0114] The starting video determination module 340 is used to receive the starting playback time returned by the terminal, and determine the starting video segment corresponding to the starting playback time from the target video set, wherein the starting playback time is selected by the user from the total playback time displayed on the terminal;
[0115] The video sending module 350 is used to send the video streams of the starting video segment and other subsequent video segments to the terminal in sequence, so that the terminal displays the corresponding video content.
[0116] The video on demand device provided by the present disclosure can, when a server receives a video on demand request, promptly determine a target video set containing corresponding video clips, and accurately determine whether the video clips 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, when it is determined that the video clips contained in the target video set are incomplete, the missing video clips in the target video set can be quickly intercepted from the original video, so that the terminal can display the complete video content by playing the video clips in the target video set in sequence.
[0117] Figure 4 A schematic diagram of another video on demand device provided by an embodiment of the present disclosure is shown. Figure 4As shown, the video on demand device 300 includes a target video determination module 310, a duration comparison module 320, a total time feedback module 330, a start video determination module 340 and a video sending module 350, and further includes a video segment acquisition module 360. The video segment acquisition module 360 obtains a plurality of continuous video segments in the original video in the following manner:
[0118] Play the original video and start recording the original video;
[0119] When it is determined that the duration of the currently recorded video segment reaches a preset duration, or the capacity of the currently recorded video segment reaches a preset capacity, saving the currently recorded video segment and starting to record the next video segment;
[0120] Each time a video segment is saved, a key video frame is selected from a plurality of video frames corresponding to the video segment in the original video for marking, and the key frame number of the key video frame is recorded in the header information of the video segment.
[0121] In some embodiments of the present disclosure, when the total time feedback module 330 is used to extract the video segments missing from the target video set from the original video and add them to the target video set, it is specifically used to:
[0122] Parsing the key frame number from the header information of each video clip in the target video set, and determining a plurality of marked key video frames from the original video;
[0123] Matching the key frame number with the key video frame, and determining a target key video frame that is not matched to a corresponding key frame number from a plurality of key video frames;
[0124] Determine a previous key video frame and a next key video frame adjacent to the target key video frame;
[0125] Determine, from the plurality of video segments included in the target video set, a first video segment corresponding to a previous key video frame and a second video segment corresponding to a next key video frame;
[0126] Based on the end timestamp of the first video segment and the start timestamp of the second video segment, the video segments missing from the target video set are extracted from the original video and added to the target video set.
[0127] In some embodiments of the present disclosure, when the video sending module 350 is used to sequentially send the video streams of the starting video segment and other subsequent video segments to the terminal, it is specifically used to:
[0128] The video streams of the starting video segment and other video segments thereafter are formed into a video queue to be sent in chronological order;
[0129] Sending a data stream of the (N+i)th video segment from the video queue to the terminal in chronological order, and loading header information of the (N+i+1)th video segment during the video stream sending of the (N+i)th video segment, where N is the sequence number of the starting video segment and i is an integer not less than 0;
[0130] Determine whether the (N+i+1)th video segment is damaged based on the header information of the (N+i+1)th video segment;
[0131] In response to determining that the (N+i+1)th video segment is not damaged, after the video stream of the (N+i)th video segment is sent, the data stream of the (N+i+1)th video segment continues to be sent to the terminal.
[0132] In some embodiments of the present disclosure, the video sending module 350 is further configured to:
[0133] In response to determining that the (N+i+1)th video segment is damaged, file damage prompt information is sent to the terminal.
[0134] In some embodiments of the present disclosure, the video sending module 350 is further configured to:
[0135] In response to determining that the (N+i+1)th video segment is damaged, sending a waiting for repair request to the terminal;
[0136] In response to receiving a confirmation message from the terminal for the waiting-for-repair request, loading header information of the (N+i+2)th video segment, and determining whether the (N+i+2)th video segment is damaged 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 the user for the waiting-for-repair request;
[0137] In response to determining that the (N+i+2)th video segment is not damaged, the (N+i+1)th video segment is deleted, a new (N+i+1)th video segment is cut out from the original video based on the end timestamp of the (N+i)th video segment and the start timestamp of the (N+i+2)th video segment, and the data stream of the new (N+i)th video segment is sent to the terminal.
[0138] In some embodiments of the present disclosure, the video sending module 350 is further configured to:
[0139] In response to determining that the (N+i+1)th video segment is damaged, sending a waiting for repair request to the terminal;
[0140] In response to receiving a confirmation message from the terminal regarding the waiting repair request, when it is determined that the (N+i+1)th video segment is the last video segment in the video queue, the (N+i+1)th video segment is deleted, a new (N+i+1)th video segment is cut out from the original video based on the end timestamp of the (N+i)th video segment, and the data stream of the new (N+i)th video segment is sent to the terminal.
[0141] It is understandable that the above-mentioned modules of the video on demand device in the embodiment of the present disclosure have the function of implementing the corresponding steps of the above-mentioned video on demand method. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions. The above-mentioned modules can be software and / or hardware, and the above-mentioned modules can be implemented separately or integrated with multiple modules. For the functional description of each module of the above-mentioned video on demand device, please refer to the corresponding description of the above-mentioned video on demand method, which will not be repeated here.
[0142] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0143] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0144] Figure 5 A schematic block diagram of an example electronic device that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0145] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate 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 RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0146] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0147] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, 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, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via ROM 502 and / or a communication unit 509. When the computer program is loaded into RAM 503 and executed by the 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 appropriate manner (e.g., by means of firmware).
[0148] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0149] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0150] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0151] To provide interaction with a user, the systems and techniques described herein 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 pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0152] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may 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.
[0153] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0154] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0155] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A video on demand method, applied to a server, characterized in that: include: 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 includes a plurality of continuous video segments in an original video; Calculating the total playback time of the target video set based on the playback time of each video segment in the target video set, calculating the original playback time of the original video based on the start timestamp and the end timestamp of the original video, and comparing the total playback time with the original playback time; In response to the total playback duration being equal to the original playback duration, determining that the number of video segments in the target video set is complete, returning the total playback duration to the terminal so that the user can select a start playback time in the total playback duration; In response to the total playback time not being equal to the original playback time, determining that the number of video segments in the target video set is incomplete, extracting the missing video segments in the target video set from the original video and adding them to the target video set, recalculating the total playback time of the target video set based on the playback time of each video segment in the target video set, and returning the total playback time to the terminal; Receiving the start playback time returned by the terminal, and determining a start video segment corresponding to the start playback time from the target video set, wherein the start playback time is selected by the user from the total playback time displayed on the terminal; The video streams of the starting video segment and other subsequent video segments are sent to the terminal in sequence, so that the terminal displays corresponding video content.
2. The video-on-demand method according to claim 1, characterized in that: The multiple continuous video segments in the original video are obtained in the following manner: Play the original video and start recording the original video; When it is determined that the duration of the currently recorded video segment reaches a preset duration, or the capacity of the currently recorded video segment reaches a preset capacity, saving the currently recorded video segment and starting to record the next video segment; Each time a video segment is saved, a key video frame is selected from a plurality of video frames corresponding to the video segment in the original video for marking, and the key frame number of the key video frame is recorded in the header information of the video segment.
3. The video-on-demand method according to claim 2, characterized in that: The extracting, from the original video, the video segments missing from the target video set and adding them to the target video set comprises: Parsing the key frame number from the header 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 that is not matched to the corresponding key frame number from the plurality of key video frames; Determine a previous key video frame and a next key video frame adjacent to the target key video frame; Determining, from the plurality of video segments included in the target video set, a first video segment corresponding to the previous key video frame and a second video segment corresponding to the next key video frame; Based on the end timestamp of the first video segment and the start timestamp of the second video segment, the video segment missing from the target video set is extracted from the original video and added to the target video set.
4. The video-on-demand method according to claim 1, characterized in that: The sending the video streams of the starting video segment and other subsequent video segments to the terminal in sequence includes: Form a video queue to be sent by chronologically arranging the video streams of the starting video segment and other video segments thereafter; Sending a data stream of the (N+i)th video segment from the video queue to the terminal in chronological order, and loading header information of the (N+i+1)th video segment during the video stream sending of the (N+i)th video segment, wherein N is the sequence number of the starting video segment and i is 0; Determine whether the (N+i+1)th video segment is damaged based on the header information of the (N+i+1)th video segment; In response to determining that the (N+i+1)th video segment is not damaged, after the video stream of the (N+i)th video segment is sent, continue to send the data stream of the (N+i+1)th video segment to the terminal.
5. The video-on-demand method according to claim 4, characterized in that: Also includes: In response to determining that the (N+i+1)th video segment is damaged, sending file damage prompt information to the terminal.
6. The video-on-demand method according to claim 4, characterized in that: Also includes: In response to determining that the (N+i+1)th video segment is damaged, sending a waiting for repair request to the terminal; In response to receiving a confirmation message from the terminal for the waiting-for-repair request, loading header information of the (N+i+2)th video segment, and determining whether the (N+i+2)th video segment is damaged 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 the user for the waiting-for-repair request; In response to determining that the (N+i+2)th video segment is not damaged, deleting the (N+i+1)th video segment, extracting a new (N+i+1)th video segment from the original video based on the end timestamp of the (N+i)th video segment and the start timestamp of the (N+i+2)th video segment, and sending a data stream of the new (N+i+1)th video segment to the terminal.
7. The video-on-demand method according to claim 4, characterized in that: Also includes: In response to determining that the (N+i+1)th video segment is damaged, sending a waiting for repair request to the terminal; In response to receiving a confirmation message from the terminal regarding the waiting repair request, if it is determined that the (N+i+1)th video segment is the last video segment in the video queue, deleting the (N+i+1)th video segment, and extracting a new (N+i+1)th video segment from the original video based on an end timestamp of the (N+i)th video segment, The data stream of the new (N+i+1)th video segment is sent to the terminal.
8. A video-on-demand device, characterized in that: include: A target video determination module is used 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, wherein the target video set includes multiple continuous video clips in an original video; A duration comparison module, configured to calculate the total playback duration of the target video set based on the playback duration of each video segment in the target video set, calculate the original playback duration of the original video based on the start timestamp and the end timestamp of the original video, and compare the total playback duration with the original playback duration; A total time feedback module is used to, in response to the total playback time being equal to the original playback time, determine that the number of video segments in the target video set is complete, and return the total playback time to the terminal so that the user can select a starting playback time in the total playback time; in response to the total playback time not being equal to the original playback time, determine that the number of video segments in the target video set is incomplete, extract the missing video segments in the target video set from the original video and add them to the target video set, recalculate the total playback time of the target video set based on the playback time of each video segment in the target video set, and return the total playback time to the terminal; a starting video determination module, configured to receive the starting playback time returned by the terminal, and determine a starting video segment corresponding to the starting playback time from the target video set, wherein the starting playback time is selected by the user from the total playback time displayed on the terminal; The video sending module is used to send the video streams of the starting video segment and other subsequent video segments to the terminal in sequence, so that the terminal displays the corresponding video content.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Processing of a video [aar] program having plural processed representations of a [aar] single video signal for reconstruction and output
CN102210147A
Video interception method and device, server and computer readable storage medium
CN110913240A