Video Encoding Conversion Method, Device, Equipment and Storage Medium

By automatically calculating and applying coding parameters to adjust video compression information, the existing video conversion technology has been solved, and the automated video conversion process has been realized, saving manpower and improving conversion quality.

CN114615501BActive Publication Date: 2025-06-20SHENZHEN WONDERSHARE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210253464.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-15
Publication Date
2025-06-20
Estimated Expiration
2042-03-15

AI Technical Summary

Technical Problem

The existing video conversion technology has low efficiency and accuracy, and users need to manually set encoding parameters, which wastes manpower.

Method used

By selecting the first video file sorted as the currently to be converted file from the video file set to be converted, the video compression information is obtained, and the encoding parameters are calculated based on the video compression information, the total volume and the preset video output file total volume, and the video compression information is automatically adjusted for encoding and conversion.

Benefits of technology

There is no need for users to manually set encoding parameters, save manpower, and improve the efficiency and accuracy of video conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114615501B_ABST
    Figure CN114615501B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a video encoding conversion method, apparatus, device, and storage medium. This application is applied to the field of video conversion technology, and it includes: selecting the first to-be-converted video file in the sorted order from the set of to-be-converted video files as the current to-be-converted video file; calculating encoding parameters according to the video compression information obtained from the current to-be-converted video file, the total volume of all to-be-converted video files in the set of to-be-converted video files, and the preset total volume of the video output file; adjusting the video compression information according to the encoding parameters, and performing encoding conversion on the current to-be-converted video file according to the adjusted video compression information to obtain a video output file; selecting the next to-be-converted video file from the set of to-be-converted video files, and using it as the current to-be-converted video file, and returning to execute step two until all to-be-converted video files are converted. The embodiments of this application can improve the efficiency and accuracy of video conversion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of video conversion, and in particular, to a video encoding conversion method, apparatus, device, and storage medium. Background Art

[0002] Most of the existing video conversion technologies solve the video conversion needs of users according to steps such as decoding, data processing, and setting encoding parameters. However, with the development of Internet communication technologies, users hope to output the source video as a video with a fixed size and volume, which is convenient for transmission via email or chat software. However, the traditional method of allowing users to set encoding parameters not only wastes manpower, but also has low efficiency and accuracy in video conversion. Summary of the Invention

[0003] Embodiments of the present invention provide a video encoding conversion method, apparatus, device, and storage medium, aiming to solve the problem of low efficiency and accuracy in existing video conversion.

[0004] In a first aspect, embodiments of the present invention provide a video encoding conversion method, which includes:

[0005] Select the first-ranked video file to be converted from the video file set to be converted according to the file identifier as the current video file to be converted, where the video file set to be converted includes multiple video files to be converted;

[0006] Obtain video compression information from the current video file to be converted, and calculate encoding parameters corresponding to the current video file to be converted according to the video compression information, the total volume of all video files to be converted in the video file set to be converted, and the total volume of the preset video output file;

[0007] Adjust the video compression information according to the encoding parameters, and perform encoding conversion on the current video file to be converted according to the adjusted video compression information to obtain a video output file;

[0008] Select the next video file to be converted from the video file set to be converted, and use the next video file to be converted as the current video file to be converted, and return to execute the step of obtaining video compression information from the current video file to be converted until all video files to be converted in the video file set to be converted are converted.

[0009] Further, obtain the video volume, GOP value, number of B frames, and video frame rate from the current video file to be converted.

[0010] Further, calculate the video bit rate in the encoding parameters corresponding to the current video file to be converted according to the video volume, the total volume of all video files to be converted in the video file set to be converted, and the total volume of the preset video output files; calculate the GOP value, the number of B frames, the video frame rate in the encoding parameters corresponding to the current video file to be converted according to the GOP value, the number of B frames, the video frame rate, the total volume, and the total volume of the preset video output files.

[0011] Further, calculate the volume ratio according to the video volume and the total volume of all video files to be converted in the video file set to be converted; calculate the video bit rate in the encoding parameters corresponding to the current video file to be converted according to the volume ratio and the total volume of the preset video output files.

[0012] Further, respectively obtain the volume of each video file to be converted in the video file set to be converted; calculate the sum of the volumes to obtain the total volume.

