A multimedia file splicing method, device, equipment and medium
By splitting the multimedia file into multiple segments and configuring the scaling value, the problem of multimedia file splicing in the prior art is solved, and the target playback time cannot be accurately achieved when adjusting the playback rate, and the fast and accurate playback time adjustment and user experience improvement are achieved.
Patent Information
- Application Number
- CN202411406510.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-10-10
AI Technical Summary
When adjusting the playback rate, existing multimedia file splicing technology requires manual adjustments multiple times, which is slow and cannot accurately meet the playback time required by customers.
By obtaining multiple multimedia files, the target file is formed in the splicing order, and the target file is split into multiple fragments based on preset splitting rules. The ym3u8 protocol is used for these clips, and the file path, original playback time and scaling value are configured for each clip. The scaling value is adjusted according to the clip type to achieve the target playback time.
It quickly adjusts the playback time of the spliced video, can accurately achieve the target playback time, improves the user experience, and can set the playback speed according to user needs.
Smart Images

Figure CN118972666B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video editing, and in particular to a multimedia file splicing method, device, equipment and medium. Background Art
[0002] Splicing multimedia files means splicing two or more audio and video files into one audio and video file while maintaining the original audio and video quality.
[0003] The basic principle of audio and video merging is that in multimedia processing, video is a sequence of pictures composed of frames, which are played in chronological order to form a continuous dynamic picture. For video frames with the same parameters, their frame rate, resolution, encoding format, etc. are matched, which makes it possible to seamlessly connect the end of one video to the beginning of another without re-encoding, thus avoiding quality loss.
[0004] In order to adapt to the increasingly rich cultural life, various spliced videos have emerged. However, when adjusting the playback rate of these spliced videos, it is only achieved by manually adjusting them one by one. Not only does it require multiple adjustments and the adjustment rate is slow, but the effects after adjustment cannot meet customer needs. Summary of the invention
[0005] In view of the above problems, the present invention provides a multimedia file splicing method, device, equipment and medium that overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect, the present invention provides a multimedia file splicing method, comprising:
[0007] Get N multimedia files, where N is a positive integer;
[0008] Connect the N multimedia files end to end in sequence according to the splicing order to form a target file;
[0009] Based on a preset splitting rule, split the target file into M segments, and mark the type of each segment, where M is a positive integer and N is equal to or not equal to M;
[0010] The ym3u8 protocol is used for the M segments, and the following parameters are configured for each segment: the file path of each segment, the original playback duration of each segment, and the scaling ratio value of the original playback duration of each segment;
[0011] Based on the type of each segment, the scaling ratio value of the original playback duration of different types of segments is adjusted to control the playback duration of the target file to reach the target playback duration.
[0012] Preferably, the target file is split into M segments based on a preset splitting rule, and the type of each segment is marked, including:
[0013] Based on a first preset splitting rule, scanning the entire time series content of the target file to determine a boundary node of a content type of the target file;
[0014] Based on the demarcation node, the target file is split into M segments, and a first identification type of each segment is marked, wherein the first identification types of some segments of the M segments are the same.
[0015] Preferably, the target file is split into M segments based on a preset splitting rule, and the type of each segment is marked, including:
[0016] Based on a second preset rule, determining a time node of the target file according to the total duration of the target file;
[0017] Based on the time node, the target file is split into M segments, and the second identification type of each segment is marked.
[0018] Preferably, the target file is split into M segments based on a preset splitting rule, and the type of each segment is marked, including:
[0019] Based on a third preset splitting rule, scanning each video frame in the entire time sequence of the target file, and determining a target video frame in the target file that contains a target person or a target scene;
[0020] Based on the start frame and the end frame of the target video frame, the target file is split into M segments, and the third identification type of each segment is marked.
[0021] Preferably, the ym3u8 protocol is used for the M segments, and the following parameters are configured for each segment: the file path of each segment, the original playback duration of each segment, and the scaling ratio value of the original playback duration of each segment, including:
[0022] Based on the ym3u8 protocol, the M fragments are defined as a file to be parsed, the content header of the file to be parsed marks the version number of the current ym3u8 protocol, and the ym3u8 protocol ends with the suffix .ym3u8;
[0023] The following parameters are configured for each segment in the file to be parsed: the file path of each segment, the original playback duration of each segment, and the scaling ratio value of the original playback duration of each segment.
[0024] Preferably, the step of adjusting the scaling ratio of the original playback duration of different types of segments based on the type of each segment to control the playback duration of the target file to reach the target playback duration includes:
[0025] Get the target playback duration and the original playback duration of each segment;
[0026] Determine scaling values of the original playback durations of different types of segments based on the target playback duration, the original playback duration of each segment, and the type of each segment;
[0027] Based on the type of each segment, the scaling ratio value of the original playback duration of different types of segments is adjusted to control the playback duration of the target file to reach the target playback duration.
[0028] Preferably, determining the scaling ratio values of the original playback durations of different types of segments based on the target playback duration, the original playback duration of each segment, and the type of each segment includes:
[0029] Based on the type of each segment, determine a weight of each type of segment, wherein the weight of each type of segment is determined based on the user's interest point;
[0030] Based on the weight of each type of segment, the target playback duration, and the original playback duration of each segment, the scaling ratio values of the original playback durations of different types of segments are determined.
[0031] In a second aspect, the present invention further provides a multimedia file splicing device, comprising:
[0032] An acquisition module, used for acquiring N multimedia files, where N is a positive integer;
[0033] A splicing module, used for sequentially connecting the N multimedia files end to end in a splicing order to form a target file;
[0034] A splitting module, used for splitting the target file into M segments based on a preset splitting rule, and marking the type of each segment, where M is a positive integer and N is equal to or not equal to M;
[0035] A configuration module, configured to use the ym3u8 protocol for the M segments and configure the following parameters for each segment: a file path of each segment, an original playback duration of each segment, and a scaling value of the original playback duration of each segment;
[0036] The adjustment module is used to control the playback duration of the target file to reach the target playback duration by adjusting the scaling ratio value of the original playback duration of different types of segments based on the type of each segment.
[0037] In a third aspect, the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.
[0038] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0039] One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:
[0040] The present invention provides a multimedia file splicing method, comprising: obtaining N multimedia files, where N is a positive integer; connecting the N multimedia files end to end in sequence according to a splicing order to form a target file; based on a preset splitting rule, splitting the target file into M segments, and marking the type of each segment, where M is a positive integer, and N is equal to or not equal to M; using the ym3u8 protocol for the M segments, and configuring the following parameters for each segment: a file path of each segment, an original playback time of each segment, and a scaling ratio value of the original playback time of each segment; based on the type of each segment, adjusting the scaling ratio values of the original playback times of different types of segments to control the playback time of the target file to reach the target playback time, identifying different types of segments in the target file, splitting them, and setting corresponding playback time scaling ratio values for different types of segments, so as to quickly enable a spliced video to meet the target playback time and achieve a preset display effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Also, throughout the accompanying drawings, the same reference figures are used to represent the same components. In the drawings:
[0042] Figure 1 A schematic diagram showing the steps of a multimedia file splicing method according to an embodiment of the present invention is shown;
[0043] Figure 2 A complete .ym3u8 file in an embodiment of the present invention is shown;
[0044] Figure 3 A schematic diagram showing the structure of a multimedia file splicing device according to an embodiment of the present invention is shown;
[0045] Figure 4 A schematic diagram of the structure of a computer device for implementing a multimedia file splicing method in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0046] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0047] Embodiment 1
[0048] The embodiment of the present invention provides a multimedia file splicing method, such as Figure 1 As shown, including:
[0049] S101, obtaining N multimedia files, where N is a positive integer;
[0050] S102, connecting N multimedia files end to end in sequence according to the splicing order to form a target file;
[0051] S103, splitting the target file into M segments based on a preset splitting rule, and marking the type of each segment, where M is a positive integer and N is equal to or not equal to M;
[0052] S104, using the ym3u8 protocol for the M segments, configuring the following parameters for each segment: the file path of each segment, the original playback duration of each segment, and the scaling value of the original playback duration of each segment;
[0053] S105 , based on the type of each segment, the scaling ratio values of the original playback durations of the different types of segments are adjusted to control the playback duration of the target file to reach the target playback duration.
[0054] In a specific implementation, the splicing method can be applied to the editing and splicing process of various film and television works, or the editing and splicing of short videos, which is not limited here.
[0055] First, S101 to S102 is a process of simply splicing multiple multimedia files, that is, first obtaining N multimedia files, the sources of these N multimedia files can be different, and then, the N multimedia files are sequentially connected end to end in a splicing order to form a target file, where N is a positive integer.
[0056] For example, you can use the concat protocol solution provided by FFmpeg to splice different types of subtitle files (srt, ass, and ssa), video files (such as h264 ts slices), and audio files (mp3, aac). Of course, you can also splice videos with the same common encoding and container format, which is not limited here.
[0057] The spliced command line code is as follows:
[0058] ffmpeg-i''concat:. / in1.ass|. / in2.ass''-c copy. / out.ass
[0059] ffmpeg-i''concat:. / in1.ts|. / in2.ass.ts|. / in3.ass.ts''-c copy. / out.ts
[0060] The splicing order is to connect the files end to end according to the arrangement order of the files to obtain the target file
[0061] The target file is formed by splicing multiple multimedia files, for example, a video formed by splicing multiple captured clips with advertising clips to be inserted, or a video formed by splicing short videos from multiple different sources, and so on.
[0062] As the short video business continues to develop, users are more and more eager to quickly obtain video experience. Therefore, if the video playback time is too long, it will affect the user experience. For example, when we watch a video with a slow plot or uninteresting video, we often want to speed up the progress. We can speed it up by setting the speed, but these all require manual settings by the user. If the video itself has been set at a certain speed, the user experience will be better. However, the user's demand for speed is also different. In order to improve the viewing effect, the present invention can set the user's speed demand according to the predicted situation to meet the preset time to play the target file.
[0063] In order to obtain a video file that meets the user's playback progress, on the one hand, it is necessary to pre-judge and identify the different types or content segments of the video, and on the other hand, it is necessary to set the playback speed of the different types or content segments according to the target duration. Combining these two, a video file that meets the user's needs can be produced.
[0064] Therefore, S103 is executed to split the target file into M segments based on a preset splitting rule, and the type of each segment is marked, where M is a positive integer and N is equal to or different from M.
[0065] Before S103, a preset splitting rule is first determined. The splitting rule mentioned in the present invention may be a splitting rule determined according to the viewing habits of general users, or a splitting rule that can provide a better viewing effect.
[0066] Among them, by collecting statistics on the viewing habits of general users, a general splitting rule can be obtained; or, by collecting the viewing habits of each user for a period of time, a splitting rule that matches the user can be obtained. Of course, according to the display effect of the video, it can also be accelerated where it is accelerated and slowed down where it needs to be displayed clearly to achieve a better viewing effect.
[0067] These splitting rules may be rules for dividing time boundaries, rules for dividing content type boundaries, and of course, rules set for target person or target scene annotation, which are not limited here.
[0068] After obtaining these splitting rules, the target file is split according to these splitting rules.
[0069] In an optional embodiment, based on a first preset splitting rule, the entire time series content of the target file is scanned to determine the boundary node of the content type of the target file. Based on the boundary node, the target file is split into M fragments, and the first identification type of each fragment is marked, wherein the first identification type of some of the M fragments is the same.
[0070] This situation applies to inserting advertisements into film and television works. In addition, it can also be applied to the opening and ending credits of film and television works.
[0071] For example, for a film and television work obtained by splicing S101 and S102, the entire time sequence content is first scanned to identify different identification types including the opening, the ending, the main film and the advertisement. Therefore, the film and television work is divided into a first segment identified as the opening, a second segment identified as the ending, a third segment identified as the advertisement, a fourth segment identified as the advertisement, the first part of the main film between the first segment and the third segment, the second main film between the third segment and the fourth segment, and the third main film between the fourth segment and the second segment. Among them, the first identification type of the opening and the ending is the same. The third segment and the fourth segment are both advertisements, so the first identification type is also the same. The first main film, the second main film and the third main film are all main film content, so the first identification type is the same.
[0072] In an optional implementation, based on a second preset splitting rule and based on the total duration of the target file, a time node of the target file is determined; based on the time node, the target file is split into M segments, and a second identification type is marked for each segment.
[0073] For example, in the spliced short video, in order to adapt to the viewing habits of users, a commentary segment will appear every 1 minute, and the length of the commentary segment is 10 seconds. This time is set. Of course, the playing time of the commentary segment and the main content is not completely unchanged. Then, the short video can be split into multiple segments according to the time division of the commentary segment and the main content.
[0074] Film and television works can also be divided according to time nodes. For example, the opening and ending credits are both of fixed length and the time nodes are clear.
[0075] There are also some martial arts videos. In order to show the shocking effect of the martial arts scenes, the length of some turning clips can be shortened and the length of the front clips can be lengthened, thus presenting a different effect. These turning clips and front clips can be divided according to time nodes.
[0076] In an optional embodiment, based on a third preset splitting rule, each video frame in the entire time sequence of the target file is scanned to determine the target video frame containing the target person or target scene in the target file; based on the start frame and the end frame of the target video frame, the target file is split into M segments, and the third identification type of each segment is marked.
[0077] In film and television works, in order to adapt to users with different preferences, they can be edited into film and television works with various playback effects. For example, some users like the acting and plot of the female lead, but are not very concerned about the acting and plot of the second female lead. In this way, by selecting the video frames containing the female lead and the video frames not containing the female lead, the video frames containing the female lead are marked. Similarly, for the video frames not containing the female lead, the degree of correlation with the female lead is analyzed and marked according to the degree of correlation. Thus, fragments of different marked types are obtained.
[0078] In addition, it can also be split according to other user needs, which is not limited here.
[0079] Next, S104 is executed to use the ym3u8 protocol for the M segments, and the following parameters are configured for each segment: the file path of each segment, the original playback duration of each segment, and the scaling ratio value of the original playback duration of each segment.
[0080] Specifically, based on the ym3u8 protocol, M fragments are defined as a file to be parsed, the content header of the file to be parsed marks the version number of the current ym3u8 protocol, and the ym3u8 protocol ends with the suffix .ym3u8; the following parameters are configured for each fragment in the file to be parsed: the file path of each fragment, the original playback time of each fragment, and the scaling ratio value of the original playback time of each fragment.
[0081] Specifically, in the video playlist defined by the ym3u8 protocol, when playing in a video player based on FFmpe (an open source audio and video encoding tool), they will be parsed and played one by one according to the order defined. Each segment configures the file path, original playback duration, and the scaling value of the original playback duration, so that the actual playback duration of each segment can be effectively set. Figure 2 As shown, it is a complete .ym3u8 file.
[0082] Among them, for clips of the same type, the scaling ratio values of the original playback time are set to be the same. For example, the opening and ending credits belong to the same type, all main films belong to the same type, and so on. Accordingly, the scaling ratio values of the original playback time corresponding to the opening and ending credits are the same, and the scaling ratio values of the original playback time of all main films are the same.
[0083] Finally, S105 is executed to control the playback duration of the target file to reach the target playback duration by adjusting the scaling ratio value of the original playback duration of different types of segments based on the type of each segment.
[0084] Specifically, the target playback time and the original playback time of each segment are obtained; based on the target playback time, the original playback time of each segment and the type of each segment, the scaling ratio values of the original playback times of different types of segments are determined; based on the type of each segment, the playback time of the target file is controlled to reach the target playback time by adjusting the scaling ratio values of the original playback times of different types of segments.
[0085] The target playback time is set according to customer needs or business needs. In order to make the spliced video reach the target playback time, the playback time of each segment also needs to be reasonably planned.
[0086] When determining the scaling ratio values of the original playback times of different types of clips, the weight of each type of clip is determined based on the type of each clip, and the weight of each type of clip is determined based on the user's interest points; based on the weight of each type of clip, the target playback time, and the original playback time of each clip, the scaling ratio values of the original playback times of different types of clips are determined.
[0087] The weights here may be determined according to the user's interest points, and the sum of the weights here is equal to 1.
[0088] The weight can also be determined according to the importance of the segment. For example, the importance of the commentary part of the short video is 60%, and the importance of the main part is 40%. The weight is also in this proportion, which is not limited here.
[0089] Then, according to the weight of each type of segment, the target playback duration, and the original playback duration of each segment, the scaling ratio values of the original playback durations of the different types of segments are determined.
[0090] Specifically, the weight can be adjusted according to the size of the weight. The larger the weight, the larger the scaling value, and the smaller the weight, the smaller the scaling value. Thus, the larger the weight, the slower the playback speed, and the smaller the weight, the faster the playback speed.
[0091] One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:
[0092] The present invention provides a multimedia file splicing method, comprising: obtaining N multimedia files, where N is a positive integer; connecting the N multimedia files end to end in sequence according to a splicing order to form a target file; based on a preset splitting rule, splitting the target file into M segments, and marking the type of each segment, where M is a positive integer, and N is equal to or not equal to M; using the ym3u8 protocol for the M segments, and configuring the following parameters for each segment: a file path of each segment, an original playback time of each segment, and a scaling ratio value of the original playback time of each segment; for the type of each segment, by adjusting the scaling ratio values of the original playback times of different types of segments, so as to control the playback time of the target file to reach the target playback time, by identifying different types of segments in the target file, splitting them, and setting corresponding playback time scaling ratio values for different types of segments, the spliced video can be quickly made to meet the target playback time and achieve a preset display effect.
[0093] Embodiment 2
[0094] Based on the same inventive concept, the embodiment of the present invention also provides a multimedia file splicing device, such as Figure 3 As shown, including:
[0095] The acquisition module 301 is used to acquire N multimedia files, where N is a positive integer;
[0096] A splicing module 302, used for sequentially connecting the N multimedia files end to end in a splicing order to form a target file;
[0097] A splitting module 303 is used to split the target file into M segments based on a preset splitting rule, and mark the type of each segment, where M is a positive integer and N is equal to or not equal to M;
[0098] The configuration module 304 is used to configure the following parameters for each segment using the ym3u8 protocol for the M segments: the file path of each segment, the original playback duration of each segment, and the scaling value of the original playback duration of each segment;
[0099] The adjustment module 305 is used to control the playback duration of the target file to reach the target playback duration by adjusting the scaling ratio value of the original playback duration of different types of segments based on the type of each segment.
[0100] In an optional implementation, the splitting module 303 is used to:
[0101] Based on a first preset splitting rule, scanning the entire time series content of the target file to determine a boundary node of a content type of the target file;
[0102] Based on the demarcation node, the target file is split into M segments, and a first identification type of each segment is marked, wherein the first identification types of some segments of the M segments are the same.
[0103] In an optional implementation, the splitting module 303 is used to:
[0104] Based on the second preset splitting rule, determining the time node of the target file according to the total duration of the target file;
[0105] Based on the time node, the target file is split into M segments, and the second identification type of each segment is marked.
[0106] In an optional implementation, the splitting module 303 is used to:
[0107] Based on a third preset splitting rule, scanning each video frame in the entire time sequence of the target file, and determining a target video frame in the target file that contains a target person or a target scene;
[0108] Based on the start frame and the end frame of the target video frame, the target file is split into M segments, and the third identification type of each segment is marked.
[0109] In an optional implementation, the configuration module 304 is used to:
[0110] Based on the ym3u8 protocol, the M fragments are defined as a file to be parsed, the content header of the file to be parsed marks the version number of the current ym3u8 protocol, and the ym3u8 protocol ends with the suffix .ym3u8;
[0111] The following parameters are configured for each segment in the file to be parsed: the file path of each segment, the original playback duration of each segment, and the scaling ratio value of the original playback duration of each segment.
[0112] In an optional implementation, the adjustment module 305 is used to:
[0113] Get the target playback duration and the original playback duration of each segment;
[0114] Determine scaling values of the original playback durations of different types of segments based on the target playback duration, the original playback duration of each segment, and the type of each segment;
[0115] Based on the type of each segment, the scaling ratio value of the original playback duration of different types of segments is adjusted to control the playback duration of the target file to reach the target playback duration.
[0116] In an optional implementation, the adjustment module 305 is specifically configured to:
[0117] Based on the type of each segment, determine a weight of each type of segment, wherein the weight of each type of segment is determined based on the user's interest point;
[0118] Based on the weight of each type of segment, the target playback duration, and the original playback duration of each segment, the scaling ratio values of the original playback durations of different types of segments are determined.
[0119] Embodiment 3
[0120] Based on the same inventive concept, an embodiment of the present invention provides a computer device, such as Figure 4 As shown, it includes a memory 404, a processor 402, and a computer program stored in the memory 404 and executable on the processor 402. When the processor 402 executes the program, the steps of the above-mentioned multimedia file splicing method are implemented.
[0121] Among them, Figure 4 In the embodiment of the present invention, a bus architecture (represented by bus 400) is shown, and bus 400 may include any number of interconnected buses and bridges, and bus 400 links various circuits including one or more processors represented by processor 402 and memory represented by memory 404. Bus 400 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 406 provides an interface between bus 400 and receiver 401 and transmitter 403. Receiver 401 and transmitter 403 may be the same element, i.e., a transceiver, providing a unit for communicating with various other devices on a transmission medium. Processor 402 is responsible for managing bus 400 and general processing, while memory 404 may be used to store data used by processor 402 when performing operations.
[0122] Embodiment 4
[0123] Based on the same inventive concept, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the above-mentioned multimedia file splicing method are implemented.
[0124] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0125] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0126] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recorded in each embodiment. More specifically, as reflected in each embodiment, the inventive aspects lie in less than all the features of the single embodiment disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0127] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. All features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device so disclosed may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0128] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in a specific embodiment, any one of the claimed embodiments may be used in any combination.
[0129] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in a multimedia file splicing device or a computer device according to an embodiment of the present invention. The present invention may also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0130] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
Claims
1. A multimedia file splicing method, characterized in that: include: Get N multimedia files, where N is a positive integer; Connect the N multimedia files end to end in sequence according to the splicing order to form a target file; Based on a preset splitting rule, split the target file into M segments, and mark the type of each segment, where M is a positive integer and N is equal to or not equal to M; The ym3u8 protocol is used for the M segments, and the following parameters are configured for each segment: the file path of each segment, the original playback duration of each segment, and the scaling ratio value of the original playback duration of each segment, including: Based on the ym3u8 protocol, the M fragments are defined as a file to be parsed, the content header of the file to be parsed marks the version number of the current ym3u8 protocol, and the ym3u8 protocol ends with the suffix .ym3u8; The following parameters are configured for each segment in the file to be parsed: the file path of each segment, the original playback duration of each segment, and the scaling ratio value of the original playback duration of each segment; Based on the type of each segment, the scaling ratio value of the original playback duration of the different types of segments is adjusted to control the playback duration of the target file to reach the target playback duration; Based on the type of each segment, the scaling ratio value of the original playback duration of different types of segments is adjusted to control the playback duration of the target file to reach the target playback duration, including: Get the target playback duration and the original playback duration of each segment; Determine scaling values of the original playback durations of different types of segments based on the target playback duration, the original playback duration of each segment, and the type of each segment; The determining, based on the target playback duration, the original playback duration of each segment, and the type of each segment, the scaling ratio values of the original playback durations of different types of segments includes: Based on the type of each segment, determine a weight of each type of segment, wherein the weight of each type of segment is determined based on the user's interest point; Determine scaling values of the original playback durations of different types of segments based on the weight of each type of segment, the target playback duration, and the original playback duration of each segment; Based on the type of each segment, the scaling ratio value of the original playback duration of different types of segments is adjusted to control the playback duration of the target file to reach the target playback duration.
2. The method according to claim 1, characterized in that The target file is split into M segments based on the preset splitting rule, and the type of each segment is marked, including: Based on a first preset splitting rule, scanning the entire time series content of the target file to determine a boundary node of a content type of the target file; Based on the demarcation node, the target file is split into M segments, and a first identification type of each segment is marked, wherein the first identification types of some segments of the M segments are the same.
3. The method according to claim 1, characterized in that The target file is split into M segments based on the preset splitting rule, and the type of each segment is marked, including: Based on the second preset splitting rule, determining the time node of the target file according to the total duration of the target file; Based on the time node, the target file is split into M segments, and the second identification type of each segment is marked.
4. The method according to claim 1, characterized in that The target file is split into M segments based on the preset splitting rule, and the type of each segment is marked, including: Based on a third preset splitting rule, scanning each video frame in the entire time sequence of the target file, and determining a target video frame in the target file that contains a target person or a target scene; Based on the start frame and the end frame of the target video frame, the target file is split into M segments, and the third identification type of each segment is marked.
5. A multimedia file splicing device, characterized in that: include: An acquisition module, used for acquiring N multimedia files, where N is a positive integer; A splicing module, used for sequentially connecting the N multimedia files end to end in a splicing order to form a target file; A splitting module, used for splitting the target file into M segments based on a preset splitting rule, and marking the type of each segment, where M is a positive integer and N is equal to or not equal to M; A configuration module is used to use the ym3u8 protocol for the M segments, and configure the following parameters for each segment: the file path of each segment, the original playback duration of each segment, and the scaling value of the original playback duration of each segment. The configuration module is used to: Based on the ym3u8 protocol, the M fragments are defined as a file to be parsed, the content header of the file to be parsed marks the version number of the current ym3u8 protocol, and the ym3u8 protocol ends with the suffix .ym3u8; The following parameters are configured for each segment in the file to be parsed: the file path of each segment, the original playback duration of each segment, and the scaling ratio value of the original playback duration of each segment; The adjustment module is used to adjust the scaling ratio value of the original playback duration of different types of clips based on the type of each clip, so as to control the playback duration of the target file to reach the target playback duration, and the adjustment module is used to: Get the target playback duration and the original playback duration of each segment; Determine scaling values of the original playback durations of different types of segments based on the target playback duration, the original playback duration of each segment, and the type of each segment; Based on the type of each segment, the scaling ratio value of the original playback duration of the different types of segments is adjusted to control the playback duration of the target file to reach the target playback duration; The adjustment module is used for: Based on the type of each segment, determine a weight of each type of segment, wherein the weight of each type of segment is determined based on the user's interest point; Based on the weight of each type of segment, the target playback duration, and the original playback duration of each segment, the scaling ratio values of the original playback durations of different types of segments are determined.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Video playing method and device
CN108235123A
Method and device for sending file
CN108271039A