Cross-platform video optimization method and device, and storage medium

By performing dual-track parameter matching and mapping conversion of video data in a cross-platform environment and optimizing encoding parameters with quality analysis algorithms, the problem of uneven video quality across platforms is solved, and stable output and consistency of video quality are achieved.

CN120602667APending Publication Date: 2025-09-05AFIRSTSOFT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510747292.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

The video quality output by multiple cross-platform encoders varies, resulting in low cross-platform video encoding efficiency.

Method used

By receiving video data, detecting the original hardware parameters and resolution, performing dual-track parameter matching processing, generating hardware encoding and software encoding, and performing mapping conversion processing, the quality analysis algorithm is used to generate encoding parameters, which are optimized and adjusted until the quality threshold is met.

Benefits of technology

It achieves stable output of video quality on different platforms and improves the consistency of cross-platform video data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602667A_ABST
    Figure CN120602667A_ABST
Patent Text Reader

Abstract

The invention relates to the field of video coding, and discloses a cross-platform video optimization method and device, and a storage medium. The method comprises the following steps: receiving video data, and detecting original hardware parameters and resolution corresponding to the video data; performing double-track parameter matching processing on the video data to generate a hardware code and a software code; performing mapping conversion processing on the hardware codes and the software codes to generate coding parameters; encoding the video data to generate an encoded video; performing quality analysis processing on the coded video to generate a quality score; judging whether the quality score is smaller than a preset score threshold value or not; and when the score is smaller than the preset score threshold, optimizing and adjusting the coding parameter to generate the optimized and adjusted coding parameter. In the embodiment of the invention, through decoder parameter mapping conversion of different platforms, stable output of video quality under different platforms is realized, and the consistency of cross-platform video data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video coding, and in particular to a cross-platform video optimization method, device and storage medium. Background Art

[0002] In the field of video coding, traditional software encoders with fixed parameter configurations exhibit unbalanced playback performance at different resolutions. Experimental data shows that H.264 soft encoding achieves a bitrate of up to 35Mbps at 4K resolution using a CRF of 22, while the same parameters for 1080p suffer from a 40% bitrate redundancy. Therefore, to overcome these issues, existing technologies have introduced hardware encoders to address this bitrate redundancy. However, with the introduction of hardware encoders, these encoders run on operating systems such as Windows, iOS, and macOS. These include the H.264 video hardware encoder (H264_qsv) developed for Intel processors, the H264_nvenc hardware encoder for NVIDIA graphics cards, and the VideoToolbox hardware acceleration framework for iOS and macOS operating systems. Not only do the parameter systems of software and hardware encoders differ significantly, but the parameter systems of hardware encoders themselves also differ significantly, leading to difficulties in adapting encoders to heterogeneous environments. For example, the PSNR values ​​of the CRF mode of x264 software encoding and the CQ mode of H264_nvenc hardware encoding can differ by 2-3dB under the same value, resulting in uncontrollable cross-platform video quality.

[0003] The lack of cross-platform compatibility and inefficient video bitrate optimization on software playback platforms across different operating systems leads to inconsistent video quality across multiple encoders. Therefore, a new technology is needed to address this issue. Summary of the Invention

[0004] The main purpose of the present invention is to solve the technical problem of uneven video quality output by cross-platform multi-encoders.

[0005] A first aspect of the present invention provides a cross-platform video optimization method, the cross-platform video optimization method comprising: Receiving video data, and detecting original hardware parameters and resolution corresponding to the video data; Reading playback hardware parameters corresponding to the video data playback; Performing dual-track parameter matching processing on the video data according to the resolution and the original hardware parameters to generate hardware encoding and software encoding; According to the playback hardware parameters, mapping and converting processing is performed on the hardware encoding and the software encoding to generate encoding parameters; encoding the video data according to the encoding parameters to generate an encoded video; Performing quality analysis on the encoded video according to a preset quality analysis algorithm to generate a quality score; Determining whether the quality score is less than a preset score threshold; If the score is not less than a preset threshold, the encoded video is determined to be a qualified video; When the score is less than a preset threshold, the encoding parameters are optimized and adjusted to generate optimized and adjusted encoding parameters.

