CN115297223A - Video processing method and device and electronic equipment - Google Patents

Video processing method and device and electronic equipment Download PDF

Info

Publication number
CN115297223A
CN115297223A CN202210775022.XA CN202210775022A CN115297223A CN 115297223 A CN115297223 A CN 115297223A CN 202210775022 A CN202210775022 A CN 202210775022A CN 115297223 A CN115297223 A CN 115297223A
Authority
CN
China
Prior art keywords
video
target
processing
processed
operations
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.)
Pending
Application number
CN202210775022.XA
Other languages
Chinese (zh)
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202210775022.XA priority Critical patent/CN115297223A/en
Publication of CN115297223A publication Critical patent/CN115297223A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/14Picture signal circuitry for video frequency region

Abstract

The embodiment of the invention provides a video processing method, a video processing device and electronic equipment, and relates to the technical field of video processing. The method comprises the following steps: determining a plurality of target operations based on parameter variation of initial parameters and target parameters of a video to be processed; determining an operation category to which each target operation belongs in preset operation categories; the preset operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation; determining a processing order of a plurality of target operations based on the priority of the operation category to which each target operation belongs; generating processing instructions for a plurality of target operations based on the processing order; and sending the processing instruction to a video processing tool so that the video processing tool executes the processing instruction on the video to be processed to obtain a video processing result. Compared with the prior art, the scheme provided by the embodiment of the invention can improve the video processing efficiency.

Description

