Dynamic video coding parameter optimization method and device based on environmental factors

By evaluating the system environment and dynamically selecting FFmpeg encoding parameters, the problems of low encoding efficiency and unsatisfactory video quality caused by static settings are solved, thus optimizing video encoding efficiency and resource utilization.

CN120897060APending Publication Date: 2025-11-04BEIJING FUNSHION ONLINE TECH LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410991304.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Existing video encoding parameters are usually statically set, which fails to effectively adapt to changes in the encoding environment, resulting in low encoding efficiency or unsatisfactory video quality.

Method used

Through system environment assessment, construction of pairwise comparison matrices, AHP weight calculation, and TOPSIS method selection, the optimal solution configuration is applied to video encoding, dynamically selecting the most suitable FFmpeg encoding parameters.

Benefits of technology

While ensuring video quality, we optimize encoding efficiency and resource utilization to achieve intelligent parameter configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120897060A_ABST
    Figure CN120897060A_ABST
Patent Text Reader

Abstract

The invention relates to a dynamic video coding parameter optimization method based on environmental factors, and the method comprises the steps: carrying out the evaluation of a current coding environment before coding, and obtaining environmental parameters; based on the environment parameters, a paired comparison matrix A is dynamically constructed; processing the paired comparison matrix A by using an AHP method, calculating the weight of each criterion, standardizing each row of the paired comparison matrix A and averaging to obtain a weight vector W, and performing consistency check; defining a specific coding parameter configuration set P, and scoring configurations in the coding parameter configuration set P; and selecting optimal solution configuration by using a TOPSIS method, and applying the optimal solution configuration to video coding. The method has the beneficial effects that the most suitable FFmpeg coding parameter configuration can be intelligently selected on the basis of the current system environment at the beginning of coding, so that the coding efficiency and the resource use are optimized while the video quality is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of video optimization, in particular to a dynamic video coding parameter optimization method and device based on environmental factors. BACKGROUND

[0002] With the development of digital video technology, the efficiency and quality of video coding become important factors. In the prior art, video coding parameters (such as code rate, frame rate, resolution) are usually set statically, without considering the changes in the coding environment, which may result in low coding efficiency or unsatisfactory video quality. SUMMARY

[0003] The technical problem to be solved by the present application is to study a dynamic video coding parameter optimization method and device based on environmental factors to improve the efficiency and quality of video coding.

[0004] The technical solution of the present application to solve the above technical problem is as follows:

[0005] A dynamic video coding parameter optimization method based on environmental factors, comprising the following steps:

[0006] Step 01, system environment evaluation: before coding starts, the current coding environment is evaluated to obtain environmental parameters;

[0007] Step 02, constructing a pair-wise comparison matrix: based on the environmental parameters, a pair-wise comparison matrix A is dynamically constructed;

[0008] Step 03, AHP weight calculation: using AHP method to process pair-wise comparison matrix A, calculating the weight of each criterion, by standardizing each row of pair-wise comparison matrix A and taking the average value, obtaining weight vector W, and performing consistency check;

[0009] Step 04, listing possible coding parameter configurations: defining a specific coding parameter configuration set P, scoring the configurations in the coding parameter configuration set P;

[0010] Step 05, applying TOPSIS method selection: using TOPSIS method to select the optimal solution configuration, and applying the optimal solution configuration to video coding.

[0011] The beneficial effects of the present application are: the present application can intelligently select the most suitable FFmpeg coding parameter configuration based on the current system environment at the beginning of coding, so as to optimize the coding efficiency and resource usage while ensuring the video quality.

[0012] On the basis of the above technical solution, the present application can also be improved as follows.

[0013] Further, dynamically constructing pair-wise comparison matrix A specifically comprises:

[0014]

[0015] wherein a 12 , a 13 , a 23 are determined dynamically based on system environment parameters.

[0016] Further, the environment parameters include CPU usage C, available memory M and disk space D; evaluating the current encoding environment specifically includes:

[0017] obtaining the current CPU usage C,

[0018] measuring the available memory M of the current system,

[0019] checking the available disk space D.

[0020] Further, a 12 , a 13 , a 23 are determined dynamically based on system environment parameters, which specifically includes:

[0021] CPU usage C:

[0022] If C>80%: set a 12 =3 and a 13 =2,