[0006] Optionally, in a first implementation of the first aspect of the present invention, performing dual-track parameter matching processing on the video data according to the resolution and the original hardware parameters to generate hardware encoding and software encoding includes: According to the playback resolution, calling a preset software encoder, performing software encoding recognition on the video data, and obtaining a software encoding; According to the original hardware parameters, a preset hardware encoder is called to perform hardware encoding recognition on the video data to obtain hardware encoding.

[0007] Optionally, in a second implementation of the first aspect of the present invention, performing mapping and conversion processing on the hardware encoding and the software encoding according to the playback hardware parameters to generate encoding parameters includes: According to the preset playback soft and hard coding settings and the preset parameter mapping table, query the hardware coding and the software coding, and the corresponding equivalent data in the playback hardware parameters; Based on the equivalent data, mapping and conversion processing is performed on the hardware encoding and the software encoding to generate encoding parameters.

[0008] Optionally, in a third implementation of the first aspect of the present invention, the parameter mapping table includes: a general parameter mapping, a hardware-specific parameter mapping, a bit rate parameter mapping, and a resolution parameter mapping.

[0009] Optionally, in a fourth implementation of the first aspect of the present invention, performing quality analysis on the encoded video according to a preset quality analysis algorithm to generate a quality score includes: The encoded video is subjected to quality analysis processing according to a preset VMAF quality analysis algorithm to generate a VMAF quality score.

[0010] Optionally, in a fifth implementation of the first aspect of the present invention, the optimizing and adjusting the encoding parameters to generate optimized and adjusted encoding parameters includes: When the resolution is less than a preset first strategy threshold, performing an equivalent process of reducing a CRF parameter on the encoding parameter, and performing an equivalent process of increasing a psy-rd parameter on the encoding parameter; When the resolution is greater than a preset second strategy threshold, the coding parameters are processed equivalent to increasing the CRF parameter, and the coding parameters are processed equivalent to reducing the rc-lookahead parameter.

[0011] Optionally, in a sixth implementation of the first aspect of the present invention, determining whether the quality score is less than a preset score threshold includes: When the resolution is in the range of 480p-720p, determining whether the quality score is less than a preset first score threshold; When the resolution is 1080p, determining whether the quality score is less than a preset second score threshold; When the resolution is in the range of 2k-4k, it is determined whether the quality score is less than a preset third score threshold.

[0012] Optionally, in a seventh implementation manner of the first aspect of the present invention, after determining the encoded video as a qualified video, the method further includes: The encoded video is exported to a preset storage address.

[0013] The second aspect of the present invention provides a cross-platform video optimization device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via lines; the at least one processor calls the instructions in the memory so that the cross-platform video optimization device executes the above-mentioned cross-platform video optimization method.

[0014] A third aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned cross-platform video optimization method.

[0015] In an embodiment of the present invention, by utilizing the difference between original hardware parameters and playback hardware parameters when the resolution is determined, the parameters of hardware encoding and software encoding on different platforms are mapped, and hardware-specific parameter adaptation is set at the same time. The video data is adapted to the platform parameter mapping to generate the encoded video, and the encoding parameters are iteratively modified using a quality analysis algorithm until the encoded video meets the encoding parameters of the video quality. The equivalent mapping and modification of parameters for different platforms and hardware overcomes the technical problem of uneven video quality output by multiple encoders across platforms, achieves stable output of video quality on different platforms, and improves the consistency of video data across platforms. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of an embodiment of a cross-platform video optimization method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a specific embodiment of step 104 of the cross-platform video optimization method according to an embodiment of the present invention; Figure 3 107 is a schematic diagram of a specific embodiment of the cross-platform video optimization method according to an embodiment of the present invention; Figure 4 109 is a schematic diagram of a specific embodiment of the cross-platform video optimization method according to an embodiment of the present invention; Figure 5 Schematic diagram of an embodiment of a cross-platform video optimization device in an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The embodiments of the present invention provide a cross-platform video optimization method, device and storage medium.