[0013] Further, calculate the compression ratio according to the total volume and the total volume of the preset video output files; calculate the GOP value, the number of B frames, and the video frame rate in the encoding parameters corresponding to the current video file to be converted according to the compression ratio, the GOP value, the number of B frames, and the video frame rate.

[0014] Further, calculate the ratio between the GOP value and the compression ratio to obtain the GOP value in the encoding parameters corresponding to the current video file to be converted; calculate the ratio between the number of B frames and the compression ratio to obtain the number of B frames in the encoding parameters corresponding to the current video file to be converted; calculate the ratio between the video frame rate and the compression ratio to obtain the video frame rate in the encoding parameters corresponding to the current video file to be converted.

[0015] In a second aspect, an embodiment of the present invention further provides a video encoding conversion device, which includes:

[0016] A selection unit, configured to select the first-sorted video file to be converted in the video file set to be converted as the current video file to be converted according to the file identifier, where the video file set to be converted includes multiple video files to be converted;

[0017] A calculation unit, configured to obtain video compression information from the current video file to be converted, and calculate encoding parameters corresponding to the current video file to be converted according to the video compression information, the total volume of all video files to be converted in the video file set to be converted, and the total volume of the preset video output files.

[0018] An encoding conversion unit is configured to adjust the video compression information according to the encoding parameters, and perform encoding conversion on the currently to-be-converted video file according to the adjusted video compression information to obtain a video output file;

[0019] A return execution unit is configured to select the next to-be-converted video file from the set of to-be-converted video files, use the next to-be-converted video file as the currently to-be-converted video file, and return to execute the step of obtaining video compression information from the currently to-be-converted video file until all the to-be-converted video files in the set of to-be-converted video files are converted.

[0020] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor. A computer program is stored on the memory, and when the processor executes the computer program, the above method is implemented.

[0021] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the above method can be implemented.

[0022] An embodiment of the present invention provides a video encoding conversion method, apparatus, device, and storage medium. Among them, the method includes: selecting, as the currently to-be-converted video file, the to-be-converted video file ranked first in the set of to-be-converted video files according to a file identifier, where the set of to-be-converted video files includes multiple to-be-converted video files; obtaining video compression information from the currently to-be-converted video file, and calculating encoding parameters corresponding to the currently to-be-converted video file according to the video compression information, the total volume of all the to-be-converted video files in the set of to-be-converted video files, and a preset total volume of the video output file; adjusting the video compression information according to the encoding parameters, and performing encoding conversion on the currently to-be-converted video file according to the adjusted video compression information to obtain a video output file; selecting the next to-be-converted video file from the set of to-be-converted video files, using the next to-be-converted video file as the currently to-be-converted video file, and returning to execute the step of obtaining video compression information from the currently to-be-converted video file until all the to-be-converted video files in the set of to-be-converted video files are converted. The technical solution of the embodiment of the present invention first calculates encoding parameters according to video compression information, total volume, and a preset total volume of the video output file, and then performs encoding conversion on the currently to-be-converted video file according to the encoding parameters and video compression information to obtain a video output file, without the need for the user to manually set encoding parameters, which not only saves manpower, but also improves the efficiency and accuracy of video conversion. Description of the Drawings

[0023] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.

[0024] Figure 1 It is a schematic flowchart of a video coding conversion method provided by an embodiment of the present invention;

[0025] Figure 2 It is a schematic block diagram of a video coding conversion device provided by an embodiment of the present invention; and

[0026] Figure 3 It is a schematic block diagram of a computer device provided by an embodiment of the present invention. Detailed implementation manners

[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0028] It should be understood that when used in this specification and the appended claims, the terms "comprises" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0029] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.

[0030] It should be further understood that the term "and / or" used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the related listed items, and includes these combinations.

[0031] As used in this specification and the appended claims, the term "if" may be construed, depending on the context, as "when", "once", "in response to determining", or "in response to detecting". Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be construed, depending on the context, to mean "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]".

[0032] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the video encoding conversion method provided by an embodiment of the present invention. The video encoding conversion method of the embodiment of the present invention can be applied to a terminal, such as intelligent terminal devices like smartphones, laptops, desktop computers, notebook computers, etc. The video encoding conversion method is implemented by an application program, such as a video conversion software, installed on the terminal. Without the need for the user to manually set encoding parameters, it not only saves manpower but also improves the efficiency and accuracy of video conversion. The video encoding conversion method will be described in detail below. As Figure 1 shown, the method includes the following steps S100 - S130.