[0023] If C<=80% CPU: set a 12 =1 and a 13 =1;

[0024] Available memory M:

[0025] If M<2G: set a 23 =0.5,

[0026] If M>=2GB: set a 23 =1 or a 23 =1.5;

[0027] Disk space D:

[0028] If D<10GB: adjust the values of a 13 and a 23 to 3,

[0029] If D>=10GB: keep the values of a 13 and a 23 as 1.

[0030] Further, the calculation formula of the weight vector W is:

[0031] W = normalized eigenvect of A

[0032] W is the principal eigenvector of the pair-wise comparison matrix A, which is normalized.

[0033] Further, the consistency check specifically includes:

[0034]

[0035] where λ max is the largest eigenvalue of A, n is the number of criteria, and RI is the random consistency index.

[0036] Further, the set of encoding parameter configurations P is pre-set or can be dynamically adjusted; and scoring the configurations in the set of encoding parameter configurations P specifically includes scoring video quality, encoding speed, and resource usage.

[0037] Further, using the TOPSIS method to select the optimal solution configuration specifically includes:

[0038] Based on the defined scoring criteria and P, a decision matrix T is constructed,

[0039]

[0040] where t ij is the score of configuration scheme i under criterion j, m is the number of schemes, and n is the number of criteria;

[0041] Standardizing T,

[0042]

[0043] Each element of the matrix T is normalized, and then the weight W obtained from AHP is applied;

[0044] V ij = T norm,ij * W j

[0045] The distance of each configuration to the ideal solution D+ and the negative ideal solution D- is calculated,

[0046] The distance D + to the ideal solution:

[0047]

[0048] The distance D - to the negative ideal solution:

[0049]

[0050] The relative closeness C is calculated for each configurationi ,

[0051]

[0052] Selection C i The highest configuration is the optimal solution configuration.

[0053] Another technical solution of the present application is as follows:

[0054] A dynamic video coding parameter optimization device based on environmental factors, comprising a memory and a processor;

[0055] The memory is used for storing a computer program;

[0056] The processor is used for implementing the dynamic video coding parameter optimization method based on environmental factors as described above when the computer program is executed.

[0057] Further, when the computer program is executed by the processor, the dynamic video coding parameter optimization method based on environmental factors as described above is implemented. BRIEF DESCRIPTION OF DRAWINGS

[0058] Figure 1 The present application is a dynamic video coding parameter optimization method based on environmental factors. DETAILED DESCRIPTION

[0059] The principles and characteristics of the present application are described below in conjunction with the accompanying drawings, and the examples are only used to explain the present application and are not used to limit the scope of the present application.

[0060] As shown in Figure 1 Embodiment 1 of the present application is a dynamic video coding parameter optimization method based on environmental factors, comprising the following steps:

[0061] Step 01, system environment evaluation: before encoding starts, the current encoding environment is evaluated to obtain environmental parameters;

[0062] Step 02, constructing a pair comparison matrix: based on the environmental parameters, a pair comparison matrix A is dynamically constructed;

[0063] Step 03, AHP weight calculation: using the AHP method to process the pair comparison matrix A, the weight of each criterion is calculated, the weight vector W is obtained by standardizing each row of the pair comparison matrix A and taking the average value, and consistency check is performed;

[0064] Step 04, list possible encoding parameter configurations: define a specific encoding parameter configuration set P, and score the configurations in the encoding parameter configuration set P;

[0065] Step 05, application TOPSIS method selection: using TOPSIS method to select the optimal solution configuration, the optimal solution configuration is applied to video coding.

[0066] The application can intelligently select the most suitable FFmpeg encoding parameter configuration based on the current system environment at the beginning of encoding, thereby optimizing the encoding efficiency and resource use while ensuring the video quality.

[0067] Embodiment 2 of the application is a dynamic video encoding parameter optimization method based on environmental factors, which dynamically constructs a comparison matrix A based on embodiment 1, and specifically includes:

[0068]

[0069] Wherein, a 12 , a 13 , a 23 is dynamically determined based on system environment parameters.

[0070] Embodiment 3 of the application is a dynamic video encoding parameter optimization method based on environmental factors, which is based on embodiment 2, and the environmental parameters include CPU usage C, available memory M and disk space D; the current encoding environment is evaluated, and specifically includes:

[0071] The current CPU usage C is obtained,