[0018] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0019] In the description of the embodiments disclosed herein, the term "including" and similar terms should be understood as open inclusion, i.e., "including but not limited to." The term "based on" should be understood as "based, at least in part, on." The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment." The terms "first," "second," etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0020] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 An embodiment of a cross-platform video optimization method in an embodiment of the present invention includes: 101. Receive video data, and detect original hardware parameters and resolution corresponding to the video data; In this embodiment, video data of the first platform is received, and original hardware parameters and resolution corresponding to the original video data are detected simultaneously, such as the original operating system is Windows, the original encoding hardware parameters are NVIDIA graphics card, and the resolution is 720p.

[0021] 102. Read the playback hardware parameters corresponding to the video data playback; In this embodiment, the playback hardware parameter corresponding to the video data playback is an Intel processor.

[0022] 103. Perform dual-track parameter matching processing on the video data according to the resolution and the original hardware parameters to generate hardware encoding and software encoding; In this embodiment, based on the resolution and original hardware parameters, dual-track parameter matching can be performed on the video data, using both software and hardware. The video data may be encoded using a hybrid encoding scheme consisting of software encoding in the first half and hardware encoding in the second half. Software encoding primarily relies on the CPU for computation, while hardware encoding utilizes hardware acceleration, such as graphics cards or dedicated chips. Switching encoding modes during the encoding process theoretically allows for software encoding in the first half and hardware encoding in the second half, as long as the encoding parameters remain consistent. Therefore, two channels can be identified for the video data. The software encoder uses a CRF mode, establishing a mapping between CRF∈[10,24] and resolution (e.g., 480p corresponds to CRF=10, 4K corresponds to CRF=24). For the hardware encoder, for NVENC / CQ mode, CQ=CRF+3 (empirical conversion formula), for QSV / ICQ mode: ICQ=CRF×1.2 (linear mapping), and for VideoToolbox / VBR mode: quality=100-CRF×2 (quality percentage mapping). Based on dual-track parameter matching, the software encoding parameters and hardware encoding parameters in the video data are matched to generate hardware encoding and software encoding.

[0023] Specifically, step 103 includes the following specific implementation methods: 1031. Call a preset software encoder according to the playback resolution, perform software encoding recognition on the video data, and obtain a software encoding; 1032. Call a preset hardware encoder according to the original hardware parameters, perform hardware encoding recognition on the video data, and obtain hardware encoding.

[0024] In steps 1031-1032, based on the set resolution parameter mapping relationship, a software encoder is called to perform software encoding recognition on the video data to obtain a software encoding. In another analysis thread, based on hardware parameters such as Intel processors, NVIDIA graphics cards, and Apple accelerator chips, corresponding hardware encoders are called to perform hardware encoding recognition on the video data to obtain a hardware encoding.

[0025] 104. Perform mapping and conversion processing on the hardware encoding and the software encoding according to the playback hardware parameters to generate encoding parameters; In this embodiment, the original hardware parameters may be video data obtained from the Apple acceleration chip on the iOS and MacOS operating systems, and the playback hardware parameters to be adapted are now NVIDIA graphics cards. Therefore, the encoding rules based on Videotoolbox are mapped to the hardware encoding rules of h264_qsv, or the encoding of the Videotoolbox is converted into h264 software encoding by the customer. According to the needs, the identified hardware encoding and software encoding can be mapped and converted to generate the hardware encoding corresponding to the required playback hardware parameters or the software encoding required to be converted, that is, the encoding parameters. It should be noted that, for the encoded data originally encoded by software h264, since the parameter settings of the software encoding are the same standard, if the software encoding is the same after conversion, there is no need for mapping and conversion, and the encoding parameters of the same software encoding h264 are directly used, which will not be described in detail here.