[0033] S100. Select the first - ranked video file to be converted from the set of video files to be converted according to the file identifier as the current video file to be converted, where the set of video files to be converted includes multiple video files to be converted.

[0034] In the embodiment of the present invention, before the video conversion software performs encoding conversion on the video files to be converted, it will first select the first - ranked video file to be converted from the set of video files to be converted according to the file identifier as the current video file to be converted, where the set of video files to be converted includes multiple video files to be converted. In practical applications, the file identifier is video_Num. For example, video_1, video_2, video_3, etc. Understandably, if there are N video files to be converted, the file identifiers of the N video files to be converted are respectively represented as video_1, video_2, video_3......video_N.

[0035] S110. Obtain video compression information from the current video file to be converted, and calculate encoding parameters corresponding to the current video file to be converted according to the video compression information, the total volume of all video files to be converted in the set of video files to be converted, and the preset total volume of the video output file.

[0036] In an embodiment of the present invention, after using the first video file to be converted as the current video file to be converted, video compression information is obtained from the current video file to be converted, where the video compression information includes parameters such as video volume, GOP value, number of B frames, and video frame rate; the video bit rate in the encoding parameters corresponding to the current video file to be converted is calculated according to the video volume, the total volume of all video files to be converted in the video file set to be converted, and the total volume of the preset video output file; the GOP value, the number of B frames, and the video frame rate in the encoding parameters corresponding to the current video file to be converted are calculated according to the GOP value, the number of B frames, the video frame rate, the total volume, and the total volume of the preset video output file. It should be noted that in the embodiment of the present invention, the GOP value is the interval between two I frames. Understandably, in a video coding sequence, there are mainly three types of coding frames, namely I frames, P frames, and B frames, and I frames, P frames, and B frames represent intra-coded picture frames, predictive-coded picture frames, and bidirectional predictive-coded picture frames, respectively.

[0037] Further, a volume ratio is calculated according to the video volume and the total volume of all video files to be converted in the video file set to be converted; the video bit rate in the encoding parameters corresponding to the current video file to be converted is calculated according to the volume ratio and the total volume of the preset video output file. In practical applications, if it is assumed that the video volume is size_video_N, the total volume is size_Total, and the total volume of the preset video output file is OutputVideo_size, then the volume ratio is size_video_N / size_Total, and the video bit rate Bitrate = size_video_N_Out / duration_video_N, where duration_video_N represents the output duration of the video file, size_video_N_Out represents the output volume of the video file, and size_video_N_Out = size_video_N / size_Total*OutputVideo_size. It should be noted that in the embodiment of the present invention, the step of calculating the total volume is specifically as follows: first, the volume of each video file to be converted in the video file set to be converted is obtained respectively; then the sum of the volumes is calculated to obtain the total volume. In practical applications, if it is assumed that the volumes of each video file in the video files to be converted are size_video_1, size_video_2, size_video_3,..., size_video_N respectively, then the total volume size_Total = size_video_1 + size_video_2 +... + size_video_N.

[0038] Further, calculate the compression ratio Compress_ratio according to the total volume size_Total and the preset total volume OutputVideo_size of the video output file. Understandably, Compress_ratio = OutputVideo_size / size_Total; calculate the GOP value, the number of B frames, and the video frame rate in the encoding parameters corresponding to the current video file to be converted according to the compression ratio, the GOP value, the number of B frames, and the video frame rate. Specifically, calculate the ratio between the GOP value and the compression ratio to obtain the GOP value in the encoding parameters corresponding to the current video file to be converted; calculate the ratio between the number of B frames and the compression ratio to obtain the number of B frames in the encoding parameters corresponding to the current video file to be converted; calculate the ratio between the video frame rate and the compression ratio to obtain the video frame rate in the encoding parameters corresponding to the current video file to be converted. In practical applications, if it is assumed that the GOP value, the number of B frames, and the video frame rate in the current video file to be converted are video_N_GOP, video_N_BFrameNum, and video_N_Fps respectively, and the GOP value, the number of B frames, and the video frame rate in the encoding parameters are video_N_GOP_Out, video_N_BFrameNum_Out, and video_N_Fps_Out respectively, understandably, calculate the GOP value, the number of B frames, and the video frame rate in the encoding parameters as shown in formulas (1) to (3).

