WO2023016039A1 - Video processing method and apparatus, electronic device, and storage medium - Google Patents

Video processing method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023016039A1
WO2023016039A1 PCT/CN2022/094754 CN2022094754W WO2023016039A1 WO 2023016039 A1 WO2023016039 A1 WO 2023016039A1 CN 2022094754 W CN2022094754 W CN 2022094754W WO 2023016039 A1 WO2023016039 A1 WO 2023016039A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
frame rate
determined
mode
camera
Prior art date
Application number
PCT/CN2022/094754
Other languages
French (fr)
Chinese (zh)
Inventor
崔瀚涛
张东
朱登奎
王燕东
郭永利
Original Assignee
荣耀终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2023016039A1 publication Critical patent/WO2023016039A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor

Definitions

  • the present application relates to the technical field of video shooting, and in particular to a video processing method, device, electronic equipment and storage medium.
  • a video processing method, device, electronic equipment, and storage medium, which can make videos captured by electronic equipment have different style effects based on the characteristics of LUTs, so as to meet higher color matching requirements.
  • a video processing method including: determining a slow-motion mode among multiple slow-motion modes, the determined slow-motion mode corresponds to a capture frame rate and an encoding frame rate, and the capture frame rate is greater than the encoding frame rate;
  • a video style template is determined among the multiple video style templates of the determined upgrade mode, and each video style template corresponds to a preset two-dimensional color lookup table 2D-LUT; based on the determined capture frame rate corresponding to the upgrade mode, it is obtained through the camera The captured video; the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera is used to process the video captured by the camera to obtain the LOG video; the LOG video is processed based on the 2D-LUT corresponding to the determined video style template to obtain The video corresponding to the determined video style template; encoding and saving the video corresponding to the determined video style template based on the determined encoding frame rate corresponding to the upscaling mode.
  • the multiple upscaling modes include a first upscaling mode and a second upscaling mode, the first upscaling mode corresponds to the first capture frame rate and the first encoding frame rate, and the second upscaling mode corresponds to the second capture frame rate and the second encoding frame rate, the first capturing frame rate is less than the second capturing frame rate, the first encoding frame rate is equal to the second encoding frame rate, and the second capturing frame rate is greater than the second encoding frame rate.
  • the video captured by the camera is processed through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video
  • it also includes: performing electronic anti-shake processing on the video captured by the camera; if the determined upscaling mode is the first upscaling mode, the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera is used for the video captured by the camera.
  • the process of processing to obtain the LOG video is as follows: the video after electronic anti-shake processing is processed through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video.
  • the electronic anti-shake function is omitted, so as to realize video content in a limited frame interval time.
  • an electronic anti-shake function is added to achieve better video processing effects.
  • the process of encoding and saving the video corresponding to the determined video style template based on the determined encoding frame rate corresponding to the upscaling mode includes:
  • the video stream is divided into two streams, one of which is encoded and saved based on the encoding frame rate corresponding to the determined upscaling mode, and the other stream is previewed.
  • the preview video and the final video can have the same visual effect, which is convenient for users to directly preview the video based on the color-graded style.
  • a video processing device including: a processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the above video processing method is implemented.
  • an electronic device including: a camera; and the above-mentioned video processing device.
  • a computer-readable storage medium In a fourth aspect, a computer-readable storage medium is provided.
  • a computer program is stored in the computer-readable storage medium, and when running on a computer, the computer is made to execute the above video processing method.
  • the video processing method, device, electronic equipment, and storage medium in the embodiments of the present application use the LUT technology in the film industry to process the LOG video based on the LUT corresponding to the determined video style template during the video recording process, so that the recorded
  • the video has the style effect corresponding to the determined video style template, so as to meet the higher color grading requirements and make the recorded video have a movie feel.
  • a video with an upscaling effect can be obtained in a relatively simple way.
  • 2D-LUT is used to process the video to achieve limited LUT processing is performed within the frame interval.
  • FIG. 1 is a structural block diagram of an electronic device in an embodiment of the present application
  • FIG. 2 is a flowchart of a video processing method in an embodiment of the present application
  • FIG. 3 is a schematic diagram of a user interface in a movie mode in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a video recording interface in an embodiment of the present application.
  • Fig. 5 is the schematic diagram of a kind of LOG curve in the embodiment of the present application.
  • FIG. 6 is a schematic diagram of a comparison of the playing time of captured video and encoded video file in the embodiment of the present application.
  • FIG. 7 is a flowchart of a video processing method in an embodiment of the present application.
  • FIG. 8 is a structural block diagram corresponding to the execution process in the second upgrade mode in the embodiment of the present application.
  • FIG. 9 is a structural block diagram corresponding to an execution process in the first upgrade mode in the embodiment of the present application.
  • FIG. 10 is a software structural block diagram of an electronic device in an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a user interface in a professional mode in an embodiment of the present application.
  • the electronic device 100 may include a processor 110, a camera 193, a display screen 194, and the like. It can be understood that, the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, Digital signal processor (digital signal processor, DSP), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
  • the ISP is used for processing the data fed back by the camera 193 .
  • the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin color.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be located in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other image signals.
  • the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • the embodiment of the present application provides a video processing method.
  • the video processing method may be executed by a processor 110, specifically an ISP or a combination of an ISP and other processors.
  • the video processing method includes:
  • Step 100 determine a step-up mode in a plurality of step-up modes, the determined step-up mode corresponds to a capture frame rate and an encoding encoder frame rate, and the capture frame rate is greater than the encoding frame rate;
  • the capture frame rate refers to the readout frame rate of the camera sensor, and the encoding frame rate affects the default playback frame rate of the video.
  • the capture frame rate is greater than the encoding frame rate, a slow motion effect is generated.
  • the video capture frame rate is greater than the playback frame rate, it is upgraded. Upscaling is a technical means in movie shooting, which can achieve different effects. For example, when the video playback frame rate is displayed at 30 frames per second, that is The frame rate is 30 frames per second (Frames Per Second, FPS), and the frame rate during shooting is 60FPS, which is upgraded.
  • the frame rate of the camera during the upgrade is suitable for different scene expressions.
  • 60FPS upgraded shooting is suitable for expressing scenes such as panning, slow walking, laughing, applauding, etc.
  • 120FPS upgraded shooting is suitable for expressing scenes such as running, turning around, pulling hair, and throwing flowers.
  • Boost mode may be entered based on user selection.
  • Step 101 determine a video style template among the plurality of video style templates in the determined upgrade mode, each video style template corresponds to a preset two-dimensional color look-up table (2D-Look Up Table, 2D-LUT);
  • LUT is a mathematical conversion model. Using LUT, one image data value can be output as another image data value, thereby changing the exposure and color of the picture. Therefore, LUTs corresponding to different video styles can be pre-generated.
  • a video style template can be determined before the electronic device records a video.
  • the video style template can be determined based on the user's choice, or based on artificial intelligence (Artificial Intelligence, AI),
  • AI Artificial Intelligence
  • the video style template is automatically determined according to the scene corresponding to the image captured by the current camera. For example, assuming that the electronic device is a mobile phone, in a possible implementation, as shown in Figure 3, the user operates the mobile phone to enter the shooting interface, and the shooting interface includes movie mode options.
  • the movie mode interface of including multiple video style template options, for example including "A" movie style template, "B” movie style template and “C” movie style template, only one " A "movie style template, understandably, multiple different movie style templates can be displayed side by side in the user interface, and the LUTs corresponding to different movie style templates can be generated based on the corresponding movie color matching style in advance, and the color conversion of the LUT has Corresponding to the style characteristics of the movie, for example, the color matching style of the movie "A" is complementary color.
  • Complementary color refers to the contrast effect of two corresponding colors. Two colors of warm color and cool color are used to emphasize the contrast to enhance the vividness, For outstanding effects, usually two contrasting colors symbolize conflicting behaviors.
  • the LUT corresponding to the "A" movie style template is ready to use After transforming the colormap, the complementary colors are more pronounced to simulate the color scheme of the "A" movie.
  • the mobile phone when the user operates the mobile phone to enter the movie mode, the mobile phone will obtain the picture taken by the current camera, and based on the AI algorithm, determine the scene corresponding to the picture and determine the scene corresponding to the scene.
  • the recommended video style template for example, if it is recognized that the subject of the currently captured picture is a young female character, the corresponding recommended video style template is determined according to the algorithm as the "C" movie style template, and the movie "C" has a young female character as the theme movie, its corresponding LUT can simulate the color matching style of the movie "C”; It is a movie with city streets as the main scene, and its corresponding LUT can simulate the color matching style of the "B" movie. In this way, a video style template matching the current scene can be automatically recommended for the user. Film styles can be pre-extracted to produce LUTs suitable for mobile electronics.
  • the frame rate of the video captured by the camera is faster, that is, the frame interval is shorter, and the processing speed in the video recording process is required to be faster.
  • the capture frame rate of 60FPS needs to apply LUT to the video
  • the processing time is within 15ms
  • the capture frame rate of 120FPS requires the application of LUT to process the video within 8ms. Therefore, for the non-upscaled mode, the LUT can be a 3D-LUT, while for the upscaled mode, a 2D-LUT needs to be used. Compared with the 2D-LUT, the 3D-LUT can achieve more accurate color control.
  • Step 102 based on the determined capture frame rate corresponding to the upscaling mode, the video captured by the camera is acquired;
  • the mobile phone After determining the upscaling mode and video style template, if the user clicks on the shooting option, the mobile phone starts to acquire the video captured by the camera based on the determined capture frequency corresponding to the upscaling mode.
  • the capture frame rate is an integer multiple of the encoding frame rate to avoid the judder effect, as shown in Figure 4.
  • the number of "X” can be used to indicate the frame rate in the slow-motion mode Multiples, assuming that the encoding frame rate is 30FPS, two “X” indicate that the capture frame rate is 60FPS, that is, the capture frame rate is twice the encoding frame rate, and four “X” indicate that the capture frame rate is 120FPS, that is, the capture frame rate is Four times the encoding frame rate, an "X” indicates that the capture frame rate is 30FPS, and it is the non-upgraded mode at this time.
  • the embodiment of this application only involves the relevant content of the upgraded mode, and does not introduce the relevant content of the non-upgraded mode;
  • Step 103 process the video captured by the camera through the logarithm (Logarithm, LOG) curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video;
  • Figure 5 illustrates a LOG curve, where the abscissa is a linear signal, represented by a 16-bit code value Code Value, and the ordinate is the LOG signal processed by the LOG curve, represented by a 10-bit code value.
  • the signal input of the camera can be used to encode the information in the dark area to the middle tone (as shown in the steep part of the curve in Figure 5), forming a 10-bit signal output, which conforms to the human eye's LOG sensing rule for light, and maximizes the The dark information is preserved, and the LOG video can use the limited bit depth to maximize the details of shadows and highlights.
  • the ASA in Figure 5 is the sensitivity, and different ASAs correspond to different ISOs, and the two belong to different systems.
  • Step 104 process the LOG video based on the two-dimensional 2D-LUT corresponding to the determined video style template, and obtain the video corresponding to the determined video style template;
  • the LOG video is used as an input, and the LUT corresponding to the video style template determined in step 101 is applied to perform mapping conversion processing on the LOG video image.
  • the output can be the video of the Rec.709 color standard, or the video of the High-Dynamic Range (HDR) 10 standard, that is, the LOG video can be processed through the LUT, Convert video to HDR10 standard.
  • HDR High-Dynamic Range
  • Different LUTs are applied to electronic equipment, and related modules in the electronic equipment can be adapted to adapt to different styles of LUTs.
  • the video style template determined in step 101 is a gray tone video style template
  • the gray tone The characteristics of the picture are that the texture in the picture is strong, the saturation is low, there is no more color interference except for the color of the character's skin, and the dark part is cooler. Based on these characteristics, the electronic device can monitor the relevant Adjust the module parameters to keep the texture in the picture, do not do strong denoising and sharpening, properly reduce the saturation of the picture, keep the skin color in the picture true to restore, and adjust the dark part of the picture to cool colors.
  • Step 105 Based on the encoding frame rate corresponding to the determined upscaling mode, the video corresponding to the determined video style template is encoded and stored. After encoding and saving, the video with the upscaling effect can be directly obtained, that is, the video with the slow motion effect. By converting the video separately, a video with an upscaling effect, that is, a video with a slow motion effect can be obtained in a relatively simple way. For example, as shown in Figure 6, assuming that the capture frame rate is 120FPS and the encoding frame rate is 30FPS, in The total video capture time at this frame rate is 1 minute, and the playback time of the encoded video file at this frame rate is 4 minutes.
  • the LUT technology of the film industry is used to process the LOG video based on the LUT corresponding to the determined video style template, so that the recorded video has the determined video style
  • the style effect corresponding to the template can meet the higher color grading requirements and make the recorded video have a cinematic feel.
  • a video with an upscaling effect can be obtained in a relatively simple way.
  • 2D-LUT is used to process the video to achieve limited LUT processing is performed within the frame interval.
  • the multiple upscaling modes include a first upscaling mode and a second upscaling mode, the first upscaling mode corresponds to the first capture frame rate and the first encoding frame rate, and the second upscaling mode corresponds to the second capture frame rate and the second encoding frame rate, the first capturing frame rate is less than the second capturing frame rate, the first encoding frame rate is equal to the second encoding frame rate, and the second capturing frame rate is greater than the second encoding frame rate.
  • the user can select the required upscaling mode based on different scenes. Different upscaling modes correspond to different upscaling frame rates. In different upscaling modes, the encoding frame rate is the same, but the capture frame rate is different.
  • the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera passes through the The video captured by the camera is processed, and before the process of obtaining the LOG video, it also includes: step 106, performing electronic image stabilization (Electric Image Stabilization, EIS) processing on the video captured by the camera; if the determined upgrade mode is the first upgrade mode , above step 103, process the video taken by the camera through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera, and the process of obtaining the LOG video is: through the logarithmic LOG corresponding to the current sensitivity ISO of the camera The curve processes the video after the electronic anti-shake processing to obtain the LOG video.
  • EIS Electronic Image Stabilization
  • the electronic device may specifically include a camera 193, an anti-mosaic Demosaic module 21, a deformation module 22, a fusion module 23, a noise processing module 24, a color correction matrix (Color Correction Matrix, CCM) module 25, a global tone mapping (Global Tone Mapping , GTM) module 26, scaling Scaler module 27, YUV denoising module 28, 2D-LUT processing module 30 and electronic anti-shake module 31, for example, if the determined slow-motion mode is the second slow-motion mode, in the process of video recording , the camera 193 shoots video at the second capture frame rate, and the camera 193 shoots a long-exposure frame video image and a short-exposure frame video image, and the exposure time corresponding to the long-exposure frame video image is greater than the exposure time corresponding to the short-exposure frame video image, The long-exposure frame video image and the short-exposure frame video image are respectively processed by the anti-mosaic module 21, so that the image is converted from the RAW domain to the RGB domain, and
  • the two-way video image electronic anti-shake module 31 performs electronic anti-shake processing, and then processes through the fusion module 23 to fuse the two video images into the same one, and the video image after fusion passes through the noise processing module 24
  • Carry out denoising processing then process through the CCM module 25, convert the video into the color space of RGB wide color gamut, then execute the above-mentioned step 103 through the GTM module 26, process the video through the LOG curve, obtain the LOG video, and then pass 2D-
  • the LUT processing module 30 executes the above step 104, processes the LOG video based on the two-dimensional 2D-LUT corresponding to the determined video style template, obtains the video corresponding to the determined video style template, and then zooms the video through the scaling module 27 Processing, the processed video image is split into two channels, one of which is saved, and the other is previewed.
  • the camera 193 shoots a video at the first capture frame rate, and the camera 193 captures a long exposure frame video image and a short exposure frame.
  • the image fusion is the same, the video image after the fusion is denoised by the noise processing module 24, then processed by the CCM module 25, the video is converted into the color space of RGB wide color gamut, and then the above-mentioned steps 103 are performed by the GTM module 26,
  • the video is processed through the LOG curve to obtain the LOG video, and then the 2D-LUT processing module 30 executes the above step 104, and the LOG video is processed based on the two-dimensional 2D-LUT corresponding to the determined video style template to obtain the determined LOG video.
  • the video corresponding to the video style template is then scaled by the scaling module 27, and the processed video image is divided into two streams, one of which is saved, and the other is previewed.
  • the electronic anti-shake function is omitted to realize the limited frame interval time
  • the content is used for video processing.
  • an electronic anti-shake function is added to achieve better video processing effects.
  • Bayer field Each lens on a digital camera has a light sensor to measure the brightness of the light, but to obtain a full-color image, generally three light sensors are required to obtain the three primary colors of red, green and blue information, and in order to reduce the cost and volume of digital cameras, manufacturers usually use CCD or CMOS image sensors.
  • CCD or CMOS image sensors usually use CCD or CMOS image sensors.
  • the original image output by CMOS image sensors is in Bayer domain RGB format, and a single pixel contains only one color value. To obtain the gray value of the image, it is necessary to interpolate the complete color information of each pixel, and then calculate the gray value of each pixel.
  • the Bayer domain refers to a raw image format inside a digital camera.
  • the Raw domain or Raw format refers to unprocessed images. Further, the Raw image can be understood as that the photosensitive element of the camera such as Complementary Metal Oxide Semiconductor (Complementary Metal Oxide Semiconductor, CMOS) or Charge-coupled Device (Charge-coupled Device, CCD) converts the captured light source signal into digital The raw data of the signal.
  • CMOS Complementary Metal Oxide Semiconductor
  • CCD Charge-coupled Device
  • a RAW file is a record of the original information of the digital camera sensor, while recording some metadata (Metadata, such as ISO (International Organization for Standardization, International Organization for Standardization) settings, shutter speed, aperture value) generated by the camera. , white balance, etc.) files.
  • the Raw domain is a format that has not been processed by the ISP nonlinearly and has not been compressed.
  • the full name of Raw format is RAW Image Format.
  • YUV is a color encoding method that is often used in various video processing components. YUV takes human perception into account when encoding photos or videos, allowing bandwidth reduction for chroma. YUV is a type of compiling true-color color space (color space). Proper nouns such as Y'UV, YUV, YCbCr, and YPbPr can all be called YUV, and they overlap with each other. Among them, "Y” represents the brightness (Luminance or Luma), that is, the grayscale value, "U” and “V” represent the chroma (Chrominance or Chroma), which are used to describe the color and saturation of the image, and are used to specify the color of the pixel .
  • YUV is divided into two formats, one is: packed formats, which store Y, U, and V values into a Macro Pixels array, which is similar to the storage method of RGB.
  • the other is: planar formats, which store the three components of Y, U, and V in different matrices.
  • Planar formats means that each Y component, U component and V component are organized in an independent plane, that is to say, all U components are behind the Y component, and V components are behind all U components.
  • the first capture frame rate is 60 FPS
  • the second capture frame rate is 120 FPS
  • the first encoding frame rate and the second encoding frame rate are 30 FPS.
  • the above step 104 based on the two-dimensional 2D-LUT corresponding to the determined video style template, processes the LOG video, and the process of obtaining the video corresponding to the determined video style template is in the HSV color space implement.
  • the 2D-LUT is obtained through 3D-LUT simulation in advance, for example, the 3D-LUT is known in advance, and the input data and output data corresponding to the 3D-LUT, the input data and the The output data all belong to the RGB color space.
  • the input data can be converted from the RGB color space to the HSV color space, and the output data can be converted from the RGB color space to the HSV color space.
  • the process of encoding and saving the video corresponding to the determined video style template based on the determined encoding frame rate corresponding to the upscaling mode in the above step 105 includes : Split the video corresponding to the determined video style template into two streams, one of which is encoded and saved based on the encoding frame rate corresponding to the determined upscaling mode, and the other stream is previewed.
  • the 2D-LUT with a relatively simple algorithm can be used to process the video, and only one stream is used for processing in each module. Processing, after the processing is completed, it will be divided into two channels, one for saving, and the other for previewing.
  • FIG. 10 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system is divided into five layers, which are, from top to bottom, the Application layer, the application framework framework layer, the system library library, the Hardware Abstraction Layer (Hardware Abstraction Layer, HAL) and the kernel layer.
  • the application layer can include applications such as cameras.
  • the application framework layer may include camera application programming interface (Application Programming Interface, API), media recording MediaRecorder and surface view Surfaceview, etc.
  • Media recording is used to record video or image data and make this data accessible to applications.
  • Surface views are used to display preview images.
  • a system library can include multiple function modules. For example: camera service CameraSevice, etc.
  • the hardware abstraction layer is used to provide interface support, for example, including the camera process CameraPipeline for the camera service to call Call.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes display drivers, camera drivers, etc.
  • HAL reports the capability information of recording two videos at the same time, and the application layer sends a capture request CaptureRequest to capture at a frame rate of 120FPS.
  • the request corresponds to a video stream and a preview stream, and simultaneously creates two An example of a media codec, mediacodec, that receives 30FPS encoding.
  • HAL calls back two streams according to the dataflow mentioned above. Among them, the preview stream is sent to display, and the video stream is sent to mediacodec. It should be noted that when switching between different upscaling modes, due to the different capture frame rates, the outflow methods of the camera sensor are different, so a restart is required to switch.
  • the video recording and video processing method provided in the embodiment of the present application may be represented as multiple functions in two shooting modes, where the two shooting modes may refer to: movie mode and professional mode.
  • the movie mode is a shooting mode related to the theme of the movie.
  • the image displayed by the electronic device 100 can give the user a sense of watching a movie.
  • the electronic device 100 also provides a plurality of video related to the theme of the movie Style templates, users can use these video style templates to obtain tone-adjusted images or videos, and the tone of these images or videos is similar or identical to the tone of the movie.
  • the movie mode can at least provide an interface for the user to trigger the LUT function and the HDR10 function. For specific descriptions about the LUT function and the HDR10 function, please refer to the following embodiments.
  • the electronic device 100 may enter a movie mode in response to a user's operation.
  • the electronic device 100 may detect a user's touch operation on the camera application, and in response to the operation, the electronic device 100 displays a default camera interface of the camera application.
  • the default camera interface can include: preview frame, shooting mode list, gallery shortcut keys, shutter controls, etc. in:
  • the preview frame can be used to display images collected by the camera 193 in real time.
  • the electronic device 100 can refresh the displayed content therein in real time, so that the user can preview the image currently captured by the camera 193 .
  • One or more shooting mode options may be displayed in the shooting mode list.
  • the one or more shooting mode options may include: portrait mode options, video recording mode options, camera mode options, movie mode options, and professional options.
  • the one or more shooting mode options can be represented as text information on the interface, such as "portrait”, “video recording”, “photographing”, “movie”, “professional”.
  • the one or more shooting mode options may also be represented as icons or other forms of interactive elements (interactive element, IE) on the interface.
  • Gallery shortcuts can be used to launch the Gallery application.
  • the gallery application program is an application program for picture management on electronic devices such as smart phones and tablet computers, and may also be called "album".
  • the name of the application program is not limited in this embodiment.
  • the gallery application program can support users to perform various operations on pictures stored on the electronic device 100, such as browsing, editing, deleting, selecting and other operations.
  • the shutter control can be used to listen for user actions that trigger a photo.
  • the electronic device 100 may detect a user operation acting on the shutter control, and in response to the operation, the electronic device 100 may save the image in the preview frame as a picture in the gallery application.
  • the electronic device 100 may also display the thumbnails of the saved images in the gallery shortcut key. That is, users can tap the shutter control to trigger a photo.
  • the shutter control may be a button or other forms of control.
  • the electronic device 100 may detect a user's touch operation on the movie mode option, and in response to the operation, the electronic device displays a user interface as shown in FIG. 3 .
  • the electronic device 100 may turn on the movie mode by default after starting the camera application. Not limited thereto, the electronic device 100 may also enable the movie mode in other ways, for example, the electronic device 100 may also enable the movie mode according to a user's voice command, which is not limited in this embodiment of the present application.
  • the electronic device 100 may detect a user's touch operation on the movie mode option, and in response to the operation, the electronic device displays a user interface as shown in FIG. 3 .
  • the user interface shown in FIG. 3 includes function options, and the function options include HDR10 options, flash options, LUT options, and setting options. These multiple function options can detect the user's touch operation, and in response to the operation, enable or disable the corresponding shooting function, for example, HDR10 function, flash function, LUT function, setting function.
  • the electronic device can enable the LUT function, and the LUT function can change the display effect of the preview image.
  • the LUT function introduces a color lookup table, which is equivalent to a color conversion model, which can output adjusted color values according to the input color values.
  • the color value of the image captured by the camera is equivalent to the input value, and different color values can be correspondingly obtained as an output value after passing through the color conversion model.
  • the image displayed in the preview box is the image adjusted by the color transformation model.
  • the electronic device 100 uses the LUT function to display an image composed of color values adjusted by the color conversion model, so as to achieve the effect of adjusting the tone of the image.
  • the electronic device 100 can provide multiple video style templates, one video style template corresponds to one color conversion model, and different video style templates can bring different display effects to the preview image.
  • these video style templates can be associated with the theme of the movie, and the tone adjustment effect brought by the video style template to the preview image can be close to or the same as the tone in the movie, creating an atmosphere for the user to shoot a movie.
  • the electronic device 100 can determine a video style template among multiple video style templates according to the current preview video image, and the determined video style template can be displayed on the interface, so that the user can understand Currently determined video style templates, for example, a plurality of video style templates including "A" movie style template, "B" movie style template and "C” movie style template, the corresponding LUTs of different movie style templates can be based on the corresponding Generated by the movie color matching style, the color conversion of the LUT has the style characteristics of the corresponding movie. Film styles can be pre-extracted to produce LUTs suitable for mobile electronics. Turning on the LUT function will change the color tone of the preview video screen. As illustrated in FIG. 3 , the electronic device 100 determines and displays the "A" movie style template.
  • the electronic device 100 may select a video style template according to the user's sliding operation. Specifically, when the electronic device 100 detects the user operation of enabling the LUT function and displays the LUT preview window, the electronic device 100 can select the first video style template located in the LUT preview window by default as the video style template selected by the electronic device 100. template. Afterwards, the electronic device 100 can detect the left and right sliding operation of the user acting on the LUT preview window, and move the position of each video style template in the LUT preview window. The first video style template displayed in the preview window is used as the video style template selected by the electronic device 100 .
  • the electronic device 100 in addition to using the video style template to change the display effect of the preview image, can also detect a user operation to start recording a video after adding the video style template, and in response to the operation, the electronic device 100 starts recording Video, so as to obtain the video after adjusting the display effect using the video style template.
  • the electronic device 100 can also detect the user operation of taking a photo, and in response to this operation, the electronic device 100 saves the preview image with the video style template added in the preview frame as a picture, so as to obtain the user's operation of using the video
  • the style template adjusts the image after the display effect.
  • HDR10 is a high-dynamic range image (High-Dynamic Range, HDR). Compared with ordinary images, HDR can provide more dynamic range and image details, and can better Reflecting the visual effects in the real environment, 10 in HDR10 is 10 bits, and HDR10 can record video with a high dynamic range of 10 bits.
  • the electronic device 100 may detect the user's touch operation on the professional mode option, and enter the professional mode.
  • the functional options that can be included in the user interface are, for example: LOG option, flashlight option, LUT option, and setting option.
  • the user interface also includes parameter adjustment options, such as: measurement Light M option, ISO option, shutter S option, exposure compensation EV option, focus mode AF option and white balance WB option.
  • the electronic device 100 may turn on the professional mode by default after starting the camera application.
  • the electronic device 100 can also enable the professional mode in other ways, for example, the electronic device 100 can also enable the professional mode according to the user's voice command, which is not limited in this embodiment of the present application.
  • the electronic device 100 may detect a user operation on the LOG option by the user, and in response to the operation, the electronic device 100 enables the LOG function.
  • the LOG function can apply the logarithmic function to the exposure curve to preserve the details of the highlights and shadows in the image captured by the camera to the maximum extent, so that the saturation of the final preview image is lower.
  • the video recorded with LOG function is called LOG video.
  • the electronic device 100 can not only record a video with a video style template added through the professional mode, but also add a video style template to the video after recording a video without a video style template, or record a LOG video after enabling the LOG function. Then add a video style template for the LOG video. In this way, the electronic device 100 can not only adjust the display effect of the picture before recording the video, but also adjust the display effect of the recorded video after the video recording is completed, which increases the flexibility and freedom of image adjustment.
  • the embodiment of the present application also provides a video processing device, including: a step-up mode determination module, configured to determine a step-up mode among a plurality of step-up modes, the determined step-up mode corresponds to a capture frame rate and an encoding frame rate, and the capture frame The rate is greater than the encoding frame rate; the video style determination module is used to determine a video style template among the plurality of video style templates in the determined upgrade mode, and each video style template corresponds to a preset two-dimensional color lookup table 2D-LUT ;
  • the video acquisition module is used to obtain the video taken by the camera based on the captured frame rate corresponding to the determined step-up mode;
  • the LOG processing module is used to pass through the camera according to the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera
  • the captured video is processed to obtain the LOG video; the 2D-LUT processing module is used to process the LOG video based on the 2D-LUT corresponding to the determined video style template to obtain
  • the video processing device may apply the above-mentioned video processing method, and the specific process and principle will not be repeated here.
  • the LOG processing module may specifically be the GTM module 26 in the above-mentioned embodiment.
  • the multiple upscaling modes include a first upscaling mode and a second upscaling mode, the first upscaling mode corresponds to the first capture frame rate and the first encoding frame rate, and the second upscaling mode corresponds to the second capture frame rate and the second encoding frame rate, the first capturing frame rate is less than the second capturing frame rate, the first encoding frame rate is equal to the second encoding frame rate, and the second capturing frame rate is greater than the second encoding frame rate.
  • the video processing device further includes: an electronic anti-shake module 31, configured to perform electronic anti-shake processing on the video captured by the camera.
  • the LOG processing module is specifically used to process the video after electronic anti-shake processing through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video.
  • the first capture frame rate is 60 FPS
  • the second capture frame rate is 120 FPS
  • the first encoding frame rate and the second encoding frame rate are 30 FPS.
  • the first frame rate is 120 FPS or 60 FPS
  • the second frame rate is 30 FPS.
  • the above step 104 based on the two-dimensional 2D-LUT corresponding to the determined video style template, processes the LOG video, and the process of obtaining the video corresponding to the determined video style template is in the HSV color space implement.
  • the encoding module is specifically configured to split the video corresponding to the determined video style template into two streams, one of which is encoded and saved based on the encoding frame rate corresponding to the determined upgrade mode, and the other stream is to preview.
  • each module of the video processing device is only a division of logical functions, and may be fully or partially integrated into one physical entity or physically separated during actual implementation.
  • these modules can all be implemented in the form of software called by the processing element; they can also be implemented in the form of hardware; some modules can also be implemented in the form of software called by the processing element, and some modules can be implemented in the form of hardware.
  • any one of the upgrade mode determination module, the video style determination module, the video acquisition module, the LOG processing module, the 2D-LUT processing module and the encoding module can be a separate processing element, or can be integrated in the video processing device, For example, it can be integrated into a certain chip of the video processing device.
  • each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
  • the upgrade mode determination module, video style determination module, video acquisition module, LOG processing module, 2D-LUT processing module and encoding module can be one or more integrated circuits configured to implement the above method, for example: one or Multiple specific integrated circuits (Application Specific Integrated Circuit, ASIC), or, one or more microprocessors (digital signal processor, DSP), or, one or more Field Programmable Gate Arrays (Field Programmable Gate Array, FPGA) wait.
  • ASIC Application Specific Integrated Circuit
  • DSP digital signal processor
  • FPGA Field Programmable Gate Array
  • the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processors that can call programs.
  • these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
  • SOC system-on-a-chip
  • An embodiment of the present application further provides a video processing device, including: a processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the video processing method in any of the foregoing embodiments is implemented.
  • the video processing apparatus may apply the above-mentioned video processing method, and the specific process and principle will not be repeated here.
  • the number of processors may be one or more, and the processor and the memory may be connected through a bus or in other ways.
  • the memory can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, such as program instructions/modules corresponding to the video processing device in the embodiment of the present application.
  • the processor executes various functional applications and data processing by running non-transitory software programs, instructions and modules stored in the memory, that is, implements the method in any of the above method embodiments.
  • the memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function; and necessary data and the like.
  • the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices.
  • an embodiment of the present application further provides an electronic device, including: a camera 193 and the above-mentioned video processing device, where the video processing device includes a processor 110 .
  • the electronic device may be any product or component with a video shooting function such as a mobile phone, a TV, a tablet computer, a watch, a bracelet, and the like.
  • An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when running on a computer, the computer is made to execute the video processing method in any of the foregoing embodiments.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the present application will be generated in whole or in part.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk).
  • "at least one” means one or more, and “multiple” means two or more.
  • “And/or” describes the association relationship of associated objects, indicating that there may be three kinds of relationships, for example, A and/or B may indicate that A exists alone, A and B exist simultaneously, or B exists alone. Among them, A and B can be singular or plural.
  • the character “/” generally indicates that the contextual objects are an “or” relationship.
  • “At least one of the following” and similar expressions refer to any combination of these items, including any combination of single items or plural items.
  • At least one of a, b, and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, and c may be single or multiple.

