CN107277650B - Video file cutting method and device - Google Patents

Video file cutting method and device Download PDF

Info

Publication number
CN107277650B
CN107277650B CN201710611538.XA CN201710611538A CN107277650B CN 107277650 B CN107277650 B CN 107277650B CN 201710611538 A CN201710611538 A CN 201710611538A CN 107277650 B CN107277650 B CN 107277650B
Authority
CN
China
Prior art keywords
segmentation
expected
frame number
video file
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710611538.XA
Other languages
Chinese (zh)
Other versions
CN107277650A (en
Inventor
赵国强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
HUA RONG INFORMATION INDUSTRY Co.,Ltd.
Original Assignee
China Huarong Technology Group Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Huarong Technology Group Ltd filed Critical China Huarong Technology Group Ltd
Priority to CN201710611538.XA priority Critical patent/CN107277650B/en
Publication of CN107277650A publication Critical patent/CN107277650A/en
Application granted granted Critical
Publication of CN107277650B publication Critical patent/CN107277650B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs

Abstract

The disclosure relates to a video file cutting method and a video file cutting device, and the method provided by the embodiment of the disclosure comprises the following steps: acquiring segmentation parameters, wherein the segmentation parameters comprise expected segmentation frame numbers and expected segmentation parts; acquiring a video file, and estimating the total frame number of the video file; determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number; and segmenting the video file according to the segmentation strategy. According to the video file cutting method and device provided by the disclosure, the video file is cut in a non-mechanical mode, the cutting strategy is intelligently selected according to the size of the expected cutting frame number and the expected cutting number of the video file, the cutting of the video file is accurate to the fine granularity of the frame, and the cutting method is wide in application range and strong in fault tolerance.

Description

Video file cutting method and device
Technical Field
The present disclosure relates to the field of multimedia technologies, and in particular, to a method and an apparatus for cutting a video file.
Background
With the continuous development of big data (big data), video segmentation technology suitable for big data processing framework is also strong. However, the traditional video file cutting tool has a relatively coarse control on the size of the video and cannot be accurate to the frame level; the fault-tolerant capability of the original video file header is weak, such as the problem of messy codes of the initial part of the Haikang video file; the control interface for the output video file coding format after being divided is less, and the requirement of special application development is difficult to meet.
Disclosure of Invention
In view of this, the present disclosure provides a video file cutting method and apparatus.
According to an aspect of the present disclosure, there is provided a video file cutting method, including: acquiring segmentation parameters, wherein the segmentation parameters comprise an expected segmentation frame number and an expected segmentation number; acquiring a video file, and estimating the total frame number of the video file; determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number; and segmenting the video file according to the segmentation strategy.
In a possible implementation manner, determining a segmentation policy according to the total frame number, the expected segmentation frame number, and the expected number of segmentation copies includes: and not dividing the video file under the condition that the total frame number is less than or equal to the expected dividing frame number.
In a possible implementation manner, determining a segmentation policy according to the total frame number, the expected segmentation frame number, and the expected number of segmentation copies includes: under the condition that the total frame number is greater than the expected segmentation frame number, comparing the ratio obtained by dividing the total frame number by the expected segmentation frame number with the size of the expected segmentation number; and determining the actual number of divided parts of the video file as the expected number of divided parts when the ratio is larger than the expected number of divided parts.
In a possible implementation manner, determining a segmentation policy according to the total frame number, the expected segmentation frame number, and the expected number of segmentation copies further includes: under the condition that the total frame number is greater than the expected segmentation frame number, comparing the ratio obtained by dividing the total frame number by the expected segmentation frame number with the size of the expected segmentation number; and determining the actual number of divided parts of the video file as the ratio in the case that the ratio is less than or equal to the expected number of divided parts.
In a possible implementation manner, in a case that the remaining frame number of the last file obtained by the division is smaller than the expected division frame number, the remaining frame number is accommodated in the last file, and a completion operation is not performed.
According to another aspect of the present disclosure, there is provided a video file cutting apparatus, comprising: the parameter acquisition module is used for acquiring segmentation parameters, and the segmentation parameters comprise expected segmentation frame numbers and expected segmentation numbers; the video acquisition module is used for acquiring a video file and estimating the total frame number of the video file; the strategy determining module is used for determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number; and the video segmentation module is used for segmenting the video file according to the segmentation strategy.
In one possible implementation, the policy determination module includes: a first policy sub-module for not segmenting the video file if the total frame number is less than or equal to the expected segmentation frame number.
In one possible implementation manner, the policy determining module further includes: the second strategy submodule is used for comparing the ratio obtained by dividing the total frame number by the expected segmentation frame number with the size of the expected segmentation number under the condition that the total frame number is greater than the expected segmentation frame number; and determining the actual number of divided parts of the video file as the expected number of divided parts when the ratio is larger than the expected number of divided parts.
In one possible implementation manner, the policy determining module further includes: a third strategy submodule, configured to compare a ratio obtained by dividing the total frame number by the expected split frame number with the expected split number when the total frame number is greater than the expected split frame number; and determining the actual number of divided parts of the video file as the ratio in the case that the ratio is less than or equal to the expected number of divided parts.
In one possible implementation, the video segmentation module includes: and the first segmentation submodule is used for accommodating the residual frame number in the last file without completion operation under the condition that the residual frame number of the last file obtained by segmentation is smaller than the expected segmentation frame number.
According to still another aspect of the present disclosure, there is provided a video file cutting apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
the parameter acquisition module is used for acquiring segmentation parameters, and the segmentation parameters comprise expected segmentation frame numbers and expected segmentation numbers; the video acquisition module is used for acquiring a video file and estimating the total frame number of the video file; the strategy determining module is used for determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number; and the video segmentation module is used for segmenting the video file according to the segmentation strategy.
According to yet another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium having instructions therein, which when executed by a processor of a terminal and/or a server, enable the terminal and/or the server to perform a video file cutting method, the method including: acquiring segmentation parameters, wherein the segmentation parameters comprise an expected segmentation frame number and an expected segmentation number; acquiring a video file, and estimating the total frame number of the video file; determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number; and segmenting the video file according to the segmentation strategy.
According to the video file cutting method and device provided by the disclosure, the video file is cut in a non-mechanical mode, the cutting strategy is intelligently selected according to the size of the expected cutting frame number and the expected cutting number of the video file, the cutting of the video file is accurate to the fine granularity of the frame, and the cutting method is wide in application range and strong in fault tolerance.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flow chart of a video file cutting method according to an embodiment of the present disclosure;
FIG. 2 shows a system architecture diagram of a video file cutting method according to another embodiment of the present disclosure;
FIG. 3 shows a flow diagram of a video file cutting method according to another embodiment of the present disclosure;
FIG. 4 shows a block diagram of a video file cutting apparatus according to an embodiment of the present disclosure;
fig. 5 shows yet another block diagram of a video file cutting apparatus according to an embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
Example 1
Fig. 1 shows a flow chart of a video file cutting method according to an embodiment of the present disclosure. As shown in fig. 1, the method includes steps 11 to 14.
And 11, acquiring segmentation parameters, wherein the segmentation parameters comprise an expected segmentation frame number and an expected segmentation number.
In this embodiment, the segmentation parameters may further include an input video file absolute path, a video file processing frame offset, an output video file absolute path, and the like. The video file can be obtained according to the absolute path of the input video file, and the storage position of the segmented video can be determined according to the absolute path of the output video file.
And step 12, acquiring a video file and estimating the total frame number of the video file.
In this embodiment, the video file may be acquired according to an absolute path of the input video file. The acquired Video file may be a file encoded by h.264 (highly compressed digital Video codec standard) such as MP4(Moving Picture Experts Group 4), MOV (QuickTime film format, an Audio/Video file format developed by Apple inc.), AVI (Audio Video Interleaved format), and the like.
In the process of estimating the total frame number of the video file, whether a header file of the video file is readable or not needs to be confirmed. If the header file of the video file cannot be read, decoding the video file by using a different coding mode is attempted. If the video image can be correctly decoded, the pre-reading is carried out according to the current decoding mode, and the total frame number of the video file is estimated and obtained. If the header file of the video file is readable, the total frame number of the video file is directly estimated.
And step 13, determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number.
In one possible implementation, determining a segmentation strategy according to the total frame number, the expected segmentation frame number, and the expected number of segmentation copies (step 13) may include the following implementation manners:
in the first mode, the video file is not divided under the condition that the total frame number is less than or equal to the expected dividing frame number.
A second mode, under the condition that the total frame number is greater than the expected segmentation frame number, comparing the ratio obtained by dividing the total frame number by the expected segmentation frame number with the size of the expected segmentation number; and determining the actual number of divided parts of the video file as the expected number of divided parts when the ratio is larger than the expected number of divided parts.
Comparing the ratio obtained by dividing the total frame number by the expected division frame number with the expected division number under the condition that the total frame number is greater than the expected division frame number; and determining the actual number of divided parts of the video file as the ratio in the case that the ratio is less than or equal to the expected number of divided parts.
And step 14, segmenting the video file according to the segmentation strategy.
In this embodiment, the video segmentation preferentially determines readability of the video head file, acquires an encoding mode, then selects a corresponding decoder to decode, segments the processed video file, and supports multiple MPEG (Moving Picture experts group) encoding. In the process of segmenting the video file, because the total frame number of the video file is an estimated value, in order to prevent the boundary overflow when the video file is read, the actual frame number contained in the video file is counted in real time in the segmenting process, and the frame number of each segmented video file is accurately calculated. The segmented video file can meet the requirements of computation frameworks such as MapReduce (a programming model for parallel operation of large-scale data sets (larger than 1 TB)) on streaming media data segmentation.
In one possible implementation manner, the segmenting the video file according to the segmentation policy includes: and under the condition that the residual frame number of the last file obtained by segmentation is smaller than the expected segmentation frame number, the residual frame number is contained in the last file, and a completion operation is not carried out.
It should be noted that the above method is also applicable to the cutting of video streams, the specific cutting process is the same as that of video files, and the method steps can also be modified appropriately according to the characteristics of the video streams, and the disclosure is not limited thereto.
The method provided by the embodiment of the disclosure adopts a non-mechanical mode to cut the video file, intelligently selects the cutting strategy according to the size of the expected cutting frame number and the expected cutting number of the video file, and the like, and accurately cuts the video file to the fine granularity of the frame, and the cutting method has wide application range and strong fault-tolerant capability. Moreover, the method is suitable for various fields of streaming media data processing, video data segmentation and parallel computation, smart city data center construction and the like, and can realize automatic cutting and code conversion of video files or video streams with various formats. Further, the obtained segmented video file or video stream can meet the requirements of computation frameworks such as MapReduce and the like on the segmentation of streaming media data. In addition, the method is convenient for a big data platform to realize data distribution and scheduling of multiprocessing tasks, thereby realizing efficient processing and analysis of video streaming media data.
It should be noted that, although the video file cutting method is described above by taking the above embodiment 1 as an example, those skilled in the art can understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set the related method steps according to personal preference and/or actual application scenes, as long as the design idea of the technical scheme is met.
Example 2
In order to better describe the video file cutting method provided by the embodiment of the present disclosure, the video file cutting method according to the embodiment of the present disclosure is generally described below through the system architecture diagram of the above method, and fig. 2 shows a system architecture diagram of a video file cutting method according to another embodiment of the present disclosure, as shown in fig. 2, in the system architecture, the video file cutting method may include:
reading in parameters and video files: reading segmentation parameters (02) including an expected segmentation frame number, an expected segmentation number and the like; a video file/stream, i.e. a video file or a video stream, is acquired (01).
Calculating a segmentation strategy according to a video segmentation algorithm: estimating the total frame number of the video file/stream, and then determining a segmentation strategy (03) according to the total frame number, the expected segmentation frame number and the expected segmentation number on the basis of a pre-designed video segmentation algorithm.
And (3) dividing the video file according to a dividing strategy: the video file/stream is divided into at least one small video file according to the obtained division strategy and stored (04).
Fig. 3 shows a flow chart of a video file cutting method according to another embodiment of the present disclosure. As shown in fig. 3, the method includes steps 21 to 27.
Step 21, reading parameters. And acquiring and reading parameters such as an absolute path of an input video file, the number of frames of an expected video file, the number of copies of the expected video file, the offset of processing frames of the video file, an absolute path of an output video file and the like.
Step 22, parameter checking. It is checked whether the parameters read in step 21 are reasonable and the parameters are initialized. Whether the parameters are reasonable may include whether the absolute path of the input video file is really valid, etc.
And step 23, reading the video. And reading in the video file according to the input video file absolute path video. In the present embodiment, the reading of video files encoded in H264, such as MP4, MOV, AVI, and the like, is supported.
And step 24, calculating the total frame number. The total number of frames of the video file read in is estimated. First, the readability of the header file of the read video file is confirmed, and in the case where the header file is readable, the total number of frames of the video file is directly estimated. When the header file of the video file cannot be read, decoding of the video file using a different encoding scheme is attempted. If the video image can be correctly decoded, the pre-reading is carried out according to the current decoding mode, and then the total frame number of the video file is estimated. Note that the error of the total frame number obtained by estimation is within 25 frames.
And step 25, calculating a segmentation strategy. And determining a video file segmentation strategy according to the expected segmentation frame number and the expected segmentation number in the input parameters and the estimated total frame number of the video file. Wherein the expected number of split frames has a relatively higher priority than the expected number of split shares. Assuming that the total frame number of the video is a, the expected number of divided frames is E, and the expected number of divided parts is C, the actual number of divided parts N may be calculated as follows:
if A is less than E, then N is 1, i.e. not divided.
If A > E, and A/E > C, let N be C.
If A > E and A/E ≦ C, then N ═ A/E.
The calculation method is only an example, and in practical applications, other methods may be adopted for calculation.
And 26, video segmentation, namely segmenting the video file according to the obtained segmentation strategy. And the readability of the video head file is judged by the video segmentation priority, the coding mode is obtained, and then a corresponding decoder is selected for decoding. Because the total frame number of the video file is an estimated value, in order to prevent the boundary overflow when the video file is read, the real frame number contained in the video is counted in real time in the segmentation process, and the frame number of each segmented video file is accurately calculated. And in the last video file obtained, if the residual frame number is less than the expected video file frame number, the residual frame number is accommodated, and the completion operation is not carried out.
And 27, storing the video, namely storing the divided video file according to the absolute path of the output video file. The divided video file supports an encoding format such as XVID (MPEG-4 video codec written by OpenDivX) or MPEG.
The method provided by the embodiment of the disclosure adopts a non-mechanical mode to cut the video file, intelligently selects the cutting strategy according to the size of the expected cutting frame number and the expected cutting number of the video file, and the like, and accurately cuts the video file to the fine granularity of the frame, and the cutting method has wide application range and strong fault-tolerant capability. Moreover, the method is suitable for various fields of streaming media data processing, video data segmentation and parallel computation, smart city data center construction and the like, and can realize automatic cutting and code conversion of video files or video streams with various formats. Further, the obtained segmented video file or video stream can meet the requirements of computation frameworks such as MapReduce and the like on the segmentation of streaming media data. In addition, the method is convenient for a big data platform to realize data distribution and scheduling of multiprocessing tasks, thereby realizing efficient processing and analysis of video streaming media data.
It should be noted that, although the video file cutting method is described above by taking the above embodiment 2 as an example, those skilled in the art can understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set the related method steps according to personal preference and/or actual application scenes, as long as the design idea of the technical scheme is met.
Example 3
Based on the video file cutting method, the disclosure provides a video file cutting device. Fig. 3 shows a block diagram of a video file cutting apparatus according to an embodiment of the present disclosure. As shown in fig. 3, the apparatus includes:
a parameter obtaining module 301, configured to obtain a segmentation parameter, where the segmentation parameter includes an expected number of segmented frames and an expected number of segmented copies.
The video obtaining module 302 is configured to obtain a video file and estimate a total frame number of the video file.
And a strategy determining module 303, configured to determine a segmentation strategy according to the total frame number, the expected segmentation frame number, and the expected number of segments.
A video segmentation module 304, configured to segment the video file according to the segmentation policy.
Based on fig. 3, fig. 4 shows a further block diagram of a video file cutting apparatus according to an embodiment of the present disclosure.
In one possible implementation, as shown in fig. 4, the policy determining module 303 includes:
a first policy submodule 3031, configured to not divide the video file if the total frame number is less than or equal to the expected number of divided frames.
In one possible implementation manner, as shown in fig. 4, the policy determining module 303 further includes:
a second policy submodule 3032, configured to compare, when the total frame number is greater than the expected split frame number, a ratio obtained by dividing the total frame number by the expected split frame number with the size of the expected split number; and determining the actual number of divided parts of the video file as the expected number of divided parts when the ratio is larger than the expected number of divided parts.
In one possible implementation manner, as shown in fig. 4, the policy determining module 303 further includes:
a third policy submodule 3033, configured to compare, when the total frame number is greater than the expected split frame number, a ratio obtained by dividing the total frame number by the expected split frame number with the size of the expected split number; and determining the actual number of divided parts of the video file as the ratio in the case that the ratio is less than or equal to the expected number of divided parts.
In a possible implementation manner, as shown in fig. 4, the video segmentation module 304 further includes: the first dividing submodule 3041 is configured to, when the remaining frame number of the last file obtained by dividing is smaller than the expected divided frame number, accommodate the remaining frame number in the last file, and do not perform a completion operation.
It should be noted that, although the video file cutting apparatus is described above by taking the above embodiment 3 as an example, those skilled in the art will understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set the relevant modules according to personal preferences and/or actual application scenes, as long as the design idea of the technical scheme is met.
The device provided by the embodiment of the disclosure cuts the video file in a non-mechanical mode, intelligently selects the cutting strategy according to the size of the expected cutting frame number and the expected cutting number of the video file, and the like, and precisely cuts the video file to the fine granularity of the frame, and the cutting method has the advantages of wide application range and strong fault-tolerant capability. Moreover, the method is suitable for various fields such as streaming media data processing, video data segmentation and parallel computation, smart city data center construction and the like, and can realize automatic cutting and code conversion of video files or video streams with various formats; the obtained segmented video file or video stream can meet the requirements of computation frameworks such as MapReduce and the like on the segmentation of streaming media data; the method is convenient for the big data platform to realize the distribution of data and the scheduling of multiprocessing tasks, thereby realizing the high-efficiency processing and analysis of the video streaming media data.
Based on the video file cutting method and device, the present disclosure provides a video file cutting device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
the parameter acquisition module is used for acquiring segmentation parameters, and the segmentation parameters comprise expected segmentation frame numbers and expected segmentation numbers; the video acquisition module is used for acquiring a video file and estimating the total frame number of the video file; the strategy determining module is used for determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number; and the video segmentation module is used for segmenting the video file according to the segmentation strategy.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (5)

1. A video file cutting method is characterized by comprising the following steps:
acquiring segmentation parameters, wherein the segmentation parameters comprise an expected segmentation frame number and an expected segmentation number;
acquiring a video file, and estimating the total frame number of the video file;
determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number;
segmenting the video file according to the segmentation policy,
wherein, the determining the segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number comprises: determining the actual number of the segmentation parts of the video file according to the ratio obtained by dividing the total frame number by the expected segmentation frame number and the expected segmentation parts, and determining a segmentation strategy according to the total video frame number, the actual number of the segmentation parts and the expected segmentation frame number;
wherein, the determining the segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number comprises:
when the total frame number is less than or equal to the expected segmentation frame number, the video file is not segmented;
the determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number, further comprising:
under the condition that the total frame number is greater than the expected segmentation frame number, comparing the ratio obtained by dividing the total frame number by the expected segmentation frame number with the size of the expected segmentation number;
determining the actual number of the divided parts of the video file as the expected number of the divided parts under the condition that the ratio is larger than the expected number of the divided parts;
wherein, in the case that the ratio is less than or equal to the expected number of divided parts, the actual number of divided parts of the video file is determined as the ratio.
2. The method of claim 1, wherein the segmenting the video file according to the segmentation policy comprises:
and under the condition that the residual frame number of the last file obtained by segmentation is smaller than the expected segmentation frame number, the residual frame number is contained in the last file, and a completion operation is not carried out.
3. A video file cutting apparatus, comprising:
the parameter acquisition module is used for acquiring segmentation parameters, and the segmentation parameters comprise expected segmentation frame numbers and expected segmentation numbers;
the video acquisition module is used for acquiring a video file and estimating the total frame number of the video file;
the strategy determining module is used for determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number;
a video segmentation module for segmenting the video file according to the segmentation policy,
wherein, the determining the segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number comprises: determining the actual number of the segmentation parts of the video file according to the ratio obtained by dividing the total frame number by the expected segmentation frame number and the expected segmentation parts, and determining a segmentation strategy according to the total video frame number, the actual number of the segmentation parts and the expected segmentation frame number;
wherein the policy determination module comprises:
a first strategy submodule, configured to not segment the video file when the total frame number is less than or equal to the expected segmentation frame number;
the second strategy submodule is used for comparing the ratio obtained by dividing the total frame number by the expected segmentation frame number with the size of the expected segmentation number under the condition that the total frame number is greater than the expected segmentation frame number; and determining the actual number of divided parts of the video file as the expected number of divided parts when the ratio is larger than the expected number of divided parts;
a third strategy submodule, configured to compare a ratio obtained by dividing the total frame number by the expected split frame number with the expected split number when the total frame number is greater than the expected split frame number; and determining the actual number of divided parts of the video file as the ratio in the case that the ratio is less than or equal to the expected number of divided parts.
4. The apparatus of claim 3, wherein the video segmentation module comprises:
and the first video segmentation sub-module is used for accommodating the residual frame number in the last file without completion operation under the condition that the residual frame number of the last file obtained by segmentation is smaller than the expected segmentation frame number.
5. A video file cutting apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
the parameter acquisition module is used for acquiring segmentation parameters, and the segmentation parameters comprise expected segmentation frame numbers and expected segmentation numbers;
the video acquisition module is used for acquiring a video file and estimating the total frame number of the video file;
the strategy determining module is used for determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number;
a video segmentation module for segmenting the video file according to the segmentation policy,
wherein, the determining the segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number comprises: determining the actual number of the segmentation parts of the video file according to the ratio obtained by dividing the total frame number by the expected segmentation frame number and the expected segmentation parts, and determining a segmentation strategy according to the total video frame number, the actual number of the segmentation parts and the expected segmentation frame number;
wherein, the determining the segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number comprises:
when the total frame number is less than or equal to the expected segmentation frame number, the video file is not segmented;
the determining a segmentation strategy according to the total frame number, the expected segmentation frame number and the expected segmentation number, further comprising:
under the condition that the total frame number is greater than the expected segmentation frame number, comparing the ratio obtained by dividing the total frame number by the expected segmentation frame number with the size of the expected segmentation number;
determining the actual number of the divided parts of the video file as the expected number of the divided parts under the condition that the ratio is larger than the expected number of the divided parts;
wherein, in the case that the ratio is less than or equal to the expected number of divided parts, the actual number of divided parts of the video file is determined as the ratio.
CN201710611538.XA 2017-07-25 2017-07-25 Video file cutting method and device Active CN107277650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710611538.XA CN107277650B (en) 2017-07-25 2017-07-25 Video file cutting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710611538.XA CN107277650B (en) 2017-07-25 2017-07-25 Video file cutting method and device

Publications (2)

Publication Number Publication Date
CN107277650A CN107277650A (en) 2017-10-20
CN107277650B true CN107277650B (en) 2020-01-21

Family

ID=60079508

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710611538.XA Active CN107277650B (en) 2017-07-25 2017-07-25 Video file cutting method and device

Country Status (1)

Country Link
CN (1) CN107277650B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109635158A (en) * 2018-12-17 2019-04-16 杭州柚子街信息科技有限公司 For the method and device of video automatic labeling, medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6342904B1 (en) * 1998-12-17 2002-01-29 Newstakes, Inc. Creating a slide presentation from full motion video
CN101398855A (en) * 2008-10-24 2009-04-01 清华大学 Video key frame extracting method and system
CN103269436A (en) * 2013-05-20 2013-08-28 山东大学 Key frame selection method in 2D-3D video conversion
CN103336957A (en) * 2013-07-18 2013-10-02 中国科学院自动化研究所 Network coderivative video detection method based on spatial-temporal characteristics
CN105451031A (en) * 2015-11-18 2016-03-30 腾讯科技(深圳)有限公司 Video transcoding method and system thereof

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9154761B2 (en) * 2013-08-19 2015-10-06 Google Inc. Content-based video segmentation
CN104159127B (en) * 2014-08-21 2019-02-22 北京奇艺世纪科技有限公司 A kind of video transcoding method, apparatus and system
CN104184925A (en) * 2014-09-11 2014-12-03 刘鹏 Video scene change detection method
CN104796732B (en) * 2015-04-21 2018-05-08 无锡天脉聚源传媒科技有限公司 A kind of audio and video edit methods and device
CN104994368B (en) * 2015-07-10 2017-10-27 孙建德 Non-key frame sort method in 2D 3D Video Quality Metrics

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6342904B1 (en) * 1998-12-17 2002-01-29 Newstakes, Inc. Creating a slide presentation from full motion video
CN101398855A (en) * 2008-10-24 2009-04-01 清华大学 Video key frame extracting method and system
CN103269436A (en) * 2013-05-20 2013-08-28 山东大学 Key frame selection method in 2D-3D video conversion
CN103336957A (en) * 2013-07-18 2013-10-02 中国科学院自动化研究所 Network coderivative video detection method based on spatial-temporal characteristics
CN105451031A (en) * 2015-11-18 2016-03-30 腾讯科技(深圳)有限公司 Video transcoding method and system thereof

Also Published As

Publication number Publication date
CN107277650A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
CN110636298B (en) Unified constraints for Merge affine mode and non-Merge affine mode
CN112929744B (en) Method, apparatus, device, medium and program product for segmenting video clips
CN109064399B (en) Image super-resolution reconstruction method and system, computer device and storage medium thereof
US20170180746A1 (en) Video transcoding method and electronic apparatus
US20140105274A1 (en) Video Coding Redundancy Reduction
US10681367B2 (en) Intra-prediction video coding method and device
CN108462900B (en) Video recommendation method and device
US20150117545A1 (en) Layered Video Encoding and Decoding
CN111263243B (en) Video coding method and device, computer readable medium and electronic equipment
CN113965751B (en) Screen content coding method, device, equipment and storage medium
CN111147926B (en) Data transcoding method and device
US10812550B1 (en) Bitrate allocation for a multichannel media stream
CN103929648A (en) Motion estimation method and device in frame rate up conversion
CN110933436A (en) Image encoding method, image encoding device, computer device, and storage medium
US10200732B1 (en) Output-aligned avail blanking for video streams
CN109246433B (en) Video encoding method and device, decoding method and device and video transmission system
CN107277650B (en) Video file cutting method and device
US10264273B2 (en) Computed information for metadata extraction applied to transcoding
CN110891195B (en) Method, device and equipment for generating screen image and storage medium
CN111327898B (en) Video coding method and device, electronic equipment and storage medium
US11284074B2 (en) Cross-channel look ahead rate control for multi-channel video encoding
CN110809158B (en) Image loop filtering processing method and device
CN109302574A (en) A kind of method and apparatus handling video flowing
CN110944211A (en) Interpolation filtering method, device, medium and electronic device for intra-frame prediction
CN112565789B (en) Video decoding and encoding method, device, computer readable medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200416

Address after: 250101 Building 2, Qilu Software Park, No.1, Shunhua Road, high tech Zone, Jinan City, Shandong Province

Patentee after: HUA RONG INFORMATION INDUSTRY Co.,Ltd.

Address before: 100088 floor 15, block a, Chengjian building, No. 18, Beitaipingzhuang Road, Haidian District, Beijing

Patentee before: CHINA HUARONG TECHNOLOGY GROUP Co.,Ltd.

TR01 Transfer of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Video file cutting method and device

Effective date of registration: 20230606

Granted publication date: 20200121

Pledgee: Bank of Beijing Co.,Ltd. Jinan Branch

Pledgor: HUA RONG INFORMATION INDUSTRY Co.,Ltd.

Registration number: Y2023980043039

PE01 Entry into force of the registration of the contract for pledge of patent right