[0072] The available memory M of the current system is measured,

[0073] The current available disk space D is checked.

[0074] In specific implementation, the CPU usage C is expressed in percentage; the available memory M is expressed in GB; and the disk space D is expressed in GB.

[0075] Embodiment 4 of the application is a dynamic video encoding parameter optimization method based on environmental factors, which is based on embodiment 3, and a 12 , a 13 , a 23 is dynamically determined based on system environment parameters, and specifically includes:

[0076] The CPU usage C is:

[0077] If C>80%: set the encoding speed more important than the video quality and resource use, set a 12 =3 and a 13 =2, indicating the importance of encoding speed relative to video quality and resource use,

[0078] If C<=80% CPU: the importance of encoding speed is reduced, set a 12 =1 and a 13 =1.

[0079] Available memory M:

[0080] If M < 2GB: importance of resource usage increases, set a 23 = 0.5, meaning resource usage is half as important as video quality,

[0081] If M >= 2GB: importance of resource usage decreases, set a 23 = 1 or a 23 = 1.5;

[0082] Disk space D:

[0083] If D < 10GB: compression efficiency becomes more important, adjust a 13 and a 23 to a value of 3,

[0084] If D >= 10GB: importance of compression efficiency decreases, keep a 13 and a 23 at a value of 1.

[0085] Embodiment 5 of the present application is a dynamic video encoding parameter optimization method based on environmental factors, and on the basis of Embodiment 4, the calculation formula of the weight vector W is:

[0086] W = normalized eigenvect of A

[0087] W is the principal eigenvector of the pair comparison matrix A, which is processed by normalization.

[0088] Embodiment 6 of the present application is a dynamic video encoding parameter optimization method based on environmental factors, and on the basis of Embodiment 5, the consistency test specifically includes:

[0089]

[0090] Wherein, λ max is the maximum eigenvalue of A, n is the number of criteria, and RI is the random consistency index.

[0091] Embodiment 7 of the present application is a dynamic video encoding parameter optimization method based on environmental factors, and on the basis of Embodiment 6, the encoding parameter configuration set P is preset by the program in advance or can be dynamically adjusted; and the scoring for the configurations in the encoding parameter configuration set P specifically includes: scoring the video quality, the encoding speed and the resource usage. Higher code rate and frame rate correspond to higher video quality; lower code rate corresponds to faster encoding speed; lower frame rate and code rate use less resources.

[0092] In implementation, if the code rate is set as 500kbps, 1000kbps and 1500kbps, and the frame rate is set as 24fps, 30fps and 60fps, then the configurations in P are scored:

[0093] Configuration A: code rate 500kbps, frame rate 24fps,

[0094] Configuration B: code rate 1000kbps, frame rate 30fps,

[0095] Configuration C: code rate 1500kbps, frame rate 60fps;

[0096] Video quality score (ten-point scale):

[0097] Configuration A: 6,

[0098] Configuration B: 8,

[0099] Configuration C: 9;

[0100] Encoding speed score (ten-point scale):

[0101] Configuration A: 8,

[0102] Configuration B: 6,

[0103] Configuration C: 5;

[0104] Resource usage score (ten-point scale):

[0105] Configuration A: 7,

[0106] Configuration B: 6,

[0107] Configuration C: 5.

[0108] Embodiment 8 of the application is a dynamic video encoding parameter optimization method based on environmental factors, which uses the TOPSIS method to select the optimal solution configuration based on embodiment 7, and specifically comprises:

[0109] Based on the defined scoring criteria and P, a decision matrix T is constructed,

[0110]

[0111] where t ij is the score of configuration scheme i under criterion j, m is the number of schemes, and n is the number of criteria;

[0112] Standardize T,

[0113]

[0114] Each element of the matrix T is standardized, and then the weight W obtained from AHP is applied;

[0115] V ij = T norm,ij * W j

[0116] calculating the distance of each configuration to the ideal solution D+ and to the negative ideal solution D-,

[0117] distance to the ideal solution D + :

[0118]

[0119] distance to the negative ideal solution D - :

[0120]

[0121] calculating the relative closeness C i for each configuration,

[0122]

[0123] selecting the configuration with the highest C i as the optimal solution configuration.

[0124] Embodiment 9 of the present application is a device for optimizing dynamic video coding parameters based on environmental factors, comprising a memory and a processor;