[0039] video_N_GOP_Out = video_N_GOP / Compress_ratio (1)

[0040] video_N_BFrameNum_Out = video_N_BFrameNum / Compress_ratio (2)

[0041] video_N_Fps_Out = video_N_Fps / Compress_ratio (3)

[0042] It should also be noted that in the embodiments of the present invention, since the preset total volume of the video output file is considered when calculating the encoding parameters, it can be ensured that the video output file meets the user's volume requirements for the video file.

[0043] S120. Adjust the video compression information according to the encoding parameters, and perform encoding conversion on the current video file to be converted according to the adjusted video compression information to obtain a video output file.

[0044] In an embodiment of the present invention, after calculating the encoding parameters corresponding to the current video file to be converted, the video compression information is adjusted according to the encoding parameters. Specifically, the video bit rate, GOP value, number of B frames, and video frame rate in the video compression information are replaced with the video bit rate, GOP value, number of B frames, and video frame rate in the encoding parameters to adjust the video compression information, and encoding conversion is performed on the current video file to be converted according to the adjusted video compression information to obtain a video output file, thus avoiding the user from manually setting encoding parameters, saving manpower, and improving the efficiency and accuracy of video conversion. It should be noted that in an embodiment of the present invention, the video compression information further includes information such as video width and video height; the video conversion software includes an encoder, and the encoding parameters are parameters set for the encoder.

[0045] S130. Select the next video file to be converted from the set of video files to be converted, and use the next video file to be converted as the current video file to be converted, and return to execute the step of obtaining video compression information from the current video file to be converted until all the video files to be converted in the set of video files to be converted are converted.

[0046] In an embodiment of the present invention, after performing encoding conversion on the current video file to be converted to obtain a video output file, the next video file to be converted is selected from the set of video files to be converted, and the next video file to be converted is used as the current video file to be converted. In practical applications, that is, the second video file to be converted is selected as the current video file to be converted, and the step of obtaining video compression information from the current video file to be converted is returned to execute until all the video files to be converted in the set of video files to be converted are converted to complete the encoding conversion of the set of video files to be converted.

[0047] Figure 2 This is a schematic block diagram of a video encoding conversion device 200 provided by an embodiment of the present invention. As Figure 2 shown, corresponding to the above video encoding conversion method, the present invention also provides a video encoding conversion device 200. The video encoding conversion device 200 includes units for executing the above video encoding conversion method, and the device can be configured in a terminal. Specifically, please refer to Figure 2 . The video encoding conversion device 200 includes a selection unit 201, a calculation unit 202, an encoding conversion unit 203, and a return execution unit 204.

[0048] Among them, the selection unit 201 is configured to select the first to-be-converted video file in the set of to-be-converted video files according to the file identifier as the current to-be-converted video file, where the set of to-be-converted video files includes multiple to-be-converted video files; the calculation unit 202 is configured to obtain video compression information from the current to-be-converted video file, and calculate encoding parameters corresponding to the current to-be-converted video file according to the video compression information, the total volume of all to-be-converted video files in the set of to-be-converted video files, and the preset total volume of the video output files; the encoding conversion unit 203 is configured to adjust the video compression information according to the encoding parameters, and perform encoding conversion on the current to-be-converted video file according to the adjusted video compression information to obtain a video output file; the return execution unit 204 is configured to select the next to-be-converted video file from the set of to-be-converted video files, and use the next to-be-converted video file as the current to-be-converted video file, and return to execute the step of obtaining video compression information from the current to-be-converted video file until all to-be-converted video files in the set of to-be-converted video files are converted.

[0049] In some embodiments, such as this embodiment, the calculation unit 202 includes an acquisition unit 2021, a first calculation subunit 2022, and a second calculation subunit 2023.

[0050] Among them, the acquisition unit 2021 is configured to obtain the video volume, GOP value, number of B frames, and video frame rate from the current to-be-converted video file; the first calculation subunit 2022 is configured to calculate the video bit rate in the encoding parameters corresponding to the current to-be-converted video file according to the video volume, the total volume of all to-be-converted video files in the set of to-be-converted video files, and the preset total volume of the video output files; the second calculation subunit 2023 is configured to calculate the GOP value, number of B frames, and video frame rate in the encoding parameters corresponding to the current to-be-converted video file according to the GOP value, the number of B frames, the video frame rate, the total volume, and the preset total volume of the video output files.