Video processing method and device and electronic equipment
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a video processing method and apparatus, and an electronic device.
Background
Currently, with the continuous development of internet technology, more and more users select to watch various video products through the internet, and meanwhile, the users put forward higher requirements on the duration and the information content of the video products.
Video products such as short videos and video motion pictures are increasingly popular with multiple users due to the advantages of short time, large information amount and the like. At present, video products such as short videos and video motion pictures are manufactured by processing one or more videos through various operations. Therefore, the efficiency of processing video affects the efficiency of producing video products such as short videos and video motion pictures.
In the related art, a method for processing a video includes: determining an operation to be executed for processing an initial video, then performing IO (Input/Output), decoding, and video stream processing operations on a video to be processed, and encoding the processed video stream to finally obtain a video processing result of a target specification, such as a video, a picture, and the like.
As shown in fig. 1, an initial video may be decoded first to obtain a video stream, then three operations of stretching, cropping, and watermarking are performed on the video stream, and the operated video stream is encoded, thereby obtaining a video processing result of a target specification.
Based on this, a video operation method is needed to improve the efficiency of video processing.
Disclosure of Invention
An embodiment of the invention provides a video processing method, a video processing device and electronic equipment, so as to improve video processing efficiency. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a video processing method, including:
determining a plurality of target operations based on parameter variation of initial parameters and target parameters of a video to be processed;
determining an operation category of each target operation in preset operation categories; the preset operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation;
determining a processing order of the plurality of target operations based on the priority of the operation category to which each target operation belongs;
generating processing instructions for the plurality of target operations based on the processing order; the processing instruction is used for indicating to decode the video to be processed, executing the plurality of target operations on the decoded video stream according to the processing sequence, and encoding the operated video stream;
and sending the processing instruction to a video processing tool so that the video processing tool executes the processing instruction on the video to be processed to obtain a video processing result.
Optionally, in a specific implementation manner, the number of the videos to be processed is multiple, and the multiple target operations include: at least one target operation for each video to be processed;
the determining the processing order of the target operations based on the priority of the operation category to which each target operation belongs comprises:
for each video to be processed, if the number of the target operations for the video to be processed is multiple, determining a processing subsequence for each target operation of the video to be processed based on the priority of the operation category to which each target operation for the video to be processed belongs;
determining a processing order of the plurality of target operations based on the respective processing sub-orders.
Optionally, in a specific implementation manner, the number of the videos to be processed is multiple, and the multiple target operations include: a first sequence of target operations for each video to be processed, a merging operation for a plurality of the videos to be processed, and a second sequence of target operations for the merged video;
the processing instruction is used for indicating to decode each video to be processed and executing a first sequence target operation aiming at each video to be processed in parallel on the decoded video stream of each video to be processed; and merging the operated video streams, executing the second sequence target operation on the merged video streams, and encoding the executed video streams.
Optionally, in a specific implementation manner, the step of determining a processing order of the target operations based on the priority of the operation category to which each target operation belongs includes:
sequentially determining the processing sequence of each target operation belonging to different operation categories according to the sequence of the priorities from high to low;
for a plurality of target operations belonging to the same operation category, determining the sub-priority of each target operation in the operation category based on the operation parameter of the target operation, and determining the processing sequence of each target operation belonging to the operation category according to the sequence of the sub-priorities from high to low.
Optionally, in a specific implementation manner, the preset operation category includes: at least two of a first type of operation, a second type of operation, a third type of operation, and a fourth type of operation;
wherein the first type of operation comprises: reducing the data amount of the video stream and influencing the video processing speed after operation;
the second type of operation includes: the operation of the video stream data volume is not influenced;
the third type of operation includes: increasing the video stream data amount and affecting the video processing speed after operation;
the fourth type of operation includes: operations that affect the amount of video stream data and do not affect the video processing speed after the operations;
the category priority of the first type of operation is higher than that of the second type of operation, the category priority of the second type of operation is higher than that of the third type of operation, and the relationship between the category priority of the fourth type of operation and the category priority of the first type of operation, the category priority of the second type of operation and the category priority of the third type of operation is set according to preset conditions.
In a second aspect of the present invention, there is also provided a video processing method, including:
determining a plurality of target operations based on parameter variations of initial parameters of a video to be processed and target parameters of a target static image; wherein the plurality of target operations comprises: decimating and frame operations following the decimating, the frame operations comprising: at least one of cropping, stretching, scaling, watermarking and toning;
determining an operation category to which each target operation belongs in preset operation categories based on the method of any one of the first aspect, and determining a processing order of the plurality of target operations based on a priority of the operation category to which each target operation belongs;
generating processing instructions for the plurality of target operations based on the processing order;
and sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes the plurality of target operations on the decoded video stream according to the processing sequence, and codes the operated video stream to obtain the target static image.
In a third aspect of the present invention, there is also provided a video processing method, including:
determining a plurality of target operations based on the initial parameters of the video to be processed and the parameter variation of the target parameters of the target dynamic image; wherein the target operation comprises: down-framing, merging, cropping, toning, and scaling;
determining an operation category to which each target operation belongs in preset operation categories based on the method of any one of the first aspect, and determining a processing order of the plurality of target operations based on a priority of the operation category to which each target operation belongs;
generating processing instructions for the plurality of target operations based on the processing order;
and sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes the plurality of target operations on the decoded video stream according to the processing sequence, and codes the operated video stream to obtain the target dynamic image.
In a fourth aspect of the present invention, there is also provided a video processing method, including:
determining a plurality of target operations based on parameter variation of initial parameters of a video to be processed and target parameters of a target video; wherein the target operation comprises: down-framing, merging, cropping, toning, and scaling;
determining an operation category to which each target operation belongs in preset operation categories based on the method of any one of the first aspect, and determining a processing order of the plurality of target operations based on a priority of the operation category to which each target operation belongs;
generating processing instructions for the plurality of target operations based on the processing order;
and sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes the plurality of target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target video.
In a fifth aspect of the present invention, there is also provided a video processing apparatus, comprising:
the first operation determining module is used for determining a plurality of target operations based on the parameter variation of the initial parameter and the target parameter of the video to be processed;
the first class determination module is used for determining the operation class of each target operation in the preset operation classes; the preset operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation;
a first order determination module, configured to determine a processing order of the target operations based on a priority of an operation category to which each target operation belongs;
a first instruction generation module for generating processing instructions regarding the plurality of target operations based on the processing order; the processing instruction is used for indicating to decode the video to be processed, executing the plurality of target operations on the decoded video stream according to the processing sequence, and encoding the operated video stream;
and the first execution module is used for sending the processing instruction to a video processing tool so that the video processing tool executes the processing instruction on the video to be processed to obtain a video processing result.
Optionally, in a specific implementation manner, the number of the videos to be processed is multiple, and the multiple target operations include: at least one target operation for each video to be processed;
the first order determining module is specifically configured to:
for each video to be processed, if the number of target operations for the video to be processed is multiple, determining a processing subsequence for each target operation of the video to be processed based on the priority of the operation category to which each target operation for the video to be processed belongs;
determining a processing order of the plurality of target operations based on the respective processing sub-orders.
Optionally, in a specific implementation manner, the number of the videos to be processed is multiple, and the multiple target operations include: a first sequence of target operations for each video to be processed, a merging operation for a plurality of the videos to be processed, and a second sequence of target operations for the merged video;
the processing instruction is used for indicating to decode each video to be processed and executing a first sequence target operation aiming at each video to be processed in parallel on the decoded video stream of each video to be processed; and merging the operated video streams, executing the second sequence target operation on the merged video streams, and encoding the executed video streams.
Optionally, in a specific implementation manner, the first order determining module is specifically configured to:
sequentially determining the processing sequence of each target operation belonging to different operation categories according to the sequence of the priorities from high to low;
for a plurality of target operations belonging to the same operation category, determining the sub-priority of each target operation in the operation category based on the operation parameter of the target operation, and determining the processing sequence of each target operation belonging to the operation category according to the sequence of the sub-priorities from high to low.
Optionally, in a specific implementation manner, the preset operation category includes: at least two of a first type of operation, a second type of operation, a third type of operation, and a fourth type of operation;
wherein the first class of operation comprises: reducing the data volume of the video stream and influencing the video processing speed after operation;
the second type of operation includes: the operation of the video stream data volume is not influenced;
the third type of operation includes: increasing the video stream data amount and affecting the video processing speed after operation;
the fourth type of operation includes: operations that affect the amount of video stream data and do not affect the video processing speed after the operations;
the category priority of the first type of operation is higher than that of the second type of operation, the category priority of the second type of operation is higher than that of the third type of operation, and the relationship between the category priority of the fourth type of operation and the category priority of the first type of operation, the category priority of the second type of operation and the category priority of the third type of operation is set according to preset conditions.
In a sixth aspect of the present invention, there is also provided a video processing apparatus, comprising:
the second operation determining module is used for determining a plurality of target operations based on the parameter variation of the initial parameters of the video to be processed and the target parameters of the target static image; wherein the plurality of target operations comprises: frame extraction and frame extraction operation after the frame extraction, wherein the frame extraction operation comprises the following steps: at least one of cropping, stretching, watermarking, and toning
A second order determining module, configured to determine, based on the apparatus according to any of the fifth aspects, an operation category to which each target operation belongs in preset operation categories, and determine, based on a priority of the operation category to which each target operation belongs, a processing order of the plurality of target operations;
a second instruction generation module for generating processing instructions regarding the plurality of target operations based on the processing order;
and the second execution module is used for sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes the plurality of target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target static image.
In a seventh aspect of the present invention, there is also provided a video processing apparatus, comprising:
the third operation determining module is used for determining a plurality of target operations based on the parameter variation of the initial parameters of the video to be processed and the target parameters of the target dynamic image; wherein the target operation comprises: a plurality of down-framing, merging, cropping, toning, and scaling;
a third order determining module, configured to determine, based on the apparatus according to any of the fifth aspects, an operation category to which each target operation belongs in preset operation categories, and determine, based on a priority of the operation category to which each target operation belongs, a processing order of the plurality of target operations;
a third instruction generation module for generating processing instructions regarding the plurality of target operations based on the processing order;
and the third execution module is configured to send the processing instruction to a video processing tool, so that the video processing tool decodes the video to be processed, executes the multiple target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target dynamic image.
In an eighth aspect of the present invention, there is also provided a video processing apparatus, comprising:
the fourth operation determination module is used for determining a plurality of target operations based on the parameter variation of the initial parameters of the video to be processed and the target parameters of the target video; wherein the target operation comprises: down-framing, merging, cropping, toning, and scaling;
a fourth order determining module, configured to determine, based on the apparatus according to any of the fifth aspects, an operation category to which each target operation belongs in preset operation categories, and determine, based on a priority of the operation category to which each target operation belongs, a processing order of the plurality of target operations;
a fourth instruction generation module, configured to generate processing instructions for the multiple target operations based on the processing order;
a fourth execution module, configured to send the processing instruction to a video processing tool, so that the video processing tool decodes the video to be processed, executes the multiple target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target video.
In a ninth aspect of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and a processor for implementing any of the above-described video processing methods when executing the program stored in the memory.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, the computer program, when executed by a processor, implementing any of the video processing methods described above.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the video processing methods described above.
The embodiment of the invention has the following beneficial effects:
as can be seen from the above, with the solution provided by the embodiment of the present invention, when processing a video to be processed, a plurality of target operations may be determined based on parameter variations of an initial parameter and a target parameter of the video to be processed; then, determining the operation category of each target operation in the preset operation categories; the preset operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation; then, determining the processing sequence of a plurality of target operations based on the priority of the operation category to which each target operation belongs; in this way, based on the processing order, processing instructions regarding a plurality of target operations can be generated; the processing instruction is used for indicating to decode a video to be processed, executing a plurality of target operations on the decoded video stream according to a processing sequence, and encoding the operated video stream; and further, sending the processing instruction to the video processing tool so that the video processing tool executes the processing instruction on the video to be processed to obtain a video processing result.
Based on this, with the scheme provided by the embodiment of the present invention, after determining a plurality of target operations to be executed based on the initial parameters of the video to be processed and the parameter variation of the target parameters, a processing order of the plurality of target operations may be determined based on an operation category to which each determined target operation belongs and based on priorities of the operation categories, and then processing instructions regarding the plurality of target operations may be generated based on the processing order, so that the video processing tool encapsulates the plurality of target operations in one-time stream processing according to the processing order and executes the target operations, thereby obtaining a video processing result. Therefore, the video to be processed is processed according to the processing sequence obtained based on the priority of the operation type, the video processing speed is increased, and further the video processing efficiency is increased.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below.
FIG. 1 is a diagram illustrating an exemplary video processing method in the prior art;
fig. 2 is a schematic flowchart of a video processing method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an embodiment of S203 according to the present invention;
fig. 4 is a schematic diagram of an embodiment of S205 according to the present invention;
fig. 5 is a schematic diagram of a specific example of determining sub-priorities corresponding to target operations according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an embodiment of a video processing method according to the present invention;
fig. 7 is a flowchart illustrating another video processing method according to an embodiment of the present invention;
fig. 8 is a flowchart illustrating a video processing method according to another embodiment of the present invention;
fig. 9 is a flowchart illustrating a video processing method according to another embodiment of the present invention;
fig. 10 is a schematic structural diagram of an apparatus for video processing method according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an apparatus for another video processing method according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an apparatus for another video processing method according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of an apparatus for another video processing method according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In the related art, a method for processing a video includes: determining the operation to be executed for processing the initial video, then performing IO, decoding, and video stream processing on the video to be processed, and encoding the processed video stream, and finally obtaining the video processing result of the target specification, such as video, picture, and the like.
As shown in fig. 1, an initial video may be decoded to obtain a video stream, then three operations of stretching, cropping, and watermarking are sequentially performed on the video stream, and the operated video stream is encoded, thereby obtaining a video processing result of a target specification.
Based on this, a video operation method is needed to improve the efficiency of video processing.
In order to solve the above technical problem, an embodiment of the present invention provides a video processing method.
The method can be applied to various application scenes needing to process videos, for example, one video can be processed to obtain audio, a moving image or a static image; or processing several videos to obtain a short video; and one video can be processed, the video time length is shortened, and the like.
Meanwhile, the method can be applied to various electronic devices such as mobile phones, notebook computers, desktop computers and the like; the method includes the steps of installing independent application software for executing the method in various electronic devices, or adding a functional module for executing the method in the functional module of the electronic device, so that the application software and/or the functional module can execute the method to generate the processing instruction. For convenience of explanation, the application software and/or the functional module are simply referred to as an instruction generation tool, and may also be referred to as a command generator. In order to distinguish from a subsequent video processing tool, an execution subject of the video processing method provided by the embodiment of the invention is hereinafter simply referred to as an instruction generation tool.
In addition, after the processing instruction is generated, the processing instruction can be executed by various video processing tools with video processing functions, so that the processing of the video to be processed is completed, and a video processing result of the target specification is obtained.
The video processing tool may be application software installed in various electronic devices such as a mobile phone, a notebook computer, a desktop computer, and a server, for example, ffmpeg (Fast Forward Mpeg), and the server may be a local server or a cloud server; the video processing tool may also be a functional module for executing the processing instruction in functional modules of various electronic devices such as a mobile phone, a notebook computer, a desktop computer, and the like. Also, the video processing tool may also be referred to as a command executor.
Moreover, the instruction generating tool and the video processing tool may be located in the same electronic device, or may be located in different electronic devices.
Based on this, the embodiment of the present invention does not limit the application scenario and the execution subject of the method.
The video processing method provided by the embodiment of the invention can comprise the following steps:
determining a plurality of target operations based on parameter variation of initial parameters and target parameters of a video to be processed;
determining an operation category to which each target operation belongs in preset operation categories; the preset operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation;
determining a processing order of the plurality of target operations based on the priority of the operation category to which each target operation belongs;
generating processing instructions for the plurality of target operations based on the processing order; the processing instruction is used for indicating to decode the video to be processed, executing the plurality of target operations on the decoded video stream according to the processing sequence, and encoding the operated video stream;
and sending the processing instruction to a video processing tool so that the video processing tool executes the processing instruction on the video to be processed to obtain a video processing result.
As can be seen from the above, with the scheme provided by the embodiment of the present invention, when processing a video to be processed, a plurality of target operations may be determined based on parameter variations of an initial parameter and a target parameter of the video to be processed; then, determining the operation category of each target operation in the preset operation categories; the preset operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation; then, determining the processing sequence of a plurality of target operations based on the priority of the operation category to which each target operation belongs; thus, based on the processing order, processing instructions for a plurality of target operations may be generated; the processing instruction is used for indicating to decode a video to be processed, executing a plurality of target operations on the decoded video stream according to a processing sequence, and encoding the operated video stream; and further, sending the processing instruction to the video processing tool so that the video processing tool executes the processing instruction on the video to be processed to obtain a video processing result.
Based on this, with the scheme provided by the embodiment of the present invention, after determining a plurality of target operations to be executed based on the initial parameters of the video to be processed and the parameter variation of the target parameters, a processing order of the plurality of target operations may be determined based on an operation category to which each determined target operation belongs and based on priorities of the operation categories, and then processing instructions regarding the plurality of target operations may be generated based on the processing order, so that the video processing tool encapsulates the plurality of target operations in one-time stream processing according to the processing order and executes the target operations, thereby obtaining a video processing result. Therefore, the video to be processed is processed according to the processing sequence obtained based on the priority of the operation type, the video processing speed is increased, and further the video processing efficiency is increased.
A video processing method provided in the embodiments of the present application is specifically described below with reference to the accompanying drawings.
Fig. 2 is a schematic flowchart of a video processing method according to an embodiment of the present invention, and as shown in fig. 2, the method may include the following steps S201 to S205.
S201: determining a plurality of target operations based on parameter variation of initial parameters and target parameters of a video to be processed;
before processing a video to be processed, firstly, according to actual needs, a worker determines a video product obtained after the video to be processed is expected to be processed and parameters of the video product. For example, it is desirable to process a video to be processed to obtain a motion picture with a frame rate of 12, a width and height of 480 × 270, and a contrast of 1.05.
In this way, the desired video product can be used as the target video, and the parameters of the target video can be used as the target parameters.
Furthermore, the instruction generation tool may determine a parameter variation amount of an initial parameter of the video to be processed and a target parameter of the target video, so that based on the parameter variation amount, the instruction generation tool may determine a plurality of target operations that need to be performed on the video to be processed.
The instruction generation tool can acquire an initial parameter of a video to be processed and a target parameter of a target video, and then calculate to obtain a parameter variation between the initial parameter and the target parameter; the instruction generation tool may also directly obtain the parameter variation, that is, after determining the target parameter, the worker calculates the parameter variation between the initial parameter of the video to be processed and the target parameter of the target video, and inputs the parameter variation to the instruction generation tool.
Moreover, the multiple target operations may include the same type of operation, or may include different types of operations, for example, a target operation includes watermarking with different operation parameters twice, and for example, a target operation includes merging, clipping, watermarking, and color matching. This is all reasonable.
In the embodiment of the present invention, the specific acquisition manner of the parameter variation and the specific number and type of the target operation are not limited.
S202: determining an operation category to which each target operation belongs in preset operation categories;
the preset operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation;
in this specific implementation manner, the data amount of the video stream may affect the speed of the video processing, and the smaller the data amount of the video stream is, the faster the video processing speed is. That is, if the video stream is reduced after an operation is performed, the video processing speed after the operation can be increased accordingly; if the video stream is increased after an operation is performed, the video processing speed after the operation may be reduced accordingly.
Based on this, the plurality of operations may be divided into a plurality of categories in advance according to the influence of each operation on the amount of video stream data and the video processing speed after the operation, to obtain a plurality of preset operation categories, for example, the plurality of operations may be divided into three operation categories, to obtain three preset operation categories, that is, a first category operation, a second category operation, and a third category operation.
In this way, after a plurality of target operations are determined, for each target operation, an operation category to which the target operation belongs among preset operation categories can be determined.
For example, the multiple operations may be pre-divided into three classes to obtain three preset operation classes, and obtain the corresponding relationship between each operation and the operation class. In this way, after determining that the plurality of target operations include clipping, scaling, toning and stretching, the operation category to which each target operation belongs in the preset operation categories may be determined in the above correspondence relationship, respectively.
Table 1 shows the correspondence between each target operation and the operation type, in which a first type of operation belonging to the preset operation type is clipped, a first type of operation belonging to the preset operation type is scaled, a second type of operation belonging to the preset operation type is toned, and a third type of operation belonging to the preset operation type is stretched.
TABLE 1
Operation of Class of operation
Cutting out Operation of the first kind
Zoom Operation of the first kind
Color matching Operation of the second kind
Stretching of Operation of the third kind
Each operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation, for example, the operation categories can be divided according to the video stream data volume reduced by the operation and the video processing speed after the operation increased, or according to the video stream data volume increased by the operation and the video processing speed after the operation reduced; meanwhile, the number of the divided operation categories can be set according to the requirements of the actual situation. In this regard, the embodiment of the present invention does not limit a specific division manner of the operation categories.
Optionally, in a specific implementation manner, the preset operation category may include: at least two of a first type of operation, a second type of operation, a third type of operation, and a fourth type of operation;
wherein the first type of operation comprises: reducing the data amount of the video stream and influencing the video processing speed after operation;
the second type of operation includes: the operation of the video stream data volume is not influenced;
the third class of operations includes: increasing the video stream data amount and affecting the video processing speed after operation;
the fourth class of operations includes: operations that affect the amount of video stream data and do not affect the video processing speed after the operations;
and the category priority of the first type of operation is higher than that of the second type of operation, the category priority of the second type of operation is higher than that of the third type of operation, and the relationship between the category priority of the fourth type of operation and the category priority of the first type of operation, the category priority of the second type of operation and the category priority of the third type of operation is set according to preset conditions.
In this specific implementation, the operations may be classified into four types, namely, a first type of operation, a second type of operation, a third type of operation, and a fourth type of operation, according to the influence on the video data amount and the video processing speed after the operation.
Among the conditions that need to be satisfied by an operation in the first class of operations is that the amount of video stream data is reduced after the operation is performed, and the video processing speed is increased after the operation, for example: frame extraction, clipping, frame dropping, scaling and other operations;
the conditions that need to be met by the operations in the second category of operations include that after performing the operation, the amount of video stream data is not affected, neither increased nor decreased, for example: operations such as watermarking, toning and the like;
the conditions that need to be satisfied by the operations in the third category of operations include that the amount of video stream data increases after the operation is performed, and the video processing speed is also slowed down after the operation, for example: stretching and the like;
the conditions that need to be met by an operation in the fourth category of operations include that after performing the operation, the amount of video stream data is affected, either increased or decreased, and that the video processing speed does not change after the operation, for example: merging and the like.
After the four operation categories are divided, determining the category priority of the four operation categories as follows: the category priority of the first type of operation is higher than that of the second type of operation, the category priority of the second type of operation is higher than that of the third type of operation, and the relationship between the category priority of the fourth type of operation and the category priority of the first type of operation, the category priority of the second type of operation, and the category priority of the third type of operation is set according to preset conditions.
The preset condition may be that the category priority of the fourth type operation is higher than the category priority of the first type operation, the category priority of the second type operation, and the category priority of the third type operation, or may be that the category priority of the fourth type operation is lower than at least one of the category priority of the first type operation, the category priority of the second type operation, and the category priority of the third type operation, which is reasonable.
That is, the relationship between the category priority of the fourth type of operation and the category priority of the first type of operation, the category priority of the second type of operation, and the category priority of the third type of operation may be set according to actual requirements.
S203: determining a processing order of a plurality of target operations based on the priority of the operation category to which each target operation belongs;
for each target operation, after the operation category of the target operation in the preset operation category is determined, the target operations may be sorted based on the priority of the operation category to which each target operation belongs, and the processing order of the target operations may be determined.
That is, after determining the operation category of the target operation in the preset operation categories, the priority of the operation category to which the target operation belongs may be determined as the priority corresponding to the target operation. Thus, for each target operation, the priority corresponding to the target operation is the priority of the operation class to which the target operation belongs. For example, the watermarking belongs to the second class of operation, the class priority of the second class of operation is the second priority, and the priority corresponding to the watermarking is the second priority.
Furthermore, the processing order of the target operations may be determined by sorting the processing order of the target operations based on the priority corresponding to each target operation.
For each target operation, after the operation category to which the target operation belongs is determined, the priority corresponding to the operation category to which the target operation belongs may be determined according to the correspondence among the operations, the operation categories, and the priorities, and the priority corresponding to the operation category to which the target operation belongs is taken as the priority corresponding to the target operation.
Illustratively, table 2 is a partial correspondence between operations, operation categories, and priorities.
TABLE 2
Operation of Class of operation Class priority
Cutting out Operation of the first kind First priority level
Zoom Operation of the first kind First priority
Watermarking Operation of the second kind Second priority
Stretching Operation of the third kind Third priority
The priority is used to represent the execution order of each target operation, and for each target operation, the higher the priority corresponding to the target operation, the earlier the target operation is executed. That is, the execution order of the corresponding target operation with high priority is before the execution order of the corresponding target operation with low priority.
Further, after determining the priority of each target operation, the processing order of the target operations may be sorted according to the priority corresponding to each target operation, and the higher the priority corresponding to the target operation is, the earlier the execution order is.
That is, the processing order of the plurality of target operations is determined in the order of the priority corresponding to each target operation from top to bottom.
Illustratively, the plurality of target operations includes: and cutting, stretching and toning, wherein the priority corresponding to cutting is higher than the priority corresponding to toning, and the priority corresponding to toning is higher than the priority corresponding to stretching, so that the processing sequence of the target operations is cutting, toning and stretching in sequence.
For example, in order to facilitate understanding of the above specific implementation manner for determining the processing order of the plurality of target operations based on the priority of the operation category to which each target operation belongs, the following description is specifically made with reference to fig. 3.
As shown in fig. 3, based on the initial parameter of the video to be processed and the parameter variation of the target parameter, five target operations are determined, wherein two target operations belong to a first class of operation, and the two target operations belonging to the first class of operation are respectively denoted as a class operation 1 and a class operation 2; the two target operations belong to a second type of operation, and the two target operations belonging to the second type of operation are respectively marked as a second type of operation 1 and a second type of operation 2; an operation belongs to a third class of operation, denoted as a third class of operation, wherein the first class of operation has a higher priority than the second and third classes of operation, and the second class of operation has a higher priority than the third class of operation.
In this way, based on the priority of the operation category to which each target operation belongs, the processing order of each target operation may be determined, that is, the processing order of the five target operations is sorted, the first-class operation 1 and the first-class operation 2 are preferentially executed, the second-class operation 1 and the second-class operation 2 are executed subsequently, and the third-class operation is executed finally, so that the processing order of the five target operations is sequentially the first-class operation 1, the first-class operation 2, the second-class operation 1, the second-class operation 2, and the third-class operation.
In fig. 3, the area of the square where each target operation is located represents the size of the data volume of the video stream when the operation is performed, that is, performing the first-type operation 1 and the first-type operation 2 can reduce the data volume of the video stream, performing the second-type operation 1 and the second-type operation 2 does not affect the data volume of the video stream, and performing the third-type operation increases the data volume of the video stream. Thus, the above five target operations are sequentially executed in the stream processing in the above processing order, and the data amount of the video stream can be made to decrease and then increase.
S204: generating processing instructions for a plurality of target operations based on the processing order; the processing instruction is used for indicating to decode a video to be processed, executing a plurality of target operations on the decoded video stream according to a processing sequence, and encoding the operated video stream;
after determining the processing sequence of the multiple target operations, the instruction generation tool may generate processing instructions related to the multiple target operations, and the processing instructions are used to instruct the video processing tool to decode an input video to be processed and process a video stream obtained after decoding, and in the process of processing the video stream, the multiple target operations are packaged together and executed according to the processing sequence.
That is to say, in the execution process of the processing instruction, the video to be processed may be decoded first, then the multiple target operations are executed on the decoded video stream according to the processing sequence, and then the processed video stream is encoded to obtain the video processing result of the target specification.
Therefore, the target operations can be executed according to the processing sequence in the process of processing the video stream once, namely the target operations are packaged together and executed according to the processing sequence, so that the video processing result of the target specification can be obtained by executing IO, decoding and encoding once on the video to be processed, and multiple IO, multiple decoding and multiple encoding are not required.
S205: and sending the processing instruction to a video processing tool so that the video processing tool executes the processing instruction on the video to be processed to obtain a video processing result.
And sending the processing instruction to a video processing tool so that the video processing tool executes the processing instruction on the equipment to be processed to obtain a video processing result.
After the processing instruction is generated, the processing instruction is sent to a video processing tool, so that the video processing tool processes the input video to be processed after receiving the processing instruction, namely the video processing tool decodes the video to be processed, executes the plurality of target operations on the decoded video stream according to the processing sequence, and then encodes the processed video stream to obtain a video processing result according with the target parameters.
For example, in order to facilitate understanding of a specific implementation manner of the above-mentioned S205, the following description is specifically made with reference to fig. 4.
As shown in fig. 4, where ffmpeg is a video processing tool, the plurality of target operations includes: and cropping, scaling and watermarking, wherein the ffmpeg command is a processing instruction generated by the instruction generation tool and related to the plurality of target operations, and the ffmpeg command is used for instructing ffmpeg to decode the video to be processed, executing the cropping, scaling and watermarking operations on the decoded video stream, and encoding the processed video stream. Thus, ffmpeg decodes the video to be processed after receiving the ffmpeg command, and encapsulates the clipping, scaling and watermarking operations in a primary video stream processing through the filter function of ffmpeg, so that the clipping, scaling and watermarking operations can be performed serially when processing the decoded video stream. And then coding the processed video stream to obtain a target video processing result.
Optionally, when the instruction generation tool and the video processing tool are located in the same electronic device, the video to be processed may be a video pre-stored in the electronic device, and the processing instruction may carry an identifier of the video to be processed. Therefore, after receiving the video to be processed, the video processing tool can determine the video to be processed according to the identifier, and then execute the processing instruction for the video to be processed.
Optionally, when the instruction generation tool and the video processing tool are located in the same electronic device, the video to be processed may be a video stored in another electronic device, and the processing instruction may carry an identifier of the video to be processed. Therefore, after receiving the video to be processed, the video processing tool can acquire the video to be processed from other electronic equipment according to the identifier, and further execute the processing instruction for the video to be processed.
Optionally, when the instruction generating tool and the video processing tool are located in different electronic devices, the instruction generating tool may send the video to be processed and the processing instruction to the video processing tool at the same time, so that the video processing tool executes the processing instruction for the video to be processed after receiving the video to be processed and the processing instruction.
Optionally, when the instruction generating tool and the video processing tool are located in different electronic devices, the video to be processed may be a video stored in another electronic device other than the electronic device where the video processing tool is located, and the processing instruction may carry an identifier of the video to be processed. Therefore, after receiving the video to be processed, the video processing tool can acquire the video to be processed from other electronic equipment according to the identifier, and further execute the processing instruction for the video to be processed.
The above embodiments are merely examples of the way for the video processing tool to acquire the video to be processed, and are not limited thereto, and any way that the video processing tool can acquire the video to be processed belongs to the protection scope of the present application.
As can be seen from the above, with the solution provided by the embodiment of the present invention, after determining a plurality of target operations to be executed based on the initial parameter of the video to be processed and the parameter variation of the target parameter, a processing order of the plurality of target operations may be determined based on an operation category to which each determined target operation belongs and based on priorities of the operation categories, and then, processing instructions regarding the plurality of target operations are generated based on the processing order, so that the video processing tool encapsulates the plurality of target operations in one-time stream processing according to the processing order and executes the plurality of target operations, thereby obtaining a video processing result. Therefore, the video to be processed is processed according to the processing sequence obtained based on the priority of the operation type, the video processing speed is increased, and further the video processing efficiency is increased.
Optionally, in a specific implementation manner, the number of videos to be processed is multiple, and the multiple target operations include: at least one target operation for each video to be processed;
in the step S203, determining the processing order of the target operations based on the priority of the operation category to which each target operation belongs may include steps 11 to 12:
step 11: for each video to be processed, if the number of target operations for the video to be processed is multiple, determining a processing subsequence for each target operation of the video to be processed based on the priority of the operation category to which each target operation for the video to be processed belongs;
step 12: based on the respective processing sub-orders, a processing order of the plurality of target operations is determined.
In this specific implementation manner, after determining that there are a plurality of videos to be processed in the current video processing and at least one target operation may be performed on each video to be processed, it may be further determined that a plurality of target operations need to be performed on each video to be processed. In this way, for each video to be processed, the operation category of each target operation that needs to be executed for processing the video to be processed in the preset operation category may be determined, and further, based on the priority of the operation category to which each target operation that needs to be executed for the video to be processed belongs, the processing sub-sequence of the plurality of target operations of the video to be processed is determined; in this way, for a plurality of videos to be processed, based on the processing sub-sequence of the plurality of target operations of each video to be processed, the processing sequence of the plurality of target operations in the current video processing process can be determined.
That is to say, when it is determined that there are multiple videos to be processed in the current video processing process, for each video to be processed, after multiple target operations of each video to be processed are determined, an operation category to which each target operation of the video to be processed belongs in a preset operation category may be determined, and further, based on the priority of the operation category to which each target operation belongs, an execution sequence of the multiple target operations of the video to be processed is sequenced, so that a processing sub-sequence of the multiple target operations of the video to be processed may be determined, and thus, after a processing sub-sequence of the multiple target operations that need to be executed for each video to be processed is determined, a processing sequence of the multiple target operations in the current video processing process may be further determined.
Illustratively, when the video to be processed in the current video processing process is two videos, determining that a plurality of target operations to be executed are clipping, stretching, color matching, frame dropping and merging. Further, it may be determined that the target operations that need to be performed on video a are cropping, stretching, and toning, and the target operations that need to be performed on video B are framing and stretching. Then, the operation types of the three target operations of the video A in the preset operation types are respectively determined, namely, the clipping belongs to the first type operation, the toning belongs to the second type operation, the stretching belongs to the third type operation, and the processing sub-sequence of the three target operations of the video A can be determined to be the clipping, toning and stretching based on the priority of the operation type of each target operation; the operation types of the two target operations in the video B in the preset operation types are respectively determined, namely, the frame dropping belongs to the first type of operation, the stretching belongs to the third type of operation, and the processing sub-sequence of the two target operations in the video B can be determined to be frame dropping and stretching based on the priority of the operation type of each target operation.
Further, determining that the processing sequence of the plurality of target operations in the video processing process is as follows: firstly, cutting is carried out on a video A, meanwhile, frame dropping is carried out on a video B, then, stretching is carried out on the video A and the video B, then, color mixing is carried out on the video A, and finally, merging is carried out on the processed video A and the processed video B, and a target video processing result is obtained.
In this specific implementation manner, the processing instruction may be configured to instruct to decode a video to be processed, serially execute a plurality of target operations on the decoded video stream according to the processing order, and encode the operated video stream; the processing unit can be used for instructing to decode the video to be processed, executing the serial execution parts of the plurality of target operation parts in parallel according to the processing sequence for the decoded video stream, and encoding the video stream after the operation; or, the method may be configured to instruct to decode the video to be processed, perform a plurality of target operations on the decoded video stream in parallel according to the processing order, and encode the operated video stream.
Optionally, in a specific implementation manner, the number of videos to be processed is multiple, and the multiple target operations include: the video processing method comprises the steps of performing a first sequence of target operation on each video to be processed, performing merging operation on a plurality of videos to be processed, and performing a second sequence of target operation on the merged videos;
in this specific implementation manner, the processing instruction is used to instruct to decode each video to be processed, and to execute a first sequence target operation for each decoded video stream of the video to be processed in parallel; and merging the operated video streams, executing a second sequence of target operation on the merged video streams, and encoding the executed video streams.
When the videos are processed, the videos to be processed are determined to be multiple, and the operations which need to be executed for each video to be processed are determined to comprise a first sequence target video, a combination operation for multiple videos to be processed, and a second sequence target operation for the combined videos. Each video to be processed can be decoded according to the processing instruction, a first sequence target operation is executed on the decoded video stream in parallel, then a merging operation is executed on the video stream on which the first sequence target operation is executed, then a second sequence target operation is executed on the merged video stream, and the operated video stream is encoded, so that a video processing result is obtained.
According to the category and the number of the target operations, the first sequence of target operations may include one or more target operations, and the second sequence of target operations may also include one or more target operations.
Illustratively, when a video is processed, a plurality of videos to be processed are determined, and then a plurality of target operations to be executed, including cropping, stretching, toning and merging, are determined according to the initial parameters and the target parameters of the videos to be processed. And determining that the cutting and the stretching are the first sequence target operation, and the color matching is the second sequence target operation, decoding the video to be processed according to the processing sequence, executing the first sequence target operation on the decoded video stream in parallel, then merging the processing results, further executing the second sequence target operation on the merged video stream, and finally, encoding the processed video stream to obtain a target video processing result. That is, clipping and stretching are performed on the decoded video stream in parallel, then merging is performed on the clipped and stretched video stream, and then color matching is performed on the merged video stream, so that the color-matched video stream is encoded to obtain a target video processing result.
When determining the operation categories of a plurality of target operations, there may be a case where the operation categories to which two or more target operations belong are of the same category, and since the priorities corresponding to several target operations belonging to the same operation category are the same, when determining the processing order of each target operation, the processing order between the two or more target operations belonging to the same operation category may also be considered.
Optionally, in a specific implementation manner, in the step S203, determining a processing order of the multiple target operations based on the priority of the operation category to which each target operation belongs may include steps 21 to 22:
step 21: sequentially determining the processing sequence of each target operation belonging to different operation categories according to the sequence of the priorities from high to low;
step 22: for a plurality of target operations belonging to the same operation category, determining the sub-priority of each target operation in the operation category based on the operation parameter of the target operation, and determining the processing sequence of each target operation belonging to the operation category according to the sequence of the sub-priorities from high to low.
In this specific implementation manner, when determining the processing order of the multiple target operations, the operation category to which the target operation belongs in the preset operation category may be determined for each target operation first, and then, according to the order from high to low of the priority of the operation category to which each target operation belongs, the target operations may be sorted according to different operation categories first, and the processing order of each operation category is determined.
Then, for two or more target operations belonging to the same category, the sub-priority of each target operation in the operation category to which the target operation belongs is determined based on the operation parameter of the data amount of the video stream for each target operation, and the processing order of each target operation belonging to the operation category is determined in the order of the sub-priorities in the operation category from high to low.
For example, in order to facilitate understanding of a specific implementation of the priority corresponding to each operation described above, the following description is made in conjunction with fig. 5.
As shown in fig. 5, six target operations are determined based on the initial parameters of the video to be processed and the parameter variation of the target parameters, wherein two target operations belong to a first class of operation, two target operations belong to a second class of operation, two operations belong to a third class of operation, and then the six target operations are sorted based on the priority of the operation class to which each target operation belongs, the two target operations belonging to the first class of operation are executed first, then the two target operations belonging to the second class of operation are executed subsequently, and finally the two target operations belonging to the third class of operation are executed.
Then, for each operation class, the sub-priorities of the two target operations belonging to that operation class are determined. As shown in FIG. 5, in the first class of operation, the sub-priority of the high-efficiency class is higher than that of the low-efficiency class; in the second type of operation, the two target operations are arranged in an arbitrary order; in the third class of operation, the high-efficiency three classes have a higher sub-priority than the low-efficiency three classes. That is, the processing order of the six target operations may be high-efficiency one, low-efficiency one, two, three and three low-efficiency types, and further, the six target operations may be encapsulated in one video stream processing according to the processing order through the filter function of ffmpeg.
The different operation categories have different influences on the data volume of the video stream and the video processing rate after the operation, so that the sub-priority corresponding to each operation belonging to the operation category can be determined according to different determination modes in each operation category.
Optionally, in the first type of operation, it is determined that a sub-priority corresponding to an operation that reduces a large amount of data of the video stream is higher than a sub-priority corresponding to an operation that reduces a small amount of data of the video stream; operations with high sub-priority may be referred to as high-efficiency operations, and operations with low sub-priority may be referred to as low-efficiency operations.
In the second type of operation, since each operation has no influence on the data volume of the video stream, the sub-priorities of the operations belonging to the second type of operation can be randomly determined;
in the third type of operation, determining that the sub-priority corresponding to the operation of increasing the data volume of the video stream is less is higher than the sub-priority corresponding to the operation of increasing the data volume of the video stream; among them, operations with high sub-priority may be referred to as three efficient types of operations, and operations with low sub-priority may be referred to as three inefficient types of operations.
In the fourth type of operation, since the fourth type of operation has little influence on the data amount of the video stream and does not affect the video processing speed after the operation, the sub-priorities of the respective operations belonging to the fourth type of operation can be randomly determined.
For example, target operations belonging to a first class of operations include: cropping, frame dropping and scaling, comparing the operating parameters of the above three target operations, since the operating parameters of scaling can reduce the least amount of video stream data, it can be determined that the sub-priority of scaling is the lowest in the first class of operations. For the two operations of clipping and frame dropping, the sizes of the clipping ratio and the frame dropping ratio can be compared based on specific operation parameters, when the clipping ratio is greater than the frame dropping ratio, it can be indicated that the amount of video stream data reduced by clipping is greater than the amount of video stream data reduced by frame dropping, and further, in the first kind of operation, the sub-priority of clipping is higher than the sub-priority of frame dropping, on the contrary, when the clipping ratio is less than the frame dropping ratio, it can be indicated that the amount of video stream data reduced by clipping is less than the amount of video stream data reduced by frame dropping, and further, in the first kind of operation, the sub-priority of frame dropping is higher than the sub-priority of clipping. The cropping ratio is the ratio of the cropping area to the original video area, and the frame reduction ratio is the ratio of the frame reduction value to the original frame rate.
Illustratively, the video to be processed includes three videos, and the initial parameters of the three videos are: frame rate is 25, width and height is 1980 × 1080; and the target parameters of the target videos corresponding to the three videos are all as follows: the frame rate was 12, the width and height was 480 × 270, and the contrast was 1.05. Thus, the determined plurality of target operations includes: cropping, down-framing, scaling, merging and contrast, and it is determined that cropping, down-framing and scaling belong to a first class of operation, merging and contrast belong to a fourth class of operation, and the cropping positions of the three videos are (0, 1080, 720), (200, 1080, 720), and (500, 350,1080, 720), respectively.
The priority of the first class operation is preset to be higher than that of the fourth class operation, that is, the priority corresponding to the cropping, the frame dropping and the scaling is higher than that corresponding to the merging and the contrast adjusting, and the processing order of the cropping, the frame dropping and the scaling is before the merging and the contrast adjusting.
Then, comparing the operation parameters of cutting, frame dropping and scaling, wherein for each video to be processed, the width and the height of the video are 1980 x 1080, and the original area is 2073600; the width and height after cutting is 1080 × 720, the area is 777600, the area after cutting is 1296000, and the cutting ratio is 0.625. The frame rate of each video to be processed is 25, the frame rate after frame reduction is 12, the frame reduction value is 13, and the frame reduction ratio is 0.52. As can be seen from the comparison, if the cropping ratio is greater than the frame reduction ratio, the data amount of the video stream with the cropping reduction is greater than the data amount of the video stream with the frame reduction, and in the first type of operation, the cropping sub-priority is higher than the sub-priority of the frame reduction.
Furthermore, the amount of data of the video stream reduced by scaling is minimal, on the basis of which, in a first type of operation, the clipping corresponding sub-priority is higher than the sub-priority of the down-frame, the sub-priority corresponding to the down-frame being higher than the sub-priority of scaling.
And, the target operations belonging to the fourth type of operation may be sequentially determined according to a merge first-execution principle preset by the user, so that the processing sequence of the five target operations is finally determined to be: cropping, down-framing, scaling, merging, and contrast adjustment.
Optionally, in a specific implementation manner, after the instruction generation tool sends the processing instruction to the video processing tool, the video processing tool may perform the following steps 31 to 32:
step 31: receiving a processing instruction for a video to be processed; the processing instruction is generated based on any one of the video operation processing methods provided by the embodiments of the present invention;
step 32: and decoding the video to be processed based on the processing instruction, executing a plurality of target operations on the decoded video stream according to the processing sequence, and encoding the operated video stream to obtain the target video.
Based on the video processing method, the instruction generation tool generates a processing instruction for instructing the video processing tool to decode the video to be processed, execute a plurality of target operations on the decoded video stream according to the processing sequence, and encode the operated video stream.
Furthermore, the video processing tool can communicate with the instruction generating tool and receive the processing instruction for the video to be processed sent by the instruction generating tool.
The video processing tool receives a processing instruction for a video to be processed, decodes the video to be processed according to the processing instruction, executes the plurality of target operations on the decoded video stream according to the sequence, and then encodes the operated video stream, so that a video processing result with target parameters can be obtained.
For example, in order to facilitate understanding of a specific implementation of the above-described video processing method, the following description is made in detail with reference to fig. 6.
As shown in fig. 6, the various input parameters are the initial parameters of the video to be processed and the target parameters of the target video; the command generator is an instruction generating tool, so that the command generator can execute any video processing method provided by the present invention to generate the processing instruction, that is, as shown in fig. 6, the command generator generates the ffmpeg command by generating a policy, that is, generates the processing instruction, and sends the processing instruction to the command executor, where the command executor is a video processing tool.
After receiving the ffmpeg command, the command executor may decode the video to be processed, execute the target operations on the decoded video stream according to the sequence, and then encode the processed video stream to obtain a video processing result.
Based on the same inventive concept, the embodiment of the invention also provides another video processing method.
Fig. 7 is a flowchart illustrating a video processing method according to an embodiment of the present invention, and as shown in fig. 7, the method may include the following steps S701 to S704:
s701: determining a plurality of target operations based on parameter variations of initial parameters of a video to be processed and target parameters of a target static image;
wherein the plurality of target operations comprises: frame extraction and frame extraction operation after the frame extraction, wherein the frame extraction operation comprises the following steps: at least one of cropping, stretching, scaling, watermarking, and toning;
s702: based on the method provided by the embodiment of the invention, the operation category of each target operation in the preset operation categories is determined, and the processing sequence of a plurality of target operations is determined based on the priority of the operation category of each target operation;
s703: generating processing instructions for a plurality of target operations based on the processing order;
s704: and sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes a plurality of target operations on the decoded video stream according to the processing sequence, and codes the operated video stream to obtain a target static image.
In the present embodiment, a desired still image can be set as a target still image, and thus, a parameter of the target still image can be set as a target parameter.
The still image may include a front cover, an illustration, a still expression, and the like.
In this way, based on the parameter variation of the initial parameter of the video to be processed and the target parameter of the target still image, it may be determined that the plurality of target operations include frame decimation and frame decimation followed by frame decimation, and the frame operations may include: at least one of cropping, stretching, scaling, watermarking, and toning.
That is, when processing a video to be processed into a target still image, frame decimation may be performed on the video to be processed, so that at least one of frame operation clipping, stretching, scaling, watermarking, and color matching is performed on a video frame obtained after frame decimation.
Of course, the target operation of processing the video to be processed into the target still image may also include other operations, and after the target operation is determined, according to the method provided by the present invention, the processing sequence of the plurality of target operations is determined, and the plurality of target operations are processed and executed according to the sequence, which is within the protection scope of the present invention.
Based on the method provided by the embodiment of the present invention, after the plurality of target operations are determined, the operation category of each target operation in the preset operation category may be determined, and further, based on the priority of the operation category to which each target operation belongs, the processing order of the plurality of target operations may be determined.
Then, based on the processing sequence, processing instructions related to a plurality of target operations may be generated and sent to the video processing tool, so that the video processing tool may decode the video to be processed, then perform a plurality of target operations on the decoded video stream according to the processing sequence, and encode the operated video stream to obtain a target still image.
The specific implementation manners of S701 to S704 are the same as those of S201 to S205, and are not described herein again.
As can be seen from the above, with the solution provided by the embodiment of the present invention, after determining a plurality of target operations to be executed based on the initial parameter of the video to be processed and the parameter variation of the target parameter, a processing order of the plurality of target operations may be determined based on an operation category to which each determined target operation belongs and based on priorities of the operation categories, and then, processing instructions regarding the plurality of target operations are generated based on the processing order, so that the video processing tool encapsulates the plurality of target operations in one-time stream processing according to the processing order and executes the plurality of target operations, thereby obtaining a video processing result. Therefore, the video to be processed is processed according to the processing sequence obtained based on the priority of the operation type, the video processing speed is increased, and further the video processing efficiency is increased.
Based on the same inventive concept, the embodiment of the invention also provides another video processing method.
Fig. 8 is a flowchart illustrating a video processing method according to an embodiment of the present invention, and as shown in fig. 8, the method may include the following steps S801 to S804:
s801: determining a plurality of target operations based on the initial parameters of the video to be processed and the parameter variation of the target parameters of the target dynamic image; wherein the target operation comprises: a plurality of down-framing, merging, cropping, toning, and scaling;
s802: based on the method provided by the embodiment of the invention, the operation category of each target operation in the preset operation categories is determined, and the processing sequence of a plurality of target operations is determined based on the priority of the operation category of each target operation;
s803: generating processing instructions for a plurality of target operations based on the processing order;
s804: and sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes a plurality of target operations on the decoded video stream according to the processing sequence, and codes the operated video stream to obtain a target dynamic image.
In the present embodiment, a desired moving image can be set as a target moving image, and thus, a parameter of the target moving image can be set as a target parameter.
The moving image may include a preview, a moving picture, and the like.
In this way, based on the initial parameters of the video to be processed and the parameter variation of the target parameters of the target dynamic image, a plurality of target operations including a plurality of down-frame, merge, crop, color-toning and zoom can be determined.
That is, when processing a video to be processed into a target dynamic image, a plurality of frame dropping, merging, cropping, toning, and scaling may be performed on the video to be processed, and thus, the target operation may include a plurality of the above-described frame dropping, merging, cropping, toning, and scaling.
Of course, the target operation for processing the video to be processed into the target dynamic image may also include other operations, and after the target operation is determined, according to the method provided by the present invention, the processing sequence of the multiple target operations is determined, and the multiple target operations are processed and executed according to the sequence, which is within the protection scope of the present invention.
Based on the method provided by the embodiment of the present invention, after the plurality of target operations are determined, the operation category of each target operation in the preset operation category may be determined, and further, based on the priority of the operation category to which each target operation belongs, the processing order of the plurality of target operations may be determined.
Then, based on the processing sequence, processing instructions related to a plurality of target operations may be generated and sent to the video processing tool, so that the video processing tool may decode the video to be processed, then perform a plurality of target operations on the decoded video stream according to the processing sequence, and encode the operated video stream to obtain a target dynamic image.
The specific implementation manners of S801-S804 are the same as those of S201-S205, and are not described herein again.
As can be seen from the above, with the solution provided by the embodiment of the present invention, after determining a plurality of target operations to be executed based on the initial parameter of the video to be processed and the parameter variation of the target parameter, a processing order of the plurality of target operations may be determined based on an operation category to which each determined target operation belongs and based on priorities of the operation categories, and then, processing instructions regarding the plurality of target operations are generated based on the processing order, so that the video processing tool encapsulates the plurality of target operations in one-time stream processing according to the processing order and executes the plurality of target operations, thereby obtaining a video processing result. Therefore, the video to be processed is processed according to the processing sequence obtained based on the priority of the operation type, the video processing speed is increased, and further the video processing efficiency is increased.
Based on the same inventive concept, the embodiment of the invention also provides another video processing method.
Fig. 9 is a flowchart illustrating a video processing method according to an embodiment of the present invention, and as shown in fig. 9, the method may include the following steps S901 to S904:
s901: determining a plurality of target operations based on parameter variation of initial parameters of a video to be processed and target parameters of a target video; wherein the target operation comprises: a plurality of down-framing, merging, cropping, toning, and scaling;
s902: based on the method provided by the embodiment of the invention, the operation category of each target operation in the preset operation categories is determined, and the processing sequence of a plurality of target operations is determined based on the priority of the operation category of each target operation;
s903: generating processing instructions for a plurality of target operations based on the processing order;
s904: and sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes a plurality of target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target video.
In this particular implementation, a desired video may be taken as a target video, and thus, a parameter of the target video may be taken as a target parameter.
Wherein, a plurality of videos to be processed can be processed into one video; or processing a video to be processed into a video with a smaller video stream data volume; this is reasonable, and is not particularly limited in the embodiments of the present invention.
In this way, based on the initial parameters of the video to be processed and the parameter variation of the target parameters of the target video, a plurality of target operations including a plurality of frame dropping, merging, cropping, toning and scaling may be determined.
That is, when processing the video to be processed into the target video, a plurality of the frame dropping, merging, clipping, toning and scaling may be performed on the video to be processed, and thus, the target operation may include a plurality of the frame dropping, merging, clipping, toning and scaling.
Of course, the target operation for processing the video to be processed into the target video may also include other operations, and after the target operation is determined, according to the method provided by the present invention, the processing sequence of the plurality of target operations is determined, and the plurality of target operations are processed and executed according to the sequence, which is within the protection scope of the present invention.
Based on the method provided by the embodiment of the present invention, after the plurality of target operations are determined, the operation category of each target operation in the preset operation category may be determined, and further, based on the priority of the operation category to which each target operation belongs, the processing order of the plurality of target operations may be determined.
Then, based on the processing sequence, processing instructions related to a plurality of target operations may be generated and sent to the video processing tool, so that the video processing tool may decode the video to be processed, then perform a plurality of target operations on the decoded video stream according to the processing sequence, and encode the operated video stream to obtain the target video.
The specific implementation manners of S901 to S904 are the same as those of S201 to S205, and are not described herein again.
As can be seen from the above, with the solution provided by the embodiment of the present invention, after determining a plurality of target operations to be executed based on the initial parameter of the video to be processed and the parameter variation of the target parameter, a processing order of the plurality of target operations may be determined based on an operation category to which each determined target operation belongs and based on priorities of the operation categories, and then, processing instructions regarding the plurality of target operations are generated based on the processing order, so that the video processing tool encapsulates the plurality of target operations in one-time stream processing according to the processing order and executes the plurality of target operations, thereby obtaining a video processing result. Therefore, the video to be processed is processed according to the processing sequence obtained based on the priority of the operation type, the video processing speed is increased, and further the video processing efficiency is increased.
Corresponding to the video processing method shown in fig. 2 provided in the foregoing embodiment of the present invention, an embodiment of the present invention further provides a video processing apparatus.
Fig. 10 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present invention, and as shown in fig. 10, the apparatus may include the following modules:
a first operation determining module 1010, configured to determine a plurality of target operations based on parameter variations of initial parameters and target parameters of a video to be processed;
a first class determining module 1020, configured to determine an operation class to which each target operation belongs in preset operation classes; the preset operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation;
a first order determination module 1030, configured to determine a processing order of the target operations based on a priority of an operation category to which each target operation belongs;
a first instruction generation module 1040, configured to generate processing instructions regarding the plurality of target operations based on the processing order; the processing instruction is used for indicating to decode the video to be processed, executing the plurality of target operations on the decoded video stream according to the processing sequence, and encoding the operated video stream;
the first execution module 1050 is configured to send the processing instruction to a video processing tool, so that the video processing tool executes the processing instruction on the device to be processed to obtain a video processing result.
As can be seen from the above, with the solution provided by the embodiment of the present invention, after determining a plurality of target operations that need to be executed based on the initial parameters of the video to be processed and the parameter variation of the target parameters, a processing order of the plurality of target operations may be determined based on an operation category to which each determined target operation belongs and based on priorities of the operation categories, and then a processing instruction regarding the plurality of target operations is generated based on the processing order, so that the processing instruction is sent to the video processing tool, so that the video processing tool encapsulates the plurality of target operations in one-time streaming processing according to the processing order to be executed, thereby obtaining a video processing result. Therefore, the video to be processed is processed according to the processing sequence obtained based on the priority of the operation type, the video processing speed is increased, and further the video processing efficiency is increased.
Optionally, in a specific implementation manner, the number of the videos to be processed is multiple, and the multiple target operations include: at least one target operation for each video to be processed;
the first order determining module 1020 is specifically configured to:
for each video to be processed, if the number of the target operations for the video to be processed is multiple, determining a processing subsequence for each target operation of the video to be processed based on the priority of the operation category to which each target operation for the video to be processed belongs;
determining a processing order of the plurality of target operations based on the respective processing sub-orders.
Optionally, in a specific implementation manner, the number of the videos to be processed is multiple, and the multiple target operations include: a first sequence of target operations for each video to be processed, a merging operation for a plurality of the videos to be processed, and a second sequence of target operations for the merged video;
the processing instruction is used for indicating to decode each video to be processed and executing a first sequence target operation aiming at the video to be processed for each decoded video stream of the video to be processed in parallel; and merging the operated video streams, executing the second sequence target operation on the merged video streams, and encoding the executed video streams.
Optionally, in a specific implementation manner, the first order determining module 1030 is specifically configured to:
sequentially determining the processing sequence of each target operation belonging to different operation categories according to the sequence of the priorities from high to low;
for a plurality of target operations belonging to the same operation category, determining the sub-priority of each target operation in the operation category based on the operation parameter of the target operation, and determining the processing sequence of each target operation belonging to the operation category according to the sequence of the sub-priorities from high to low.
Optionally, in a specific implementation manner, the preset operation category includes: at least two of a first type of operation, a second type of operation, a third type of operation, and a fourth type of operation;
wherein the first type of operation comprises: reducing the data amount of the video stream and influencing the video processing speed after operation;
the second type of operation includes: the operation of the video stream data volume is not influenced;
the third type of operation includes: increasing the video stream data amount and affecting the video processing speed after operation;
the fourth type of operation includes: operations that affect the video stream data volume and do not affect the video processing speed after the operations;
the category priority of the first type of operation is higher than that of the second type of operation, the category priority of the second type of operation is higher than that of the third type of operation, and the relationship between the category priority of the fourth type of operation and the category priority of the first type of operation, the category priority of the second type of operation and the category priority of the third type of operation is set according to preset conditions.
Corresponding to the video processing method shown in fig. 7 provided in the foregoing embodiment of the present invention, an embodiment of the present invention further provides a video processing apparatus.
Fig. 11 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present invention. As shown in fig. 11, the apparatus may include the following modules:
a second operation determining module 1110, configured to determine a plurality of target operations based on parameter variations of initial parameters of a video to be processed and target parameters of a target still image; wherein the plurality of target operations comprises: frame decimation and frame decimation followed by frame decimation, the frame operations comprising: at least one of cutting, stretching, watermarking and toning;
a second order determining module 1120, configured to determine, based on the apparatus provided in the embodiment of the present invention, an operation category to which each target operation belongs in preset operation categories, and determine a processing order of the target operations based on a priority of the operation category to which each target operation belongs;
a second instruction generation module 1130 configured to generate processing instructions for the plurality of target operations based on the processing order;
a second execution module 1140, configured to send the processing instruction to a video processing tool, so that the video processing tool decodes the video to be processed, executes the multiple target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target still image.
As can be seen from the above, with the solution provided by the embodiment of the present invention, after determining a plurality of target operations to be executed based on the initial parameter of the video to be processed and the parameter variation of the target parameter, a processing order of the plurality of target operations may be determined based on an operation category to which each determined target operation belongs and based on priorities of the operation categories, and then, processing instructions regarding the plurality of target operations are generated based on the processing order, so that the video processing tool encapsulates the plurality of target operations in one-time stream processing according to the processing order and executes the plurality of target operations, thereby obtaining a video processing result. Therefore, the video to be processed is processed according to the processing sequence obtained based on the priority of the operation type, the video processing speed is increased, and further the video processing efficiency is increased.
Corresponding to the video processing method shown in fig. 8 provided in the foregoing embodiment of the present invention, an embodiment of the present invention further provides a video processing apparatus.
Fig. 12 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present invention. As shown in fig. 12, the apparatus may include the following modules:
a third operation determining module 1210, configured to determine a plurality of target operations based on parameter variation of an initial parameter of a video to be processed and a target parameter of a target dynamic image; wherein the target operation comprises: a plurality of down-framing, merging, cropping, toning, and scaling;
a third order determining module 1220, configured to determine, based on the apparatus provided in the embodiment of the present invention, an operation category to which each target operation belongs in preset operation categories, and determine, based on a priority of the operation category to which each target operation belongs, a processing order of the plurality of target operations;
a third instruction generating module 1230, configured to generate processing instructions regarding the target operations based on the processing order;
the third executing module 1240 is configured to send the processing instruction to a video processing tool, so that the video processing tool decodes the video to be processed, executes the multiple target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target dynamic image.
As can be seen from the above, with the solution provided by the embodiment of the present invention, after determining a plurality of target operations that need to be executed based on the initial parameters of the video to be processed and the parameter variation of the target parameters, a processing order of the plurality of target operations may be determined based on an operation category to which each determined target operation belongs and based on priorities of the operation categories, and then processing instructions regarding the plurality of target operations are generated based on the processing order, so that the video processing tool encapsulates the plurality of target operations in one-time stream processing according to the processing order and executes the plurality of target operations, thereby obtaining a video processing result. Therefore, the video to be processed is processed according to the processing sequence obtained based on the priority of the operation type, the video processing speed is increased, and further the video processing efficiency is increased.
Corresponding to the video processing method shown in fig. 9 provided in the foregoing embodiment of the present invention, an embodiment of the present invention further provides a video processing apparatus.
Fig. 13 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present invention. As shown in fig. 13, the apparatus may include the following modules:
a fourth operation determining module 1310, configured to determine a plurality of target operations based on parameter variation of the initial parameter of the video to be processed and the target parameter of the target video; wherein the target operation comprises: down-framing, merging, cropping, toning, and scaling;
a fourth order determining module 1320, configured to determine, based on the apparatus provided in the embodiment of the present invention, an operation category to which each target operation belongs in the preset operation categories, and determine, based on a priority of the operation category to which each target operation belongs, a processing order of the plurality of target operations;
a fourth instruction generation module 1330 configured to generate processing instructions for the target operations based on the processing order;
the fourth executing module 1340 is configured to send the processing instruction to a video processing tool, so that the video processing tool decodes the video to be processed, executes the multiple target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target video.
As can be seen from the above, with the solution provided by the embodiment of the present invention, after determining a plurality of target operations that need to be executed based on the initial parameters of the video to be processed and the parameter variation of the target parameters, a processing order of the plurality of target operations may be determined based on an operation category to which each determined target operation belongs and based on priorities of the operation categories, and then processing instructions regarding the plurality of target operations are generated based on the processing order, so that the video processing tool encapsulates the plurality of target operations in one-time stream processing according to the processing order and executes the plurality of target operations, thereby obtaining a video processing result. Therefore, the video to be processed is processed according to the processing sequence obtained based on the priority of the operation type, the video processing speed is increased, and further the video processing efficiency is increased.
The embodiment of the present invention further provides an electronic device, as shown in fig. 14, which includes a processor 1401, a communication interface 1402, a memory 1403, and a communication bus 1404, where the processor 1401, the communication interface 1402, and the memory 1403 complete mutual communication through the communication bus 1404,
a memory 1403 for storing a computer program;
the processor 1401 is configured to implement the steps of any of the video processing methods provided in the embodiments of the present invention described above when executing the program stored in the memory 1403.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The Memory may include a Random Access Memory (RAM), and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, and a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the video processing method described in any of the above embodiments.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the video processing method of any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on differences from other embodiments. In particular, as for the apparatus embodiment, the electronic device embodiment, the computer-readable storage medium embodiment and the computer-readable storage medium, since they are substantially similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (14)

