Video splicing method and device, and computer storage medium
By generating and splicing the transport stream addresses of video clip tags, the problem of switching and loading between videos is solved, the user experience is improved, and the automatic splicing and smooth playback of videos are realized.
Patent Information
- Application Number
- CN202111217461.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-05
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2039-12-05
AI Technical Summary
When playing a video theme album, there is an obvious switching and loading process between videos, which affects the user experience. The existing solution is cumbersome and has a heavy workload, and cannot effectively solve this problem.
By receiving the playback request of the target video, the video clip tags are generated, and the corresponding transport stream addresses are spliced to form a playlist to realize automatic splicing of videos and avoid the switching and loading process between videos.
It improves the user experience, reduces the video switching and loading process, realizes automatic video splicing, and provides a smoother playback experience.
Smart Images

Figure CN113992942B_ABST
Abstract
Description
[0001] This application is a divisional application with the application date of December 5, 2019, application number 201911237610.2, and the name of the invention being “Video splicing method and device, computer storage medium”. Technical Field
[0002] The present application relates to the field of video processing technology, and in particular to a video splicing method and device, and a computer storage medium. Background Art
[0003] In many video playing clients, users can obtain video theme albums of the video theme by searching for the video theme or selecting the video theme provided by the client. When playing videos in the video theme album, the videos can be automatically played one after another.
[0004] However, the videos in the video theme album are all independent videos. Therefore, after requesting all the transport stream addresses corresponding to a video to the playlist and playing it, it is necessary to request all the transport stream addresses corresponding to a video to the playlist again before playing the next video. Therefore, there is an obvious switching and loading process between two videos. In addition, the video theme album is mainly composed of edited short videos, so the frequent switching and loading process greatly affects the user's viewing experience. The only way to solve this problem to a certain extent is to manually edit multiple short videos and splice them into one video.
[0005] However, manual editing is obviously too cumbersome, and due to the large workload, the number of videos that can be provided to users is also very limited. Therefore, it is particularly important to effectively solve the problem of obvious switching and loading between two videos when playing videos in the video theme album. Summary of the invention
[0006] Based on the above-mentioned deficiencies of the prior art, the present application provides a video splicing method and device, and a computer storage medium to solve the problem of obvious switching and loading processes between two videos when playing videos in a video theme album.
[0007] In order to achieve the above objectives, this application provides the following technical solutions:
[0008] The first aspect of the present application provides a video splicing method, comprising:
[0009] Receive a play request for a target video; wherein the play request carries at least a video identifier of the target video;
[0010] Acquire the transport stream address of the video segment corresponding to each segment tag corresponding to the video identifier; wherein each segment tag is a segment tag in the segment tag set corresponding to the video identifier;
[0011] splicing the transport stream addresses in sequence to obtain a play list of the target video;
[0012] Returns a playlist of the target video.
[0013] Optionally, in the above method, the method for generating the fragment tag includes:
[0014] For each uploaded original video, divide the continuous image frames belonging to the same video theme in the original video into a video segment;
[0015] Generate a segment tag corresponding to each of the video segments; wherein the segment tag at least includes the time period of the video segment in the original video, the identifier of the original video, and the video theme.
[0016] Optionally, in the above method, after generating the segment label corresponding to each of the video segments, the method further includes:
[0017] Combining the segment tags belonging to the same video theme respectively to obtain multiple segment tag sets;
[0018] A video identifier corresponding to each of the segment label sets is generated respectively; wherein one segment label set corresponds to one target video.
[0019] Optionally, in the above method, before receiving the playback of the target video, the method further includes:
[0020] Receiving a query request for a video topic;
[0021] Combining the plurality of segment tags belonging to the video theme respectively to obtain a plurality of segment tag sets;
[0022] The video identifier and video cover corresponding to each of the segment label sets are generated and returned respectively; wherein one segment label set corresponds to one target video.
[0023] Optionally, in the above method, obtaining the transport stream address of the video segment indicated by each segment tag corresponding to the video identifier includes:
[0024] When it is determined that the video identifier exists in the corresponding segment tag set, the address information of the original video corresponding to the identifier of the original video is determined for each segment tag in the segment tag set, and the transmission stream address of the video segment corresponding to the time period of the original video is obtained based on the address information.
[0025] A second aspect of the present application provides a video splicing device, including:
[0026] A first receiving unit, configured to receive a playback request of a target video; wherein the playback request carries at least a video identifier of the target video;
[0027] An acquisition unit, configured to acquire a transport stream address of a video segment corresponding to each segment tag corresponding to the video identifier; wherein each segment tag is a segment tag in a segment tag set corresponding to the video identifier;
[0028] A splicing unit, used for splicing the respective transport stream addresses in sequence to obtain a play list of the target video;
[0029] The sending unit is used to return the play list of the target video.
[0030] Optionally, the above device further comprises a pre-processing unit, wherein the pre-processing unit comprises:
[0031] A division unit, for dividing, for each uploaded original video, consecutive image frames belonging to the same video subject in the original video into a video segment;
[0032] The first generating unit is used to generate a segment label corresponding to each of the video segments; wherein the segment label at least includes a time period of the video segment in the original video, an identifier of the original video, and a video theme.
[0033] Optionally, in the above device, the preprocessing unit further includes:
[0034] A first combining unit, used for combining the segment tags belonging to the same video theme respectively to obtain a plurality of segment tag sets;
[0035] The second generating unit is used to respectively generate a video identifier corresponding to each of the segment label sets; wherein one segment label set corresponds to one target video.
[0036] Optionally, in the above device, it also includes:
[0037] A second receiving unit, configured to receive a query request for a video topic;
[0038] A second combining unit, configured to respectively combine the plurality of segment tags belonging to the video theme to obtain a plurality of segment tag sets;
[0039] The third generating unit is used to respectively generate and return the video identifier and video cover corresponding to each of the segment label sets; wherein one segment label set corresponds to one target video.
[0040] Optionally, in the above device, the acquisition unit includes:
[0041] The acquisition subunit is used to determine the address information of the original video corresponding to the identifier of the original video for each fragment tag in the fragment tag set when it is determined that the video identifier exists with the corresponding fragment tag set, and to obtain the transmission stream address of the video fragment corresponding to the time period of the original video according to the address information.
[0042] A third aspect of the present application provides a computer storage medium for storing a program, which, when executed, is used to implement the video splicing method as described in any one of the above.
[0043] The present application provides a video splicing method, which preselects and generates a segment tag corresponding to each video segment before receiving a playback request for a target video, and generates a corresponding video identifier for a segment tag set. Therefore, when receiving a playback request for a target video, the transmission stream address of the video segment corresponding to each segment tag in the segment tag set corresponding to the video identifier is obtained according to the video identifier carried in the playback request, and then the transmission stream addresses are spliced in sequence to obtain and return the play list of the target video. Thus, by splicing the transmission stream addresses of the video segments corresponding to the segment tags, multiple videos are spliced into one target video, and there is no longer a problem of switching and loading between videos, which effectively improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0045] Figure 1 A schematic diagram of a flow chart of a method for generating a fragment tag provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of an example of a method for generating a fragment tag provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of a flow chart of another method for generating a fragment tag provided in another embodiment of the present application;
[0048] Figure 4 A schematic diagram of an example of another method for generating a fragment tag provided in another embodiment of the present application;
[0049] Figure 5 A schematic diagram of a flow chart of a video splicing method provided in another embodiment of the present application;
[0050] Figure 6 A schematic diagram of a flow chart of a video splicing method provided in another embodiment of the present application;
[0051] Figure 7 A schematic flow chart of an example of a video splicing method provided in another embodiment of the present application;
[0052] Figure 8 A schematic structural diagram of a video splicing device provided in another embodiment of the present application;
[0053] Fig. 9 A schematic diagram of the structure of a preprocessing unit provided in another embodiment of the present application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0056] An embodiment of the present application provides a video splicing method to solve the problem that when playing videos in a video theme album, after playing one video, there is an obvious switching and loading process when the next video is automatically played, thereby affecting the user's viewing experience.
[0057] First of all, it should be noted that when implementing the video splicing method provided by the present application, it is necessary to pre-generate segment labels corresponding to multiple video segments. Therefore, optionally, the present application embodiment provides a method for generating segment labels, such as Figure 1 As shown, specifically including:
[0058] S101. For each uploaded original video, divide the continuous image frames in the original video that belong to the same video theme into a video segment.
[0059] The original video refers to the uploaded complete video that can be directly played without the splicing method of this application. The image frame of the original video refers to each frame of the original video. The video theme refers to the theme name corresponding to the video content, such as games, cars, funny or the name of a star, so the video theme is also a type of attribute information of the video.
[0060] It should be noted that in this application, the original video is divided into multiple segments only by definition, and the original video is not edited into multiple video segments. Therefore, in the embodiment of this application, the video segment refers to a part of the original video, rather than an independent video.
[0061] Optionally, in the embodiment of the present application, for each original video uploaded, it is necessary to divide the video segments according to the video content of the video. Of course, it is also possible to divide only part of the original videos, for example, only divide the original videos whose video duration is greater than a preset duration. It should be noted that an original video can be divided into multiple video segments, or only one video, or even the entire original video can be divided into one video segment, that is, one original video is one video segment.
[0062] Specifically, for each uploaded original video, the video theme to which each image frame belongs can be determined based on the pictures and texts contained in each image frame in the original video. Specifically, the image features in the image frame can be extracted through image recognition technology, and then the corresponding video theme can be obtained through the constructed neural network model. Finally, continuous image frames belonging to the same video theme are divided into a video segment.
[0063] Optionally, when dividing the segments, for continuous image frames belonging to the same video theme, the number of image frames needs to meet a preset number before they are divided into a video segment. Alternatively, after dividing the segments, it is determined whether the number of image frames corresponding to the video segment meets the preset number. If it does not meet the preset number, the division of the video segment is cancelled. In this way, video segments with too few frames can be avoided, because when a video segment with too few frames is played, it is seen as just one picture, which is not considered a video segment, so there is no point in splicing, which can improve work efficiency to a certain extent.
[0064] It should also be noted that an image frame can correspond to multiple video themes, so an image frame can be divided into multiple different video clips, that is, there can be overlapping image frames between video clips. Similarly, a video clip can correspond to multiple video themes, which can be multiple different video themes, or multiple levels of different video themes. For example, a video clip can correspond to multiple different video themes such as games and comedy at the same time, or it can correspond to multiple levels of different video themes such as comedy themes, movie comedy themes, and European and American movie comedy themes. This refines the video themes, allowing users to watch and search for videos with a smaller granularity, and more accurately find target videos that suit their preferences.
[0065] S102: Generate a segment tag corresponding to each video segment, where the segment tag at least includes a time period of the video segment in the original video, an identifier of the original video, and a video theme.
[0066] That is, after the original video is divided into multiple video segments, a segment tag is generated for the corresponding video theme and time period of each video segment. It can also be considered that multiple segment tags are marked for an original video, and can be stored in the attribute information of the original video.
[0067] The segment tag records the time period of the video segment in the original video, the identifier of the original video, and the corresponding video theme. The identifier of the original video may be the video name of the original video. Thus, according to the tag and time period of the original video in the segment tag, it is possible to determine the video segment corresponding to each segment tag, and the video segment from which minute to which minute of the original video it is.
[0068] For example, Figure 2As shown, the original video A is a video with a duration of 24 minutes. According to the content of the video, it is divided into 5 video clips, and each video clip is labeled, so as to obtain 5 labels of the original video A. Among them, the video theme of label 1 is scenery, sea, and waves, corresponding to the 9th minute to the 10th minute of the original video A; the video theme of label 2 is stars, star names, and eyes, corresponding to the 13th minute and 15 seconds to the 14th minute and 21 seconds of the original video A; the video theme of label 3 is games, game names, and achievement names, corresponding to the 15th minute and 21 seconds to the 16th minute and 30 seconds of the original video A; the video theme of label 4 is racing, F1 racing, and drifting, corresponding to the 17th minute and 30 seconds to the 18th minute and 30 seconds of the original video A; the video theme of label 5 is shopping, luxury goods, and brand names, corresponding to the 19th minute and 30 seconds to the 24th minute of the original video A.
[0069] Optionally, based on the fragment tags generated in the above embodiment, in another embodiment of the present application, Figure 3 As shown, after sequentially executing step S301, dividing the continuous image frames belonging to the same video theme in the original video into a video segment for each uploaded original video, and step S302, generating a segment label corresponding to each video segment, the method may further include:
[0070] S303: Combine the segment tags belonging to the same video theme respectively to obtain multiple segment tag sets.
[0071] Specifically, all the segment tags belonging to the same video theme can be combined to obtain multiple segment tag sets; that is, one video theme corresponds to one segment tag set. It is also possible to combine every N segment tags of all the segment tags belonging to the same video theme into a segment tag set, and combine the last remaining segment tags less than N into a segment tag set, or combine the last segment tags greater than N but less than twice N into a segment tag set. Where N is a positive integer. In this way, one video theme corresponds to multiple segment tags, avoiding the target video obtained by the final splicing from being too long.
[0072] It should be noted that the segment tags in the segment tag set are in a sequential order to facilitate the subsequent determination of the splicing order. Specifically, they can be randomly sorted or sorted according to a preset sorting rule, such as sorting according to the length of the corresponding video segment or sorting according to the upload time of the corresponding original video.
[0073] S304: Generate video identifiers corresponding to each segment tag set respectively.
[0074] Among them, a segment tag set corresponds to a target video. That is, the video segment corresponding to each segment tag in a segment tag set is all the video data of a target video. It can be seen that the target video spliced in this application is not to cut each video segment from the original video and then splice it into a video. The target video only has a corresponding relationship with the video segment, or there is only a corresponding relationship between the video name and the video segment, so the spliced target video can only be considered as a virtual video.
[0075] For example, Figure 4 As shown in the figure, the five segment labels correspond to the target video F with a duration of 16 minutes. These five labels are the segment labels of the five original videos, namely original video A, original video B, original video C, original video D, and original video E. The video themes of these five labels are: game, game a, and game achievement b. The video segments corresponding to these five segment labels are the five video segments corresponding to the target video F. Therefore, as long as these five video segments are played in sequence, the target video F of 16 minutes can be played. Among them, the 0th minute to the 1st minute of the target video F is the 9th minute to the 10th minute of the video A corresponding to the video label 1; the 1st minute to the 3rd minute of the target video F is the 13th minute to the 15th minute of the video B corresponding to the video label 2; the 3rd minute to the 8th minute of the target video F is the 20th minute to the 25th minute of the video C corresponding to the video label 3; the 8th minute to the 12th minute of the target video F is the 16th minute to the 20th minute of the video D corresponding to the video label 4; the 12th minute to the 16th minute of the target video F is the 12th minute to the 16th minute of the video E corresponding to the video label 5.
[0076] It should be noted that the generated video identifier can be a name corresponding to the video theme of the segment tag in the segment tag set, which is the name of the target video, and then the video name is returned to the user terminal for selection or query. At the same time, the corresponding video cover and other information corresponding to the segment tag set can also be generated.
[0077] Based on the segment tags generated in the above embodiments, the combined segment tag set, the generated video identifiers and the corresponding relationship between them, the embodiment of the present application provides a video splicing method, such as Figure 5 As shown, including:
[0078] S501: Receive a play request for a target video, where the play request carries at least a video identifier of the target video.
[0079] Optionally, when the user terminal responds to the user selecting to play the target video, a play request of the target video is received. Optionally, in addition to carrying the video identifier of the target video, the play request may also include other attribute information of the target video, such as the video theme of the target video, the corresponding segment tag set, etc., and may also carry user information, so that the play request can be authenticated through the user information to determine whether the play request has the authority to play the target video.
[0080] S502: Acquire a transport stream address of a video segment corresponding to each segment tag corresponding to the video identifier, where each segment tag is a segment tag in a segment tag set corresponding to the video identifier.
[0081] It should be noted that videos are usually transmitted and stored using transport streams (TS). Therefore, the video data of a video is stored in TS packets. The video data contained in each TS packet is relatively small, so an original video or video clip is composed of multiple TS packets, and each TS packet has a corresponding transport stream address.
[0082] Specifically, each video identifier corresponds to a segment tag set, and the video segment corresponding to each segment tag in the segment tag set, and the data of each video segment is stored in the corresponding TS data packet. Therefore, what is obtained is the transport stream address of each TS data packet of the video segment corresponding to each segment tag corresponding to the video identifier.
[0083] S503: Connect the transport stream addresses in sequence to obtain a playlist of the target video.
[0084] Specifically, according to the segment tag sorting rule in the segment tag set, the transport stream addresses of the video segments corresponding to the segment tags may be arranged in sequence to obtain a play list of the target video.
[0085] S504: Return the playlist of the target video.
[0086] Since the video is composed of TS packets, when the user terminal requests a video, what is obtained is a playlist containing the transport stream addresses of all TS packets of the video. Then the user terminal obtains the video data for playback according to the transport stream addresses of the TS packets in the playlist. Therefore, the video splicing method provided by the embodiment of the present application divides the video into multiple video segments before receiving the playback request of the target video, generates a segment tag corresponding to each video segment, and generates a corresponding video identifier for the segment tag set. Therefore, when receiving the playback request of the target video, according to the video identifier carried in the playback request, the transport stream address of the video segment corresponding to each segment tag corresponding to the video identifier is obtained, and then each transport stream address is spliced in turn to obtain the playlist of the target video, and returned to the user terminal, so that the user terminal can play each video segment in turn, thereby realizing the splicing of multiple videos into a target video, so that there is no problem of switching and loading between videos, and effectively improving the user experience.
[0087] based on Figure 1 Corresponding embodiments, or based on Figure 3 Corresponding to the embodiment, in another embodiment of the present application, another video splicing method is improved. That is, in this embodiment, it can be performed only when Figure 1 After the corresponding embodiment, the method provided in this embodiment is executed, or it can be executed Figure 3 After the corresponding embodiment, the method provided in this embodiment is executed. Figure 6 As shown, the method specifically includes:
[0088] S601: Receive a query request for a video topic.
[0089] Specifically, the user terminal sends a query request when responding to a query about a video topic.
[0090] It should be noted that only executing Figure 1 After the corresponding embodiment, the method provided by this embodiment is executed, and then after executing step S602, step S603 is directly executed. Because there is no segment tag set at this time, there is no target video corresponding to the segment tag set, which is returned to the user terminal. Therefore, at this time, it is necessary to combine the segment tags accordingly according to the query request of the video theme. Figure 3After the corresponding embodiment, the method provided in this embodiment is executed, which means that the segment tag set and the corresponding video identifier have been pre-generated at this time, and can be fed back to the user terminal. However, considering that the video theme of the segment tags of the pre-generated segment tag set does not match the queried video theme, it is necessary to first determine whether there is a segment tag set consistent with the queried video theme; if so, the video identifier and video cover corresponding to the segment tag set consistent with the queried video theme are directly returned. If not, execute step S602.
[0091] S602: Combine multiple segment tags belonging to the queried video topic respectively to obtain multiple segment tag sets.
[0092] It should be noted that the specific implementation process of step S602 may refer to step S303 in the above embodiment, which will not be described in detail here.
[0093] S603: Generate and return the video identifier and video cover corresponding to each segment tag set.
[0094] Among them, a segment label set corresponds to a target video.
[0095] Optionally, the generated video identifier can be the name of the target video. Specifically, the corresponding name can be generated according to the queried video theme and the video theme in the segment tag of the segment tag set. For example, the queried video theme is an F1 racing video. The generated video identifier can generate an F1 racing accident video, an F1 racing overtaking video, etc. according to the different video themes in the segment tags of the segment tag set. For the video cover, an image frame can be selected from the video segment corresponding to any segment tag in the segment tag set as the video cover.
[0096] S604: Receive a play request for a target video, where the play request carries at least a video identifier of the target video.
[0097] It should be noted that the specific implementation process of this step can refer to step S501 in the above method embodiment, and will not be repeated here.
[0098] S605. When it is determined that the video identifier has a corresponding segment tag set, for each segment tag in the segment tag set, determine the address information of the original video corresponding to the identifier of the original video, and obtain the transmission stream address of the video segment corresponding to the time period of the original video based on the address information.
[0099] It should be noted that in addition to the spliced virtual video, the user terminal also provides the original video, so the target video selected by the user terminal for playback is not necessarily the spliced virtual video obtained by the query, but may also be the original video. Therefore, after receiving the playback request of the target video, first determine whether the target video is a spliced video or an original video based on whether there is a corresponding segment tag set according to the video identifier.
[0100] Specifically, when it is determined that there is a corresponding segment tag set for the video identifier, that is, when it is determined that the target video is a spliced video, the address information of the original video corresponding to the identifier of the original video is determined for each segment tag in the segment tag set. Among them, the address information of the original video refers to the address information of the content distribution network (CDN) server where the original video is located. It should be noted that in order to reduce network congestion and improve access response speed and hit rate, the current data is stored on different CDN servers. Therefore, different original videos may also be stored on different CDN servers. Through the identifier of the original video in the segment tag, the address information of the CDN server where the original video is located is queried, and then according to the address information of the CDN server, a video time period of the original video is obtained from the CDN server, and the corresponding video segment's transmission stream address. Among them, the video time period is the time period in the segment tag, and the time period indicates which time period in the original video the video segment corresponding to the segment tag is.
[0101] It should be noted that in addition to multiple CDN servers storing videos, there are usually multiple servers processing playback requests from user terminals. Therefore, after receiving the playback request and performing authentication, the server determined by the load balancing needs to determine whether the playback request can be processed on this server, that is, whether the requested target video can be scheduled. If it can be processed, the target video will be scheduled by this server. If it cannot be processed, the scheduler that can process this request, that is, the scheduling server of the target video, will be determined, and the address of the scheduling server of the target video will be returned, so that the user terminal can request the target video from the scheduling server of the target video, that is, forward the playback request. The server that can schedule the target video obtains the transmission stream address from each corresponding CDN server, splices it into a play list, and returns it to the user terminal.
[0102] For example, Figure 7As shown, the user terminal sends a play request for playing video F to request authentication and schedule video F. At this time, the authentication / scheduling server receives the play request. After authentication, if it is determined that video F is a spliced virtual video, it determines whether this server is the scheduling server of video F. If not, the play request is forwarded and the address of the scheduling server where video F is located is returned to the user terminal. The user terminal then requests the scheduling server of video F for the play list of video F. The scheduling server of video F determines the address of the CDN server where the original video of each video segment corresponding to each segment tag is located in the corresponding segment tag set according to the identifier of video F. Among them, the video segments that make up video F are the video segments of the original video A, original video B, original video C, original video D, and original video E, and these five original videos are stored on different CDN servers. Therefore, the scheduling server of video F needs to obtain the transmission stream addresses of each video segment that makes up video F from the five corresponding CDN services, and then splice these transmission stream addresses into a complete play list, and finally return the play list of video F to the user terminal.
[0103] S606: Concatenate the transport stream addresses in sequence to obtain and return a playlist of the target video.
[0104] The specific implementation of step S606 may refer to step S503 and step S504 in the above method embodiment, and will not be described in detail here.
[0105] Another embodiment of the present application provides a video splicing device, such as Figure 8 As shown, including:
[0106] The first receiving unit 801 is configured to receive a play request of a target video, wherein the play request at least carries a video identifier of the target video.
[0107] It should be noted that the specific working process of the first receiving unit 801 may refer to step S501 in the above method embodiment, and will not be repeated here.
[0108] The acquisition unit 802 is used to acquire the transport stream address of the video segment corresponding to each segment tag corresponding to the video identifier.
[0109] Each segment tag is a segment tag in a segment tag set corresponding to the video identifier.
[0110] It should be noted that the specific working process of the acquisition unit 802 may refer to step S502 in the above method embodiment, and will not be described in detail here.
[0111] The splicing unit 803 is used to sequentially splice the transport stream addresses to obtain a play list of the target video.
[0112] It should be noted that the specific working process of the splicing unit 803 may refer to step S503 in the above method embodiment, and will not be described in detail here.
[0113] The sending unit 804 is used to return the play list of the target video.
[0114] It should be noted that the specific working process of the sending unit 804 may refer to step S504 in the above method embodiment, and will not be repeated here.
[0115] Optionally, in another embodiment of the present application, a pre-processing unit is also included. Fig. 9 As shown, the pre-processing unit comprises:
[0116] The division unit 901 is used to divide the continuous image frames belonging to the same video theme in each uploaded original video into a video segment.
[0117] It should be noted that the specific working process of the division unit 901 may refer to step S101 in the above method embodiment, and will not be described in detail here.
[0118] The first generating unit 902 is configured to generate a segment tag corresponding to each video segment; wherein the segment tag at least includes a time period of the video segment in the original video, an identifier of the original video, and a video theme.
[0119] It should be noted that the specific working process of the first generating unit 902 may refer to step S102 in the above method embodiment, and will not be repeated here.
[0120] Optionally, in another embodiment of the present application, Fig. 9 , the preprocessing unit also includes:
[0121] The first combining unit 903 is used to respectively combine the segment tags belonging to the same video theme to obtain multiple segment tag sets.
[0122] It should be noted that the specific working process of the first combining unit 903 may refer to step S303 in the above method embodiment, which will not be described in detail here.
[0123] The second generating unit 904 is used to generate a video identifier corresponding to each segment tag set respectively; wherein one segment tag set corresponds to one target video.
[0124] It should be noted that the specific working process of the second generating unit 904 may refer to step S304 in the above method embodiment, and will not be repeated here.
[0125] Optionally, in another embodiment of the present application, the video splicing device further includes:
[0126] The second receiving unit is used to receive a query request for a video topic.
[0127] The second combining unit is used to respectively combine multiple segment tags belonging to the video theme to obtain multiple segment tag sets.
[0128] The third generating unit is used to generate and return the video identifier and video cover corresponding to each segment tag set, wherein one segment tag set corresponds to one target video.
[0129] It should be noted that the specific working process of the above-mentioned units in the embodiment of the present application can refer to steps S601 to S603 in the above-mentioned method embodiment, and will not be repeated here.
[0130] Optionally, in another embodiment of the present application, the acquiring unit 802 includes:
[0131] The acquisition subunit is used to determine the address information of the original video corresponding to the identifier of the original video for each segment tag in the segment tag set when it is determined that the video identifier has a corresponding segment tag set, and to obtain the transmission stream address of the video segment corresponding to the time period of the original video according to the address information.
[0132] It should be noted that the specific working process of the acquisition subunit may refer to step S605 in the above method embodiment, which will not be repeated here.
[0133] The present application provides a video splicing device, which pre-selects and generates a segment tag corresponding to each video segment before receiving a playback request for a target video, and generates a corresponding video identifier for a segment tag set. Therefore, when the first receiving unit receives a playback request for a target video, the acquisition unit obtains the transmission stream address of the video segment corresponding to each segment tag in the segment tag set corresponding to the video identifier according to the video identifier carried in the playback request, and then the splicing unit splices the various transmission stream addresses in sequence to obtain and return the play list of the target video. Thus, by splicing the transmission stream addresses of the video segments corresponding to the segment tags, multiple videos are spliced into one target video, and there is no longer the problem of switching and loading between videos, which effectively improves the user experience.
[0134] Another embodiment of the present application provides a computer storage medium for storing a program, which, when executed, is used to implement a video splicing method as provided in any one of the above method embodiments.
[0135] It should be noted that when the program is executed to implement the video splicing method provided by any of the above method embodiments, the specific implementation process can refer to the above method embodiments accordingly.
[0136] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0137] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A video splicing method, characterized in that: include: Receiving a query request for a video topic; Combining multiple segment labels belonging to the queried video topic respectively to obtain multiple segment label sets corresponding to the queried video topic, wherein one segment label set corresponds to one target video; Generate and return the video identifier corresponding to each of the segment tag sets corresponding to the queried video subject respectively; Receive a play request for the target video, where the play request carries at least a video identifier of the target video; Determine whether the current server is a scheduling server of the target video, and the scheduling server of the target video is a scheduling server that can schedule the target video; If it is determined that the current server is the scheduling server of the target video, then the address of the CDN server where the original video to which the video fragments corresponding to each segment tag in the corresponding segment tag set belong is determined according to the video identifier of the target video through the scheduling server of the target video; the video fragments corresponding to each segment tag belong to different original videos, and different original videos are stored on different CDN servers; the segment tag includes the identifier of the original video where the video fragment is located and the video theme of the video fragment, and the video theme corresponding to the video fragment includes multiple levels of different video themes; the identifier of the original video in the segment tag is used to query the address of the CDN server where the original video is located; if an image frame in the original video corresponds to multiple video themes, then this image frame is divided into multiple different video fragments by definition; the multiple video themes include multiple levels of different video themes; If it is determined that the current server is not the scheduling server of the target video, the address of the scheduling server of the target video is returned, so that the user terminal requests the target video from the scheduling server of the target video, and the scheduling server of the target video performs the step of determining, according to the video identifier of the target video, the address of the CDN server where the original video to which the video segment corresponding to each segment tag in the corresponding segment tag set belongs is located; According to the determined address of the CDN server, acquiring the delivery stream address of the video segment corresponding to each segment tag from a plurality of different CDN servers; splicing the transport stream addresses of the video segments corresponding to the segment tags to obtain a play list of the target video; Returns a playlist of the target video.
2. The method according to claim 1, characterized in that After receiving the playback request of the target video, the method further includes: Determining whether the target video is a spliced virtual video according to the video identifier of the target video; If the target video is a spliced virtual video, the step of determining, according to the video identifier of the target video, the address of the CDN server where the original video to which the video segments corresponding to each segment tag in the corresponding segment tag set belong is located is performed.
3. The method according to claim 2, characterized in that The receiving a request to play the target video includes: The server determined by load balancing receives a request for playing a target video; the request for playing the target video is used to request authentication and schedule the target video; After authentication, the step of determining whether the target video is a spliced virtual video according to the video identifier of the target video is performed.
4. A video splicing method, characterized in that: include: For the uploaded original video, the image frames that are continuous and belong to the same video theme in the original video are divided into a video segment according to definition, specifically including: when an image frame in the original video corresponds to multiple video themes, the image frame is divided into multiple different video segments according to definition; the multiple video themes include multiple levels of different video themes; Generate a segment label corresponding to each video segment, wherein the segment label at least includes a time period of the video segment in the original video, an identifier of the original video, and a video theme; the video theme of the video segment includes multiple levels of different video themes; The segment tags belonging to the same video theme are combined respectively to obtain multiple segment tag sets; wherein one video theme corresponds to one segment tag set, and one segment tag set corresponds to one target video; the video segments corresponding to each segment tag in one segment tag set belong to different original videos, and different original videos are stored in different CDN servers; Generating a video identifier corresponding to each of the segment tag sets as the video identifier of the target video; the identifier of the original video in the segment tag is used to query the address of the CDN server where the original video is located when the target video is requested to be played, so as to obtain the transport stream address of each video segment from multiple different CDN servers according to the determined address of the CDN server; the transport stream addresses of each video segment are used to splice into a play list of the target video; Receiving a query request for a video topic; Combining the plurality of segment tags belonging to the queried video topic respectively to obtain a plurality of segment tag sets corresponding to the queried video topic, wherein one segment tag set corresponds to one target video; Generate and return the video identifier corresponding to each of the segment tag sets corresponding to the queried video subject respectively; A play request of a target video is received through a scheduling server. If it is determined that the target video is a spliced virtual video, it is determined whether the current server is the scheduling server of the target video. If not, the play request is forwarded, and the address of the scheduling server where the target video is located is returned to the user terminal, so that the user terminal requests the scheduling server where the target video is located for a play list of the target video; wherein the play request carries at least a video identifier of the target video; The transmission stream addresses of the video segments corresponding to the segment tags corresponding to the video identifier are obtained through the scheduling server where the target video is located, wherein the address of the CDN server where the original video of the video segment corresponding to each segment tag in the corresponding segment tag set is located is determined according to the video identifier of the target video; different original videos to which the video segments constituting the target video belong are stored on different CDN servers; the transmission stream addresses of the video segments constituting the target video are obtained from the different CDN servers; the segment tags are segment tags in the segment tag set corresponding to the video identifier; Concatenate the transport stream addresses corresponding to the segment tags to obtain a play list of the target video; Return the playlist of the target video to the user terminal.
5. The method according to claim 4, characterized in that After generating the segment label corresponding to each video segment, the method further includes: The segment tag is stored in the attribute information of the original video.
6. The method according to claim 4, characterized in that The step of dividing the continuous image frames in the original video and belonging to the same video subject into a video segment includes: Obtaining the number of continuous image frames belonging to the same video subject in the original video; When the number meets the preset number, the continuous image frames in the original video and belonging to the same video subject are divided into a video segment by definition; When the number does not meet the preset number, it is prohibited to define and divide the continuous image frames in the original video that belong to the same video subject into one video segment.
7. A video splicing device, characterized in that: include: A second receiving unit, configured to receive a query request for a video topic; A second combining unit is used to respectively combine multiple segment tags belonging to the queried video topic to obtain multiple segment tag sets corresponding to the queried video topic, wherein one segment tag set corresponds to one target video; A third generating unit, configured to respectively generate and return a video identifier corresponding to each of the segment tag sets corresponding to the queried video subject; A first receiving unit, configured to receive a play request for the target video, wherein the play request carries at least a video identifier of the target video; An acquisition unit is used to determine whether the current server is the scheduling server of the target video, and the scheduling server of the target video is a scheduling server that can schedule the target video; if it is determined that the current server is the scheduling server of the target video, then the address of the CDN server where the original video to which the video segments corresponding to each segment tag in the corresponding segment tag set belong is located is determined by the scheduling server of the target video according to the video identifier of the target video; the video segments corresponding to each segment tag belong to different original videos, and different original videos are stored on different CDN servers; the segment tag includes the identifier of the original video and the corresponding video theme, and the video theme corresponding to the segment tag includes multiple levels of different video themes; The identifier of the original video in the segment tag is used to query the address of the CDN server where the original video is located; if an image frame in the original video corresponds to multiple video themes, the image frame is defined to be divided into multiple different video segments; the multiple video themes include multiple levels of different video themes; if it is determined that the current server is not the scheduling server of the target video, the address of the scheduling server of the target video is returned so that the user terminal requests the target video from the scheduling server of the target video, and the scheduling server of the target video executes the step of determining the address of the CDN server where the original video to which the video segment corresponding to each segment tag in the corresponding segment tag set belongs is located according to the video identifier of the target video; The acquisition unit is further configured to acquire, from a plurality of different CDN servers, the transport stream addresses of the video segments corresponding to the respective segment tags according to the determined addresses of the CDN servers; A splicing unit, used for splicing the transport stream addresses of the video segments corresponding to the segment tags to obtain a play list of the target video; The sending unit is used to return the play list of the target video.
8. A video splicing device, characterized in that: include: The dividing unit is used to divide the image frames that are continuous and belong to the same video theme in the uploaded original video into a video segment from the definition, specifically comprising: when an image frame in the original video corresponds to multiple video themes, dividing the image frame into multiple different video segments from the definition; the multiple video themes include multiple levels of different video themes; A first generating unit is used to generate a segment label corresponding to each video segment, wherein the segment label at least includes a time period of the video segment in the original video, an identifier of the original video, and a video theme; the video theme of the video segment includes multiple levels of different video themes; The first combining unit is used to respectively combine the segment tags belonging to the same video theme to obtain multiple segment tag sets; wherein one video theme corresponds to one segment tag set, and one segment tag set corresponds to one target video; the video segments corresponding to each segment tag in one segment tag set belong to different original videos, and the different original videos are stored in different CDN servers; The second generating unit is used to generate a video identifier corresponding to each of the segment tag sets as the video identifier of the target video; the identifier of the original video in the segment tag is used to query the address of the CDN server where the original video is located when the target video is requested to be played, so as to obtain the transport stream address of each video segment from multiple different CDN servers according to the determined address of the CDN server; the transport stream address of each video segment is used to splice into a play list of the target video; A second receiving unit, configured to receive a query request for a video topic; A second combining unit is used to respectively combine the multiple segment tags belonging to the queried video topic to obtain multiple segment tag sets corresponding to the queried video topic, wherein one segment tag set corresponds to one target video; A third generating unit, configured to respectively generate and return a video identifier corresponding to each of the segment tag sets corresponding to the queried video subject; A first receiving unit is used to receive a play request of a target video through a scheduling server, and if it is determined that the target video is a spliced virtual video, determine whether the current server is the scheduling server of the target video, and if not, forward the play request, and return the address of the scheduling server where the target video is located to the user terminal, so that the user terminal requests the scheduling server where the target video is located for a play list of the target video; wherein the play request carries at least a video identifier of the target video; An acquisition unit is used to acquire, through the scheduling server where the target video is located, the transport stream addresses of the video segments corresponding to the respective segment tags corresponding to the video identifier, wherein the address of the CDN server where the original video of the video segments corresponding to the respective segment tags in the corresponding segment tag set is located is determined according to the video identifier of the target video; different original videos to which the respective video segments constituting the target video belong are stored on different CDN servers; the transport stream addresses of the respective video segments constituting the target video are acquired from the different CDN servers; the respective segment tags are segment tags in the segment tag set corresponding to the video identifier; A splicing unit, used for splicing the transport stream addresses corresponding to the segment tags to obtain a play list of the target video; A sending unit is used to return the play list of the target video to the user terminal.
9. A computer storage medium, characterized in that Used to store a program, which, when executed, is used to implement the video splicing method as described in any one of claims 1-3, or to implement the video splicing method as described in any one of claims 4-6.
Citation Information
Patent Citations
Video loading method and electronic device
CN103716656A
A method and equipment for scheduling CDN edge nodes
CN109831511A
Video data processing method and device, computer readable medium and electronic equipment
CN110198432A
Video generation method, system and device, video playing method, system and device, storage medium and equipment
CN110213672A
Video editing method and electronic device
CN110381371A