[0026] For further information, see Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a specific embodiment of step 104 of the cross-platform video optimization method in an embodiment of the present invention. Step 104 includes the following specific implementation methods: 1041. Query the hardware encoding and the software encoding for corresponding equivalent data in the playback hardware parameters according to the preset playback soft and hard coding settings and the preset parameter mapping table; 1042. Based on the equivalent data, perform mapping conversion processing on the hardware encoding and the software encoding to generate encoding parameters.

[0027] In steps 1041-1042, the parameter mapping table includes the general parameter mapping relationship in Table 1, the hardware-specific parameter mapping table in Table 2, the bit rate control mode parameter mapping table in Table 3, the resolution parameter mapping table in Table 4, and the functional parameter mapping table in Table 5, which realizes the conversion between different parameters of different hardware encoders and software encoders. For example, the mapping of the soft-edited CRF value and the hardware encoder parameters is based on experimental data (such as CRF=22 corresponds to NVENCCQ=23), the soft-edited optimizes motion estimation of different resolutions through ref (reference frame number), and the hardware encoder adapts to the video memory resources through max_frame_size or surfaces. The playback soft and hard encoding settings can be the hardware encoding settings for the first half of the video, the software encoding settings for the second half of the video, or the hardware encoding settings for the entire video segment. It should be noted that the equivalent data in the hardware encoding settings is the hardware encoding data (such as h264_nvenc encoded data) corresponding to the playback hardware parameters (such as hardware parameters of the NVIDIA graphics card).

[0028] Table 1. Common parameter mapping

[0029] Table 2. Hardware-specific parameter mapping table

[0030] Table 3. Rate control mode parameter mapping table

[0031] Table 4. Resolution parameter mapping table

[0032] Table 5. Function parameter mapping table

[0033] Based on Tables 1 to 5 above, it is explained that the parameter mapping table includes mapping relationships such as general parameter mapping, hardware-specific parameter mapping, bit rate parameter mapping, and resolution parameter mapping.

[0034] As shown in Table 1, the hardware encoding deblock parameters of video data in the original iOS and MacOS operating systems are: rc=vbr dynamic adjustment, and the software encoding deblock parameters are: deblock=-1,-1.

[0035] The equivalent data of the deblock parameter corresponding to the NVIDIA graphics card in the playback hardware parameter is: spatial-aq=1 / / equivalent.

[0036] The equivalent parameters of h264_nvenc (hard encoding) and h264 (soft encoding) are retrieved from Videotoolbox (hard encoding) in the video data. The equivalent parameters of h264_nvenc (hard encoding) are retrieved from h264 (soft encoding) in the video data. The conversion methods described above are: hard encoding to hard encoding or soft encoding, and soft encoding to hard encoding. Based on the playback of soft and hard encoding, the original video data encoding method is determined. This allows the conversion of original iOS and macOS video data to encoding parameters for software encoding, hardware encoding, or hybrid encoding of video clips using NVIDIA graphics cards on Windows systems.

[0037] It should be noted that for general parameters, the deblock parameter indirectly implements equivalent filtering through the hardware encoder's rate control parameters (such as NVENC's spatial-aq). The psy-rd parameter is directly controlled by the software encoder through psy-rd, and the hardware encoder enables rate-distortion optimization through rdo=1. Regarding hardware-specific parameters. In h264_qsv (hard encoding), mbbrc=0 disables macroblock-level rate control, and vcm=0 turns off video encoding mode. In h264_nvenc (hard encoding), spatial-aq=1 enables spatial adaptive quantization, and forced-idr=1 forces the insertion of IDR frames. In videotoolbox (hard encoding), rc=vbr enables dynamic rate control, and max_rate_multiplier adjusts the rate fluctuation range.