[0051] In some embodiments, such as this embodiment, the first calculation subunit 2022 includes a third calculation subunit 20221 and a fourth calculation subunit 20222.

[0052] Among them, the third calculation subunit 20221 is used to calculate a volume ratio according to the video volume and the total volume of all video files to be converted in the video file set to be converted. Calculating the total volume of all video files to be converted in the video file set to be converted includes: respectively obtaining the volume of each video file to be converted in the video file set to be converted; calculating the sum of the volumes to obtain the total volume; the fourth calculation subunit 20222 is used to calculate the video bit rate in the encoding parameters corresponding to the current video file to be converted according to the volume ratio and the total volume of the pre-set video output file.

[0053] In some embodiments, such as this embodiment, the second calculation subunit 2023 includes a fifth calculation subunit 20231, a sixth calculation subunit 20232, a seventh calculation subunit 20233, and an eighth calculation subunit 20234.

[0054] Among them, the fifth calculation subunit 20231 is used to calculate a compression ratio according to the total volume and the total volume of the pre-set video output file; the sixth calculation subunit 20232 is used to calculate the ratio between the GOP value and the compression ratio to obtain the GOP value in the encoding parameters corresponding to the current video file to be converted; the seventh calculation subunit 20233 is used to calculate the ratio between the number of B frames and the compression ratio to obtain the number of B frames in the encoding parameters corresponding to the current video file to be converted; the eighth calculation subunit 20234 is used to calculate the ratio between the video frame rate and the compression ratio to obtain the video frame rate in the encoding parameters corresponding to the current video file to be converted.

[0055] The specific implementation manner of the video encoding conversion device 200 in the embodiments of the present invention corresponds to the above video encoding conversion method, and will not be elaborated here.

[0056] The above video encoding conversion device can be implemented in the form of a computer program, and this computer program can run on a computer device as shown in Figure 3 shown.

[0057] Please refer to Figure 3 , Figure 3 which is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 300 is a terminal, and the terminal can be an electronic device with communication functions such as a smart phone, a desktop computer, a laptop computer, a tablet computer, etc.

[0058] Refer to Figure 3 , the computer device 300 includes a processor 302, a memory, and a network interface 305 connected through a system bus 301. Among them, the memory may include a storage medium 303 and an internal memory 304.

[0059] The storage medium 303 can store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, it can cause the processor 302 to execute a video encoding conversion method.

[0060] The processor 302 is used to provide computing and control capabilities to support the operation of the entire computer device 300.

[0061] The internal memory 304 provides an environment for the operation of the computer program 3032 in the storage medium 303. When the computer program 3032 is executed by the processor 302, it can cause the processor 302 to execute a video encoding conversion method.

[0062] The network interface 305 is used for network communication with other devices. Those skilled in the art can understand that Figure 3 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device 300 to which the solution of this application is applied. The specific computer device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0063] Wherein, the processor 302 is used to run the computer program 3032 stored in the memory to implement the following steps: select the first sorted video file to be converted in the video file set to be converted as the current video file to be converted according to the file identifier, wherein the video file set to be converted includes multiple video files to be converted; obtain video compression information from the current video file to be converted, and calculate encoding parameters corresponding to the current video file to be converted according to the video compression information, the total volume of all video files to be converted in the video file set to be converted, and the preset total volume of the video output file; adjust the video compression information according to the encoding parameters, and perform encoding conversion on the current video file to be converted according to the adjusted video compression information to obtain a video output file; select the next video file to be converted from the video file set to be converted, and use the next video file to be converted as the current video file to be converted, and return to execute the step of obtaining video compression information from the current video file to be converted until all video files to be converted in the video file set to be converted are converted.

[0064] In some embodiments, such as this embodiment, when the processor 302 implements the step of obtaining video compression information from the current video file to be converted, it specifically implements the following steps: obtain the video volume, GOP value, number of B frames, and video frame rate from the current video file to be converted.