Abstract

Provided in the embodiments of the present application are a video processing method and apparatus, an electronic device, and a storage medium, relating to the technical field of video capturing, and allowing for videos captured by an electronic device to have different style effects based on the characteristics of a LUT, so as to meet higher toning requirements. The video processing method comprises: determining one boost mode from among a plurality of boost modes, the capture frame rate being greater than the encoded frame rate; determining one video style template from among a plurality of video style templates of the determined boost mode; obtaining a video captured by a camera on the basis of the determined capture frame rate corresponding to the determined boost mode; processing the video captured by the camera by means of a log curve corresponding to a current photosensitivity ISO of the camera; processing the log video on the basis of a 2D-LUT corresponding to the determined video style template; and encoding and storing the video corresponding to the determined video style template on the basis of a coding frame rate corresponding to the determined boost mode.

Description

视频处理方法、装置、电子设备和存储介质Video processing method, device, electronic device and storage medium
本申请要求于2021年8月12日提交中国专利局、申请号为202110926817.1、申请名称为“视频处理方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110926817.1 and the application title "video processing method, device, electronic equipment and storage medium" filed with the China Patent Office on August 12, 2021, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请涉及视频拍摄技术领域,特别涉及一种视频处理方法、装置、电子设备和存储介质。The present application relates to the technical field of video shooting, and in particular to a video processing method, device, electronic equipment and storage medium.
背景技术Background technique
随着技术的发展,用户对通过手机等终端所拍摄的视频效果和风格的要求越来越高,然而,目前的手机中拍摄视频所使用的滤镜通常沿用拍照模式下的滤镜原理,经过滤镜处理的视频无法满足较高的调色要求。With the development of technology, users have higher and higher requirements for the effect and style of videos shot by terminals such as mobile phones. However, the filters used for shooting videos in current mobile phones usually follow the filter principle in camera mode. The video processed by the filter cannot meet the high color grading requirements.
发明内容Contents of the invention
一种视频处理方法、装置、电子设备和存储介质,可以基于LUT的特性使电子设备所拍摄的视频具有不同的风格效果,以满足更高的调色要求。A video processing method, device, electronic equipment, and storage medium, which can make videos captured by electronic equipment have different style effects based on the characteristics of LUTs, so as to meet higher color matching requirements.
第一方面,提供一种视频处理方法,包括:在多个升格模式中确定一个升格模式,所确定的升格模式对应一个捕获帧率和一个编码帧率,捕获帧率大于编码帧率;在所确定的升格模式的多个视频风格模板中确定一个视频风格模板,每个视频风格模板对应一个预设的二维颜色查找表2D-LUT;基于所确定的升格模式对应的捕获帧率获取通过摄像头拍摄的视频;通过摄像头当前的感光度ISO所对应的对数LOG曲线对通过摄像头拍摄的视频进行处理,得到LOG视频;基于所确定的视频风格模板对应的2D-LUT对LOG视频进行处理,得到与所确定的视频风格模板对应的视频;基于所确定的升格模式对应的编码帧率将与所确定的视频风格模板对应的视频进行编码保存。In the first aspect, a video processing method is provided, including: determining a slow-motion mode among multiple slow-motion modes, the determined slow-motion mode corresponds to a capture frame rate and an encoding frame rate, and the capture frame rate is greater than the encoding frame rate; A video style template is determined among the multiple video style templates of the determined upgrade mode, and each video style template corresponds to a preset two-dimensional color lookup table 2D-LUT; based on the determined capture frame rate corresponding to the upgrade mode, it is obtained through the camera The captured video; the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera is used to process the video captured by the camera to obtain the LOG video; the LOG video is processed based on the 2D-LUT corresponding to the determined video style template to obtain The video corresponding to the determined video style template; encoding and saving the video corresponding to the determined video style template based on the determined encoding frame rate corresponding to the upscaling mode.
在一种可能的实施方式中,多个升格模式包括第一升格模式和第二升格模式,第一升格模式对应第一捕获帧率和第一编码帧率,第二升格模式对应第二捕获帧率和第二编码帧率,第一捕获帧率小于第二捕获帧率,第一编码帧率等于第二编码帧率,第二捕获帧率大于第二编码帧率。In a possible implementation manner, the multiple upscaling modes include a first upscaling mode and a second upscaling mode, the first upscaling mode corresponds to the first capture frame rate and the first encoding frame rate, and the second upscaling mode corresponds to the second capture frame rate and the second encoding frame rate, the first capturing frame rate is less than the second capturing frame rate, the first encoding frame rate is equal to the second encoding frame rate, and the second capturing frame rate is greater than the second encoding frame rate.
在一种可能的实施方式中,若所确定的升格模式为第一升格模式,则在通过摄像头当前的感光度ISO所对应的对数LOG曲线对通过摄像头拍摄的视频进行处理,得到LOG视频的过程之前,还包括:对通过摄像头拍摄的视频进行电子防抖处理;若所确定的升格模式为第一升格模式,通过摄像头当前的感光度ISO所对应的对数LOG曲线对通过摄像头拍摄的视频进行处理,得到LOG视频的过程为:通过摄像头当前的感光度ISO所对应的对数LOG曲线对进行电子防抖处理之后的视频进行处理,得到LOG 视频。在第一升格模式和第二升格模式中,对于捕获帧率较高的升格模式,由于帧间隔较短,因此,省略其中的电子防抖功能,以实现在有限的帧间隔时间内容进行视频的处理,对于捕获帧率较低的升格模式,由于帧间隔时间较长,因此,增加电子防抖功能,以实现更好的视频处理效果。In a possible implementation manner, if the determined slow-motion mode is the first slow-motion mode, the video captured by the camera is processed through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video Before the process, it also includes: performing electronic anti-shake processing on the video captured by the camera; if the determined upscaling mode is the first upscaling mode, the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera is used for the video captured by the camera. The process of processing to obtain the LOG video is as follows: the video after electronic anti-shake processing is processed through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video. In the first slow-motion mode and the second slow-motion mode, for the slow-motion mode with a higher capture frame rate, due to the shorter frame interval, the electronic anti-shake function is omitted, so as to realize video content in a limited frame interval time. Processing, for the slow-motion mode with a low capture frame rate, due to the long frame interval, an electronic anti-shake function is added to achieve better video processing effects.
在一种可能的实施方式中,基于所确定的升格模式对应的编码帧率将所述与所确定的视频风格模板对应的视频进行编码保存的过程包括:将与所确定的视频风格模板对应的视频分流为两路,其中一路基于所确定的升格模式对应的编码帧率进行编码保存,另外一路进行预览。可以使预览视频和最终得到的视频具有相同的视觉效果,便于用户直接基于调色后的风格进行视频预览。In a possible implementation manner, the process of encoding and saving the video corresponding to the determined video style template based on the determined encoding frame rate corresponding to the upscaling mode includes: The video stream is divided into two streams, one of which is encoded and saved based on the encoding frame rate corresponding to the determined upscaling mode, and the other stream is previewed. The preview video and the final video can have the same visual effect, which is convenient for users to directly preview the video based on the color-graded style.
第二方面,提供一种视频处理装置,包括:处理器和存储器,存储器用于存储至少一条指令,指令由所述处理器加载并执行时以实现上述的视频处理方法。In a second aspect, a video processing device is provided, including: a processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the above video processing method is implemented.
第三方面,提供一种电子设备,包括:摄像头;上述的视频处理装置。In a third aspect, an electronic device is provided, including: a camera; and the above-mentioned video processing device.
第四方面,提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述的视频处理方法。In a fourth aspect, a computer-readable storage medium is provided. A computer program is stored in the computer-readable storage medium, and when running on a computer, the computer is made to execute the above video processing method.
本申请实施例中的视频处理方法、装置、电子设备和存储介质,在视频录制过程中,利用电影行业的LUT技术,基于所确定的视频风格模板对应的LUT对LOG视频进行处理,使所录制的视频具有所确定的视频风格模板对应的风格效果,以满足较高的调色要求,使所录制的视频具有电影感。并且,利用较高的捕获帧率配合较低的编码帧率,可以通过较为简单的方式得到具有升格效果的视频,同时,在升格模式中,使用2D-LUT对视频进行处理,以实现在有限的帧间隔时间内进行LUT处理。The video processing method, device, electronic equipment, and storage medium in the embodiments of the present application use the LUT technology in the film industry to process the LOG video based on the LUT corresponding to the determined video style template during the video recording process, so that the recorded The video has the style effect corresponding to the determined video style template, so as to meet the higher color grading requirements and make the recorded video have a movie feel. Moreover, by using a higher capture frame rate combined with a lower encoding frame rate, a video with an upscaling effect can be obtained in a relatively simple way. At the same time, in the upscaling mode, 2D-LUT is used to process the video to achieve limited LUT processing is performed within the frame interval.
附图说明Description of drawings
图1为本申请实施例中一种电子设备的结构框图;FIG. 1 is a structural block diagram of an electronic device in an embodiment of the present application;
图2为本申请实施例中一种视频处理方法的流程图;FIG. 2 is a flowchart of a video processing method in an embodiment of the present application;
图3为本申请实施例中一种电影模式下用户界面的示意图;FIG. 3 is a schematic diagram of a user interface in a movie mode in an embodiment of the present application;
图4为本申请实施例中一种视频录制界面的示意图;FIG. 4 is a schematic diagram of a video recording interface in an embodiment of the present application;
图5为本申请实施例中一种LOG曲线的示意图;Fig. 5 is the schematic diagram of a kind of LOG curve in the embodiment of the present application;
图6为本申请实施例中一种在升格模式下捕获视频和编码后视频文件播放时间的对比示意图;FIG. 6 is a schematic diagram of a comparison of the playing time of captured video and encoded video file in the embodiment of the present application;
图7为本申请实施例中令一种视频处理方法的流程图;FIG. 7 is a flowchart of a video processing method in an embodiment of the present application;
图8为本申请实施例中一种在第二升格模式下执行流程所对应的结构框图;FIG. 8 is a structural block diagram corresponding to the execution process in the second upgrade mode in the embodiment of the present application;
图9为本申请实施例中一种在第一升格模式下执行流程所对应的结构框图;FIG. 9 is a structural block diagram corresponding to an execution process in the first upgrade mode in the embodiment of the present application;
图10为本申请实施例中一种电子设备的软件结构框图;FIG. 10 is a software structural block diagram of an electronic device in an embodiment of the present application;
图11为本申请实施例中一种专业模式下用户界面的示意图。FIG. 11 is a schematic diagram of a user interface in a professional mode in an embodiment of the present application.
具体实施方式Detailed ways
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。The terms used in the embodiments of the present application are only used to explain specific embodiments of the present application, and are not intended to limit the present application.
在介绍本申请实施例之前,首先对本申请实施例所涉及的电子设备进行介绍,如 图1所示,电子设备100可以包括处理器110,摄像头193,显示屏194等。可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。Before introducing the embodiment of the present application, the electronic device involved in the embodiment of the present application is first introduced. As shown in FIG. 1 , the electronic device 100 may include a processor 110, a camera 193, a display screen 194, and the like. It can be understood that, the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。The processor 110 may include one or more processing units, for example: the processor 110 may include a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, Digital signal processor (digital signal processor, DSP), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors. The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction. A memory may also be provided in the processor 110 for storing instructions and data.
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used for processing the data fed back by the camera 193 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。 Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
如图2所示,本申请实施例提供一种视频处理方法,该视频处理方法的执行主体可以为处理器110,具体可以为ISP或者ISP与其他处理器的组合,该视频处理方法包括:As shown in FIG. 2 , the embodiment of the present application provides a video processing method. The video processing method may be executed by a processor 110, specifically an ISP or a combination of an ISP and other processors. The video processing method includes:
步骤100、在多个升格模式中确定一个升格模式,所确定的升格模式对应一个捕 获capture帧率和一个编码encoder帧率,捕获帧率大于编码帧率; Step 100, determine a step-up mode in a plurality of step-up modes, the determined step-up mode corresponds to a capture frame rate and an encoding encoder frame rate, and the capture frame rate is greater than the encoding frame rate;
其中,捕获帧率是指摄像头传感器的读出帧率,编码帧率影响视频的默认播放帧率,当捕获帧率大于编码帧率时,产生慢动作效果。当视频的捕获帧率大于播放帧率时,即为升格,升格是电影拍摄中的一种技术手段,可以实现不同的效果,例如,视频播放时的帧率为每秒显示30帧画面,即帧率为30每秒传输帧数(Frames Per Second,FPS),而拍摄时的帧率为60FPS,即为升格,升格中摄像头拍摄时的帧率适用于不同的场景表达。例如,60FPS的升格拍摄适于表达平移、慢走、欢笑、鼓掌等场景,120FPS的升格拍摄适于表达跑步、转身、撩头发、撒花等场景。升格模式可以基于用户的选择进入。Among them, the capture frame rate refers to the readout frame rate of the camera sensor, and the encoding frame rate affects the default playback frame rate of the video. When the capture frame rate is greater than the encoding frame rate, a slow motion effect is generated. When the video capture frame rate is greater than the playback frame rate, it is upgraded. Upscaling is a technical means in movie shooting, which can achieve different effects. For example, when the video playback frame rate is displayed at 30 frames per second, that is The frame rate is 30 frames per second (Frames Per Second, FPS), and the frame rate during shooting is 60FPS, which is upgraded. The frame rate of the camera during the upgrade is suitable for different scene expressions. For example, 60FPS upgraded shooting is suitable for expressing scenes such as panning, slow walking, laughing, applauding, etc., and 120FPS upgraded shooting is suitable for expressing scenes such as running, turning around, pulling hair, and throwing flowers. Boost mode may be entered based on user selection.
步骤101、在所确定的升格模式的多个视频风格模板中确定一个视频风格模板,每个视频风格模板对应一个预设的二维颜色查找表(2D-Look Up Table,2D-LUT); Step 101, determine a video style template among the plurality of video style templates in the determined upgrade mode, each video style template corresponds to a preset two-dimensional color look-up table (2D-Look Up Table, 2D-LUT);
其中,LUT的本质为数学转换模型,利用LUT可以将一种图像数据值输出为另外的图像数据值,从而改变画面的曝光与色彩。因此,可以预先生成对应不同视频风格的LUT,在电子设备录制视频之前,首先确定出一个视频风格模板,例如可以基于用户的选择来确定视频风格模板,或者基于人工智能(Artificial Intelligence,AI),根据当前摄像头获取的图像所对应的场景自动确定视频风格模板。例如,假设电子设备为手机,在一种可能的实施方式中,如图3所示,用户操作手机进入拍摄界面,拍摄界面包括电影模式选项,当用户进一步选择电影模式选项进入电影模式,在对应的电影模式界面中,包括多个视频风格模板选项,例如包括《A》电影风格模板、《B》电影风格模板和《C》电影风格模板,图3所示的用户界面中仅显示了一个《A》电影风格模板,可以理解地,用户界面中可以并排显示多个不同的电影风格模板,不同的电影风格模板所对应的LUT可以是预先基于对应电影配色风格所生成的,LUT的颜色转换具有对应电影所具有的风格特点,例如《A》电影的配色风格为互补色,互补色是指两种对应的颜色形成对比效果,以暖色系与冷色系的两种颜色来强调对比度以提升鲜艳、突出的效果,通常两种对比的色彩象征冲突行为,透过外在的互补色彩的呈现来表达角色内心正处于矛盾或是身心交瘁的状态,《A》电影风格模板所对应的LUT即用于将颜色映射转换之后,更明显地呈现互补色,以模拟《A》电影的配色风格。在一种可能的实施方式中,如图3所示,用户操作手机进入电影模式,手机会通过获取当前摄像头所拍摄的画面,并基于AI算法确定画面所对应的场景并确定与该场景对应的推荐的视频风格模板,例如若识别到当前所拍摄的画面主体为年轻女性人物,根据算法确定对应的推荐的视频风格模板为《C》电影风格模板,《C》电影为以年轻女性人物为主题的电影,其对应的LUT可以模拟《C》电影的配色风格;例如若识别到当前所拍摄的画面为城市街道,根据算法确定对应的视频风格模板为《B》电影风格模板,《B》电影为以城市街道为主要场景的电影,其对应的LUT可以模拟《B》电影的配色风格。这样,可以自动为用户推荐符合当前场景的视频风格模板。可以预先从电影风格中提取,产生适合移动电子设备的LUT。其中,在升格模式中,摄像头拍摄的视频的帧率较快,即帧间隔较短,则要求视频录制过程中的处理速度也要越快,例如,60FPS的捕获帧率,需要应用LUT对视频进行处理的时间在15ms以内,120FPS的捕获帧率,需要应用LUT对视频进行处理的时间在8ms以内。因此,对于非升格模式,LUT 可以为3D-LUT,而对于升格模式,需要使用2D-LUT,相对于2D-LUT,3D-LUT可以实现更加精确的色彩控制,但是,3D-LUT在应用时由于算法的复杂性,需要更多的处理时间,而2D-LUT在应用时所需要的处理时间较短,因此,在本申请实施例中,基于升格模式进行LUT处理,因此应用2D-LUT,以实现在有限的帧间隔时间内进行LUT处理。Among them, the essence of LUT is a mathematical conversion model. Using LUT, one image data value can be output as another image data value, thereby changing the exposure and color of the picture. Therefore, LUTs corresponding to different video styles can be pre-generated. Before the electronic device records a video, a video style template can be determined first. For example, the video style template can be determined based on the user's choice, or based on artificial intelligence (Artificial Intelligence, AI), The video style template is automatically determined according to the scene corresponding to the image captured by the current camera. For example, assuming that the electronic device is a mobile phone, in a possible implementation, as shown in Figure 3, the user operates the mobile phone to enter the shooting interface, and the shooting interface includes movie mode options. In the movie mode interface of , including multiple video style template options, for example including "A" movie style template, "B" movie style template and "C" movie style template, only one " A "movie style template, understandably, multiple different movie style templates can be displayed side by side in the user interface, and the LUTs corresponding to different movie style templates can be generated based on the corresponding movie color matching style in advance, and the color conversion of the LUT has Corresponding to the style characteristics of the movie, for example, the color matching style of the movie "A" is complementary color. Complementary color refers to the contrast effect of two corresponding colors. Two colors of warm color and cool color are used to emphasize the contrast to enhance the vividness, For outstanding effects, usually two contrasting colors symbolize conflicting behaviors. Through the presentation of external complementary colors to express the character's inner conflict or exhausted state, the LUT corresponding to the "A" movie style template is ready to use After transforming the colormap, the complementary colors are more pronounced to simulate the color scheme of the "A" movie. In a possible implementation, as shown in Figure 3, when the user operates the mobile phone to enter the movie mode, the mobile phone will obtain the picture taken by the current camera, and based on the AI algorithm, determine the scene corresponding to the picture and determine the scene corresponding to the scene. The recommended video style template, for example, if it is recognized that the subject of the currently captured picture is a young female character, the corresponding recommended video style template is determined according to the algorithm as the "C" movie style template, and the movie "C" has a young female character as the theme movie, its corresponding LUT can simulate the color matching style of the movie "C"; It is a movie with city streets as the main scene, and its corresponding LUT can simulate the color matching style of the "B" movie. In this way, a video style template matching the current scene can be automatically recommended for the user. Film styles can be pre-extracted to produce LUTs suitable for mobile electronics. Among them, in the upgrade mode, the frame rate of the video captured by the camera is faster, that is, the frame interval is shorter, and the processing speed in the video recording process is required to be faster. For example, the capture frame rate of 60FPS needs to apply LUT to the video The processing time is within 15ms, and the capture frame rate of 120FPS requires the application of LUT to process the video within 8ms. Therefore, for the non-upscaled mode, the LUT can be a 3D-LUT, while for the upscaled mode, a 2D-LUT needs to be used. Compared with the 2D-LUT, the 3D-LUT can achieve more accurate color control. However, when the 3D-LUT is applied Due to the complexity of the algorithm, more processing time is required, and the processing time required for 2D-LUT application is shorter. Therefore, in the embodiment of this application, LUT processing is performed based on the upgrade mode, so 2D-LUT is applied. In order to realize LUT processing within a limited frame interval time.
步骤102、基于所确定的升格模式对应的捕获帧率获取通过摄像头拍摄的视频; Step 102, based on the determined capture frame rate corresponding to the upscaling mode, the video captured by the camera is acquired;
例如,在确定了升格模式和视频风格模板之后,如果用户点击拍摄选项,则手机开始基于所确定的升格模式对应的捕获频率获取通过摄像头拍摄的视频,在一种可能的实施方式中,在同一个升格模式中,捕获帧率为编码帧率的整数倍,以避免颤动judder效应,如图4所示,在视频录制界面中,例如可以通过“X”的数量来表示升格模式中的帧率倍数,假设编码帧率为30FPS,两个“X”表示捕获帧率为60FPS,即捕获帧率为编码帧率的两倍,四个“X”表示捕获帧率为120FPS,即捕获帧率为编码帧率的四倍,一个“X”表示捕获帧率为30FPS,此时为非升格模式,本申请实施例仅涉及升格模式的相关内容,对于非升格模式的相关内容不做介绍;For example, after determining the upscaling mode and video style template, if the user clicks on the shooting option, the mobile phone starts to acquire the video captured by the camera based on the determined capture frequency corresponding to the upscaling mode. In a possible implementation manner, at the same time In a slow-motion mode, the capture frame rate is an integer multiple of the encoding frame rate to avoid the judder effect, as shown in Figure 4. In the video recording interface, for example, the number of "X" can be used to indicate the frame rate in the slow-motion mode Multiples, assuming that the encoding frame rate is 30FPS, two "X" indicate that the capture frame rate is 60FPS, that is, the capture frame rate is twice the encoding frame rate, and four "X" indicate that the capture frame rate is 120FPS, that is, the capture frame rate is Four times the encoding frame rate, an "X" indicates that the capture frame rate is 30FPS, and it is the non-upgraded mode at this time. The embodiment of this application only involves the relevant content of the upgraded mode, and does not introduce the relevant content of the non-upgraded mode;
步骤103、通过摄像头当前的感光度ISO所对应的对数(Logarithm,LOG)曲线对通过摄像头拍摄的视频进行处理,得到LOG视频; Step 103, process the video captured by the camera through the logarithm (Logarithm, LOG) curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video;
其中,LOG曲线是基于场景的曲线,不同ISO下LOG曲线略有不同。随着ISO的增加,LOG曲线最大值也在增加。当ISO提高到一定程度,高光处有肩部形状,保持高光不过曝。如图5所示,图5示意了一种LOG曲线,其中横坐标为线性信号,以16比特bit编码值Code Value表示,纵坐标为经过LOG曲线处理后的LOG信号,以10bit编码值表示。通过LOG曲线处理,可以利用摄像头的信号输入,将暗部区间的信息编码到中间调(如图5中曲线陡峭的部分),形成10bit的信号输出,符合人眼对光线LOG感应规则,最大化的保留了暗部信息,LOG视频可以利用有限的bit深度最大化的保留阴影和高光的细节。图5中的ASA即为感光度,不同的ASA即对应不同的ISO,两者属于不同制式。Among them, the LOG curve is based on the scene, and the LOG curve is slightly different under different ISOs. As the ISO increases, the maximum value of the LOG curve also increases. When the ISO is increased to a certain level, the highlights will have a shoulder shape, keeping the highlights from being exposed. As shown in Figure 5, Figure 5 illustrates a LOG curve, where the abscissa is a linear signal, represented by a 16-bit code value Code Value, and the ordinate is the LOG signal processed by the LOG curve, represented by a 10-bit code value. Through LOG curve processing, the signal input of the camera can be used to encode the information in the dark area to the middle tone (as shown in the steep part of the curve in Figure 5), forming a 10-bit signal output, which conforms to the human eye's LOG sensing rule for light, and maximizes the The dark information is preserved, and the LOG video can use the limited bit depth to maximize the details of shadows and highlights. The ASA in Figure 5 is the sensitivity, and different ASAs correspond to different ISOs, and the two belong to different systems.
步骤104、基于所确定的视频风格模板对应的二维2D-LUT对LOG视频进行处理,得到与所确定的视频风格模板对应的视频; Step 104, process the LOG video based on the two-dimensional 2D-LUT corresponding to the determined video style template, and obtain the video corresponding to the determined video style template;
具体地,在得到LOG视频之后,以LOG视频作为输入,应用在步骤101中所确定的视频风格模板对应的LUT,对LOG视频图像进行映射转换处理,在处理之后,既可以得到与所确定的视频风格模板对应的视频。基于LUT对LOG视频进行处理后输出的可以是Rec.709色彩标准的视频,也可以是高动态范围图像(High-Dynamic Range,HDR)10标准的视频,即可以通过LUT对LOG视频的处理,将视频转换为HDR10标准。Specifically, after the LOG video is obtained, the LOG video is used as an input, and the LUT corresponding to the video style template determined in step 101 is applied to perform mapping conversion processing on the LOG video image. The video corresponding to the video style template. After the LOG video is processed based on the LUT, the output can be the video of the Rec.709 color standard, or the video of the High-Dynamic Range (HDR) 10 standard, that is, the LOG video can be processed through the LUT, Convert video to HDR10 standard.
不同的LUT应用在电子设备上,可以对电子设备中相关的模块进行适配,以适应不同风格的LUT,例如,如果在步骤101中所确定的视频风格模板为灰色调视频风格模板,灰色调画面的特点为使画面中纹理感较强、饱和度较低、除了人物皮肤的颜色,没有更多的颜色干扰、暗部较冷,基于这些特点,电子设备在录制视频的过程中,可以对相关的模块参数进行调整,保持画面中的纹理,不做很强的去噪和锐化,适当降低画面的饱和度,保持画面中的皮肤颜色真实还原,使画面的暗部向冷色调整。Different LUTs are applied to electronic equipment, and related modules in the electronic equipment can be adapted to adapt to different styles of LUTs. For example, if the video style template determined in step 101 is a gray tone video style template, the gray tone The characteristics of the picture are that the texture in the picture is strong, the saturation is low, there is no more color interference except for the color of the character's skin, and the dark part is cooler. Based on these characteristics, the electronic device can monitor the relevant Adjust the module parameters to keep the texture in the picture, do not do strong denoising and sharpening, properly reduce the saturation of the picture, keep the skin color in the picture true to restore, and adjust the dark part of the picture to cool colors.
步骤105、基于所确定的升格模式对应的编码帧率将与所确定的视频风格模板对应的视频进行编码保存,编码保存之后,可以直接得到升格效果的视频,即具有慢动作效果的视频,无需单独对视频进行转换,可以通过较简单的方式得到具有升格效果的视频,也就是具有慢动作效果的视频,例如,如图6所示,假设捕获帧率为120FPS,编码帧率为30FPS,在该帧率下的视频捕获时间共1分钟,在该帧率下编码后的视频文件播放时间则为4分钟。Step 105: Based on the encoding frame rate corresponding to the determined upscaling mode, the video corresponding to the determined video style template is encoded and stored. After encoding and saving, the video with the upscaling effect can be directly obtained, that is, the video with the slow motion effect. By converting the video separately, a video with an upscaling effect, that is, a video with a slow motion effect can be obtained in a relatively simple way. For example, as shown in Figure 6, assuming that the capture frame rate is 120FPS and the encoding frame rate is 30FPS, in The total video capture time at this frame rate is 1 minute, and the playback time of the encoded video file at this frame rate is 4 minutes.
本申请实施例中的视频处理方法,在视频录制过程中,利用电影行业的LUT技术,基于所确定的视频风格模板对应的LUT对LOG视频进行处理,使所录制的视频具有所确定的视频风格模板对应的风格效果,以满足较高的调色要求,使所录制的视频具有电影感。并且,利用较高的捕获帧率配合较低的编码帧率,可以通过较为简单的方式得到具有升格效果的视频,同时,在升格模式中,使用2D-LUT对视频进行处理,以实现在有限的帧间隔时间内进行LUT处理。In the video processing method in the embodiment of the present application, during the video recording process, the LUT technology of the film industry is used to process the LOG video based on the LUT corresponding to the determined video style template, so that the recorded video has the determined video style The style effect corresponding to the template can meet the higher color grading requirements and make the recorded video have a cinematic feel. Moreover, by using a higher capture frame rate combined with a lower encoding frame rate, a video with an upscaling effect can be obtained in a relatively simple way. At the same time, in the upscaling mode, 2D-LUT is used to process the video to achieve limited LUT processing is performed within the frame interval.
在一种可能的实施方式中,多个升格模式包括第一升格模式和第二升格模式,第一升格模式对应第一捕获帧率和第一编码帧率,第二升格模式对应第二捕获帧率和第二编码帧率,第一捕获帧率小于第二捕获帧率,第一编码帧率等于第二编码帧率,第二捕获帧率大于第二编码帧率。在视频录制之前,用户可以基于不同的场景选择所需要的升格模式,不同的升格模式对应不同的升格帧率,在不同的升格模式中,编码帧率相同,但是捕获帧率不同。In a possible implementation manner, the multiple upscaling modes include a first upscaling mode and a second upscaling mode, the first upscaling mode corresponds to the first capture frame rate and the first encoding frame rate, and the second upscaling mode corresponds to the second capture frame rate and the second encoding frame rate, the first capturing frame rate is less than the second capturing frame rate, the first encoding frame rate is equal to the second encoding frame rate, and the second capturing frame rate is greater than the second encoding frame rate. Before video recording, the user can select the required upscaling mode based on different scenes. Different upscaling modes correspond to different upscaling frame rates. In different upscaling modes, the encoding frame rate is the same, but the capture frame rate is different.
在一种可能的实施方式中,如图7和图8所示,若所确定的升格模式为第一升格模式,则在通过摄像头当前的感光度ISO所对应的对数LOG曲线对所述通过摄像头拍摄的视频进行处理,得到LOG视频的过程之前,还包括:步骤106、对通过摄像头拍摄的视频进行电子防抖(Electric Image Stabilization,EIS)处理;若所确定的升格模式为第一升格模式,上述步骤103、通过摄像头当前的感光度ISO所对应的对数LOG曲线对所述通过摄像头拍摄的视频进行处理,得到LOG视频的过程为:通过摄像头当前的感光度ISO所对应的对数LOG曲线对进行电子防抖处理之后的视频进行处理,得到LOG视频。In a possible implementation manner, as shown in FIG. 7 and FIG. 8 , if the determined slow-motion mode is the first slow-motion mode, the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera passes through the The video captured by the camera is processed, and before the process of obtaining the LOG video, it also includes: step 106, performing electronic image stabilization (Electric Image Stabilization, EIS) processing on the video captured by the camera; if the determined upgrade mode is the first upgrade mode , above step 103, process the video taken by the camera through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera, and the process of obtaining the LOG video is: through the logarithmic LOG corresponding to the current sensitivity ISO of the camera The curve processes the video after the electronic anti-shake processing to obtain the LOG video.
具体地,电子设备具体可以包括摄像头193、反马赛克Demosaic模块21、变形模块22、融合模块23、噪声处理模块24、色彩校正矩阵(Color Correction Matrix,CCM)模块25、全局色调映射(Global Tone Mapping,GTM)模块26、缩放Scaler模块27、YUV去噪模块28、2D-LUT处理模块30和电子防抖模块31,例如,若所确定的升格模式为第二升格模式,在视频录制的过程中,摄像头193以第二捕获帧率拍摄视频,摄像头193拍摄得到长曝光帧视频图像和短曝光帧视频图像,长曝光帧视频图像所对应的曝光时间大于短曝光帧视频图像所对应的曝光时间,长曝光帧视频图像和短曝光帧视频图像分别通过反马赛克模块21的处理,使图像从RAW域转换为RGB域,之后两路视频图像分别通过变形模块22的处理,通过对视频图像的变形实现对齐、防抖的效果,之后两路视频图像电子防抖模块31进行电子防抖处理,之后通过融合模块23处理,将两种视频图像融合为同一个,融合之后的视频图像通过噪声处理模块24进行去噪处理,然后通过CCM模块25处理,将视频转换为RGB广色域的色彩空间,然后通过GTM模块26执行上述步骤103,通过LOG曲线对视频进行处理,得到LOG 视频,然后通过2D-LUT处理模块30执行上述步骤104、基于所确定的视频风格模板对应的二维2D-LUT对LOG视频进行处理,得到与所确定的视频风格模板对应的视频,然后通过缩放模块27对视频进行缩放处理,处理之后的视频图像分流为两路,其中一路进行保存,另外一路进行预览。如图7和图9所示,若所确定的升格模式为第一升格模式,在视频录制的过程中,摄像头193以第一捕获帧率拍摄视频,摄像头193拍摄得到长曝光帧视频图像和短曝光帧视频图像,长曝光帧视频图像所对应的曝光时间大于短曝光帧视频图像所对应的曝光时间,长曝光帧视频图像和短曝光帧视频图像分别通过反马赛克模块21的处理,使图像从RAW域转换为RGB域,之后两路视频图像分别通过变形模块22的处理,通过对视频图像的变形实现对齐、防抖的效果,之后两路视频图像直接通过融合模块23处理,将两种视频图像融合为同一个,融合之后的视频图像通过噪声处理模块24进行去噪处理,然后通过CCM模块25处理,将视频转换为RGB广色域的色彩空间,然后通过GTM模块26执行上述步骤103,通过LOG曲线对视频进行处理,得到LOG视频,然后通过2D-LUT处理模块30执行上述步骤104、基于所确定的视频风格模板对应的二维2D-LUT对LOG视频进行处理,得到与所确定的视频风格模板对应的视频,然后通过缩放模块27对视频进行缩放处理,处理之后的视频图像分流为两路,其中一路进行保存,另外一路进行预览。也就是说,在第一升格模式和第二升格模式中,对于捕获帧率较高的升格模式,由于帧间隔较短,因此,省略其中的电子防抖功能,以实现在有限的帧间隔时间内容进行视频的处理,对于捕获帧率较低的升格模式,由于帧间隔时间较长,因此,增加电子防抖功能,以实现更好的视频处理效果。Specifically, the electronic device may specifically include a camera 193, an anti-mosaic Demosaic module 21, a deformation module 22, a fusion module 23, a noise processing module 24, a color correction matrix (Color Correction Matrix, CCM) module 25, a global tone mapping (Global Tone Mapping , GTM) module 26, scaling Scaler module 27, YUV denoising module 28, 2D-LUT processing module 30 and electronic anti-shake module 31, for example, if the determined slow-motion mode is the second slow-motion mode, in the process of video recording , the camera 193 shoots video at the second capture frame rate, and the camera 193 shoots a long-exposure frame video image and a short-exposure frame video image, and the exposure time corresponding to the long-exposure frame video image is greater than the exposure time corresponding to the short-exposure frame video image, The long-exposure frame video image and the short-exposure frame video image are respectively processed by the anti-mosaic module 21, so that the image is converted from the RAW domain to the RGB domain, and then the two video images are respectively processed by the deformation module 22, through the deformation of the video image. Alignment, anti-shake effect, then the two-way video image electronic anti-shake module 31 performs electronic anti-shake processing, and then processes through the fusion module 23 to fuse the two video images into the same one, and the video image after fusion passes through the noise processing module 24 Carry out denoising processing, then process through the CCM module 25, convert the video into the color space of RGB wide color gamut, then execute the above-mentioned step 103 through the GTM module 26, process the video through the LOG curve, obtain the LOG video, and then pass 2D- The LUT processing module 30 executes the above step 104, processes the LOG video based on the two-dimensional 2D-LUT corresponding to the determined video style template, obtains the video corresponding to the determined video style template, and then zooms the video through the scaling module 27 Processing, the processed video image is split into two channels, one of which is saved, and the other is previewed. As shown in Figures 7 and 9, if the determined upscaling mode is the first upscaling mode, during the video recording process, the camera 193 shoots a video at the first capture frame rate, and the camera 193 captures a long exposure frame video image and a short exposure frame. Expose the frame video image, the exposure time corresponding to the long exposure frame video image is greater than the exposure time corresponding to the short exposure frame video image, the long exposure frame video image and the short exposure frame video image are processed by the anti-mosaic module 21 respectively, so that the image from The RAW domain is converted into the RGB domain, and then the two-way video images are processed by the deformation module 22 respectively, and the effects of alignment and anti-shake are realized through the deformation of the video images, and then the two-way video images are directly processed by the fusion module 23 to combine the two video images. The image fusion is the same, the video image after the fusion is denoised by the noise processing module 24, then processed by the CCM module 25, the video is converted into the color space of RGB wide color gamut, and then the above-mentioned steps 103 are performed by the GTM module 26, The video is processed through the LOG curve to obtain the LOG video, and then the 2D-LUT processing module 30 executes the above step 104, and the LOG video is processed based on the two-dimensional 2D-LUT corresponding to the determined video style template to obtain the determined LOG video. The video corresponding to the video style template is then scaled by the scaling module 27, and the processed video image is divided into two streams, one of which is saved, and the other is previewed. That is to say, in the first slow-motion mode and the second slow-motion mode, for the slow-motion mode with a higher capture frame rate, since the frame interval is shorter, the electronic anti-shake function is omitted to realize the limited frame interval time The content is used for video processing. For the sublimation mode with a low capture frame rate, due to the long frame interval, an electronic anti-shake function is added to achieve better video processing effects.
以下对RAW和YUV的相关内容进行说明:The following describes the relevant content of RAW and YUV:
拜耳域:数码相机上的每个镜头都带有一个光传感器,用以测量光线的明亮程度,但若要获得一幅全彩图像,一般需要有三个光传感器分别获得红、绿、蓝三基色信息,而为了降低数码相机的成本与体积,生产厂商通常会采用CCD或CMOS图像传感器,通常的,CMOS图像传感器输出的原始图像为拜尔域RGB格式,单个像素点只包含一种颜色值,要得到图像的灰度值,需要先插补完整各像素点的颜色信息,再计算各像素点的灰度值。也就是说拜耳域是指数码相机内部的一种原始图片格式。Bayer field: Each lens on a digital camera has a light sensor to measure the brightness of the light, but to obtain a full-color image, generally three light sensors are required to obtain the three primary colors of red, green and blue information, and in order to reduce the cost and volume of digital cameras, manufacturers usually use CCD or CMOS image sensors. Usually, the original image output by CMOS image sensors is in Bayer domain RGB format, and a single pixel contains only one color value. To obtain the gray value of the image, it is necessary to interpolate the complete color information of each pixel, and then calculate the gray value of each pixel. In other words, the Bayer domain refers to a raw image format inside a digital camera.
Raw域或称Raw格式,是指未经加工图像。进一步地,所述Raw图像可以理解为,就是相机的感光元件比如互补金属氧化物半导体(Complementary Metal OxideSemiconductor,CMOS)或者电荷耦合器件(Charge-coupled Device,CCD)将捕捉到的光源信号转化为数字信号的原始数据。RAW文件是一种记录了数码相机传感器的原始信息,同时记录了由相机拍摄所产生的一些元数据(Metadata,如感光度ISO(InternationalOrganization for Standardization,国际标准化组织)的设置、快门速度、光圈值、白平衡等)的文件。Raw域是未经ISP非线性处理、也未经压缩的格式。Raw格式的全称是RAW Image Format。The Raw domain or Raw format refers to unprocessed images. Further, the Raw image can be understood as that the photosensitive element of the camera such as Complementary Metal Oxide Semiconductor (Complementary Metal Oxide Semiconductor, CMOS) or Charge-coupled Device (Charge-coupled Device, CCD) converts the captured light source signal into digital The raw data of the signal. A RAW file is a record of the original information of the digital camera sensor, while recording some metadata (Metadata, such as ISO (International Organization for Standardization, International Organization for Standardization) settings, shutter speed, aperture value) generated by the camera. , white balance, etc.) files. The Raw domain is a format that has not been processed by the ISP nonlinearly and has not been compressed. The full name of Raw format is RAW Image Format.
YUV是一种颜色编码方法,常使用在各个视频处理组件中。YUV在对照片或视频编码时,考虑到人类的感知能力,允许降低色度的带宽。YUV是编译true-color颜色空间(color space)的种类,Y'UV、YUV、YCbCr、YPbPr等专有名词都可以称为YUV,彼此有重叠。其中“Y”表示明亮度(Luminance或Luma),也就是灰阶值,“U”和“V” 表示色度(Chrominance或Chroma),作用是描述影像色彩及饱和度,用于指定像素的颜色。一般YUV分成两种格式,一种是:紧缩格式(packedformats),将Y、U、V值存储成Macro Pixels数组,和RGB的存放方式类似。另一种是:平面格式(planarformats),将Y、U、V的三个分量分别存放在不同的矩阵中。平面格式(planarformats)是指每Y分量,U分量和V分量都是以独立的平面组织的,也就是说所有的U分量都在Y分量后面,而V分量在所有的U分量后面。YUV is a color encoding method that is often used in various video processing components. YUV takes human perception into account when encoding photos or videos, allowing bandwidth reduction for chroma. YUV is a type of compiling true-color color space (color space). Proper nouns such as Y'UV, YUV, YCbCr, and YPbPr can all be called YUV, and they overlap with each other. Among them, "Y" represents the brightness (Luminance or Luma), that is, the grayscale value, "U" and "V" represent the chroma (Chrominance or Chroma), which are used to describe the color and saturation of the image, and are used to specify the color of the pixel . Generally, YUV is divided into two formats, one is: packed formats, which store Y, U, and V values into a Macro Pixels array, which is similar to the storage method of RGB. The other is: planar formats, which store the three components of Y, U, and V in different matrices. Planar formats (planarformats) means that each Y component, U component and V component are organized in an independent plane, that is to say, all U components are behind the Y component, and V components are behind all U components.
在一种可能的实施方式中,第一捕获帧率为60FPS,第二捕获帧率为120FPS,第一编码帧率和第二编码帧率为30FPS。In a possible implementation manner, the first capture frame rate is 60 FPS, the second capture frame rate is 120 FPS, and the first encoding frame rate and the second encoding frame rate are 30 FPS.
在一种可能的实施方式中,上述步骤104、基于所确定的视频风格模板对应的二维2D-LUT对LOG视频进行处理,得到与所确定的视频风格模板对应的视频的过程在HSV色彩空间执行。In a possible implementation manner, the above step 104, based on the two-dimensional 2D-LUT corresponding to the determined video style template, processes the LOG video, and the process of obtaining the video corresponding to the determined video style template is in the HSV color space implement.
具体地,基于2D-LUT对LOG视频进行处理时,2D-LUT为预先通过3D-LUT模拟得到的,例如,预先知道3D-LUT,以及3D-LUT对应的输入数据和输出数据,输入数据和输出数据均属于RGB色彩空间,此时,可以将输入数据由RGB色彩空间转换至HSV色彩空间,将输出数据由RGB色彩空间转换至HSV色彩空间,通过HSV色彩空间中数据的转换关系,既可以得到2D-LUT的具体模型,以便于在视频录制的过程中,应用该2D-LUT,由于在2D-LUT中只能基于两个变量进行转换,因此可以对色调H和饱和度S进行转换,将明度V忽略,以实现2D-LUT模拟3D-LUT的效果。Specifically, when the LOG video is processed based on the 2D-LUT, the 2D-LUT is obtained through 3D-LUT simulation in advance, for example, the 3D-LUT is known in advance, and the input data and output data corresponding to the 3D-LUT, the input data and the The output data all belong to the RGB color space. At this time, the input data can be converted from the RGB color space to the HSV color space, and the output data can be converted from the RGB color space to the HSV color space. Through the conversion relationship of the data in the HSV color space, you can Get the specific model of 2D-LUT, so as to apply the 2D-LUT in the process of video recording. Since only two variables can be converted in 2D-LUT, the hue H and saturation S can be converted. Ignore the brightness V to achieve the effect of 2D-LUT simulating 3D-LUT.
在一种可能的实施方式中,如图8和图9所示,上述步骤105、基于所确定的升格模式对应的编码帧率将与所确定的视频风格模板对应的视频进行编码保存的过程包括:将与所确定的视频风格模板对应的视频分流为两路,其中一路基于所确定的升格模式对应的编码帧率进行编码保存,另外一路进行预览。在升格模式中,由于捕获帧率较高,为了保证在较高帧率下视频处理过程能够完成,可以使用算法较为简单的2D-LUT对视频进行处理,并且仅使用一路流在各模块中进行处理,在处理完成之后再分流为两路,一路进行保存,另外一路进行预览。In a possible implementation manner, as shown in FIG. 8 and FIG. 9 , the process of encoding and saving the video corresponding to the determined video style template based on the determined encoding frame rate corresponding to the upscaling mode in the above step 105 includes : Split the video corresponding to the determined video style template into two streams, one of which is encoded and saved based on the encoding frame rate corresponding to the determined upscaling mode, and the other stream is previewed. In upgrade mode, due to the high capture frame rate, in order to ensure that the video processing process can be completed at a high frame rate, the 2D-LUT with a relatively simple algorithm can be used to process the video, and only one stream is used for processing in each module. Processing, after the processing is completed, it will be divided into two channels, one for saving, and the other for previewing.
以下结合软件架构对本申请实施例进行说明,本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。图10是本申请实施例的电子设备100的软件结构框图。The following describes the embodiment of the present application in conjunction with the software architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 . FIG. 10 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为五层,从上至下分别为应用程序Application层、应用程序框架framework层、系统库library、硬件抽象层(Hardware Abstraction Layer,HAL)以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Android system is divided into five layers, which are, from top to bottom, the Application layer, the application framework framework layer, the system library library, the Hardware Abstraction Layer (Hardware Abstraction Layer, HAL) and the kernel layer.
应用程序层可以包括相机等应用程序。The application layer can include applications such as cameras.
应用程序框架层可以包括相机应用程序编程接口(Application Programming Interface,API)、媒体录制MediaRecorder和表面视图Surfaceview等。媒体录制用来录制视频或图片数据,并使这些数据可以被应用程序访问。表面视图用来显示预览画面。The application framework layer may include camera application programming interface (Application Programming Interface, API), media recording MediaRecorder and surface view Surfaceview, etc. Media recording is used to record video or image data and make this data accessible to applications. Surface views are used to display preview images.
系统库可以包括多个功能模块。例如:相机服务CameraSevice等。A system library can include multiple function modules. For example: camera service CameraSevice, etc.
硬件抽象层用于提供接口支持,例如包括相机流程CameraPipeline以供相机服务 调用Call。The hardware abstraction layer is used to provide interface support, for example, including the camera process CameraPipeline for the camera service to call Call.
内核层是硬件和软件之间的层。内核层包含显示驱动,摄像头驱动等。The kernel layer is the layer between hardware and software. The kernel layer includes display drivers, camera drivers, etc.
结合捕获视频的一种具体场景,HAL上报同时录制两段视频的能力信息,应用程序层下发捕获请求CaptureRequest,以120FPS帧率进行捕获,请求对应一个录像的流和一个预览流,同时创建两个媒体编解码器mediacodec示例,接收30FPS的编码。HAL按照上述的数据流dataflow,回调两路流。其中,预览流送显示,录像流送mediacodec。需要说明的是,在切换不同的升格模式时,由于捕获帧率不同,摄像头传感器的出流方式不同,因此需要重启以实现切换。Combined with a specific scene of video capture, HAL reports the capability information of recording two videos at the same time, and the application layer sends a capture request CaptureRequest to capture at a frame rate of 120FPS. The request corresponds to a video stream and a preview stream, and simultaneously creates two An example of a media codec, mediacodec, that receives 30FPS encoding. HAL calls back two streams according to the dataflow mentioned above. Among them, the preview stream is sent to display, and the video stream is sent to mediacodec. It should be noted that when switching between different upscaling modes, due to the different capture frame rates, the outflow methods of the camera sensor are different, so a restart is required to switch.
本申请实施例提供的录像视频处理方法可以表现为两种拍摄模式下的多个功能,其中这两种拍摄模式可以是指:电影模式、专业模式。The video recording and video processing method provided in the embodiment of the present application may be represented as multiple functions in two shooting modes, where the two shooting modes may refer to: movie mode and professional mode.
电影模式是一种与电影主题相关的拍摄模式,在该模式下,电子设备100显示的图像能够从感官上给用户一种观看电影的效果,电子设备100还提供多个与电影主题相关的视频风格模板,用户可以利用这些视频风格模板获得色调调整后的图像或视频,这些图像或视频的色调与电影的色调类似或相同。在本申请以下实施例中,电影模式至少可提供用户触发LUT功能、HDR10功能的接口。具体关于LUT功能、HDR10功能的描述可以参见以下实施例。The movie mode is a shooting mode related to the theme of the movie. In this mode, the image displayed by the electronic device 100 can give the user a sense of watching a movie. The electronic device 100 also provides a plurality of video related to the theme of the movie Style templates, users can use these video style templates to obtain tone-adjusted images or videos, and the tone of these images or videos is similar or identical to the tone of the movie. In the following embodiments of the present application, the movie mode can at least provide an interface for the user to trigger the LUT function and the HDR10 function. For specific descriptions about the LUT function and the HDR10 function, please refer to the following embodiments.
例如,假设电子设备100为手机,在一种可能的实施方式中,如图3所示,电子设备可以响应用户的操作进入电影模式。例如,电子设备100可以检测到用户作用于相机应用程序的触控操作,响应于该操作,电子设备100显示相机应用程序的默认拍照界面。默认拍照界面可包括:预览框、拍摄模式列表、图库快捷键、快门控件等。其中:For example, assuming that the electronic device 100 is a mobile phone, in a possible implementation manner, as shown in FIG. 3 , the electronic device may enter a movie mode in response to a user's operation. For example, the electronic device 100 may detect a user's touch operation on the camera application, and in response to the operation, the electronic device 100 displays a default camera interface of the camera application. The default camera interface can include: preview frame, shooting mode list, gallery shortcut keys, shutter controls, etc. in:
预览框可用于显示摄像头193实时采集的图像。电子设备100可以实时刷新其中的显示内容,以便于用户预览摄像头193当前采集的图像。The preview frame can be used to display images collected by the camera 193 in real time. The electronic device 100 can refresh the displayed content therein in real time, so that the user can preview the image currently captured by the camera 193 .
拍摄模式列表中可以显示有一个或多个拍摄模式选项。这一个或多个拍摄模式选项可以包括:人像模式选项、录像模式选项、拍照模式选项、电影模式选项、专业选项。这一个或多个拍摄模式选项在界面上可以表现为文字信息,例如“人像”、“录像”、“拍照”、“电影”、“专业”。不限于此,这一个或多个拍摄模式选项在界面上还可以表现为图标或者其他形式的交互元素(interactive element,IE)。One or more shooting mode options may be displayed in the shooting mode list. The one or more shooting mode options may include: portrait mode options, video recording mode options, camera mode options, movie mode options, and professional options. The one or more shooting mode options can be represented as text information on the interface, such as "portrait", "video recording", "photographing", "movie", "professional". Not limited thereto, the one or more shooting mode options may also be represented as icons or other forms of interactive elements (interactive element, IE) on the interface.
图库快捷键可用于开启图库应用程序。图库应用程序是智能手机、平板电脑等电子设备上的一款图片管理的应用程序,又可以称为“相册”,本实施例对该应用程序的名称不做限制。图库应用程序可以支持用户对存储于电子设备100上的图片进行各种操作,例如浏览、编辑、删除、选择等操作。Gallery shortcuts can be used to launch the Gallery application. The gallery application program is an application program for picture management on electronic devices such as smart phones and tablet computers, and may also be called "album". The name of the application program is not limited in this embodiment. The gallery application program can support users to perform various operations on pictures stored on the electronic device 100, such as browsing, editing, deleting, selecting and other operations.
快门控件可用于监听触发拍照的用户操作。电子设备100可以检测到作用于快门控件的用户操作,响应于该操作,电子设备100可以将预览框中的图像保存为图库应用程序中的图片。另外,电子设备100还可以在图库快捷键中显示所保存的图像的缩略图。也即是说,用户可以点击快门控件来触发拍照。其中,快门控件可以是按钮或者其他形式的控件。The shutter control can be used to listen for user actions that trigger a photo. The electronic device 100 may detect a user operation acting on the shutter control, and in response to the operation, the electronic device 100 may save the image in the preview frame as a picture in the gallery application. In addition, the electronic device 100 may also display the thumbnails of the saved images in the gallery shortcut key. That is, users can tap the shutter control to trigger a photo. Wherein, the shutter control may be a button or other forms of control.
电子设备100可以检测到用户作用于电影模式选项的触控操作,响应于该操作,电子设备显示如图3所示的用户界面。The electronic device 100 may detect a user's touch operation on the movie mode option, and in response to the operation, the electronic device displays a user interface as shown in FIG. 3 .
在一些实施例中,电子设备100可以在启动相机应用程序后默认开启电影模式。不限于此,电子设备100还可以通过其他方式开启电影模式,例如电子设备100还可以根据用户的语音指令开启电影模式,本申请实施例对此不作限制。In some embodiments, the electronic device 100 may turn on the movie mode by default after starting the camera application. Not limited thereto, the electronic device 100 may also enable the movie mode in other ways, for example, the electronic device 100 may also enable the movie mode according to a user's voice command, which is not limited in this embodiment of the present application.
电子设备100可以检测到用户作用于电影模式选项的触控操作,响应于该操作,电子设备显示如图3所示的用户界面。The electronic device 100 may detect a user's touch operation on the movie mode option, and in response to the operation, the electronic device displays a user interface as shown in FIG. 3 .
如图3示出的用户界面中包括功能选项,功能选项包括HDR10选项、闪光灯选项、LUT选项、设置选项。这多个功能选项都可以检测到用户的触控操作,并响应于该操作,开启或关闭对应的拍摄功能,例如,HDR10功能、闪光灯功能、LUT功能、设置功能。The user interface shown in FIG. 3 includes function options, and the function options include HDR10 options, flash options, LUT options, and setting options. These multiple function options can detect the user's touch operation, and in response to the operation, enable or disable the corresponding shooting function, for example, HDR10 function, flash function, LUT function, setting function.
电子设备可以开启LUT功能,该LUT功能可以改变预览图像的显示效果。实质上,LUT功能引入了颜色查找表,颜色查找表相当于一个颜色转换模型,该颜色转换模型能够根据输入的色彩值,输出调整后的色彩值。摄像头采集的图像的色彩值相当于输入值,不同的色彩值经过颜色转换模型后,都可以对应得到一个输出值。最终,显示在预览框中的图像即为经过颜色转换模型调整后的图像。电子设备100利用该LUT功能,显示经过颜色转换模型调整后的色彩值组成的图像,达到调整图像色调的效果。开启LUT功能之后,电子设备100可以提供多个视频风格模板,一个视频风格模板对应一个颜色转换模型,不同的视频风格模板可以给预览图像带来不同的显示效果。并且,这些视频风格模板可以与电影主题相关联,视频风格模板给预览图像带来的色调调整效果可以和电影中的色调接近或相同,为用户营造拍摄电影的氛围感。The electronic device can enable the LUT function, and the LUT function can change the display effect of the preview image. In essence, the LUT function introduces a color lookup table, which is equivalent to a color conversion model, which can output adjusted color values according to the input color values. The color value of the image captured by the camera is equivalent to the input value, and different color values can be correspondingly obtained as an output value after passing through the color conversion model. Finally, the image displayed in the preview box is the image adjusted by the color transformation model. The electronic device 100 uses the LUT function to display an image composed of color values adjusted by the color conversion model, so as to achieve the effect of adjusting the tone of the image. After the LUT function is enabled, the electronic device 100 can provide multiple video style templates, one video style template corresponds to one color conversion model, and different video style templates can bring different display effects to the preview image. Moreover, these video style templates can be associated with the theme of the movie, and the tone adjustment effect brought by the video style template to the preview image can be close to or the same as the tone in the movie, creating an atmosphere for the user to shoot a movie.
另外,在电子设备100开启LUT功能之后,电子设备100可以根据当前预览视频画面,在多个视频风格模板中确定一个视频风格模板,所确定的视频风格模板可以显示在界面中,以便于用户了解当前所确定的视频风格模板,例如多个视频风格模板包括《A》电影风格模板、《B》电影风格模板和《C》电影风格模板,不同的电影风格模板所对应的LUT可以是预先基于对应电影配色风格所生成的,LUT的颜色转换具有对应电影所具有的风格特点。可以预先从电影风格中提取,产生适合移动电子设备的LUT。LUT功能的开启会改变预览视频画面的色调。如图3中示意的,电子设备100确定《A》电影风格模板并进行显示。In addition, after the electronic device 100 enables the LUT function, the electronic device 100 can determine a video style template among multiple video style templates according to the current preview video image, and the determined video style template can be displayed on the interface, so that the user can understand Currently determined video style templates, for example, a plurality of video style templates including "A" movie style template, "B" movie style template and "C" movie style template, the corresponding LUTs of different movie style templates can be based on the corresponding Generated by the movie color matching style, the color conversion of the LUT has the style characteristics of the corresponding movie. Film styles can be pre-extracted to produce LUTs suitable for mobile electronics. Turning on the LUT function will change the color tone of the preview video screen. As illustrated in FIG. 3 , the electronic device 100 determines and displays the "A" movie style template.
在一些实施例中,电子设备100可以根据用户的滑动操作来选择视频风格模板。具体地,当电子设备100检测到用户开启LUT功能的用户操作,显示LUT预览窗口之后,电子设备100可以默认选择位于LUT预览窗口中的第一个视频风格模板,作为电子设备100选中的视频风格模板。之后,电子设备100可以检测到用户作用于LUT预览窗口的左右滑动操作,移动LUT预览窗口中各视频风格模板的位置,当电子设备100不再检测到用户的滑动操作时,电子设备100将LUT预览窗口中显示的第一个视频风格模板作为电子设备100选中的视频风格模板。In some embodiments, the electronic device 100 may select a video style template according to the user's sliding operation. Specifically, when the electronic device 100 detects the user operation of enabling the LUT function and displays the LUT preview window, the electronic device 100 can select the first video style template located in the LUT preview window by default as the video style template selected by the electronic device 100. template. Afterwards, the electronic device 100 can detect the left and right sliding operation of the user acting on the LUT preview window, and move the position of each video style template in the LUT preview window. The first video style template displayed in the preview window is used as the video style template selected by the electronic device 100 .
在一些实施例中,电子设备100除了可以使用视频风格模板改变预览图像的显示效果,还可以在添加视频风格模板之后,检测到开始录制视频的用户操作,响应于该操作,电子设备100开始录制视频,从而获得使用视频风格模板调整显示效果后的视频。另外,在录制视频的过程中,电子设备100还可以检测到拍摄照片的用户操作,响应于该操作,电子设备100将预览框中添加了视频风格模板的预览图像保存成图片, 从而获得使用视频风格模板调整显示效果后的图像。In some embodiments, in addition to using the video style template to change the display effect of the preview image, the electronic device 100 can also detect a user operation to start recording a video after adding the video style template, and in response to the operation, the electronic device 100 starts recording Video, so as to obtain the video after adjusting the display effect using the video style template. In addition, during the process of recording the video, the electronic device 100 can also detect the user operation of taking a photo, and in response to this operation, the electronic device 100 saves the preview image with the video style template added in the preview frame as a picture, so as to obtain the user's operation of using the video The style template adjusts the image after the display effect.
电子设备可以开启HDR10功能,HDR10模式中,HDR即为高动态范围图像(High-Dynamic Range,HDR),相比于普通的图像,HDR可以提供更多的动态范围和图像细节,能够更好地反映出真实环境中的视觉效果,HDR10中的10即为10比特,HDR10可以以10位高动态范围录制视频。Electronic devices can enable the HDR10 function. In HDR10 mode, HDR is a high-dynamic range image (High-Dynamic Range, HDR). Compared with ordinary images, HDR can provide more dynamic range and image details, and can better Reflecting the visual effects in the real environment, 10 in HDR10 is 10 bits, and HDR10 can record video with a high dynamic range of 10 bits.
电子设备100可以检测到用户作用于专业模式选项的触控操作,进入专业模式。如图11所示,电子设备处于专业模式时,用户界面中可以包括的功能选项例如为:LOG选项、闪光灯选项、LUT选项、设置选项,另外,用户界面还包括参数调节选项,例如为:测光M选项、ISO选项、快门S选项、曝光补偿EV选项、对焦方式AF选项和白平衡WB选项。The electronic device 100 may detect the user's touch operation on the professional mode option, and enter the professional mode. As shown in Figure 11, when the electronic device is in the professional mode, the functional options that can be included in the user interface are, for example: LOG option, flashlight option, LUT option, and setting option. In addition, the user interface also includes parameter adjustment options, such as: measurement Light M option, ISO option, shutter S option, exposure compensation EV option, focus mode AF option and white balance WB option.
在一些实施例中,电子设备100可以在启动相机应用程序后默认开启专业模式。不限于此,电子设备100还可以通过其他方式开启专业模式,例如电子设备100还可以根据用户的语音指令开启专业模式,本申请实施例对此不作限制。In some embodiments, the electronic device 100 may turn on the professional mode by default after starting the camera application. Not limited thereto, the electronic device 100 can also enable the professional mode in other ways, for example, the electronic device 100 can also enable the professional mode according to the user's voice command, which is not limited in this embodiment of the present application.
电子设备100可以检测到用户作用于LOG选项的用户操作,响应于该操作,电子设备100开启LOG功能。其中,LOG功能能够将对数函数应用到曝光曲线上,最大限度地保留摄像头采集的图像中,高光和阴影部分的细节,使最终呈现出来的预览图像的饱和度较低。其中,使用LOG功能录制的视频称为LOG视频。The electronic device 100 may detect a user operation on the LOG option by the user, and in response to the operation, the electronic device 100 enables the LOG function. Among them, the LOG function can apply the logarithmic function to the exposure curve to preserve the details of the highlights and shadows in the image captured by the camera to the maximum extent, so that the saturation of the final preview image is lower. Among them, the video recorded with LOG function is called LOG video.
电子设备100通过专业模式除了可以录制添加了视频风格模板的视频,还可以在录制未添加视频风格模板的视频后,为该视频添加视频风格模板,或者,在开启LOG功能后,录制LOG视频,之后再为该LOG视频添加视频风格模板。这样,电子设备100不仅可以在录制视频的之前调整画面的显示效果,还可以在视频录制完成之后,调整录制的视频的显示效果,增加了图像调整的灵活性和自由度。The electronic device 100 can not only record a video with a video style template added through the professional mode, but also add a video style template to the video after recording a video without a video style template, or record a LOG video after enabling the LOG function. Then add a video style template for the LOG video. In this way, the electronic device 100 can not only adjust the display effect of the picture before recording the video, but also adjust the display effect of the recorded video after the video recording is completed, which increases the flexibility and freedom of image adjustment.
本申请实施例还提供一种视频处理装置,包括:升格模式确定模块,用于在多个升格模式中确定一个升格模式,所确定的升格模式对应一个捕获帧率和一个编码帧率,捕获帧率大于编码帧率;视频风格确定模块,用于在所确定的升格模式的多个视频风格模板中确定一个视频风格模板,每个视频风格模板对应一个预设的二维颜色查找表2D-LUT;视频获取模块,用于基于所确定的升格模式对应的捕获帧率获取通过摄像头拍摄的视频;LOG处理模块,用于通过摄像头当前的感光度ISO所对应的对数LOG曲线对所述通过摄像头拍摄的视频进行处理,得到LOG视频;2D-LUT处理模块,用于基于所确定的视频风格模板对应的2D-LUT对LOG视频进行处理,得到与所确定的视频风格模板对应的视频;编码模块,用于基于所确定的升格模式对应的编码帧率将与所确定的视频风格模板对应的视频进行编码保存。The embodiment of the present application also provides a video processing device, including: a step-up mode determination module, configured to determine a step-up mode among a plurality of step-up modes, the determined step-up mode corresponds to a capture frame rate and an encoding frame rate, and the capture frame The rate is greater than the encoding frame rate; the video style determination module is used to determine a video style template among the plurality of video style templates in the determined upgrade mode, and each video style template corresponds to a preset two-dimensional color lookup table 2D-LUT ; The video acquisition module is used to obtain the video taken by the camera based on the captured frame rate corresponding to the determined step-up mode; the LOG processing module is used to pass through the camera according to the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera The captured video is processed to obtain the LOG video; the 2D-LUT processing module is used to process the LOG video based on the 2D-LUT corresponding to the determined video style template to obtain the video corresponding to the determined video style template; the encoding module , for encoding and saving the video corresponding to the determined video style template based on the determined encoding frame rate corresponding to the upscaling mode.
该视频处理装置可以应用上述的视频处理方法,具体过程和原理在此不再赘述,其中,LOG处理模块具体可以为上述实施例中的GTM模块26。The video processing device may apply the above-mentioned video processing method, and the specific process and principle will not be repeated here. The LOG processing module may specifically be the GTM module 26 in the above-mentioned embodiment.
在一种可能的实施方式中,多个升格模式包括第一升格模式和第二升格模式,第一升格模式对应第一捕获帧率和第一编码帧率,第二升格模式对应第二捕获帧率和第二编码帧率,第一捕获帧率小于第二捕获帧率,第一编码帧率等于第二编码帧率,第二捕获帧率大于第二编码帧率。In a possible implementation manner, the multiple upscaling modes include a first upscaling mode and a second upscaling mode, the first upscaling mode corresponds to the first capture frame rate and the first encoding frame rate, and the second upscaling mode corresponds to the second capture frame rate and the second encoding frame rate, the first capturing frame rate is less than the second capturing frame rate, the first encoding frame rate is equal to the second encoding frame rate, and the second capturing frame rate is greater than the second encoding frame rate.
在一种可能的实施方式中,视频处理装置还包括:电子防抖模块31,用于对通过 摄像头拍摄的视频进行电子防抖处理。LOG处理模块具体用于,通过摄像头当前的感光度ISO所对应的对数LOG曲线对进行电子防抖处理之后的视频进行处理,得到LOG视频。In a possible implementation manner, the video processing device further includes: an electronic anti-shake module 31, configured to perform electronic anti-shake processing on the video captured by the camera. The LOG processing module is specifically used to process the video after electronic anti-shake processing through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video.
在一种可能的实施方式中,第一捕获帧率为60FPS,第二捕获帧率为120FPS,第一编码帧率和第二编码帧率为30FPS。In a possible implementation manner, the first capture frame rate is 60 FPS, the second capture frame rate is 120 FPS, and the first encoding frame rate and the second encoding frame rate are 30 FPS.
在一种可能的实施方式中,第一帧率为120每秒传输帧数FPS或60FPS,第二帧率为30FPS。In a possible implementation manner, the first frame rate is 120 FPS or 60 FPS, and the second frame rate is 30 FPS.
在一种可能的实施方式中,上述步骤104、基于所确定的视频风格模板对应的二维2D-LUT对LOG视频进行处理,得到与所确定的视频风格模板对应的视频的过程在HSV色彩空间执行。In a possible implementation manner, the above step 104, based on the two-dimensional 2D-LUT corresponding to the determined video style template, processes the LOG video, and the process of obtaining the video corresponding to the determined video style template is in the HSV color space implement.
在一种可能的实施方式中,编码模块具体用于,将与所确定的视频风格模板对应的视频分流为两路,其中一路基于所确定的升格模式对应的编码帧率进行编码保存,另外一路进行预览。In a possible implementation manner, the encoding module is specifically configured to split the video corresponding to the determined video style template into two streams, one of which is encoded and saved based on the encoding frame rate corresponding to the determined upgrade mode, and the other stream is to preview.
应理解以上视频处理装置的各个模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且这些模块可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块以软件通过处理元件调用的形式实现,部分模块通过硬件的形式实现。例如,升格模式确定模块、视频风格确定模块、视频获取模块、LOG处理模块、2D-LUT处理模块和编码模块中的任意一者可以为单独设立的处理元件,也可以集成在视频处理装置中,例如集成在视频处理装置的某一个芯片中实现,此外,也可以以程序的形式存储于视频处理装置的存储器中,由视频处理装置的某一个处理元件调用并执行以上各个模块的功能。其它模块的实现与之类似。此外这些模块全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件可以是一种集成电路,具有信号的处理能力。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。It should be understood that the above division of each module of the video processing device is only a division of logical functions, and may be fully or partially integrated into one physical entity or physically separated during actual implementation. And these modules can all be implemented in the form of software called by the processing element; they can also be implemented in the form of hardware; some modules can also be implemented in the form of software called by the processing element, and some modules can be implemented in the form of hardware. For example, any one of the upgrade mode determination module, the video style determination module, the video acquisition module, the LOG processing module, the 2D-LUT processing module and the encoding module can be a separate processing element, or can be integrated in the video processing device, For example, it can be integrated into a certain chip of the video processing device. In addition, it can also be stored in the memory of the video processing device in the form of a program, and the functions of the above modules can be called and executed by a certain processing element of the video processing device. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, and can also be implemented independently. The processing element mentioned here may be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
例如,升格模式确定模块、视频风格确定模块、视频获取模块、LOG处理模块、2D-LUT处理模块和编码模块这些模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit,ASIC),或,一个或多个微处理器(digital singnal processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,FPGA)等。再如,当以上某个模块通过处理元件调度程序的形式实现时,该处理元件可以是通用处理器,例如中央处理器(Central Processing Unit,CPU)或其它可以调用程序的处理器。再如,这些模块可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。For example, the upgrade mode determination module, video style determination module, video acquisition module, LOG processing module, 2D-LUT processing module and encoding module can be one or more integrated circuits configured to implement the above method, for example: one or Multiple specific integrated circuits (Application Specific Integrated Circuit, ASIC), or, one or more microprocessors (digital signal processor, DSP), or, one or more Field Programmable Gate Arrays (Field Programmable Gate Array, FPGA) wait. For another example, when one of the above modules is implemented in the form of a processing element scheduler, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processors that can call programs. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
本申请实施例还提供一种视频处理装置,包括:处理器和存储器,存储器用于存储至少一条指令,指令由处理器加载并执行时以实现上述任意实施例中的视频处理方法。An embodiment of the present application further provides a video processing device, including: a processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the video processing method in any of the foregoing embodiments is implemented.
该视频处理装置可以应用上述的视频处理方法,具体过程和原理在此不再赘述。The video processing apparatus may apply the above-mentioned video processing method, and the specific process and principle will not be repeated here.
处理器的数量可以为一个或多个,处理器和存储器可以通过总线或者其他方式连接。存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂 态计算机可执行程序以及模块,如本申请实施例中的视频处理装置对应的程序指令/模块。处理器通过运行存储在存储器中的非暂态软件程序、指令以及模块,从而执行各种功能应用以及数据处理,即实现上述任意方法实施例中的方法。存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;以及必要数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。The number of processors may be one or more, and the processor and the memory may be connected through a bus or in other ways. As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, such as program instructions/modules corresponding to the video processing device in the embodiment of the present application. The processor executes various functional applications and data processing by running non-transitory software programs, instructions and modules stored in the memory, that is, implements the method in any of the above method embodiments. The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function; and necessary data and the like. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices.
如图1所示,本申请实施例还提供一种电子设备,包括:摄像头193和上述的视频处理装置,视频处理装置包括处理器110。As shown in FIG. 1 , an embodiment of the present application further provides an electronic device, including: a camera 193 and the above-mentioned video processing device, where the video processing device includes a processor 110 .
视频处理装置的具体原理和工作过程与上述实施例相同,在此不再赘述。该电子设备可以是例如手机、电视、平板电脑、手表、手环等任何具有视频拍摄功能的产品或部件。The specific principle and working process of the video processing device are the same as those of the above-mentioned embodiments, and will not be repeated here. The electronic device may be any product or component with a video shooting function such as a mobile phone, a TV, a tablet computer, a watch, a bracelet, and the like.
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述任意实施例中的视频处理方法。An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when running on a computer, the computer is made to execute the video processing method in any of the foregoing embodiments.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk).
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示单独存在A、同时存在A和B、单独存在B的情况。其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项”及其类似表达,是指的这些项中的任意组合,包括单项或复数项的任意组合。例如,a,b和c中的至少一项可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three kinds of relationships, for example, A and/or B may indicate that A exists alone, A and B exist simultaneously, or B exists alone. Among them, A and B can be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, and c may be single or multiple.
以上仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only preferred embodiments of the present application, and are not intended to limit the present application. For those skilled in the art, there may be various modifications and changes in the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application shall be included within the protection scope of this application.

