Method and apparatus for providing a set of video segments
Technical Field
The present invention relates to the field of video technologies, and in particular, to a method and an apparatus for providing a video segment set.
Background
Often, a user may wish to view a set of one or more video segments, for example, the user may wish to view a set of goal video segments for a certain star, etc.
Conventional video service providers (e.g., video websites, etc.) typically decompress, splice, transcode, and then save the collected video segments as a new file to a server for distribution to users.
However, the links of decompression, splicing, transcoding and the like in this method bring processing troubles. Moreover, the new file generated in this way is duplicated in the content and some video clips already stored in the server, the duplicated storage of the same content wastes server storage resources, and the storage of multiple places of the same content is also inconvenient for unified management. Furthermore, the new files generated are also not easy to modify.
Disclosure of Invention
In view of the above, the present invention provides a method for providing a video segment set, so as to overcome the above-mentioned shortcomings in the prior art.
According to an aspect of the invention, a method for providing a set of video segments is proposed, the method comprising: sending a request for a set of video segments, the set of video segments including at least one video segment; receiving a protocol file associated with the requested set of video segments, wherein the protocol file contains information about each video segment; reading each video clip based on the protocol file; and displaying the read video clip based on the protocol file.
According to another aspect of the present invention, a method for providing a set of video segments is presented, the method comprising: receiving a request for a set of video segments, the set of video segments including at least one video segment; sending a protocol file associated with the requested set of video segments, wherein the protocol file contains information about each video segment; and providing the video segments for display based on the protocol file.
According to another aspect of the present invention, there is provided an apparatus for providing a set of video segments, the apparatus comprising: a sending component for sending a request for a set of video segments, the set of video segments comprising at least one video segment; receiving means for receiving a protocol file associated with the requested set of video segments, wherein the protocol file contains information about each video segment; reading means for reading each video clip based on the protocol file; and a display section for displaying the read video clip based on the protocol file.
According to another aspect of the present invention, there is provided an apparatus for providing a set of video segments, the apparatus comprising: receiving means for receiving a request for a set of video segments, the set of video segments comprising at least one video segment; sending means for sending a protocol file associated with the requested set of video segments, wherein the protocol file contains information about each video segment; and a video clip providing component for providing each video clip for display based on the protocol file.
According to the aspects of the invention, complicated processing such as decoding, splicing, transcoding and the like in the traditional method is avoided, and because each video segment keeps the original storage mode unchanged and no new video file is generated, repeated storage of the same content is avoided, the storage space is saved, and meanwhile, the management is facilitated. In addition, since the reading and displaying of the video clips are performed based on the protocol file, the reading and displaying modes (such as the displaying sequence and the like) of the video clips can be changed by modifying the protocol file, and the modification is simpler and more convenient compared with the traditional method.
Other features and aspects of the present invention will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the invention and, together with the description, serve to explain the principles of the invention.
Fig. 1 shows a flow diagram of a method for providing a set of video segments according to an embodiment of the invention.
Fig. 2 shows a flow diagram of a method for providing a set of video segments according to an example of an embodiment of the invention.
Fig. 3 shows a flow diagram of a method for providing a set of video segments according to another embodiment of the invention.
Fig. 4 is a block diagram illustrating a structure of an apparatus for providing a video clip set according to another embodiment of the present invention.
Fig. 5 is a block diagram illustrating an apparatus for providing a video clip set according to another embodiment of the present invention.
Fig. 6 shows a block diagram of an apparatus for providing a video segment collection according to another embodiment of the present invention.
Detailed Description
Various exemplary embodiments, features and aspects of the present invention will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present invention. It will be understood by those skilled in the art that the present invention may be practiced without some of these specific details. In some instances, methods, procedures, components, and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present invention.
Example 1
Fig. 1 shows a flow diagram of a method for providing a set of video segments according to an embodiment of the invention. As shown in fig. 1, the method mainly includes:
step 101 of sending a request for a set of video segments, the set of video segments comprising at least one video segment,
receiving a protocol file associated with the requested set of video segments, step 102, wherein the protocol file contains information about each video segment,
step 103, reading each video clip based on the protocol file, and
and 104, displaying the read video clip based on the protocol file.
According to the method of the embodiment, the video segments are not spliced to form a new video, but the information of each video segment is provided through the protocol file, and each video segment can be read and displayed according to the protocol file, that is, the purpose of displaying the video segment set formed by each video segment is realized under the condition that a new video is not actually formed.
According to the embodiment, complex processing such as decoding, splicing, transcoding and the like in the traditional method is avoided, and as each video segment keeps the original storage mode unchanged and no new video file is generated, repeated storage of the same content is avoided, the storage space is saved, and meanwhile, the management is facilitated. In addition, since the reading and displaying of the video clips are performed based on the protocol file, the reading and displaying modes (such as the displaying sequence and the like) of the video clips can be changed by modifying the protocol file, and the modification is simpler and more convenient compared with the traditional method.
The "video clip" described herein may be a piece of video data or a video file having any encoding format, and the encoding formats of the video clips constituting the video clip set may be different and may be collected on any principle as needed. In one example, video segments comprising the same set of video segments may contain associated content, such as the same characters, same-type plots, and so forth.
In one example, a request for a set of video segments may be sent by a client. The request may be generated in response to a user triggering a feature (e.g., a link, button, icon, etc.) associated with the set of video segments on the client. In one example, the generated request may be sent to a server.
In one example, a protocol file associated with the set of video segments may be received by the client, which may be provided by the server in response to receiving the request. For example, protocol files may be synchronized from a server to a client via HTTP. The protocol file may contain information about each video clip. In one example, the information may include, for example, a storage address of each video clip, and/or an encoding format of each video clip, and/or the like. Those skilled in the art will appreciate that the information contained in the protocol file is not limited thereto, as long as it can cause the client to read and display each video clip.
In an example where the protocol file contains a storage location for each video clip, each video clip can be read according to the storage location. In an example where the protocol file contains the encoding format of each video clip, each video clip may be decoded separately according to the encoding format in the protocol file, and the decoded video clips may be displayed.
In one example, illustrative, non-limiting examples of a protocol file may include information relating to one or more of a storage location of a video clip, a video clip ID, a size of a video clip, a frame rate, a bitrate, a resolution, an audio format, a video stream structure, a key frame location, a display timestamp, a decoding timestamp. The information can be used for the client to read, decode, display, drag and drop the video clip set and the like. Optionally, the protocol file may also include information about the video clip set as a whole, such as the total duration of the video clip set, the total number of frames, all audio formats and video formats involved, and so on. In one example, after receiving the protocol file, the client may parse the protocol file to obtain information therein, and initialize the client media module based on the information, such as initializing a data stream protocol, initializing a codec library, initializing a queue and a display frame, and so on, to prepare for subsequent reading and display processing.
In one example, in response to a request for a set of video segments, the video segments may be read and displayed sequentially starting with the first video segment by default in the order of the video segments set by the protocol file.
Another example is given below in connection with fig. 2, which can locate a desired display position, read and displayed with an arbitrary key frame as a starting point.
Fig. 2 shows a flow diagram of a method for providing a set of video segments according to an example of an embodiment of the invention. Steps in fig. 2 that are labeled the same as those in fig. 1 have the same operations, and detailed descriptions of these steps are omitted for the sake of brevity.
The protocol file in the example shown in fig. 2 may also include information about the key frame locations in each video clip. Based on this, the example shown in fig. 2 may further include the following steps on the basis of the embodiment shown in fig. 1:
step 201, receiving an indication related to a desired display position,
step 202, in the protocol file, determining the key frame position corresponding to the required display position,
step 203, sending a request for the determined key frame location,
step 204, taking the determined key frame position as a starting point, executing step 103, namely reading each video clip based on the protocol file, and executing step 104, namely displaying the read video clip based on the protocol file.
The example realizes the quick positioning of the required display position, and can read and display the video clip set by taking any key frame position in the video clip set as a starting point.
In one example, the information contained in the protocol file about the locations of the key frames in each video clip can include the offset locations (typically on the time axis) of the key frames in each video clip, and optionally the actual locations of the key frames.
In one example, the user may indicate the desired display location by dragging a bar or the like on the display interface. The location may correspond to a certain temporal location on a timeline of the set of video clips. In one example, the protocol file may include the sequence and duration of each video segment, so that the desired display position indicated by the user can be located at a certain time position in a certain video segment, i.e. the corresponding key frame position can be determined.
Steps 103 and 104 may be performed with the key frame position as a starting point. For example, it is possible to start from this key frame position, read the video clip in which the key frame position is located, then sequentially read other video clips, and display the read video clips. In this way, display from the position desired by the user is quickly achieved.
In yet another example, the protocol file may include display timestamps for each video segment, and for two adjacent video segments, the last display timestamp of the previous video segment is adjacent to the first display timestamp of the next video segment to ensure that the display remains continuous when switching between video segments.
In yet another example, if an error occurs in the display process, the process may be re-executed from step 101 or 201 in response to an operation with the user to resume the display from the default starting position of the set of video segments or the desired display position indicated by the user.
Example 2
Fig. 3 shows a flow diagram of a method for providing a set of video segments according to another embodiment of the invention. As shown in fig. 3, the method mainly includes:
step 301, receiving a request for a video segment set, wherein the video segment set comprises at least one video segment;
step 302, sending a protocol file associated with the requested set of video segments, wherein the protocol file contains information about each video segment; and
step 303, providing each video segment for display based on the protocol file.
In one example, a request for a set of video segments from a client may be received by a server (e.g., a server of a video service provider) and a protocol file associated with the requested set of video segments is sent. For a description of examples of protocol files, see example 1.
In one example, the protocol file may contain a storage location for each video clip, from which the server may provide each video clip to the client for display.
In one example, a protocol file may include information about key frame locations in each video clip, and a server may receive a request from a client for key frame locations, which may be determined from the protocol file and correspond to desired display locations. The server can provide each video clip for display based on the protocol file by taking the received key frame position as a starting point, so that the required display position can be quickly positioned, and the video clip set can be read and displayed by taking any key frame position in the video clip set as the starting point.
Example 3
Fig. 4 is a block diagram illustrating a structure of an apparatus for providing a video clip set according to another embodiment of the present invention. According to fig. 4, the apparatus 400 mainly comprises:
a sending component 401 for sending a request for a set of video segments, the set of video segments comprising at least one video segment;
a receiving component 402 for receiving a protocol file associated with the requested set of video segments, wherein the protocol file contains information about each video segment;
reading means 403 for reading each video clip based on the protocol file; and
a display component 404 for displaying the read video clip based on the protocol file.
In one example, the protocol file may contain a storage location of each video clip, wherein reading each video clip based on the protocol file may include: and reading each video clip according to the storage position.
In one example, the protocol file may contain information about an encoding format of each video clip, wherein displaying the read video clip based on the protocol file may include: and respectively decoding each video clip according to the information related to the coding format of each video clip in the protocol file, and displaying each decoded video clip.
In one example, the protocol file may include information about key frame locations in each video clip.
In one example, the apparatus may further include: means for receiving an indication relating to a desired display position; means for determining a key frame location corresponding to a desired display location based on the protocol file; means for sending a request for the determined key frame location; means for reading each video clip based on the protocol file with the determined key frame position as a starting point; and means for displaying the read video clip based on the protocol file.
In one example, the protocol file may include a display timestamp for each video segment, and for two adjacent video segments, a last display timestamp of a previous video segment is adjacent to a first display timestamp of a next video segment.
In one example, the apparatus may further include: and the component is used for analyzing the protocol file and initializing the client media module based on the information obtained after analysis.
In one example, the protocol file may include information relating to one or more of a storage location of the video clip, a video clip ID, a size of the video clip, a frame rate, a bitrate, a resolution, an audio format, a video stream structure, a key frame location, a display timestamp, a decoding timestamp.
Example 4
Fig. 5 is a block diagram illustrating an apparatus for providing a video clip set according to another embodiment of the present invention. According to fig. 5, the device 500 essentially comprises:
a receiving component 501 for receiving a request for a set of video segments, the set of video segments comprising at least one video segment;
a sending component 502 for sending a protocol file associated with the requested set of video segments, wherein the protocol file contains information about each video segment; and
a video clip providing component 503 for providing the video clips for display based on the protocol file.
In one example, the protocol file may contain a storage location for each video clip, wherein providing each video clip for display based on the protocol file may comprise: providing the video segments for display according to the storage location.
In one example, the protocol file may include information about key frame locations in each video clip.
In one example, the apparatus may further include: means for receiving a request for a key frame location, wherein the key frame location is determined according to the protocol file and corresponds to a desired display location; and means for providing each video clip for display based on the protocol file with the received key frame location as a starting point.
In one example, the protocol file may include a display timestamp for each video segment, and for two adjacent video segments, a last display timestamp of a previous video segment is adjacent to a first display timestamp of a next video segment.
In one example, the protocol file may include information relating to one or more of a storage location of the video clip, a video clip ID, a size of the video clip, a frame rate, a bitrate, a resolution, an audio format, a video stream structure, a key frame location, a display timestamp, a decoding timestamp.
Example 5
Fig. 6 shows a block diagram of an apparatus for providing a video segment collection according to another embodiment of the present invention. The device 1100 for providing a collection of video segments may be a host server with computing capabilities, a personal computer PC, or a portable computer or terminal that can be carried, etc. The specific embodiments of the present invention do not limit the specific implementation of the compute node.
The apparatus 1100 for providing a set of video segments includes a processor (processor)1110, a communication Interface (Communications Interface)1120, a memory 1130, and a bus 1140. The processor 1110, the communication interface 1120, and the memory 1130 communicate with each other via the bus 1140.
The communication interface 1120 is used to communicate with network devices, including, for example, virtual machine management centers, shared storage, and the like.
Processor 1110 is configured to execute programs. Processor 1110 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
The memory 1130 is used to store files. The memory 1130 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1130 may also be a memory array. The storage 1130 may also be partitioned and the blocks may be combined into virtual volumes according to certain rules.
In one possible embodiment, the program may be a program code including computer operation instructions. The program is particularly useful for implementing the steps of the method for providing a collection of video segments according to an embodiment of the present invention.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may select different ways to implement the described functionality for specific applications, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
If the described functionality is implemented in the form of computer software and sold or used as a stand-alone product, it is to some extent possible to consider all or part of the technical solution of the invention (for example, the part contributing to the prior art) to be embodied in the form of a computer software product. The computer software product is generally stored in a non-volatile storage medium readable by a computer and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the methods according to the embodiments of the present invention. The storage medium includes various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.