[0065] In some embodiments, such as this embodiment, when the processor 302 implements the step of calculating the encoding parameters corresponding to the current video file to be converted according to the video compression information, the total volume of all video files to be converted in the video file set to be converted, and the total volume of the preset video output files, the specific implementation is as follows: calculating the video bit rate in the encoding parameters corresponding to the current video file to be converted according to the video volume, the total volume of all video files to be converted in the video file set to be converted, and the total volume of the preset video output files; calculating the GOP value, the number of B frames, and the video frame rate in the encoding parameters corresponding to the current video file to be converted according to the GOP value, the number of B frames, the video frame rate, the total volume, and the total volume of the preset video output files.

[0066] In some embodiments, such as this embodiment, when the processor 302 implements the step of calculating the video bit rate in the encoding parameters corresponding to the current video file to be converted according to the video volume, the total volume of all video files to be converted in the video file set to be converted, and the total volume of the preset video output files, the specific implementation is as follows: calculating the volume ratio according to the video volume and the total volume of all video files to be converted in the video file set to be converted; calculating the video bit rate in the encoding parameters corresponding to the current video file to be converted according to the volume ratio and the total volume of the preset video output files.

[0067] In some embodiments, such as this embodiment, when the processor 302 implements the step of calculating the total volume of all video files to be converted in the video file set to be converted, the specific implementation is as follows: respectively obtaining the volume of each video file to be converted in the video file set to be converted; calculating the sum of the volumes to obtain the total volume.

[0068] In some embodiments, such as this embodiment, when the processor 302 implements the step of calculating the GOP value, the number of B frames, and the video frame rate in the encoding parameters corresponding to the current video file to be converted according to the GOP value, the number of B frames, the video frame rate, the total volume, and the total volume of the preset video output files, the specific implementation is as follows: calculating the compression ratio according to the total volume and the total volume of the preset video output files; calculating the GOP value, the number of B frames, and the video frame rate in the encoding parameters corresponding to the current video file to be converted according to the compression ratio, the GOP value, the number of B frames, and the video frame rate.

[0069] In some embodiments, such as this embodiment, when the processor 302 implements the steps of calculating the GOP value, the number of B frames, and the video frame rate in the encoding parameters corresponding to the current video file to be converted according to the compression ratio, the GOP value, the number of B frames, and the video frame rate, the following steps are specifically implemented: Calculate the ratio between the GOP value and the compression ratio to obtain the GOP value in the encoding parameters corresponding to the current video file to be converted; Calculate the ratio between the number of B frames and the compression ratio to obtain the number of B frames in the encoding parameters corresponding to the current video file to be converted; Calculate the ratio between the video frame rate and the compression ratio to obtain the video frame rate in the encoding parameters corresponding to the current video file to be converted.

[0070] It should be understood that in the embodiments of the present application, the processor 302 may be a central processing unit (CPU), and this processor 302 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or this processor may also be any conventional processor, etc.

[0071] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a storage medium, and the storage medium is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0072] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above video encoding conversion method.

[0073] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disc, etc., all of which are computer-readable storage media that can store program codes.

[0074] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0075] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0076] The steps in the method embodiments of the present invention can be adjusted, combined, and deleted according to actual needs. The units in the device embodiments of the present invention can be combined, divided, and deleted according to actual needs. In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0077] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.

[0078] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0079] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.

[0080] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A video encoding conversion method, characterized in that, Including: Select the first video file to be converted in the set of video files to be converted according to the file identifier as the current video file to be converted, where the set of video files to be converted includes multiple video files to be converted; Obtain video compression information from the current video file to be converted, and calculate encoding parameters corresponding to the current video file to be converted according to the video compression information, the total volume of all video files to be converted in the set of video files to be converted, and the preset total volume of the video output file; Adjust the video compression information according to the encoding parameters, and perform encoding conversion on the current video file to be converted according to the adjusted video compression information to obtain a video output file; Select the next video file to be converted from the set of video files to be converted, and use the next video file to be converted as the current video file to be converted, and return to execute the step of obtaining video compression information from the current video file to be converted until all video files to be converted in the set of video files to be converted are converted; Among them, the step of obtaining video compression information from the current video file to be converted and calculating encoding parameters corresponding to the current video file to be converted according to the video compression information, the total volume of all video files to be converted in the set of video files to be converted, and the preset total volume of the video output file includes: Obtain the video volume, GOP value, number of B frames, and video frame rate from the current video file to be converted; Calculate the video bit rate in the encoding parameters corresponding to the current video file to be converted according to the video volume, the total volume of all video files to be converted in the set of video files to be converted, and the preset total volume of the video output file; Calculate the GOP value, number of B frames, and video frame rate in the encoding parameters corresponding to the current video file to be converted according to the GOP value, the number of B frames, the video frame rate, the total volume, and the preset total volume of the video output file.