Claims (9)

  1. 一种视频处理方法,其特征在于,包括:A video processing method, characterized in that, comprising:
    在多个升格模式中确定一个升格模式,所确定的升格模式对应一个捕获帧率和一个编码帧率,所述捕获帧率大于所述编码帧率;Determining a ramp-up mode among the plurality of ramp-up modes, the determined ramp-up mode corresponds to a capture frame rate and an encoding frame rate, and the capture frame rate is greater than the encoding frame rate;
    在所确定的升格模式的多个视频风格模板中确定一个视频风格模板,每个视频风格模板对应一个预设的二维颜色查找表2D-LUT;Determine a video style template among the plurality of video style templates in the determined upgrade mode, and each video style template corresponds to a preset two-dimensional color lookup table 2D-LUT;
    基于所确定的升格模式对应的捕获帧率获取通过摄像头拍摄的视频;Acquiring the video captured by the camera based on the determined capture frame rate corresponding to the upscaling mode;
    通过所述摄像头当前的感光度ISO所对应的对数LOG曲线对所述通过摄像头拍摄的视频进行处理,得到LOG视频;Process the video captured by the camera through a logarithmic LOG curve corresponding to the current sensitivity ISO of the camera to obtain a LOG video;
    基于所确定的视频风格模板对应的2D-LUT对所述LOG视频进行处理,得到与所确定的视频风格模板对应的视频;The LOG video is processed based on the 2D-LUT corresponding to the determined video style template to obtain a video corresponding to the determined video style template;
    基于所确定的升格模式对应的编码帧率将所述与所确定的视频风格模板对应的视频进行编码保存。The video corresponding to the determined video style template is encoded and saved based on the determined encoding frame rate corresponding to the upscaling mode.
  2. 根据权利要求1所述的视频处理方法,其特征在于,The video processing method according to claim 1, wherein,
    所述多个升格模式包括第一升格模式和第二升格模式,所述第一升格模式对应第一捕获帧率和第一编码帧率,所述第二升格模式对应第二捕获帧率和第二编码帧率,所述第一捕获帧率小于所述第二捕获帧率,所述第一编码帧率等于所述第二编码帧率,所述第二捕获帧率大于所述第二编码帧率。The multiple upscaling modes include a first upscaling mode and a second upscaling mode, the first upscaling mode corresponds to the first capture frame rate and the first encoding frame rate, and the second upsampling mode corresponds to the second capture frame rate and the second frame rate Two encoding frame rates, the first capture frame rate is less than the second capture frame rate, the first encoding frame rate is equal to the second encoding frame rate, and the second capture frame rate is greater than the second encoding frame rate frame rate.
  3. 根据权利要求2所述的视频处理方法,其特征在于,The video processing method according to claim 2, wherein,
    若所确定的升格模式为所述第一升格模式,则在所述通过所述摄像头当前的感光度ISO所对应的对数LOG曲线对所述通过摄像头拍摄的视频进行处理,得到LOG视频的过程之前,还包括:If the determined upscaling mode is the first upscaling mode, the process of processing the video captured by the camera on the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video Previously, also included:
    对所述通过摄像头拍摄的视频进行电子防抖处理;Perform electronic anti-shake processing on the video captured by the camera;
    若所确定的升格模式为所述第一升格模式,所述通过所述摄像头当前的感光度ISO所对应的对数LOG曲线对所述通过摄像头拍摄的视频进行处理,得到LOG视频的过程为:If the determined upgrading mode is the first upgrading mode, the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera is used to process the video captured by the camera, and the process of obtaining the LOG video is:
    通过所述摄像头当前的感光度ISO所对应的对数LOG曲线对进行电子防抖处理之后的视频进行处理,得到LOG视频。The video after the electronic anti-shake processing is processed through the logarithmic LOG curve corresponding to the current sensitivity ISO of the camera to obtain the LOG video.
  4. 根据权利要求3所述的视频处理方法,其特征在于,The video processing method according to claim 3, wherein,
    所述第一捕获帧率为60FPS,所述第二捕获帧率为120FPS,所述第一编码帧率和所述第二编码帧率为30FPS。The first capture frame rate is 60FPS, the second capture frame rate is 120FPS, and the first encoding frame rate and the second encoding frame rate are 30FPS.
  5. 根据权利要求1所述的视频处理方法,其特征在于,The video processing method according to claim 1, wherein,
    所述基于所确定的视频风格模板对应的二维2D-LUT对所述LOG视频进行处理,得到与所确定的视频风格模板对应的视频的过程在HSV色彩空间执行。The process of processing the LOG video based on the two-dimensional 2D-LUT corresponding to the determined video style template to obtain the video corresponding to the determined video style template is performed in the HSV color space.
  6. 根据权利要求1所述的视频处理方法,其特征在于,还包括:The video processing method according to claim 1, further comprising:
    所述基于所确定的升格模式对应的编码帧率将所述与所确定的视频风格模板对应的视频进行编码保存的过程包括:The process of encoding and saving the video corresponding to the determined video style template based on the determined encoding frame rate corresponding to the upscaling mode includes:
    将与所确定的视频风格模板对应的视频分流为两路,其中一路基于所确定的升格模式对应的编码帧率进行编码保存,另外一路进行预览。The video corresponding to the determined video style template is split into two streams, one of which is encoded and saved based on the encoding frame rate corresponding to the determined upscaling mode, and the other stream is previewed.
  7. 一种视频处理装置,其特征在于,包括:A video processing device, characterized in that it comprises:
    处理器和存储器,所述存储器用于存储至少一条指令,所述指令由所述处理器加载并执行时以实现如权利要求1至6中任意一项所述的视频处理方法。A processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the video processing method according to any one of claims 1 to 6 can be realized.
  8. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    摄像头;Camera;
    如权利要求7所述的视频处理装置。The video processing device as claimed in claim 7.
  9. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行如权利要求1至6中任意一项所述的视频处理方法。A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when it runs on a computer, the computer executes the video program according to any one of claims 1 to 6. Approach.
