Disclosure of Invention
An object of the present application is to provide a system, a method and a device for video splicing and playing, which solve the problem that the video, the movie or the tv show must be completely spliced to see the whole effect, and the problems of time and labor consuming splicing and slow speed of viewing the sample.
According to an aspect of the present application, there is provided a system for splicing and playing videos, the system comprising:
a main control program, a play control file module and a player,
the broadcast control file module is used for generating a broadcast control file according to the video information input by the operation user;
the main control program comprises a broadcast control file reader which is used for establishing a broadcast control list in a memory according to a read broadcast control file, wherein the broadcast control list comprises video clips to be played which are played according to a play sequence;
the player is used for playing the video clips to be played in the play list according to a time axis in the play control file, wherein the time axis is determined by the play record of each video clip to be played in the play control list.
Further, the main control program includes an event control module, configured to trigger an event after the current video clip to be played is played, and play the next video clip to be played according to the event until all play records in the play control file are played.
Further, the main control program includes a timer, which is used to control the player when the playing time of the played video segment reaches the timer, so as to play the next video segment to be played.
Further, the player includes a player component, an API interface, and a scene switching interface, where the player component is configured to play a video clip, the API interface is configured to provide information of the played video clip, and the scene switching interface is configured to switch a scene between two segments of video clips to be played.
According to another aspect of the present application, there is also provided a method for playing a video mosaic, the method including:
generating a broadcast control file according to the input video information, wherein the video information comprises a video file to be played, a video scene switching mode and information of playing start and end time;
establishing a broadcast control list in a memory according to the read broadcast control file, wherein the broadcast control list comprises video clips to be played according to a play sequence;
and playing the video clips to be played in the play list according to a time axis in the play file, wherein the time axis is determined by the play record of each video clip to be played in the play list.
Further, the format of the broadcast control file includes a text file format, and each line of information in the text file format includes line recording information in the local line playlist, start time and end time of playing a video, and a video scene switching mode.
Further, establishing a broadcast control list in the memory according to the read broadcast control file, including:
prefetching a file header of the read broadcast control file into a broadcast control list;
and storing the position of the playing control file, the playing start time and the playing duration in the playing control list.
Further, playing the video clips to be played in the play list according to a time axis in the play file, including:
and playing the video clips to be played in the play list according to the time axis in the play control file, triggering an event after the current video clip to be played is played, and playing the next video clip to be played according to the event until all play records in the play control file are played.
Further, the method comprises:
supplementing the broadcast control list according to the video information and caching the video clips in the supplemented broadcast control list to a memory;
and pre-playing the video clips in the supplemented play list in the memory.
According to another aspect of the present application, there is also provided an apparatus for splicing and playing videos, the apparatus including:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method as previously described.
According to yet another aspect of the present application, there is also provided a computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to implement the method as described above.
Compared with the prior art, the playing control file is generated according to the input video information, wherein the video information comprises the video file to be played, a video scene switching mode and the information of the playing start time and the playing end time; establishing a broadcast control list in a memory according to the read broadcast control file, wherein the broadcast control list comprises video clips to be played according to a play sequence; and playing the video clips to be played in the play list according to a time axis in the play file, wherein the time axis is determined by the play record of each video clip to be played in the play list. The continuous playing of the player is controlled by utilizing the playing control file, so that the effect after the video is spliced can be seen without splicing the file, the defect that the whole effect can be seen only after the video, the film or the television series are completely spliced in the prior art is overcome, and the fast viewing of the film and television series styles and the fast viewing of the sample can be greatly reduced by means of the fast splicing playing function of the video. For a film, the player is used for appointing a starting point and playing time, so that the video file splicing time is greatly saved, and the production efficiency is improved. The video of different segments is quickly defined and continuously played, so that convenience is brought to real cutting.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (e.g., Central Processing Units (CPUs)), input/output interfaces, network interfaces, and memory.
The Memory may include volatile Memory in a computer readable medium, Random Access Memory (RAM), and/or nonvolatile Memory such as Read Only Memory (ROM) or flash Memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, Phase-Change RAM (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash Memory or other Memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, magnetic cassette tape, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transmyedia), such as modulated data signals and carrier waves.
Fig. 1 shows a schematic structural diagram of a system for video splicing and playing provided in accordance with an aspect of the present application, the system including: the system comprises a main control program 100, a broadcastcontrol file module 200 and a player 300, wherein the broadcastcontrol file module 200 is used for generating a broadcast control file according to video information input by an operation user; the main control program 100 includes a broadcast control file reader configured to create a broadcast control list in a memory according to a read broadcast control file, where the broadcast control list includes video clips to be played according to a play sequence; the player 300 is configured to play the video clips to be played in the play list according to a time axis in the play file, where the time axis is determined by the play record of each video clip to be played in the play list. The player can be an integrated video player, and can play a certain file from a specified time duration to a specified time point; the playing control file is a time axis playing control file and adopts a TXT file format, so that a common TXT file editor can open the file, and convenience is provided for quickly editing a time axis; the main control program can call the video player to control the video player to play from a fixed time point, and after playing to a certain specific time point, the main control program switches to the next playing clip according to the time axis playing control file, and the playing clip can be one clip of the video file and can also be another video file.
In an embodiment of the present application, the time axis control file mainly indicates a sequence of playing files, an initial position of playing files, a scene switching manner of playing files up and down, and the like. The broadcast control file is in a TXT format, so that manual or program modification can be facilitated. The basic format may be:
sequence number [ TAB ] playing file [ TAB ] starting time-ending time [ TAB ] scene change mode;
here, the sequence number represents that the present line is the record of the several lines in the present time axis playlist; TAB represents, each key value of each row is divided by TAB; from start time to end time, split by "-"; the time format is: how many seconds and milliseconds to start with the video, the seconds and milliseconds are divided by "-"; scene change mode: several values are preset to represent scene change patterns such as fade in and fade out, shot blur, shot fixation, etc. In one example:
1D \ movie \ material 5.avi 01.100-10.3001
2D movie material 2.avi 02.200-15.4002
In the first line, D: \ movie \ material. avi is a playing file; starting playing from 100 milliseconds in the 1 st minute to 300 milliseconds in the 10 th minute; the switching is performed in mode 1. In the second line, D: \ movie \ material 2.avi is a playing file; the playing is started from 200 ms in the 2 nd minute and ended at 400 ms in the 15 th minute; the switching is performed in mode 2.
Specifically, the main control program 100 includes an event control module, configured to trigger an event after the current video clip to be played is played, and play the next video clip to be played according to the event until all play records in the play control file are played. The main control program informs the player of the position and the starting point of the played video file, the player plays the video, after the end point is reached, the event control module initiates an event to inform the player, the player stops playing, the main control program simultaneously checks the next played file, loads and plays the next played file from the appointed time until the time shaft playing control file records are all played.
With continued reference to fig. 1, the main control program 100 includes a timer, which is used to control the player to play the next video clip to be played when the playing time of the played video clip reaches the timer. After the playing control is started, a timer is set, and after the timing is reached, the player is controlled to play the next file.
With continued reference to fig. 1, the player 300 includes a player component, an API interface, and a scene switching interface, where the player component is configured to play a video clip, the API interface is configured to provide information of the played video clip, and the scene switching interface is configured to switch a scene between two segments of video clips to be played. Here, the player provides a playing function as a component, and may provide an external scheduling API interface, set a playing time and a playing duration, and also perform setting of scene switching. The player component provides basic player functions, and can schedule play, play start time and the like to the outside through an API (application programming interface). The scene cut interface may provide scene changes that set up the player to switch between two segments of video. The controller also includes a system configuration module for setting basic parameters of the player, etc.
Fig. 2 is a flowchart illustrating a method for playing a video mosaic according to another aspect of the present application, where the method includes: step S11 to step S13,
in step S11, a broadcast control file is generated according to the recorded video information, where the video information includes a video file to be played, a video scene switching mode, and information of the start and end time of playing; here, the operator enters information of the video to be played, and the operator enters a video file to be played continuously, start and end times of the playing, and a mode of switching video scenes. The input video information can be repeatedly input and modified, can be directly input by opening a text file, and can also be input by means of a graphic mode. And forming a broadcast control file according to the input video information, wherein the broadcast control file comprises time axis information and can also be called as a time axis broadcast control file.
In step S12, a broadcast control list is created in the memory according to the read broadcast control file, where the broadcast control list includes video clips to be played that are played according to the play sequence; here, the main control program of the console extracts the broadcast control record from the memory to form a broadcast control list, as shown in fig. 3, the console reads the broadcast control file, and establishes a playlist in the memory. When splicing films, a cut file needs to be established independently, the cut is determined only when one film needs to be determined repeatedly, each cut occupies space, and the storage space is greatly wasted; in the application, the broadcast control list is established in the memory according to the broadcast control file, so that the video storage space is greatly saved. And only one material is reserved to realize the play as required.
In step S13, the video clips to be played in the play list are played according to a time axis in the play file, where the time axis is determined by the play record of each video clip to be played in the play list. Here, the console reads the control file to the playing clip, reads the time axis in the playing control file, processes the playing record, and stores the playing record in the playing control sequence, so as to play the video clip to be played in the playing control sequence in the order. By using the fixed-point and fixed-length playing function of the player, the film does not need to be cut really, thereby releasing manpower and greatly improving the splicing efficiency. The video splicing method is used for repeatedly cutting a film, so that the efficiency is improved.
In an embodiment of the present application, the format of the broadcast control file includes a text file format, and each line of information in the text file format includes line recording information in a local line playlist, start time and end time of playing a video, and a video scene switching mode. Here, the broadcast control file is recorded as a TXT format, and the content of the broadcast control file. Therefore, editing can be realized as long as the file name and the initial time are input, the user can conveniently use the device, the video can be spliced only by editing the text file, the style of the video can be quickly checked, if the effect of the checked sample is unsatisfactory, the playing list file is simply modified, the sample can be changed, and the efficiency is greatly improved. Exemplarily, the following steps are carried out:
1D \ movie \ material 5.avi 01.100-10.3001
2D movie material 2.avi 02.200-15.4002
3 http://video.opg.cn 03.300-13.600 1
4 \\10.50.20.4\movie\2.mp4 04.200-05.200 1
It should be noted that the video file may be in a local directory or in a network or shared network hard disk, so as to prevent the film from being copied over and copied, save time, and improve efficiency.
In an embodiment of the present application, in step S12, a file header of the read broadcast control file is prefetched into a broadcast control list; and storing the position of the playing control file, the playing start time and the playing duration in the playing control list. Here, after the console reads the time axis play control file, a play control queue is generated in the content according to the play control file, the play control queue stores the position of the play file, the start of play, the play duration and other information, and meanwhile, for smooth switching, the file header of each play file is prefetched into the list, and the prefetched segment is a video segment between the prefetched segments and the segments, for example, when the video segment is played to segment 2, the beginning part of segment 3 needs to be taken, so that the transition effect and the smooth transition are facilitated, and as shown in fig. 4, the video file is prefetched to form a complete list.
In an embodiment of the present application, in step S13, the video clips to be played in the play list are played according to the time axis in the play file, after the current video clip to be played is played, an event is triggered, and the next video clip to be played is played according to the event until all play records in the play file are played. The console informs the player of the position and the starting point of the played video file, the player plays the video, and after the end point is reached, the player is informed of an event initiated by an event controller arranged in the player, the player stops playing, simultaneously the next played file is checked, the next played file is loaded and played from the appointed time until the time axis playing control file records are all played. Therefore, the switching of playing can be realized by depending on the functions of the player, and the control of the upper scene and the lower scene is easier to realize. And a timer can be set to calculate the playing time length when the video clips in the playing control list are played.
In an embodiment of the present application, the method includes: supplementing the broadcast control list according to the video information and caching the video clips in the supplemented broadcast control list to a memory; and pre-playing the video clips in the supplemented play list in the memory. After the broadcast control list is established, the broadcast control list is supplemented according to the video information, the content of the beginning part of each video clip is cached, the content is prefetched into the memory for pre-playing, and the spliced sample is checked. The contents are supplemented through cache, so that smooth playing and special transition effects can be realized, and later-stage video switching is facilitated.
In a specific embodiment of the present application, as shown in fig. 5, first, a control program reads a broadcast control file, and the control program constructs a broadcast control list in a memory; then, supplementing a broadcast control list according to the video information, caching partial content, and facilitating later-stage video switching; starting a player to play the first segment; after the player finishes playing, reporting playing-finished event information to a control program; controlling the program to play the subsequent video clips in sequence; repeating the steps and playing n video clips; reporting event when the n video clips are played; and the control program inquires the play list and judges whether the play list is the last segment, and if the play list is the last segment, the whole play process is finished. Specific application effect scene examples: as shown in fig. 6, in order to splice several segments of 5 segments of video material, such as segment one to segment six, according to the video splicing method described in the present application, the six segments in fig. 6 are not cut, and the original file is still stored, but a play list is established, and a player is used to perform segmented continuous playing, so as to achieve the effect of continuously playing the six segments, and instead of being newly spliced into a file, a play list is established, such as the play list shown in fig. 7. Therefore, no intermediate clip file is generated, and after the time axis broadcast control file is edited, the sample can be directly played without splicing, so that the time is greatly saved. Especially, when the style of the whole video is not determined in the early stage and the shooting of the material is more, the method can greatly improve the efficiency.
The method utilizes the time axis to play the control file, forms and realizes the control of continuous playing of the player, thereby realizing the effect after the video splicing without splicing the file, overcoming the defect that the whole effect can only be seen after the video, the film or the TV play are spliced completely before, and depending on the function of the quick splicing playing of the video, the quick viewing of the styles of the film and the TV play which are greatly reduced, and the quick viewing of the sample film. The method can be used for designating the starting point and the playing time length by using the player, so that the video file splicing time is greatly saved, and the production efficiency is improved. The video of different segments is quickly defined and continuously played, so that convenience is brought to real cutting.
In addition, a computer readable medium is provided in an embodiment of the present application, and computer readable instructions are stored thereon, and the computer readable instructions can be executed by a processor to implement the foregoing method for video splicing and playing.
In an embodiment of the present application, an apparatus for splicing and playing a video is further provided, where the apparatus includes:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method as previously described.
For example, the computer readable instructions, when executed, cause the one or more processors to:
generating a broadcast control file according to the input video information, wherein the video information comprises a video file to be played, a video scene switching mode and information of playing start and end time;
establishing a broadcast control list in a memory according to the read broadcast control file, wherein the broadcast control list comprises video clips to be played according to a play sequence;
and playing the video clips to be played in the play list according to a time axis in the play file, wherein the time axis is determined by the play record of each video clip to be played in the play list.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, implemented using Application Specific Integrated Circuits (ASICs), general purpose computers or any other similar hardware devices. In one embodiment, the software programs of the present application may be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application through the operation of the computer. Program instructions which invoke the methods of the present application may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the present application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or a solution according to the aforementioned embodiments of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.