[0038] 105. Encode the video data according to the encoding parameters to generate an encoded video; In this embodiment, the software encoding and hardware encoding of video data for the original iOS and macOS operating systems are converted to obtain encoding parameters for NVIDIA graphics card video. Then, based on these encoding parameters, the video data is encoded and executed, adjusting the encoding of the original video data to a video encoded for NVIDIA graphics card hardware acceleration on the Windows platform. Specifically, the hardware acceleration segment can be determined by the playback software and hard coding settings. The non-accelerated segment can be software encoded, and the accelerated segment is set to hardware encoding adapted to the NVIDIA graphics card hardware.

[0039] 106. Perform quality analysis on the encoded video according to a preset quality analysis algorithm to generate a quality score; In this embodiment, video quality analysis methods can be categorized into three different models: full-reference, semi-reference, and no-reference. Specifically, the quality scoring method can be a no-reference (NR) algorithm: This algorithm parses the coded bitstream to obtain input information, maps the input parameters to quality using an arithmetic function, and combines it with a machine learning model to predict the residual, ultimately generating a quality score. Other scoring methods can also include calculations such as PSNR (Peak Signal-to-Noise Ratio) and SSIM (Structural Similarity Index). Based on a pre-set quality analysis algorithm, the coded video is subjected to some video quality-related analysis to generate a quality score.

[0040] Specifically, step 106 includes the following specific implementation methods: 1061. Perform quality analysis on the encoded video according to a preset VMAF quality analysis algorithm to generate a VMAF quality score.

[0041] Among the 1061 steps, the VMAF quality analysis algorithm was developed by Netflix to predict how humans actually perceive video quality. VMAF (Video Multimethod Assessment Fusion) serves as the core quality metric, combining multi-dimensional features such as structural similarity (SSIM) and motion vector error (MVE) to provide a quality score (ranging from 0-100, with 100 being optimal) that more closely reflects human perception. VMAF leverages machine learning to analyze patterns, motion, and details to produce a score that closely reflects the viewer experience. VMAF is used for codec comparison and optimization of adaptive bitrate streams, performing quality analysis on encoded video to generate the VMAF quality score.

[0042] 107. Determine whether the quality score is less than a preset score threshold; In this embodiment, a score threshold, such as 80 points, can be directly set to determine whether the VMAF quality score of the encoded video is less than 80 points.

[0043] For further information, see Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a specific embodiment of step 107 of the cross-platform video optimization method in an embodiment of the present invention. Step 107 includes the following specific implementation methods: 1071. When the resolution is in the range of 480p-720p, determine whether the quality score is less than a preset first score threshold; 1072. When the resolution is 1080p, determine whether the quality score is less than a preset second score threshold; 1073. When the resolution is in the range of 2k-4k, determine whether the quality score is less than a preset third score threshold.

[0044] In step 1071, different target scores can be set for the quality score for videos of different resolutions. When the resolution is between 480p and 720p, the quality score is determined to be less than 85 points. When the resolution is 1080p, the quality score is determined to be less than 87 points. When the resolution is between 2k and 4k, the quality score is determined to be less than 90 points.

[0045] 108. When the score is not less than a preset score threshold, the encoded video is determined to be a qualified video; In this embodiment, the quality score is not less than the score threshold, that is, the quality score is greater than or equal to the score threshold, and the encoded video is determined to be a qualified video, completing cross-platform soft and hard coding adaptation.

[0046] Furthermore, after step 108, the following specific implementations are also included: 1081. Export the encoded video to a preset storage address.

[0047] In step 1081, after determining that the video is qualified, the encoded video can be exported to the local C drive or uploaded to a cloud database.

[0048] 109. When the score is less than a preset threshold, the coding parameters are optimized and adjusted to generate optimized and adjusted coding parameters.