2. The video encoding conversion method according to claim 1, characterized in that, The calculation of the video bit rate in the encoding parameters corresponding to the current video file to be converted according to the video volume, the total volume of all video files to be converted in the set of video files to be converted, and the preset total volume of the video output file includes: Calculate the volume ratio according to the video volume and the total volume of all video files to be converted in the set of video files to be converted; Calculate the video bit rate in the encoding parameters corresponding to the current video file to be converted according to the volume ratio and the preset total volume of the video output file.

3. The video encoding conversion method according to claim 2, characterized in that, Calculating the total volume of all video files to be converted in the set of video files to be converted includes: Obtain the volume of each video file to be converted in the set of video files to be converted respectively; Calculate the sum of the volumes to obtain the total volume.

4. The video encoding conversion method according to claim 2, characterized in that, The calculation of the GOP value, number of B frames, and video frame rate in the encoding parameters corresponding to the current video file to be converted according to the GOP value, the number of B frames, the video frame rate, the total volume, and the preset total volume of the video output file includes: Calculate the compression ratio based on the total volume and the preset total volume of the video output file; Calculate the GOP value, the number of B frames, and the video frame rate in the encoding parameters corresponding to the current video file to be converted based on the compression ratio, the GOP value, the number of B frames, and the video frame rate.

5. The video encoding conversion method according to claim 4, characterized in that, The calculating the GOP value, the number of B frames, and the video frame rate in the encoding parameters corresponding to the current video file to be converted based on the compression ratio, the GOP value, the number of B frames, and the video frame rate includes: Calculate the ratio between the GOP value and the compression ratio to obtain the GOP value in the encoding parameters corresponding to the current video file to be converted; Calculate the ratio between the number of B frames and the compression ratio to obtain the number of B frames in the encoding parameters corresponding to the current video file to be converted; Calculate the ratio between the video frame rate and the compression ratio to obtain the video frame rate in the encoding parameters corresponding to the current video file to be converted.

6. A video encoding conversion device, characterized in that, Includes: A selection unit for selecting the first-ranked video file to be converted from the set of video files to be converted as the current video file to be converted according to the file identifier, where the set of video files to be converted includes multiple video files to be converted; A calculation unit for obtaining video compression information from the current video file to be converted and calculating the encoding parameters corresponding to the current video file to be converted according to the video compression information, the total volume of all the video files to be converted in the set of video files to be converted, and the preset total volume of the video output file; An encoding conversion unit for adjusting the video compression information according to the encoding parameters and performing encoding conversion on the current video file to be converted according to the adjusted video compression information to obtain a video output file; A return execution unit for selecting the next video file to be converted from the set of video files to be converted, taking the next video file to be converted as the current video file to be converted, and returning to execute the step of obtaining video compression information from the current video file to be converted until all the video files to be converted in the set of video files to be converted are converted; Wherein, the calculation unit includes: An acquisition unit for obtaining the video volume, the GOP value, the number of B frames, and the video frame rate from the current video file to be converted; A first calculation subunit for calculating the video bit rate in the encoding parameters corresponding to the current video file to be converted according to the video volume, the total volume of all the video files to be converted in the set of video files to be converted, and the preset total volume of the video output file; A second calculation subunit for calculating the GOP value, the number of B frames, and the video frame rate in the encoding parameters corresponding to the current video file to be converted according to the GOP value, the number of B frames, the video frame rate, the total volume, and the preset total volume of the video output file.

7. A computer device, characterized in that, The computer device includes a memory and a processor. A computer program is stored on the memory. When the processor executes the computer program, the video encoding conversion method described in any one of claims 1-5 is implemented.

8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program. When the computer program is executed by a processor, the video encoding conversion method described in any one of claims 1-5 can be implemented.

Citation Information

Patent Citations

  • Method and device for transcoding video file online

    CN105681823A

  • Method and device for controlling bit-rate for video encoding, video encoding system using same and computer product therefor

    WO2009149564A1