[0125] the memory is configured to store a computer program;

[0126] the processor is configured to implement the method for optimizing dynamic video coding parameters based on environmental factors according to any one of embodiments 1 to 8 when the computer program is executed.

[0127] Embodiment 10 of the present application is a device for optimizing dynamic video coding parameters based on environmental factors, which, on the basis of embodiment 9, implements the method for optimizing dynamic video coding parameters based on environmental factors according to any one of embodiments 1 to 8 when the computer program is executed by the processor.

[0128] The above description is merely preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for optimizing dynamic video coding parameters based on environmental factors, characterized in that, Includes the following steps: Step 01: System Environment Assessment: Before coding begins, assess the current coding environment and obtain the environment parameters; Step 02: Constructing the pairwise comparison matrix: Dynamically construct the pairwise comparison matrix A based on environmental parameters; Step 03: Perform AHP weight calculation: Use the AHP method to process the pairwise comparison matrix A, calculate the weight of each criterion, obtain the weight vector W by standardizing each row of the pairwise comparison matrix A and taking the average value, and perform a consistency check. Step 04: List possible encoding parameter configurations: Define a specific set of encoding parameter configurations P, and score the configurations in the set of encoding parameter configurations P; Step 05: Apply the TOPSIS method to select the optimal solution configuration and apply the optimal solution configuration to the video encoding.

2. The method for optimizing dynamic video coding parameters based on environmental factors according to claim 1, characterized in that, The dynamic construction of the comparison matrix A specifically includes: Among them, a 12 a 13 a 23 The system environment parameters are dynamically determined.

3. The method for optimizing dynamic video coding parameters based on environmental factors according to claim 2, characterized in that, The environmental parameters include CPU utilization (C), available memory (M), and disk space (D); the evaluation of the current coding environment specifically includes: Get the current CPU utilization C. Measure the available memory (M) of the current system. Check the currently available disk space D.

4. The method for optimizing dynamic video coding parameters based on environmental factors according to claim 3, characterized in that, The a 12 a 13 a 23 Dynamically determining based on system environment parameters specifically includes: CPU utilization C: If C > 80%: Set a 12 =3 and a 13 =2, If C <= 80% CPU: Set a 12 =1 and a 13 =1; Available memory M: If M < 2G: Set a 23 =0.5, If M >= 2GB: Set a 23 =1 or a 23 =1.5; Disk space D: If D < 10GB: Adjust a 13 and a 23 The value is 3. If D >= 10GB: Keep a 13 and a 23 The value is 1.

5. The method for optimizing dynamic video coding parameters based on environmental factors according to claim 4, characterized in that, The formula for calculating the weight vector W is: W=normailized eigenvect of A W is the principal eigenvector of the pairwise comparison matrix A, which has been normalized.

6. The method for optimizing dynamic video coding parameters based on environmental factors according to claim 5, characterized in that, The consistency check specifically includes: Where, λ max is the largest eigenvalue of A, n is the number of criteria, and RI is the random consistency index.

7. The method for optimizing dynamic video coding parameters based on environmental factors according to claim 6, characterized in that, The encoding parameter configuration set P is preset by the program or can be dynamically adjusted; the scoring of the configurations in the encoding parameter configuration set P specifically includes scoring video quality, encoding speed and resource usage.

8. The method for optimizing dynamic video coding parameters based on environmental factors according to claim 7, characterized in that, The selection of the optimal solution configuration using the TOPSIS method specifically includes: Based on the defined scoring criteria and P, a decision matrix T is constructed. Where t ij is the score of configuration scheme i under criterion j, m is the number of schemes, n is the number of criterions; Standardized T, For each element of matrix T, standardize it, and then apply the weights W obtained by AHP; V ij =T norm,ij *W j Calculate the distances from each configuration to the ideal solution D+ and the negative ideal solution D-. Distance D to the ideal solution + : Distance D to the negative ideal solution - : Calculate the relative proximity C for each configuration. i , Choose C i The highest configuration is the optimal solution configuration.

9. A device for optimizing dynamic video coding parameters based on environmental factors, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to, when executing the computer program, implement the dynamic video coding parameter optimization method based on environmental factors as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the dynamic video coding parameter optimization method based on environmental factors as described in any one of claims 1 to 8.