[0049] In this embodiment, when the VMAF quality score (480p-720p) is less than 85, the VMAF quality score (1080p) is less than 87, and the VMAF quality score (2k-4k) is less than 90, the encoding parameters are optimized and adjusted to generate optimized encoding parameters. Then, based on the optimized encoding parameters, the process returns to step 105 to encode the video data according to the new encoding parameters to generate a new encoded video. The process then loops back to step 109 until the video quality meets the requirements.

[0050] For further information, see Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a specific embodiment of step 109 of the cross-platform video optimization method according to an embodiment of the present invention. Step 109 includes the following specific implementation methods: 1091. When the resolution is less than a preset first strategy threshold, performing an equivalent process of reducing a CRF parameter on the encoding parameter, and performing an equivalent process of increasing a psy-rd parameter on the encoding parameter; 1092. When the resolution is greater than a preset second strategy threshold, performing an equivalent process of increasing a CRF parameter on the coding parameter, and performing an equivalent process of reducing an rc-lookahead parameter on the coding parameter.

[0051] In steps 1091-1092, the Constant Rate Factor (CRF) is a parameter used in H.264 and H.265 video encoding to balance video encoding quality and file size. The psy-rd parameter stands for psycho-visual optimization, which adjusts encoding strategies based on the characteristics of human visual perception. The goal is to maximize compression efficiency while maintaining subjective visual quality. The psy-rd value consists of two parts in the format x:y, where the first number x represents the strength of the psycho-visual optimization (Psy-RDO), and the second number y represents the strength of the psycho-visual trellis quantization (Psy-Trellis).

[0052] At low resolutions, such as resolutions less than 720p, the equivalent processing of reducing the CRF / CQ value (e.g., CRF = 22 to 20) and enabling the equivalent processing of psy-rd = 1.5 can enhance texture protection. Specific optimization methods may also include the following: 1. High-precision bit rate control: A significantly lower CRF / ICQ value is used, sacrificing a small bitrate increase (approximately 15%-20%) in exchange for stricter quantization accuracy (QP reduction of 30%), ensuring high-fidelity reproduction of texture details (such as hair and fabric grain) and edge sharpness. For hardware encoders (such as Intel QSV), extended bitrate control (extbrc=1) and adaptive quantization compensation (aq-strength=0.9) are enabled to suppress chroma distortion at low resolutions.

[0053] 2. Enhanced motion estimation algorithm: Improved sub-pixel motion estimation accuracy, combining multiple reference frames with high-density motion search, significantly improves motion vector prediction accuracy (reducing motion estimation error by 20%). Enabled Trellis quantization optimization and rate-distortion optimization (RDO) decision making to reduce residual coding error (increasing bitrate utilization by 12%).

[0054] The rc-lookahead parameter is a parameter in video encoding that specifies the number of frames the encoder looks ahead when encoding the current frame. At high resolutions, such as those greater than 1080p, increasing the CRF / CQ value (e.g., CRF = 24 to 26) and reducing the rc-lookahead parameter can improve encoding speed. Specific optimization methods include the following: 1. Quantization step size optimization: At high resolutions (such as 4K), pixel density increases significantly, and the same quantization step size (QP) results in an exponential increase in data volume. By appropriately increasing the CRF value (e.g., CRF = 24) or the CQ / ICQ value of the hardware encoder, the quantization step size can be increased (QP increases by approximately 30%-40%), significantly reducing the bitrate (4K video bitrate reduction of 50%-60%). At the same time, rate-distortion optimization (RDO) is used to dynamically compensate for high-frequency detail loss (VMAF drop ≤ 2 points).

[0055] Data support: In the AVC encoding test, the 4K video bitrate was approximately 35Mbps when CRF=24 (55Mbps when CRF=18), and the VMAF score only dropped from 93.8 to 91.2, with no significant difference in subjective quality.

[0056] 2. Computing resource allocation strategy: Look-ahead frame window compression: shortens rc-lookahead from the default 120 frames to 50 frames, reduces the complexity of inter-frame prediction (reduced CPU load), speeds up encoding, and balances quality and speed.