1. A method of video processing, the method comprising:
determining a plurality of target operations based on parameter variation of initial parameters and target parameters of a video to be processed;
determining an operation category to which each target operation belongs in preset operation categories; the preset operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation;
determining a processing order of the plurality of target operations based on the priority of the operation category to which each target operation belongs;
generating processing instructions for the plurality of target operations based on the processing order; the processing instruction is used for indicating to decode the video to be processed, executing the plurality of target operations on the decoded video stream according to the processing sequence, and encoding the operated video stream;
and sending the processing instruction to a video processing tool so that the video processing tool executes the processing instruction on the video to be processed to obtain a video processing result.
2. The method according to claim 1, wherein the number of the videos to be processed is plural, and the plural target operations comprise: at least one target operation for each video to be processed;
the determining the processing order of the target operations based on the priority of the operation category to which each target operation belongs comprises:
for each video to be processed, if the number of target operations for the video to be processed is multiple, determining a processing subsequence for each target operation of the video to be processed based on the priority of the operation category to which each target operation for the video to be processed belongs;
determining a processing order of the plurality of target operations based on the respective processing sub-orders.
3. The method according to claim 2, wherein the number of the videos to be processed is plural, and the plural target operations comprise: a first sequence of target operations for each video to be processed, a merging operation for a plurality of the videos to be processed, and a second sequence of target operations for the merged video;
the processing instruction is used for indicating to decode each video to be processed and executing a first sequence target operation aiming at the video to be processed for each decoded video stream of the video to be processed in parallel; and merging the operated video streams, executing the second sequence target operation on the merged video streams, and encoding the executed video streams.
4. The method of claim 1, wherein the step of determining the processing order of the target operations based on the priority of the operation class to which each target operation belongs comprises:
sequentially determining the processing sequence of each target operation belonging to different operation categories according to the sequence of the priorities from high to low;
for a plurality of target operations belonging to the same operation category, determining the sub-priority of each target operation in the operation category based on the operation parameter of the target operation, and determining the processing sequence of each target operation belonging to the operation category according to the sequence of the sub-priorities from high to low.
5. The method according to any of claims 1-4, wherein the preset operation categories include: at least two of a first type of operation, a second type of operation, a third type of operation, and a fourth type of operation;
wherein the first class of operation comprises: reducing the data volume of the video stream and influencing the video processing speed after operation;
the second type of operation includes: the operation of the video stream data volume is not influenced;
the third type of operation includes: increasing the video stream data amount and affecting the video processing speed after operation;
the fourth type of operation includes: operations that affect the amount of video stream data and do not affect the video processing speed after the operations;
the priority of the first kind of operation is higher than that of the second kind of operation, the priority of the second kind of operation is higher than that of the third kind of operation, and the relationship between the priority of the fourth kind of operation and the priority of the first kind of operation, the priority of the second kind of operation and the priority of the third kind of operation is set according to preset conditions.
6. A method of video processing, the method comprising:
determining a plurality of target operations based on parameter variations of initial parameters of a video to be processed and target parameters of a target static image; wherein the plurality of target operations comprises: frame decimation and frame decimation followed by frame decimation, the frame operations comprising: at least one of cropping, stretching, scaling, watermarking, and toning;
determining an operation category to which each target operation belongs in preset operation categories based on the method of any one of claims 1 to 5, and determining a processing order of the plurality of target operations based on a priority of the operation category to which each target operation belongs;
generating processing instructions for the plurality of target operations based on the processing order;
and sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes the plurality of target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target static image.
7. A method of video processing, the method comprising:
determining a plurality of target operations based on the initial parameters of the video to be processed and the parameter variation of the target parameters of the target dynamic image; wherein the target operation comprises: down-framing, merging, cropping, toning, and scaling;
determining an operation category to which each target operation belongs in preset operation categories based on the method of any one of claims 1-5, and determining a processing order of the plurality of target operations based on a priority of the operation category to which each target operation belongs;
generating processing instructions for the plurality of target operations based on the processing order;
and sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes the plurality of target operations on the decoded video stream according to the processing sequence, and codes the operated video stream to obtain the target dynamic image.
8. A method of video processing, the method comprising:
determining a plurality of target operations based on parameter variation of initial parameters of a video to be processed and target parameters of a target video; wherein the target operation comprises: down-framing, merging, cropping, toning, and scaling;
determining an operation category to which each target operation belongs in preset operation categories based on the method of any one of claims 1-5, and determining a processing order of the plurality of target operations based on a priority of the operation category to which each target operation belongs;
generating processing instructions for the plurality of target operations based on the processing order;
and sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes the plurality of target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target video.
9. A video processing apparatus, characterized in that the apparatus comprises:
the first operation determining module is used for determining a plurality of target operations based on the parameter variation of the initial parameter and the target parameter of the video to be processed;
the first class determination module is used for determining the operation class of each target operation in the preset operation classes; the preset operation category is divided according to the influence of each operation on the video stream data volume and the video processing speed after the operation;
a first order determination module, configured to determine a processing order of the target operations based on a priority of an operation category to which each target operation belongs;
a first instruction generation module for generating processing instructions regarding the plurality of target operations based on the processing order; the processing instruction is used for indicating to decode the video to be processed, executing the plurality of target operations on the decoded video stream according to the processing sequence, and encoding the operated video stream;
and the first execution module is used for sending the processing instruction to a video processing tool so that the video processing tool executes the processing instruction on the video to be processed to obtain a video processing result.
10. A video processing apparatus, characterized in that the apparatus comprises:
the second operation determining module is used for determining a plurality of target operations based on the parameter variation of the initial parameters of the video to be processed and the target parameters of the target static image; wherein the plurality of target operations comprises: frame decimation and frame decimation followed by frame decimation, the frame operations comprising: at least one of cutting, stretching, watermarking and toning;
a second order determination module, configured to determine, based on the apparatus of claim 9, an operation category to which each target operation belongs among preset operation categories, and determine a processing order of the plurality of target operations based on a priority of the operation category to which each target operation belongs;
a second instruction generation module for generating processing instructions regarding the plurality of target operations based on the processing order;
and the second execution module is used for sending the processing instruction to a video processing tool so that the video processing tool decodes the video to be processed, executes the plurality of target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target static image.
11. A video processing apparatus, characterized in that the apparatus comprises:
the third operation determining module is used for determining a plurality of target operations based on the parameter variation of the initial parameters of the video to be processed and the target parameters of the target motion picture; wherein the target operation comprises: a plurality of down-framing, merging, cropping, toning, and scaling;
a third order determination module, configured to determine, based on the apparatus of claim 9, an operation category to which each target operation belongs in the preset operation categories, and determine a processing order of the plurality of target operations based on a priority of the operation category to which each target operation belongs;
a third instruction generation module for generating processing instructions regarding the plurality of target operations based on the processing order;
and a third execution module, configured to send the processing instruction to a video processing tool, so that the video processing tool decodes the video to be processed, executes the multiple target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target motion picture.
12. A video processing apparatus, characterized in that the apparatus comprises;
the fourth operation determination module is used for determining a plurality of target operations based on the parameter variation of the initial parameters of the video to be processed and the target parameters of the target video; wherein the target operation comprises: down-framing, merging, cropping, toning, and scaling;
a fourth order determination module, configured to determine, based on the apparatus of claim 9, an operation category to which each target operation belongs among preset operation categories, and determine a processing order of the plurality of target operations based on a priority of the operation category to which each target operation belongs;
a fourth instruction generation module for generating processing instructions regarding the plurality of target operations based on the processing order;
and a fourth execution module, configured to send the processing instruction to a video processing tool, so that the video processing tool decodes the video to be processed, executes the multiple target operations on the decoded video stream according to the processing sequence, and encodes the operated video stream to obtain the target video.
13. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 8 when executing a program stored in the memory.
14. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-8.
CN202210775022.XA 2022-07-01 2022-07-01 Video processing method and device and electronic equipment Pending CN115297223A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210775022.XA CN115297223A (en) 2022-07-01 2022-07-01 Video processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210775022.XA CN115297223A (en) 2022-07-01 2022-07-01 Video processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115297223A true CN115297223A (en) 2022-11-04

