WO2020118601A1 - Procédé, appareil, dispositif électronique, et support de stockage pour codage vidéo - Google Patents
Procédé, appareil, dispositif électronique, et support de stockage pour codage vidéo Download PDFInfo
- Publication number
- WO2020118601A1 WO2020118601A1 PCT/CN2018/120828 CN2018120828W WO2020118601A1 WO 2020118601 A1 WO2020118601 A1 WO 2020118601A1 CN 2018120828 W CN2018120828 W CN 2018120828W WO 2020118601 A1 WO2020118601 A1 WO 2020118601A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- application
- video
- encoder
- load rate
- encoding
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/70—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
Definitions
- the present application relates to the technical field of electronic equipment, and more specifically, to a video encoding method, device, electronic equipment, and storage medium.
- this application proposes a video encoding method, device, electronic device, and storage medium to improve the encoding quality of video.
- an embodiment of the present application provides a video encoding method, the method includes: when an application is detected to start video recording, acquiring a default encoding code rate corresponding to the application; determining the default encoding code Whether the bit rate is lower than the bit rate threshold; if it is lower than the bit rate threshold, then the application is controlled to select a designated soft encoder to encode the video data of the video.
- an embodiment of the present application provides a video encoding device.
- the device includes: a bit rate acquisition module, a bit rate judgment module, and an encoding control module, wherein the recording detection module is used to detect the start of an application When performing video recording, obtain the default encoding bit rate corresponding to the application; the bit rate determining module is used to determine whether the default encoding bit rate is lower than the bit rate threshold; the encoding control module is used if The code rate threshold controls the application to select a designated soft encoder to encode the video data of the video.
- an embodiment of the present application provides an electronic device, including: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and It is configured to be executed by the one or more processors, and the one or more programs are configured to perform the video encoding method provided in the first aspect described above.
- an embodiment of the present application provides a storage medium, and the computer-readable storage medium stores program code, and the program code can be called by a processor to execute the video encoding method provided in the first aspect.
- the control application program selects the designated soft encoder to encode the video data of the video.
- This method can determine the default coding rate according to the recorded video when the default coding rate is less than the code rate threshold, using a designated soft encoder to encode, thereby improving the flexibility of the encoding method and improving the encoding when recording low bit rate video quality.
- FIG. 1 shows a flowchart of a video encoding method according to an embodiment of the present application.
- FIG. 2 shows a flowchart of a video encoding method according to another embodiment of the present application.
- FIG. 3 shows a flowchart of step S260 in the video encoding method according to an embodiment of the present application
- FIG. 4 shows a flowchart of a video encoding method according to yet another embodiment of the present application.
- FIG. 5 shows a block diagram of a video encoding device according to an embodiment of the present application.
- FIG. 6 shows a block diagram of an encoding control module in a video encoding device according to an embodiment of the application.
- FIG. 7 is a block diagram of an electronic device for performing a video encoding method according to an embodiment of the present application.
- FIG. 8 is a storage unit for storing or carrying program codes for implementing a video encoding method according to an embodiment of the present application.
- an electronic device can run a client with a video recording function, and then trigger the client's video recording function to perform video recording, and finally store or transmit the recorded video to other devices.
- the methods of encoding video mainly include hard coding methods and soft coding methods.
- hard coding is performed by a dedicated hardware module (that is, a circuit board), for example, a GPU (Graphics Processing Unit, graphics processor) is usually used for encoding.
- Soft coding is to use CPU (Central Processing Unit, central processing unit) for coding. The implementation is simple, the parameter adjustment is convenient, and the upgrade is easy, but the CPU load is heavy and the performance is lower than hard coding.
- hard coding technology does not occupy CPU resources, it can save CPU resources.
- Most applications will prefer to use hard coding for video encoding, such as using the hard encoder that comes with the system.
- the inventor found that although video encoding is performed by hard coding, the load of the CPU can be reduced, the resources of the CPU can be released, and the smoothness of the system can be improved. However, when encoding a video with a low bit rate, the encoding quality of the hard encoding method is lower than that of the soft encoding method, which results in poor quality of the recorded video.
- the inventor after a long period of research and proposed the video encoding method, device, electronic device, and storage medium provided by the embodiments of the present application, when the application is detected to start video recording, the default encoding bit rate of the application is determined Whether it is lower than the bit rate threshold, if it is lower than the bit rate threshold, the control application chooses to specify a soft encoder to encode the video data of the video, thereby improving the flexibility of the encoding method and improving the encoding when recording low bit rate video quality.
- an embodiment of the present application provides a video encoding method, which can be applied to electronic devices.
- the video encoding method may include:
- Step S110 When it is detected that the application program starts to record video, the default encoding code rate corresponding to the application program is obtained.
- the electronic device When the electronic device records video, it encodes the acquired video data (for example, the video data collected by the camera) to obtain a video file for storage or transmission. Since hard coding can save CPU resources, applications of electronic devices usually prefer to use hard coding to encode video data. For all videos, if the hard-coding method is used for encoding, when the default encoding rate of the recorded video required by the application is low, the encoding quality will be poor, and finally the recorded video quality will be poor.
- the default encoding code rate corresponding to the application when an application is detected to start video recording, the default encoding code rate corresponding to the application may be determined, wherein the default encoding code rate corresponding to the application is the encoding of the recorded video required by the application The bit rate in the parameter.
- the electronic device may determine whether the application program starts video recording in various ways.
- the electronic device can detect whether the video recording interface is called, and when receiving a call request from the application program to the video recording interface, it is determined that the application program is detected to start video recording. For example, it can be detected whether an application call request to the interface MediaProjection or MediaProjectionManage is received. When a call request to the above interface is received, the application is confirmed to start video recording.
- the electronic device can detect whether the setting application is running in the foreground, and when the setting application is running in the foreground, it can be sure that the application starts video recording.
- the above setting application may be an application for video recording.
- the electronic device may store a list or list of application programs for video recording. The list or list can be freely configured by the user of the electronic device. The electronic device can first detect which application is currently running in the foreground, and then further detect whether the application currently running in the foreground is on the list. If it is, then it is determined that it is currently in the video playback state.
- the electronic device is an Android operating system
- the name of the application currently running in the foreground can be obtained by executing the getRunningTasks method of ActivityManager.
- the electronic device can also obtain a list of programs used by the user through the UsageStatsManager, and identify the most recently used application recorded in the list as the current foreground application.
- the recording control in the interface of the application is triggered, it is determined that the application starts video recording.
- the default encoding code rate corresponding to the application program that is, the encoding code rate required by the application program to record video may be obtained.
- the encoding parameters include: video size, resolution, code rate, format, etc.
- the default encoding bit rate corresponding to the application program can be obtained.
- the specific way of obtaining the default encoding bit rate corresponding to the application program may not be limited in the embodiments of the present application.
- Step S120 Determine whether the default coding rate is lower than the code rate threshold.
- the default encoding code rate corresponding to the application can be compared with the code rate threshold to determine whether the default encoding code rate is lower than the code rate threshold.
- the code rate threshold is used to divide the low code rate and other code rates, that is, when the code rate is lower than the code rate threshold, it is a low code rate.
- the specific bit rate threshold may not be limited, for example, the bit rate threshold may be 2 Mbps (megabits per second) or 1.52 Mbps.
- Step S130 If it is lower than the code rate threshold, control the application to select a designated soft encoder to encode the video data of the video.
- the control application program chooses to designate a soft encoder to encode the video data of the video.
- the designated soft encoder is an encoder that uses a soft encoding method.
- the designated soft encoder may be a third-party soft encoder or a system soft encoder.
- the specific designated soft encoder may not be limited.
- the designated soft encoder is used to encode the video data of the video.
- the application can use hard coding (for example, using the system's hard encoder or other hard encoder) to encode the video data.
- the video encoding method provided by the embodiment of the present application obtains the default encoding code rate corresponding to the application when it detects that the application starts video recording, and then determines whether the default encoding code rate is lower than the code rate threshold. When the rate is lower than the bit rate threshold, the control application chooses to specify a soft encoder to encode the video data. Compared with the hard encoding method, the video data is encoded, which improves the encoding quality and thus the quality of the recorded video.
- FIG. 2 another embodiment of the present application provides a video encoding method, which can be applied to an electronic device.
- the video encoding method may include:
- Step S210 When it is detected that the application program starts video recording, the default encoding code rate corresponding to the application program is obtained.
- Step S220 Determine whether the default coding rate is lower than the code rate threshold.
- steps S210 and S220 reference may be made to the content of the foregoing embodiments, and details are not described herein again.
- Step S230 If it is lower than the bit rate threshold, determine whether the application is in the set list.
- the above setting list may be an application program for controlling video data that needs to be encoded by a designated soft encoder when recording a low bit rate video. That is to say, when the default encoding bit rate required by the applications in the list to record video is lower than the above-mentioned bit rate threshold, the above-mentioned designated soft encoder needs to be used to encode the video data.
- the setting list may include identification information of applications in the list, and the identification information may include process names, package names, etc. Of course, specific identification information may not be used as a limitation.
- the process name can be used to determine whether the above-mentioned application is within the setting content. Therefore, judging whether the application is in the set list may include: acquiring the process name of the application; judging whether the process name is the same as the process name of the application in the set list.
- the process name of the application program can be obtained.
- the process name can be obtained through Process.myPid() and RunningAppProcessInfo to obtain the process name of the processor currently running.
- the specific method of obtaining the process name may not be limited.
- the package name may be used to determine whether the above-mentioned application is in the set list. Therefore, determining whether the application is in the set list may include: acquiring the package name of the application; determining whether the package name is the same as the package name of the application in the set list.
- the adb command to view the package name of the application.
- the specific way to obtain the package name may not be limited.
- the obtained package name is the same as the package name of the application in the setting list, it can be determined that the application that starts video recording is in the setting list; when the obtained package name is obtained.
- the package name of the application in the above setting list is different, it can be determined that the above application for starting video recording is not in the setting list.
- the application can use hard coding (for example, using the system's hard encoder or other hard encoder) to encode the video data.
- Step S240 If it is in the set list, obtain the load rate of the central processor.
- the load ratio refers to the ratio of the load of the CPU to the maximum load of the CPU.
- the CPU load rate is not a fixed state. For example, when only one application is running, the CPU load rate may be 10%, and when two applications are running, the CPU load rate may be 20%, and when three applications are running, the CPU load may be The rate reached 35%.
- obtaining the load rate of the CPU may include: obtaining the load rate of the central processor in real time or periodically during the video recording process. It can be understood that, after the video recording is started, the CPU load rate can also be obtained to determine whether the application program uses the specified soft encoder to encode the video data to avoid the CPU load rate being too high, which may cause a stuck or application crash. Wait. Obtaining the load factor of the CPU at regular intervals may be obtaining the load factor of the CPU at a set interval.
- the foregoing obtaining the load rate of the central processor may include: obtaining the load rate of the central processor, including: obtaining the current load rate of the central processor; and estimating that the central processor is within a set duration The increase rate of the load rate; obtain the sum of the increase rate of the load rate and the current load rate, and use the sum as the load rate of the central processor.
- the electronic device can estimate the running time of the application program. For example, the electronic device can record the running time of each installed application program, and divide the time into multiple time periods, and the running time of each application program corresponds to the time period, so that the time period that each application program frequently runs can be obtained. Furthermore, according to the time period during which each application program frequently runs, it can be inferred which applications will be started within a certain time period. In addition, among the applications installed in the electronic device, some applications will periodically perform some tasks, such as regularly updating, obtaining data from the network, or performing data processing. When performing the above tasks, it will increase the CPU load rate to a certain extent. Therefore, you can record the running time of each application and the CPU load rate during runtime to estimate changes in the CPU load rate.
- the load rate of the central processor can be obtained, and the obtained load rate of the central processor can be used to determine whether to use the above-mentioned designated soft coding
- the standard of the video data encoding device is a standard of the video data encoding device.
- the current load rate of the CPU is obtained.
- the operating system of the electronic device is the Android system
- the system load condition and the process time can be obtained through the ProcessStats class in the Android system.
- the specific implementation principle is to read the files in the /proc directory.
- the kernel will update the files in the /proc directory and write the PID operation status into the corresponding file.
- the current load rate of the central processor can be obtained.
- the above way of obtaining the current load rate of the central processor is not limited in the implementation of this application.
- the electronic device can estimate the amount of increase in the load rate of the content of the CPU in the set duration based on the running time of each application program recorded above and the load factor of the CPU at runtime. Therefore, the estimated increase in the load rate of the central processor within a set duration may include:
- the historical load rate of the CPU corresponding to the above-mentioned video recording start application within a set duration is determined.
- the current time is time A
- the CPU when application 2 is running The load rate is 30%. Since the application 1 and the application 2 are running in the same time period, the maximum CPU load rate when the two are running, that is, 30%, can be taken as 30% as the above application for starting video recording Corresponding historical load rate of CPU within the set duration.
- the amount of increase in the load rate of the CPU within the set time period can be estimated based on the above-mentioned historical load rate.
- the above-mentioned historical load rate may be used as an increase in the load rate of the CPU within the set duration.
- the above-mentioned set duration can be set as the above-mentioned application program for starting video recording, and the historical recording duration of recorded video. It is understandable that the electronic device can record the historical recording duration of the application each time a video is recorded.
- the above-mentioned set duration can be the average of multiple historical recording durations recorded, or the maximum value among multiple historical recording durations . Therefore, the stability during the video recording can be ensured, and the occurrence of jams can be avoided.
- the current load rate and the increase in the load rate can be calculated, and the sum of the two can be used as the central processor's Load rate.
- Step S250 Determine whether the load factor is lower than the first load factor threshold.
- the load ratio after obtaining the load ratio of the CPU of the electronic device, the load ratio can be compared with the first load ratio threshold to determine whether the load ratio is lower than the first load ratio threshold.
- the CPU load rate can be divided into a first level and a second level, wherein the load rate below the first load rate threshold is at the first level, and the load rate not lower than the first load rate threshold is at the second level .
- the load rate is the first level, it means that the CPU load is very low within the above set duration, that is, the tasks that need to be executed by the CPU are very small, that is, the number of threads is very low; when the load rate is the second level, It means that the load of the CPU is low within the above set duration, that is to say, fewer tasks need to be executed by the CPU, that is, the number of threads is lower, but there are more tasks that need to be executed by the CPU and the number of threads The number of threads is higher than the first level.
- the first load rate threshold can be determined according to the parameters of the CPU and the like, which is related to the performance of the CPU. As an implementation manner, when the maximum operating frequency of the CPU is high, it can still support encoding using a designated soft encoder when the load rate reaches a high level, which can be higher than that of the CPU with a lower maximum operating frequency. For example, the maximum operating frequencies of the two CPUs are 1 GHz and 2 GHz respectively. If the first load rate threshold corresponding to the maximum operating frequency of 1 GHz is 50%, the first load rate threshold corresponding to the maximum operating frequency of 2 GHz is 65%. Of course, the above first load rate threshold is only an example, and does not represent a limitation on the specific first load rate threshold in the embodiments of the present application.
- Step S260 If it is lower than the first load rate threshold, control the application to select a designated soft encoder to encode the video data of the video.
- the designated soft encoder is used to perform Encoding does not overload the CPU. Therefore, you can control the application to choose a designated soft encoder to encode video data to obtain a video file.
- the load factor of the CPU When it is determined that the load factor of the CPU is not lower than the first load rate threshold, it indicates that the load of the CPU is low within the above set duration, but at this time, the designated soft coding is used for encoding, which may cause CPU load
- the rate is at a high level, which leads to stuttering, so you can control the application to select the system’s hard encoder or soft encoder to encode video data
- the encoder for encoding video data includes: The encoder includes: a designated soft encoder, a system hard encoder, and a system soft encoder.
- the hard encoder of the system is the hard encoder that comes with the system of the electronic device, such as the Android platform AVC (Advanced Video Coding, Advanced Video Coding) hard encoder.
- the soft encoder of the system is the soft encoder that comes with the system of the electronic device, such as Google AVC soft encoder.
- the electronic device can also be installed with a specified soft encoder.
- the specified soft encoder can be mounted with an efficient AVC soft encoder through the OpenMax architecture.
- This soft encoder can be open source
- the ffmpeg AVC encoder can also be a three-party AVC encoder integrated with other manufacturers.
- the designated soft encoder's encoding effect on the video is better than the system's soft encoder's encoding effect on the video.
- the designated soft encoder can overcome the encoding block effect and mosaic.
- the encoder for encoding video data in the electronic device may also include other encoders.
- an application program when an encoder is selected, it is usually selected according to the priority relationship of the encoder, that is, an encoder with a high priority is selected to encode video data.
- the priority relationship of the encoder selected by the application program is that the priority of the system's hard encoder is greater than that of the system's soft encoder, and the priority of the system's soft encoder is greater than that of other encoders (including the above-mentioned designated soft encoders). ). Therefore, referring to FIG. 3, controlling the application program to select a designated soft encoder to encode the video data of the video may include:
- Step S261 Adjust the priority of the designated soft encoder to the highest priority, and the priority is the priority of the encoder selected by the application.
- the priority relationship between the encoders according to the system is that the priority of the system's hard encoder is the largest. Therefore, the priority of the designated soft encoder can be adjusted to the highest priority, so that the application can select the designated soft encoder to encode the video data when selecting the encoder according to the priority of the encoder.
- Step S262 Control the application to select the designated soft encoder with the highest priority to encode the video data of the video.
- the latest priority can be transmitted to the application program, so that the application program can select the designated soft encoder to perform the video data according to the priority of the new encoder. Encoding, to realize the control application chooses the designated soft encoder to encode.
- the video encoding method may further include: reducing the operating frequency of the image processor.
- the application program is encoded using soft encoding, it will not use the GPU for hard encoding.
- the GPU often has high performance, so the operating frequency of the image processor can be appropriately reduced, so that the power consumption of electronic devices reduce.
- the specific degree to which the working frequency of the GPU needs to be reduced may not be limited in the embodiments of the present application, and it may be determined according to the performance parameters of the GPU.
- the video encoding method provided by the embodiment of the present application obtains the default encoding bit rate corresponding to the application when it is detected that the application starts to record video, and when the default encoding bit rate is lower than the bit rate threshold, it is determined whether the application is in In the setting list, when it is determined that the application is in the setting list, it is determined whether the application uses the designated soft encoder to encode the video data according to the load rate of the CPU. Since the coding effect of the specified soft encoder is better than the hard encoder and soft encoder of the system, the encoding effect during video recording can be improved, thereby improving the video quality of the recorded video.
- yet another embodiment of the present application provides a video encoding method, which can be applied to electronic devices.
- the video encoding method may include:
- Step S310 When it is detected that the application program starts video recording, the default encoding code rate corresponding to the application program is obtained.
- Step S320 Determine whether the default encoding code rate is lower than the code rate threshold.
- steps S310 and S320 reference may be made to the content of the foregoing embodiments, and details are not described herein again.
- Step S330 If it is lower than the bit rate threshold, determine whether the application is in the set list.
- a setting list is set in the electronic device.
- the setting list is used to control an application program that needs to encode video data by specifying a soft encoder when recording a low bit rate video.
- the above setting list can be set by the user. For example, multiple applications can be displayed in the setting interface, and the status corresponding to each application. It can be understood that if the status corresponding to the application is "off", it means that the application is removed or not added to the above In the set list, if the corresponding state of the application is "on”, it means that the application is added to the above list. Therefore, in the embodiment of the present application, the video encoding method may further include:
- the application is set in a set list.
- the application can be set in the setting list according to the first operation.
- the electronic device may also be set to use the specified soft encoder.
- the specified soft encoder can be used to encode the video data.
- the video encoding method may further include: according to the detected second operation, opening the permission of the application to use the specified soft encoder.
- the video encoding method may further include: if the bit rate threshold is not lower than, controlling the application program to select a hard encoder of the system or a soft encoder of the system for the video Encode video data.
- Step S340 If it is in the set list, obtain the load rate of the central processor.
- Step S350 determine whether the load factor is lower than the first load factor threshold.
- Step S360 If it is lower than the first load rate threshold, control the application to select a designated soft encoder to encode the video data of the video.
- steps S340 and S360 reference may be made to the content of the foregoing embodiments, and details are not described herein again.
- Step S370 If it is not lower than the first load rate threshold, it is determined whether the load rate is lower than the second load rate threshold, and the second load rate threshold is greater than the first load rate threshold.
- the load factor of the CPU if it is determined that the load factor of the CPU is not lower than the first load rate threshold, that is, the load factor of the CPU is greater than or equal to the first load rate threshold, it means that if the CPU executes the process of specifying the soft encoder at this time , May cause stuttering.
- the CPU may cause a freeze due to the soft encoder designated by the CPU to encode the video data. Therefore, in the embodiment of the present application, when the load rate of the CPU is not less than the first load rate threshold, it can be determined that the CPU is in a state where it cannot be very low, that is, a state in which the system soft encoder cannot be used for video encoding.
- the system soft encoder when the CPU load rate is not less than the first load rate threshold, it can be determined whether the CPU load rate is lower than the second load rate threshold, where the second load rate threshold is greater than the first load rate threshold to determine When the load rate of the CPU is not less than the first load rate threshold, can the system soft encoder be used for video encoding.
- the second load rate threshold may be a critical value of the load rate when the CPU cannot use the system's soft encoder for video encoding, and the CPU may use the system's soft encoder for video encoding. That is to say, when the load rate of the CPU is not lower than the second load rate threshold, the load rate is at a low level, and the remaining resources of the CPU cannot support encoding using the specified soft encoder, but the system soft encoder can be used for encoding ; When the CPU load rate is lower than the second load rate threshold, the CPU load rate is at a high level, and the remaining resources of the CPU cannot support the encoding using the specified soft encoder or the system soft encoder.
- the second load rate threshold may also be determined according to CPU performance parameters and the like.
- Step S380 If it is lower than the second load rate threshold, control the soft encoder of the application selection system to encode the video data of the video.
- the system soft encoder when it is determined that the load factor of the CPU is not lower than the second load rate threshold, since the remaining resources of the CPU cannot support the encoding using the designated soft encoder, but the system soft encoder can be used for encoding, so it can be used
- the soft encoder of the system encodes the video data of the recorded video. Compared with the use of hard coding technology to encode low bit rate video, it can also improve the encoding quality of the video.
- the control application selects and assigns a soft encoder to encode video data
- the priority of the system’s soft encoder can be adjusted to the highest priority, and the control application selects the soft encoder of the system with the highest priority To encode video data.
- Step S390 If it is not lower than the second load rate threshold, control the hard encoder of the application selection system to encode the video data of the video.
- the CPU load rate when it is determined that the CPU load rate is lower than the second load rate threshold, the CPU load rate is at a high level, and the remaining resources of the CPU cannot support encoding using the specified soft encoder, nor can it support the use of system software.
- the encoder encodes, so the application should use the system's hard encoder to encode the video data.
- the priority of the system's hard encoder can be adjusted to the highest priority, and the control application selects the hard encoder of the system with the highest priority To encode video data.
- the video encoding method may further include: detecting whether the load rate of the image processor is lower than the third load Rate threshold; if it is lower than the third load rate threshold, the operating frequency of the image processor is reduced.
- the application program is encoded using soft encoding, it will not use the GPU for hard encoding.
- the GPU often has high performance, so the operating frequency of the image processor can be appropriately reduced, so that the power consumption of electronic devices reduce.
- the specific degree to which the working frequency of the GPU needs to be reduced may not be limited in the embodiments of the present application, and it may be determined according to the performance parameters of the GPU.
- it can also be determined whether to reduce the working frequency of the GPU according to the actual working condition of the GPU.
- the load rate of the GPU is lower than the third load rate threshold, it means that the GPU has more remaining resources, so the operating frequency of the GPU can be appropriately reduced to reduce the power consumption of the electronic device.
- the specific value of the third load rate threshold can be used as a limit, and can be determined according to the performance parameters of the GPU.
- the video encoding method provided by the embodiment of the present application obtains the default encoding bit rate corresponding to the application when it is detected that the application starts to record video, and when the default encoding bit rate is lower than the bit rate threshold, it is determined whether the application is in In the setting list, when it is determined that the application is in the setting list, it is determined whether the application uses the designated soft encoder to encode the video data according to the load rate of the CPU. Since the coding effect of the specified soft encoder is better than the hard encoder and soft encoder of the system, the encoding effect during video recording can be improved, thereby improving the video quality of the recorded video.
- the system hard code or soft encoder is further used for encoding according to the CPU load rate.
- the system soft encoder is used for encoding At the same time, relative to the use of hard coding technology to encode low bit rate video, it can also improve the video encoding quality.
- FIG. 5 shows a block diagram of a video encoding apparatus 400 provided by an embodiment of the present application.
- the video encoding device 400 is applied to the above mobile terminal.
- the device shown in FIG. 5 will be described below.
- the video encoding device 400 includes: a code rate acquisition module 410, a code rate judgment module 420, and an encoding control module 430.
- the recording detection module 410 is used to obtain the default encoding bit rate corresponding to the application when it detects that the application starts video recording; the code rate determining module 420 is used to determine whether the default encoding bit rate Below the code rate threshold; the encoding control module 430 is used to control the application to select a designated soft encoder to encode the video data of the video if it is below the code rate threshold.
- the encoding control module 430 includes: a priority adjustment unit 431 and a control execution unit 432.
- the priority adjustment unit 431 is used to adjust the priority of the designated soft encoder to the highest priority, and the priority is the priority of the application to select the encoder;
- the control execution unit 432 uses In order to control the application program to select the designated soft encoder with the highest priority to encode the video data of the video.
- the encoding effect of the designated soft encoder on the video is better than that of the system soft encoder on the video.
- the encoding control module 430 may be specifically configured to: if it is lower than the bit rate threshold, determine whether the application is in the set list; if it is in the set list, control the The application program selects a designated soft encoder to encode the video data of the video.
- the encoding control module 430 determines whether the application is in the set list, including: acquiring the process name of the application; determining whether the process name is the same as the process name of the application in the set list.
- the encoding control module 430 determines whether the application is in the set list, including: acquiring the package name of the application; determining whether the package name is the same as the package name of the application in the set list .
- the video encoding device 400 may further include: a list setting module.
- the list setting module is used to set the application in the set list according to the detected first operation.
- the video encoding device 400 may further include: a permission enabling module.
- the permission opening module is used to enable the application to use the specified soft encoder according to the detected second operation.
- the video encoding device 400 may further include: a load rate acquisition module and a first load rate determination module.
- the load rate obtaining module is used to obtain the load rate of the central processor before the controlling the application program to select a designated soft encoder to encode the video data of the video;
- the first load rate determining module is used to determine the load rate Whether the load rate is lower than the first load rate threshold. If it is lower than the first load rate threshold, the encoding control module controls the application to select a designated soft encoder to encode the video data of the video.
- the video encoding device 400 may further include: a second load rate determination module, a first encoding module, and a second encoding module.
- the second load rate determination module is used to determine whether the load rate is lower than the second load rate threshold if the first load rate threshold is not lower than the first load rate threshold, and the second load rate threshold is greater than the first load Rate threshold;
- the first encoding module is used to control the soft encoder of the application selection system to encode the video data of the video if it is below the second load rate threshold;
- the second encoding module is used if not Below the second load rate threshold, the hard encoder of the application selection system is controlled to encode the video data of the video.
- the load rate acquisition module may be specifically used to acquire the load rate of the central processor in real time or periodically during video recording.
- the load rate acquisition module may be specifically used to: obtain the current load rate of the central processor; estimate the increase rate of the load rate of the central processor within a set duration; obtain the increase rate of the load rate and The sum value of the current load rate, the sum value is used as the load rate of the central processor.
- the first load rate obtaining module estimates the increase in the load rate of the central processor within a set duration, which may include: obtaining the historical load rate of the central processor corresponding to the application within the set duration; The historical load rate estimates an increase in the load rate of the central processor within the set duration.
- the video encoding device 400 may further include: a third encoding module.
- the third encoding module is configured to: if the bit rate threshold is not lower than, control the application program to select a hard encoder of the system or a soft encoder of the system to encode the video data of the video.
- the video encoding device 400 may further include: a frequency reduction module.
- the frequency reduction module is used to reduce the working frequency of the image processor after controlling the application program to select a designated soft encoder to encode the video data of the video.
- the video encoding device 400 may further include: a second load rate judgment module.
- the second load rate determination module is used to detect whether the load rate of the image processor is lower than the third load rate threshold before reducing the operating frequency of the image processor. If it is lower than the third load rate threshold, the frequency reduction module reduces the operating frequency of the image processor.
- the coupling between the modules may be electrical, mechanical, or other forms of coupling.
- each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
- the above integrated modules may be implemented in the form of hardware or software function modules.
- the solution provided in this application obtains the default encoding bit rate corresponding to the application when it detects that the application starts video recording, and determines whether the default encoding bit rate is lower than the code rate threshold, and if it is lower than With this bit rate threshold, the control application program selects the designated soft encoder to encode the video data of the video.
- This method can determine the default coding rate according to the recorded video when the default coding rate is less than the code rate threshold, using a designated soft encoder to encode, thereby improving the flexibility of the encoding method and improving the encoding when recording low bit rate video quality.
- the electronic device 100 may be an electronic device capable of running an application program such as a smart phone, a tablet computer, an e-book.
- the electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more application programs, where one or more application programs may be stored in the memory 120 and configured to be configured by one Executed by one or more processors 110, and one or more programs are configured to execute the method as described in the foregoing method embodiments.
- the processor 110 may include one or more processing cores.
- the processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, executes or executes instructions, programs, code sets or instruction sets stored in the memory 120, and calls data stored in the memory 120 to execute Various functions and processing data of the electronic device 100.
- the processor 110 may adopt at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA) Various hardware forms.
- the processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processing unit (Graphics Processing Unit, GPU), and a modem.
- CPU Central Processing Unit
- GPU Graphics Processing Unit
- modem modem
- CPU mainly deals with operating system, user interface and application program, etc.
- GPU is used for rendering and rendering of display content
- modem is used for handling wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, and may be implemented by a communication chip alone.
- the memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory).
- the memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets.
- the memory 120 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , Instructions for implementing the following method embodiments.
- the storage data area may also store data created by the terminal 100 in use (such as a phone book, audio and video data, and chat history data).
- FIG. 8 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
- the computer readable medium 800 stores program codes, and the program codes can be called by a processor to execute the method described in the above method embodiments.
- the computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
- the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium.
- the computer-readable storage medium 800 has a storage space for the program code 810 that performs any of the method steps described above. These program codes can be read from or written into one or more computer program products.
- the program code 810 may be compressed in an appropriate form, for example.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
L'invention concerne un procédé, un appareil, un dispositif électronique, et un support de stockage pour un codage vidéo. Le procédé de codage vidéo comprend les étapes suivantes : acquérir un taux de codage par défaut correspondant à un programme d'application lors de la détection du fait que le programme d'application a lancé un enregistrement vidéo ; déterminer si le taux de codage par défaut est inférieur à un seuil de taux de codage ; si tel est le cas, commander le programme d'application pour sélectionner un codeur logiciel désigné et coder des données vidéo de la vidéo. Le présent procédé peut améliorer la qualité de codage de la vidéo enregistré.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201880098554.6A CN112840663B (zh) | 2018-12-13 | 2018-12-13 | 视频编码方法、装置、电子设备及存储介质 |
PCT/CN2018/120828 WO2020118601A1 (fr) | 2018-12-13 | 2018-12-13 | Procédé, appareil, dispositif électronique, et support de stockage pour codage vidéo |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2018/120828 WO2020118601A1 (fr) | 2018-12-13 | 2018-12-13 | Procédé, appareil, dispositif électronique, et support de stockage pour codage vidéo |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020118601A1 true WO2020118601A1 (fr) | 2020-06-18 |
Family
ID=71075877
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/120828 WO2020118601A1 (fr) | 2018-12-13 | 2018-12-13 | Procédé, appareil, dispositif électronique, et support de stockage pour codage vidéo |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112840663B (fr) |
WO (1) | WO2020118601A1 (fr) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114157850A (zh) * | 2021-11-26 | 2022-03-08 | 珠海视熙科技有限公司 | 一种数据传输方法、装置及计算机可读存储介质 |
CN114501017A (zh) * | 2022-03-04 | 2022-05-13 | 百果园技术(新加坡)有限公司 | 一种视频编码适配方法、装置、设备及存储介质 |
CN115665485B (zh) * | 2022-12-26 | 2023-04-28 | 杭州星犀科技有限公司 | 视频画面优化方法及装置、存储介质和视频终端 |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103702124A (zh) * | 2012-09-27 | 2014-04-02 | 深圳市快播科技有限公司 | 一种转码加速方法和转码器 |
CN104768063A (zh) * | 2015-04-07 | 2015-07-08 | 天脉聚源(北京)教育科技有限公司 | 一种视频编码方法及装置 |
CN105025327A (zh) * | 2015-07-14 | 2015-11-04 | 福建富士通信息软件有限公司 | 一种移动终端现场直播的方法及*** |
WO2016115531A1 (fr) * | 2015-01-15 | 2016-07-21 | Huawei Technologies Co., Ltd. | Système et procédé pour un algorithme de passage de message |
CN106454413A (zh) * | 2016-09-20 | 2017-02-22 | 北京小米移动软件有限公司 | 直播编码切换方法、装置及设备 |
CN107277607A (zh) * | 2017-06-09 | 2017-10-20 | 努比亚技术有限公司 | 一种屏幕图像录制方法、终端及计算机可读存储介质 |
CN107948660A (zh) * | 2017-11-16 | 2018-04-20 | 北京小米移动软件有限公司 | 视频编码适配的方法及装置 |
CN108769738A (zh) * | 2018-06-15 | 2018-11-06 | 广州酷狗计算机科技有限公司 | 视频处理方法、装置、计算机设备和存储介质 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006340066A (ja) * | 2005-06-02 | 2006-12-14 | Mitsubishi Electric Corp | 動画像符号化装置、動画像符号化方法及び記録再生方法 |
CN106131470A (zh) * | 2016-06-24 | 2016-11-16 | 维沃移动通信有限公司 | 一种视频录制的方法及移动终端 |
CN107580227B (zh) * | 2017-09-27 | 2020-06-05 | 维沃移动通信有限公司 | 一种视频编码方法、移动终端 |
-
2018
- 2018-12-13 WO PCT/CN2018/120828 patent/WO2020118601A1/fr active Application Filing
- 2018-12-13 CN CN201880098554.6A patent/CN112840663B/zh active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103702124A (zh) * | 2012-09-27 | 2014-04-02 | 深圳市快播科技有限公司 | 一种转码加速方法和转码器 |
WO2016115531A1 (fr) * | 2015-01-15 | 2016-07-21 | Huawei Technologies Co., Ltd. | Système et procédé pour un algorithme de passage de message |
CN104768063A (zh) * | 2015-04-07 | 2015-07-08 | 天脉聚源(北京)教育科技有限公司 | 一种视频编码方法及装置 |
CN105025327A (zh) * | 2015-07-14 | 2015-11-04 | 福建富士通信息软件有限公司 | 一种移动终端现场直播的方法及*** |
CN106454413A (zh) * | 2016-09-20 | 2017-02-22 | 北京小米移动软件有限公司 | 直播编码切换方法、装置及设备 |
CN107277607A (zh) * | 2017-06-09 | 2017-10-20 | 努比亚技术有限公司 | 一种屏幕图像录制方法、终端及计算机可读存储介质 |
CN107948660A (zh) * | 2017-11-16 | 2018-04-20 | 北京小米移动软件有限公司 | 视频编码适配的方法及装置 |
CN108769738A (zh) * | 2018-06-15 | 2018-11-06 | 广州酷狗计算机科技有限公司 | 视频处理方法、装置、计算机设备和存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN112840663B (zh) | 2024-05-03 |
CN112840663A (zh) | 2021-05-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020118601A1 (fr) | Procédé, appareil, dispositif électronique, et support de stockage pour codage vidéo | |
WO2021057619A1 (fr) | Procédé et appareil de récupération de mémoire, dispositif électronique et support de stockage | |
WO2021057665A1 (fr) | Procédé et appareil de stockage de données, terminal mobile et support de stockage | |
US10862992B2 (en) | Resource cache management method and system and apparatus | |
US20180267826A1 (en) | Techniques to compose memory resources across devices | |
CN110764906B (zh) | 内存回收处理方法、装置、电子设备以及存储介质 | |
WO2021008348A1 (fr) | Procédé et dispositif d'affichage d'images, terminal mobile, et support d'informations | |
JP7186877B2 (ja) | 映像デコーディング制御方法、装置、電子機器及び記憶媒体 | |
US20130166832A1 (en) | Methods and electronic devices for adjusting the operating frequency of a memory | |
US20130282869A1 (en) | Method, apparatus, and computer program product for scheduling file uploads | |
US11010094B2 (en) | Task management method and host for electronic storage device | |
WO2021057623A1 (fr) | Procédé et appareil de récupération de mémoire, dispositif électronique et support de stockage | |
US10459873B2 (en) | Method for adaptively adjusting framerate of graphic processing unit and computer system using thereof | |
WO2017032080A1 (fr) | Procédé et dispositif de commande de carnet d'adresses et terminal mobile | |
CN111263153B (zh) | 视频编码方法、装置、设备及存储介质 | |
CN111142788B (zh) | 一种数据迁移方法、装置和计算机可读存储介质 | |
KR20210091812A (ko) | 비디오 증강 제어 방법, 장치, 전자 기기 및 저장 매체 | |
CN105447820A (zh) | 一种图片处理方法、装置和移动终端 | |
US20150135136A1 (en) | Information processing apparatus, information processing method, and storage medium | |
WO2021077375A1 (fr) | Procédé et appareil de réglage de fréquence de communication, dispositif électronique et support de stockage | |
WO2017198112A1 (fr) | Procédé et appareil de commutation de fréquence, et support de stockage lisible par ordinateur | |
JP6211622B2 (ja) | チャネル・アウェアなジョブ・スケジューリング | |
US10484444B2 (en) | Communication method, communication device, and recording medium for streaming | |
WO2020107970A1 (fr) | Procédé et appareil de décodage vidéo, dispositif électronique et support de stockage | |
WO2023083064A1 (fr) | Procédé et appareil de traitement vidéo, dispositif électronique, et support de stockage lisible |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18942728 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 28.10.2021) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18942728 Country of ref document: EP Kind code of ref document: A1 |