[0057] Hardware acceleration optimization: For NVIDIA NVENC: enable optical flow acceleration (optical-flow=1) and video memory compression (nv12_to_p010=1), significantly improving motion estimation speed; for Intel QSV: use asynchronous pipeline technology (async_depth=4) to achieve CPU-GPU load balancing.

[0058] 3. Visual quality assurance mechanism: Adaptive quantization enhancement: Enables spatial and temporal adaptive quantization (spatial-aq=2, temporal-aq=2), dynamically allocating bitrate to moving areas (increasing the bitrate in dynamic areas by 20%), and suppressing blocking and blurring in high-speed motion scenes.

[0059] Configure psychovisual optimization parameters (psy-rd=1.5, psy-rdoq=2.0), prioritizing edge contours and texture details that are sensitive to the human eye (SSIM improvement ≥ 0.05).

[0060] Setting deblock=-2,-1 weakens the filtering strength for flat areas (reducing the perceived blocking effect by 40%) while maintaining appropriate filtering in highly textured areas to avoid ringing artifacts.

[0061] It should be noted that the scheme of steps 101 to 109 is affected by the following factors: 1. When VMAF is in the low range (e.g., VMAF < 80), bitrate increases are more sensitive to score improvements. At higher ranges (VMAF > 90), the difficulty of improving is significantly increased. For example, a bitrate increase of 5% is required to increase VMAF from 80 to 81, while a bitrate increase of 15% is required to increase VMAF from 90 to 91.

[0062] 2. The bitrate efficiency (speed) of hardware encoders (such as NVENC) is higher than that of software encoders (such as x264), but the cost of improving VMAF is higher. For hardware encoders, the bitrate increase of each 1 point of VMAF improvement is about 110% of that of software encoders.

[0063] 3. Dynamic scenes (such as live game streaming) require 30%-50% higher bitrates than static scenes (such as lecture videos). For every 10% increase in motion intensity, the bitrate required to improve VMAF by one point increases by 2-3%.

[0064] Factors 1-3 may be considered for optimizing coding parameters. Technicians can adjust the coding optimization solution based on factors 1-3 according to needs, and will not be elaborated here.

[0065] In an embodiment of the present invention, by utilizing the difference between original hardware parameters and playback hardware parameters when the resolution is determined, the parameters of hardware encoding and software encoding on different platforms are mapped, and hardware-specific parameter adaptation is set at the same time. The video data is adapted to the platform parameter mapping to generate the encoded video, and the encoding parameters are iteratively modified using a quality analysis algorithm until the encoded video meets the encoding parameters of the video quality. The equivalent mapping and modification of parameters for different platforms and hardware overcomes the technical problem of uneven video quality output by multiple encoders across platforms, achieves stable output of video quality on different platforms, and improves the consistency of video data across platforms.

[0066] Figure 5 The figure is a schematic diagram of the structure of a cross-platform video optimization device provided by an embodiment of the present invention. This cross-platform video optimization device 500 may vary significantly depending on configuration or performance. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors), memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) storing applications 533 or data 532. The memory 520 and storage medium 530 may be either transient or persistent storage. The program stored in the storage medium 530 may include one or more modules (not shown), each of which may include a series of instructions for operating on the cross-platform video optimization device 500. Furthermore, the processor 510 may be configured to communicate with the storage medium 530 to execute the series of instructions stored in the storage medium 530 on the cross-platform video optimization device 500.

[0067] The cross-platform video optimization device 500 may further include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and / or one or more operating systems 531, such as Windows Server, MacOS X, Unix, Linux, Free BSD, etc. It will be understood by those skilled in the art that Figure 5 The cross-platform video optimization device structure shown does not constitute a limitation on the cross-platform video optimization device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0068] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the steps of the cross-platform video optimization method.