PCT/CN2022/094754 2021-08-12 2022-05-24 Video processing method and apparatus, electronic device, and storage medium WO2023016039A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110926817.1 2021-08-12
CN202110926817.1A CN113824913A (en) 2021-08-12 2021-08-12 Video processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2023016039A1 true WO2023016039A1 (en) 2023-02-16

Family

ID=78913138

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/094754 WO2023016039A1 (en) 2021-08-12 2022-05-24 Video processing method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (2) CN115242992B (en)
WO (1) WO2023016039A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478929A (en) * 2023-12-28 2024-01-30 昆明中经网络有限公司 Novel media exquisite image processing system based on AI large model

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242992B (en) * 2021-08-12 2023-08-18 荣耀终端有限公司 Video processing method, device, electronic equipment and storage medium
CN113810642B (en) * 2021-08-12 2023-02-28 荣耀终端有限公司 Video processing method and device, electronic equipment and storage medium
WO2023124165A1 (en) * 2021-12-31 2023-07-06 荣耀终端有限公司 Image processing method and related electronic device
CN114520874B (en) * 2022-01-28 2023-11-24 西安维沃软件技术有限公司 Video processing method and device and electronic equipment
WO2023173882A1 (en) * 2022-03-15 2023-09-21 荣耀终端有限公司 Method for generating logarithmic curve, and device and storage medium
CN114598834A (en) * 2022-05-10 2022-06-07 中国铁塔股份有限公司 Video processing method and device, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077828A (en) * 2014-11-25 2017-08-18 英特尔公司 Size to color lookup table is compressed
CN108616696A (en) * 2018-07-19 2018-10-02 北京微播视界科技有限公司 A kind of video capture method, apparatus, terminal device and storage medium
US20200007718A1 (en) * 2018-06-29 2020-01-02 Ati Technologies Ulc Method and apparatus for nonlinear interpolation color conversion using look up tables
CN111510698A (en) * 2020-04-23 2020-08-07 惠州Tcl移动通信有限公司 Image processing method, device, storage medium and mobile terminal
CN113824913A (en) * 2021-08-12 2021-12-21 荣耀终端有限公司 Video processing method and device, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015122734A (en) * 2013-11-25 2015-07-02 パナソニックIpマネジメント株式会社 Imaging apparatus and imaging method
KR102449872B1 (en) * 2015-12-18 2022-09-30 삼성전자주식회사 Photographing apparatus and method for controlling the same
CN108600646B (en) * 2018-07-25 2020-09-08 张维良 Control method for multi-image acquisition equipment movie and television shooting equipment
CN110636375B (en) * 2019-11-11 2022-03-11 RealMe重庆移动通信有限公司 Video stream processing method and device, terminal equipment and computer readable storage medium
CN113067994B (en) * 2021-03-31 2022-08-19 联想(北京)有限公司 Video recording method and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077828A (en) * 2014-11-25 2017-08-18 英特尔公司 Size to color lookup table is compressed
US20200007718A1 (en) * 2018-06-29 2020-01-02 Ati Technologies Ulc Method and apparatus for nonlinear interpolation color conversion using look up tables
CN108616696A (en) * 2018-07-19 2018-10-02 北京微播视界科技有限公司 A kind of video capture method, apparatus, terminal device and storage medium
CN111510698A (en) * 2020-04-23 2020-08-07 惠州Tcl移动通信有限公司 Image processing method, device, storage medium and mobile terminal
CN113824913A (en) * 2021-08-12 2021-12-21 荣耀终端有限公司 Video processing method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478929A (en) * 2023-12-28 2024-01-30 昆明中经网络有限公司 Novel media exquisite image processing system based on AI large model
CN117478929B (en) * 2023-12-28 2024-03-08 昆明中经网络有限公司 Novel media exquisite image processing system based on AI large model