Family

ID=83821993

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210775022.XA Pending CN115297223A (en) 2022-07-01 2022-07-01 Video processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115297223A (en)

Similar Documents

Publication Publication Date Title
US9912974B2 (en) Shot structure of online video as a predictor of success
CN109408639B (en) Bullet screen classification method, bullet screen classification device, bullet screen classification equipment and storage medium
CN113542867A (en) Content filtering in a media playback device
KR102104193B1 (en) How to select service parameters and related devices
CN108628898B (en) Method, device and equipment for data storage
CN110555334B (en) Face feature determination method and device, storage medium and electronic equipment
CN111147926B (en) Data transcoding method and device
US11960421B2 (en) Operation accelerator and compression method
CN111327921A (en) Video data processing method and device
CN111970565A (en) Video data processing method and device, electronic equipment and storage medium
CN116567170A (en) Video super-resolution parallel scheduling method and device for cloud platform and cloud platform
CN109218722B (en) Video coding method, device and equipment
CN110913225A (en) Image encoding method, image encoding device, electronic device, and computer-readable storage medium
US20100083336A1 (en) Method and apparatus for providing rich media service
CN114710667A (en) Rapid prediction method and device for CU partition in H.266/VVC screen content frame
CN112766397A (en) Classification network and implementation method and device thereof
CN110413840B (en) Neural network for constructing video determination label and training method thereof
CN103051899B (en) A kind of method of video decode and device
CN115297223A (en) Video processing method and device and electronic equipment
CN116668691A (en) Picture compression transmission method and device and terminal equipment
CN112752104B (en) Image compensation method, image compensation device, storage medium and electronic equipment
CN110809158B (en) Image loop filtering processing method and device
CN112183227B (en) Intelligent face region coding method and device
CN112950580A (en) Quality evaluation method, and quality evaluation model training method and device
CN110163129B (en) Video processing method, apparatus, electronic device and computer readable storage medium

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