[0069] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0070] In addition, although adopting specific order to describe each operation, this should be understood as requiring such operation to be carried out in the specific order shown or in sequential order, or requiring that all illustrated operations should be carried out to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although comprising some specific implementation details in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation also can be implemented in a plurality of implementations individually or in the mode of any suitable subcombination.

[0071] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A cross-platform video optimization method, characterized in that: Including steps: Receiving video data, and detecting original hardware parameters and resolution corresponding to the video data; Reading playback hardware parameters corresponding to the video data playback; Performing dual-track parameter matching processing on the video data according to the resolution and the original hardware parameters to generate hardware encoding and software encoding; According to the playback hardware parameters, mapping and converting processing is performed on the hardware encoding and the software encoding to generate encoding parameters; encoding the video data according to the encoding parameters to generate an encoded video; Performing quality analysis on the encoded video according to a preset quality analysis algorithm to generate a quality score; Determining whether the quality score is less than a preset score threshold; If the score is not less than a preset threshold, the encoded video is determined to be a qualified video; When the score is less than a preset threshold, the encoding parameters are optimized and adjusted to generate optimized and adjusted encoding parameters.

2. The cross-platform video optimization method according to claim 1, characterized in that: The performing dual-track parameter matching processing on the video data according to the resolution and the original hardware parameters to generate hardware encoding and software encoding includes: According to the playback resolution, calling a preset software encoder, performing software encoding recognition on the video data, and obtaining a software encoding; According to the original hardware parameters, a preset hardware encoder is called to perform hardware encoding recognition on the video data to obtain hardware encoding.

3. The cross-platform video optimization method according to claim 1, characterized in that: The performing mapping and conversion processing on the hardware encoding and the software encoding according to the playback hardware parameters to generate encoding parameters includes: According to the preset playback soft and hard coding settings and the preset parameter mapping table, query the hardware coding and the software coding, and the corresponding equivalent data in the playback hardware parameters; Based on the equivalent data, mapping and conversion processing is performed on the hardware encoding and the software encoding to generate encoding parameters.

4. The cross-platform video optimization method according to claim 3, characterized in that: The parameter mapping table includes: general parameter mapping, hardware-specific parameter mapping, bit rate parameter mapping, and resolution parameter mapping.

5. The cross-platform video optimization method according to claim 1, characterized in that: The performing quality analysis on the encoded video according to a preset quality analysis algorithm to generate a quality score includes: The encoded video is subjected to quality analysis processing according to a preset VMAF quality analysis algorithm to generate a VMAF quality score.

6. The cross-platform video optimization method according to claim 5, characterized in that: The optimizing and adjusting the encoding parameters to generate the optimized and adjusted encoding parameters comprises: When the resolution is less than a preset first strategy threshold, performing an equivalent process of reducing a CRF parameter on the encoding parameter, and performing an equivalent process of increasing a psy-rd parameter on the encoding parameter; When the resolution is greater than a preset second strategy threshold, the coding parameters are processed equivalent to increasing the CRF parameter, and the coding parameters are processed equivalent to reducing the rc-lookahead parameter.

7. The cross-platform video optimization method according to claim 1, characterized in that: Determining whether the quality score is less than a preset score threshold includes: When the resolution is in the range of 480p-720p, determining whether the quality score is less than a preset first score threshold; When the resolution is 1080p, determining whether the quality score is less than a preset second score threshold; When the resolution is in the range of 2k-4k, it is determined whether the quality score is less than a preset third score threshold.

8. The cross-platform video optimization method according to claim 1, characterized in that: After determining the encoded video as a qualified video, the method further includes: The encoded video is exported to a preset storage address.

9. A cross-platform video optimization device, characterized in that: The cross-platform video optimization device includes: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instructions in the memory to enable the cross-platform video optimization device to execute the cross-platform video optimization method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the cross-platform video optimization method according to any one of claims 1 to 8 is implemented.