Also Published As

Publication number Publication date
CN115242992B (en) 2023-08-18
CN113824913A (en) 2021-12-21
CN115242992A (en) 2022-10-25

Similar Documents

Publication Publication Date Title
WO2023016039A1 (en) Video processing method and apparatus, electronic device, and storage medium
WO2023016035A1 (en) Video processing method and apparatus, electronic device, and storage medium
WO2023016037A1 (en) Video processing method and apparatus, electronic device, and storage medium
WO2023160295A1 (en) Video processing method and apparatus
CN113824914B (en) Video processing method and device, electronic equipment and storage medium
US10600170B2 (en) Method and device for producing a digital image
CN114449199B (en) Video processing method and device, electronic equipment and storage medium
WO2023016040A1 (en) Video processing method and apparatus, electronic device, and storage medium
WO2023016044A1 (en) Video processing method and apparatus, electronic device, and storage medium
WO2023016038A1 (en) Video processing method and apparatus, electronic device, and storage medium
WO2023016042A1 (en) Video processing method and apparatus, electronic device, and storage medium
WO2023016043A1 (en) Video processing method and apparatus, electronic device, and storage medium
WO2023016041A1 (en) Video processing method and apparatus, electronic device, and storage medium
US20240137650A1 (en) Video Processing Method and Apparatus, Electronic Device, and Storage Medium
US20240129639A1 (en) Video processing method and apparatus, electronic device, and storage medium
CN115706853A (en) Video processing method and device, electronic equipment and storage medium
US20230215051A1 (en) Systems, apparatus, and methods for color space representation
TW202310622A (en) Flexible region of interest color processing for cameras

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: 22855025

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE