WO2023015997A1 - 视频编辑方法和视频编辑装置 - Google Patents

视频编辑方法和视频编辑装置 Download PDF

Info

Publication number
WO2023015997A1
WO2023015997A1 PCT/CN2022/092061 CN2022092061W WO2023015997A1 WO 2023015997 A1 WO2023015997 A1 WO 2023015997A1 CN 2022092061 W CN2022092061 W CN 2022092061W WO 2023015997 A1 WO2023015997 A1 WO 2023015997A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
videos
lut
sampling
sampling period
Prior art date
Application number
PCT/CN2022/092061
Other languages
English (en)
French (fr)
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 WO2023015997A1 publication Critical patent/WO2023015997A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47205End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for manipulating displayed content, e.g. interacting with MPEG-4 objects, editing locally
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals

Definitions

  • the present application relates to the field of multimedia technology, and more specifically, to a video editing method and a video editing device.
  • the user can obtain a video file in the standard format of the recorder (Rec) 709 after shooting a video with the mobile phone, and the user can manually select a LUT for the video from the list at the bottom of the gallery editing interface element.
  • Rec recorder
  • the present application provides a video editing method and a video editing device, which are beneficial to improving the intelligent optimization effect of LUT.
  • a video editing method including: obtaining a Log file of a target video. Based on the Log file, the target video is segmented to obtain multiple sub-videos. Determine picture attributes of multiple sub-videos, where the picture attributes include scene attributes and/or color attributes.
  • the LUTs of the multiple sub-videos are determined according to the picture attributes of the multiple sub-videos and a preset mapping relationship, and the mapping relationship is used to represent the correspondence between the multiple picture attributes and the multiple LUT elements.
  • the target video is rendered based on the LUTs of the plurality of sub-videos.
  • the video recommendation device may divide the target video into multiple sub-videos, and recommend an appropriate LUT for each sub-video, which is beneficial to improve the effect of LUT on video optimization.
  • the target video is segmented to obtain multiple sub-videos, including: sampling the Log file according to at least one sampling period, and determining at least one sampling period A plurality of sampling frames in each sampling period, the plurality of sampling frames are used for image frames obtained by sampling the target video according to the sampling period. Based on a plurality of sampling frames in each sampling period, mark candidate segmentation symbols for the target video in each sampling period. Based on the candidate segmentation symbols of the target video in each sampling period, the segmentation symbols of the target video are determined, and the segmentation symbols divide the target video into multiple sub-videos.
  • the video recommendation device can sample the target video at sampling periods with different precisions, so that the finally divided sub-videos can be better adapted to different LUTs.
  • the Log file is sampled according to at least one sampling period, and determining multiple sampling frames for each sampling period in at least one sampling period includes: according to at least one sampling period
  • the Log file is sampled in the first sampling period in to determine a plurality of first sampling frames.
  • a degree of difference between two adjacent first sampling frames among the plurality of first sampling frames is calculated.
  • the candidate segment symbols are marked between two adjacent first sampling frames whose degree of difference is greater than or equal to a first threshold.
  • the Log file is sampled according to at least one sampling period, and determining multiple sampling frames for each sampling period in at least one sampling period includes: according to at least one sampling period
  • the first sampling period in is to sample the Log file to determine multiple first frames and multiple last frames. Calculate the degree of difference between two adjacent first frames and last frames among the plurality of first frames and the plurality of last frames.
  • the candidate segment symbols are marked in the time period when the degree of difference between two adjacent first and last frames is greater than or equal to the first threshold.
  • determining the segment symbol of the target video based on the candidate segment symbol of the target video in each sampling period includes: according to each of the at least one sampling period The sampling period determines a plurality of candidate segment symbols, and determines the overlapping candidate segment symbols among the plurality of candidate segment symbols as the segment symbol of the target video.
  • At least one sampling period includes three sampling periods, which are respectively a first sampling period of 1 s, a second sampling period of 100 ms, and a third sampling period of 10 ms.
  • the light sensitivity levels of the multiple sub-videos are determined according to the color attributes of the multiple sub-videos.
  • determining the LUT of the multiple sub-videos includes: selecting scenes from the mapping relationship with the multiple sub-videos according to the scene attributes and/or light perception levels of the multiple sub-videos The LUT corresponding to the attribute and/or light sensitivity level.
  • the electronic device can recommend a suitable style of LUT for each sub-video according to the preset mapping relationship between the scene attribute and the light sensitivity level and the recommended LUT, which is more intelligent and can exert the optimization effect of the LUT.
  • the first aspect after determining the LUTs of the multiple sub-videos, determine the color difference results of the LUTs of two adjacent sub-videos in the multiple sub-videos according to the LUTs of the multiple sub-videos. If there is a LUT whose color difference result is greater than or equal to the second threshold, adjust the LUT of at least one sub-video in the two adjacent sub-videos.
  • Rendering the target video based on the LUTs of the multiple sub-videos includes: rendering the target video based on the adjusted LUT, where the adjusted LUT belongs to the same candidate LUT set as the pre-adjusted LUT.
  • determining the color difference results of the LUTs of two adjacent sub-videos in the multiple sub-videos includes: The brightness, exposure, light source intensity, black-highlight ratio and contrast of the LUT of a sub-video determine the color difference result of the LUTs of two adjacent sub-videos in multiple sub-videos.
  • a video editing device including: configured to execute the method in any possible implementation manner of the foregoing first aspect.
  • the apparatus includes a module configured to execute the method in any possible implementation manner of the foregoing first aspect.
  • another video editing device including a processor, the processor is coupled to a memory, and can be used to execute instructions in the memory, so as to implement the method in any possible implementation manner of any of the foregoing aspects.
  • the device further includes a memory.
  • the device further includes a communication interface, and the processor is coupled to the communication interface.
  • the video editing apparatus is an electronic device.
  • the communication interface may be a transceiver, or an input/output interface.
  • the video editing device is a chip configured in electronic equipment.
  • the communication interface may be an input/output interface.
  • a processor including: an input circuit, an output circuit, and a processing circuit.
  • the processing circuit is configured to receive a signal through the input circuit and transmit a signal through the output circuit, so that the processor executes the method in any possible implementation manner of the first aspect above.
  • the above-mentioned processor can be a chip
  • the input circuit can be an input pin
  • the output circuit can be an output pin
  • the processing circuit can be a transistor, a gate circuit, a flip-flop, and various logic circuits.
  • the input signal received by the input circuit may be received and input by, for example but not limited to, the receiver
  • the output signal of the output circuit may be, for example but not limited to, output to the transmitter and transmitted by the transmitter
  • the circuit may be the same circuit, which is used as an input circuit and an output circuit respectively at different times.
  • the embodiment of the present application does not limit the specific implementation manners of the processor and various circuits.
  • a processing device including a processor and a memory.
  • the processor is used to read instructions stored in the memory, and may receive signals through the receiver and transmit signals through the transmitter, so as to execute the method in any possible implementation manner of the first aspect above.
  • processors there are one or more processors, and one or more memories.
  • the memory may be integrated with the processor, or the memory may be separated from the processor.
  • the memory can be a non-transitory (non-transitory) memory, such as a read-only memory (read only memory, ROM), which can be integrated with the processor on the same chip, or can be respectively arranged in different On the chip, the embodiment of the present application does not limit the type of the memory and the configuration of the memory and the processor.
  • a non-transitory memory such as a read-only memory (read only memory, ROM)
  • ROM read only memory
  • a related data interaction process such as sending indication information may be a process of outputting indication information from a processor
  • receiving capability information may be a process of receiving input capability information from a processor.
  • processed output data may be output to the transmitter, and input data received by the processor may be from the receiver.
  • the transmitter and the receiver may be collectively referred to as a transceiver.
  • the processing device in the above-mentioned fifth aspect may be a chip, and the processor may be implemented by hardware or by software.
  • the processor may be a logic circuit, an integrated circuit, etc.;
  • the processor may be a general-purpose processor, which is realized by reading the software code stored in the memory, and the memory may be integrated in the processor, or it may be located outside the processor and exist independently.
  • a computer program product includes: a computer program (also referred to as code, or instruction), which, when the computer program is run, causes the computer to perform any one of the possible implementations in the first aspect above. methods in methods.
  • a computer program also referred to as code, or instruction
  • a computer-readable storage medium stores a computer program (also referred to as code, or an instruction) which, when run on a computer, enables the computer to execute the above-mentioned first aspect.
  • a computer program also referred to as code, or an instruction
  • Figure 1 is a schematic diagram of a different LUT style
  • FIG. 2 is a schematic structural diagram of an electronic device applicable to an embodiment of the present application
  • Fig. 3 is a schematic flowchart of a video editing method provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a divided video provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of another divided video provided by the embodiment of the present application.
  • FIG. 6 is a schematic diagram of a video editing interface provided by an embodiment of the present application.
  • Fig. 7 is a schematic flowchart of another video editing method provided by the embodiment of the present application.
  • FIG. 8 is a schematic diagram of an interface for recording a video provided by an embodiment of the present application.
  • FIG. 9 is a software structure diagram of an electronic device provided by an embodiment of the present application.
  • Fig. 10 is a schematic flowchart of another video editing method provided by the embodiment of the present application.
  • Fig. 11 is a schematic block diagram of a video editing device provided by an embodiment of the present application.
  • Fig. 12 is a schematic block diagram of another video editing device provided by the embodiment of the present application.
  • Fig. 13 is a schematic block diagram of another video editing device provided by an embodiment of the present application.
  • LUT is a color conversion template similar to filters. For example, it can be a red, blue, green (red green blue, RGB) mapping table. LUT can transform the actual sampled pixel gray value into another corresponding gray value after a certain transformation (such as threshold, inversion, contrast adjustment and linear transformation, etc.), which can highlight the image. Useful information, the effect of enhancing the light contrast of an image.
  • An image consists of many pixels, and each pixel is represented by an RGB value.
  • the display screen of the electronic device can display the image according to the RGB value of each pixel in the image. In other words, these RGB values instruct the display how to emit light, so as to mix a variety of colors to present to the user.
  • the LUT is a RGB mapping table, which is used to represent the corresponding relationship between RGB values before and after adjustment.
  • Table 1 shows an example of a LUT.
  • the output RGB value is (6, 9, 4) through the mapping of the LUT shown in Table 1.
  • the output RGB value is (66, 17, 47) through the mapping of the LUT shown in Table 1.
  • the output RGB value is (117, 82, 187) after the mapping of the LUT shown in Table 1.
  • the output RGB value is (255, 247, 243) after being mapped by the LUT shown in Table 1.
  • FIG. 1 is a schematic diagram of a style of different LUTs, showing the processing results of the original image 100 under three different color look-up tables of LUT 1, LUT 2 and LUT 3.
  • the original image 100 collected by the camera is processed by using LUT 1, and the image 101 shown in FIG. 1 can be obtained.
  • the image 102 shown in FIG. 1 can be obtained.
  • the image 103 shown in FIG. 1 can be obtained. Comparing the image 101, the image 102, and the image 103 shown in FIG. 1 shows that the image 101, the image 102, and the image 103 have different image effects or styles.
  • the user After shooting the video, the user enters the gallery editing page, and can manually select a LUT element for the video file. For non-professional users, confusion may arise during the selection process, and a LUT element that is not suitable for the video content is selected. In addition, a video may contain multiple angles and scenes. If the same LUT element is used for the entire video, some paragraphs may not match the LUT style, which is not conducive to the optimization of the video by the LUT.
  • embodiments of the present application provide a video editing method and a video editing device. Based on the original Log video file and combined with the actual shooting scene, the whole video can be divided into multiple sub-videos, and a LUT element can be intelligently recommended for each sub-video, which is conducive to improving the intelligent optimization effect of the LUT on the video.
  • each term and English abbreviation such as picture attribute, scene attribute, color attribute, sampling frame, etc.
  • picture attribute, scene attribute, color attribute, sampling frame, etc. are all illustrative examples given for convenience of description, and should not constitute a Any restrictions. This application does not exclude the possibility of defining other terms that can achieve the same or similar functions in existing or future agreements.
  • 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 types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the contextual objects are an “or” relationship.
  • “At least one of the following” or similar expressions refer to any combination of these items, including any combination of single or plural items.
  • At least one (one) of a, b and c may represent: a, or b, or c, or a and b, or a and c, or b and c, or a, b and c, wherein a, b, c can be single or multiple.
  • FIG. 2 is a schematic structural diagram of an electronic device applicable to an embodiment of the present application.
  • the electronic device 200 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, Battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor 180, button 190, motor 191, indicator 192, camera 193, a display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the structure shown in this embodiment does not constitute a specific limitation on the electronic device 200 .
  • the electronic device 200 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 implemented 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 an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, display processing unit (display process unit, DPU), and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • the electronic device 200 may also include one or more processors 110 . Wherein, the processor may be the nerve center and command center of the electronic device 200 .
  • the processor can generate an operation control signal according to the instruction opcode and the 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 memory in processor 110 is a cache memory.
  • the memory may hold instructions or data used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the electronic device 200.
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or USB interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB interface etc.
  • the USB interface 130 is an interface conforming to the USB standard specification, specifically, it may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 200 , and can also be used to transmit data between the electronic device 200 and peripheral devices. It can also be used to connect headphones and play audio through them.
  • the interface connection relationship between the modules shown in the embodiment of the present application is a schematic description, and does not constitute a structural limitation of the electronic device 200 .
  • the electronic device 200 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 can receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 200 . While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device 200 through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be disposed in the processor 110 .
  • the power management module 141 and the charging management module 140 can also be set in the same device.
  • the wireless communication function of the electronic device 200 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 200 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 200 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless local area network (wireless local area networks, WLAN), Bluetooth, global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), NFC, Solutions for wireless communication such as infrared technology (infrared, IR).
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device 200 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include GSM, GPRS, CDMA, WCDMA, TD-SCDMA, LTE, GNSS, WLAN, NFC, FM, and/or IR technology and the like.
  • the above-mentioned GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou satellite navigation system (bei dou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • global positioning system global positioning system, GPS
  • global navigation satellite system global navigation satellite system
  • GLONASS global navigation satellite system
  • Beidou satellite navigation system bei dou navigation satellite system, BDS
  • quasi-zenith satellite system quadsi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • SBAS satellite based augmentation systems
  • the electronic device 200 can implement a display function through the GPU, the display screen 194 and the application processor.
  • Application processors may include NPUs and/or DPUs.
  • 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 instructions to generate or alter display information.
  • the NPU is a neural-network (NN) computing processor. By referring to the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and continuously learn by itself. Applications such as intelligent cognition of the electronic device 200 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • DPU is also called display sub-system (display sub-system, DSS), and DPU is used for adjusting the color of display screen 194, and DPU can adjust the color of display screen through color three-dimensional lookup table (3D look up table, 3D LUT). Adjustment. DPU can also perform image scaling, noise reduction, contrast enhancement, backlight brightness management, hdr processing, display parameter Gamma adjustment and other processing.
  • the display screen 194 is used to display images, videos and the like.
  • the display screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (liquid crystal display, LCD), organic light-emitting diode (organic light-emitting diode, OLED), active-matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light emitting diode (AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed or quantum dot light emitting diodes (quantum dot light emitting diodes, QLED).
  • the electronic device 200 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the electronic device 200 can realize the shooting function through ISP, one or more cameras 193 , video codec, GPU, one or more display screens 194 and application processors.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, save data files such as music, photos, videos, etc. in the external memory card.
  • the internal memory 121 may be used to store one or more computer programs including instructions.
  • the processor 110 may execute the above-mentioned instructions stored in the internal memory 121 to make the electronic device 200 execute various functional applications and data processing.
  • the internal memory 121 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system; the stored program area can also store one or more application programs (such as a gallery, contacts, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 200 (such as photos, contacts, etc.) and the like.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the processor 110 can cause the electronic device 200 to execute various functional applications and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in the memory provided in the processor 110 .
  • the internal memory 121 is used to store the LUT set, the preset mapping relationship, and the preset LUT color difference information in the embodiment of the present application.
  • the LUT set includes all LUT elements supported by the electronic device 200, and the LUT elements may also be called LUT templates.
  • the preset mapping relationship is used to represent the corresponding relationship between multiple picture attributes and multiple LUT elements, which may be shown in Table 2 below.
  • the preset LUT color difference information includes the color difference between every two LUT elements.
  • the LUT color difference information may be embodied in the form of a color difference table.
  • the electronic device 200 may implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used for converting digital audio information into analog audio signal output, and is also used for converting analog audio input into digital audio signal.
  • the audio module 170 may also be used to encode and decode audio signals.
  • the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
  • Speaker 170A also referred to as a "horn", is used to convert audio electrical signals into sound signals.
  • Electronic device 200 can listen to music through speaker 170A, or listen to hands-free calls.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 200 receives a call or a voice message, the receiver 170B can be placed close to the human ear to receive the voice.
  • the microphone 170C also called “microphone” or “microphone”, is used to convert sound signals into electrical signals.
  • the user can put his mouth close to the microphone 170C to make a sound, and input the sound signal to the microphone 170C.
  • the electronic device 200 may be provided with at least one microphone 170C.
  • the electronic device 200 may be provided with two microphones 170C, which may also implement a noise reduction function in addition to collecting sound signals. In some other embodiments, the electronic device 200 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions, etc.
  • the earphone interface 170D is used for connecting wired earphones.
  • the earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the sensors 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and an ambient light sensor 180L , bone conduction sensor 180M and so on.
  • the pressure sensor 180A is used for sensing pressure signals, and can convert the pressure signals into electrical signals.
  • pressure sensor 180A may be disposed on display screen 194 .
  • pressure sensors 180A such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors.
  • a capacitive pressure sensor may be comprised of at least two parallel plates with conductive material.
  • the electronic device 200 determines the intensity of pressure according to the change in capacitance.
  • the electronic device 200 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 200 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view short messages is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
  • the gyro sensor 180B can be used to determine the motion posture of the electronic device 200 .
  • the angular velocity of the electronic device 200 around three axes may be determined by the gyro sensor 180B.
  • the gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shaking angle of the electronic device 200, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the electronic device 200 through reverse movement to achieve anti-shake.
  • the gyroscope sensor 180B can also be used for navigation, somatosensory game scenes and so on.
  • the acceleration sensor 180E can detect the acceleration of the electronic device 200 in various directions (generally three axes). When the electronic device 200 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the distance sensor 180F is used to measure the distance.
  • the electronic device 200 may measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 200 may use the distance sensor 180F for distance measurement to achieve fast focusing.
  • the keys 190 include a power key, a volume key and the like.
  • the key 190 can be a mechanical key or a touch key.
  • the electronic device 200 may receive key input and generate key signal input related to user settings and function control of the electronic device 200 .
  • the motor 191 may be a rotor motor and/or a linear motor, such as an X-axis linear motor or a Z-axis linear motor. At least one motor 191 may be included in the electronic device.
  • the SIM card interface 195 is used for connecting a SIM card.
  • the SIM card can be connected and separated from the electronic device 200 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the electronic device 200 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of multiple cards may be the same or different.
  • the SIM card interface 195 is also compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 200 interacts with the network through the SIM card to implement functions such as calling and data communication.
  • the electronic device 200 adopts an eSIM, that is, an embedded SIM card, and the eSIM card may be embedded in the electronic device 200 .
  • Fig. 3 is a schematic flowchart of a video editing method 300 provided by an embodiment of the present application.
  • the steps of the video editing method 300 can be executed by the electronic device 200, and the electronic device 200 has the function of intelligently segmenting the video and recommending an appropriate LUT for each sub-video.
  • Method 300 includes the following steps:
  • S303 Determine picture attributes of multiple sub-videos, where the picture attributes include scene attributes and/or color attributes.
  • S304 Determine the LUTs of the multiple sub-videos according to the picture attributes of the multiple sub-videos and a preset mapping relationship, where the mapping relationship is used to represent the correspondence between the multiple picture attributes and the multiple LUT elements.
  • the Electronic equipment can be edited based on the original Log file of the target video.
  • the original Log file is a grayscale image with a high color gamut range. Different filters can be added to the Log file to achieve different effects. Therefore, the original Log file is used as the Original film editing video can bring more room for optimization.
  • the embodiment of the present application can intelligently segment the target video, determine multiple sub-videos, and recommend a suitable style of LUT element for each sub-video, so that the LUT filter can optimize the video better.
  • the electronic device 200 has a preset LUT set, and has a corresponding candidate LUT set for each picture attribute.
  • S302 includes: sampling the Log file according to at least one sampling period, and determining a plurality of sampling frames in each sampling period in the at least one sampling period, where the plurality of sampling frames represent the multiple of the target video paragraphs. Based on a plurality of sampling frames in each sampling period, mark candidate segmentation symbols for the target video in each sampling period. Based on the candidate segmentation symbols of the target video in each sampling period, the segmentation symbols of the target video are determined, and the segmentation symbols divide the target video into multiple sub-videos.
  • FIG. 4 is a schematic diagram of dividing a video provided by an embodiment of the present application.
  • the electronic device first samples the target video according to the first sampling period to obtain a plurality of first sampling frames. Afterwards, the electronic device may calculate the degree of difference between every two adjacent sampling frames in the plurality of first sampling frames. If the calculated degree of difference is greater than or equal to the first threshold, the electronic device considers that two adjacent sampling frames are different paragraphs, and marks candidate segmentation symbols between these two adjacent sampling frames (as shown in Figure 4 Candidate segment symbols in 1 are shown). If the calculated difference degree is smaller than the first threshold, the electronic device considers that two adjacent sampling frames are the same paragraph, and does not mark candidate segmentation symbols between the two adjacent sampling frames.
  • the first sampling period may be 1s or 100 frames, and the first threshold may be 20%.
  • the electronic device may continue to mark candidate segment symbols for the target video according to the second sampling period and the third sampling period (as shown by candidate segment symbol 2 and candidate segment symbol 3 in FIG. 4 ). It can be seen from Figure 4 that there may be overlapping candidate segment symbols under different precision sampling periods, and the electronic device can obtain the overlapping candidate segment symbols at different precisions according to the length of the target video as the segment symbols of the target video, each The left and right sides of the segment symbol are different sub-paragraphs, thus completing the operation of dividing multiple sub-paragraphs.
  • the second sampling period may be 100 ms or 20 frames
  • the third sampling period may be 10 ms or 10 frames.
  • FIG. 5 is a schematic diagram of another video division provided by an embodiment of the present application. Taking the first sampling period as 1s, the second sampling period as 100ms, and the third sampling period as 10ms as an example, the electronic device can sample video images at the beginning and end of each sampling period to obtain the first frame and the last frame . Legend 1 in Figure 5 indicates the time period corresponding to the first sampling period when the difference between the first frame and the last frame exceeds 20%, that is, 1s, that is, the electronic device believes that the video picture has changed within this 1s sampling time .
  • legend 2 indicates the time period corresponding to the second sampling period when the difference between the first frame and the last frame exceeds 20%, that is, 100 ms, that is, the electronic device believes that the video picture changes within the 100 ms sampling time.
  • Legend 3 shows the time period corresponding to the third sampling period when the difference between the first frame and the last frame exceeds 20%, that is, 10 ms, that is, the electronic device believes that the video picture changes within the 10 ms sampling time.
  • the time period in which the sampling periods represented by the three legends overlap means that the change of the video picture can be recognized under the sampling period of these three precisions, so the electronic device can mark the final segmentation symbol in the overlapping time period.
  • four sub-videos can be divided finally, that is, sub-video 1 , sub-video 2 , sub-video 3 and sub-video 4 in the figure.
  • FIG. 4 and FIG. 5 use three sampling periods with different precisions as an example to introduce the division of sub-segments, and the electronic device may continue to increase the sampling precision to mark candidate segment symbols for the target video.
  • a low-accuracy sampling period it is possible to divide the same shot scene into different sub-videos, which may eventually lead to different styles of LUTs being recommended for the same scene, affecting the overall uniform style of the video. Therefore, a higher-precision sampling period is required to divide the target video into sub-videos that can adapt to different LUTs.
  • the target video may be divided into too fragmented and too many sub-videos. Therefore, dividing multiple sub-videos with sampling periods of different precision can effectively avoid the problems of inaccurate and over-division of paragraphs.
  • the electronic device can identify the picture attributes of each sub-video, where the picture attributes include scene attributes and color attributes.
  • CV computer vision
  • electronic devices can rely on the underlying computer vision (CV) algorithm to identify the scene attributes of a single frame, including hundreds of specific scene attributes such as people, cities, oceans, nights, food, vehicles, flowers, and blue sky. Scenes.
  • the CV algorithm can sample and analyze several frames to confirm the scene properties.
  • electronic devices can also rely on the CV algorithm to analyze the color attributes of a single frame, including dimensions such as brightness, exposure, light source intensity, black-highlight ratio, etc., and determine the light sensitivity level of the single frame through calculation.
  • Sensitivity levels include: high-key, mid-tone, low-key, brighter, exposure, less light source, balance, undershoot, etc. Table 2 shows the correspondence between color attributes and light sensitivity levels.
  • the electronic device may sample the first sub-video based on the CV algorithm. For example, the length of sampling the first sub-video is 5s, and 100 frames of images may be evenly sampled at a fixed period. Then analyze the scene properties in these 100 frames. For example, the analysis finds that among the 100 frames of pictures, 80 frames are the scene attribute of the city, 10 frames are the scene attribute of the ocean, and 10 frames are the scene attribute of the food, so the electronic device can determine the scene of the first sub-video The attribute is city. The process of determining the picture attributes of other sub-videos is similar to that of the first sub-video, and will not be repeated here.
  • the electronic device can determine the color attributes of these 100 frames based on the CV algorithm, and calculate the light sensitivity level corresponding to each frame according to the color attributes, and finally count the different For the number of frames under the light sensitivity level, the light sensitivity level with the largest proportion of frames is determined as the light sensitivity level of the first sub-video.
  • the process of determining the light sensitivity levels of other sub-videos is similar to that of the first sub-video, and will not be repeated here.
  • the electronic device may select a LUT corresponding to the scene attributes and light sensitivity levels of the multiple sub-videos according to a preset mapping relationship.
  • S304 can specifically include: The mapping relationship between levels and presets determines the LUT of multiple sub-videos.
  • the video is an indoor character scene, and it is suitable to use a LUT with a large aperture blur effect to highlight the details of the characters. If the light in the video is more prominent and brighter, a LUT with high saturation is preferred, for example "Portrait close-up" LUT. If the light in the video is dim and there are few light sources in the picture, the "70s" LUT that can render the sense of age is recommended first.
  • the video is an outdoor natural scenery scene
  • the light in the video is soft and the color is balanced
  • the video is a city vista, and a modern "cyberpunk" LUT is recommended for the night scene against the backdrop of neon lights.
  • Table 3 shows the corresponding relationship between some scene attributes, light sensitivity level and recommended LUT.
  • the electronic device has a preset set of candidate LUTs.
  • the recommended LUTs in Table 2 above are LUT elements in the candidate LUT set.
  • LUT 1 is the LUT set for [portrait, high-key (brighter) ] with the highest priority of the picture attribute, that is, the LUT with the highest matching degree with the picture attribute of [portrait, high-key (brighter)]
  • the electronic device gives priority to recommending LUT 1 for the sub-video corresponding to the picture attribute.
  • the method 300 method further includes: according to the LUTs of the multiple sub-videos, determining the color difference results of the LUTs of two adjacent sub-videos in the multiple sub-videos; For the LUT whose difference result is greater than or equal to the second threshold, adjust the LUT of at least one sub-video in two adjacent sub-videos; S305 includes: editing the target video based on the adjusted LUT, the adjusted LUT and the pre-adjusted LUT belong to the same A set of candidate LUTs.
  • the overall style may not be uniform.
  • a highly saturated, high-contrast LUT for the first half of a video e.g., a city night scene
  • a softer, more natural LUT for the second half e.g., a close-up portrait
  • a nostalgic second half Thick black and white LUT so the style of the whole film is weird.
  • the electronic device can adjust the LUT of at least one sub-video in two adjacent sub-videos according to the preset LUT color difference information, which is conducive to a more unified overall film style and better visual effects.
  • each LUT has its own color attribute, and the color attribute includes at least one of brightness, exposure, light source intensity, black-to-highlight ratio, or contrast. What is compared here is the color difference value of the two LUTs themselves, not the color difference value of the two sub-videos after adding the LUT, nor the color difference value of the two sub-videos themselves.
  • the LUT color difference information includes a color difference result between each two kinds of LUTs. Taking two LUT elements in the LUT set supported by the electronic device as an example, they are marked as LUT 1 and LUT 2 .
  • the brightness of LUT 1 is ⁇ 1
  • the exposure is ⁇ 1
  • the light source intensity is ⁇ 1
  • the black-to-highlight ratio is ⁇ 1
  • the contrast is ⁇ 1
  • the brightness of LUT 2 is ⁇ 2
  • the exposure is ⁇ 2
  • the light source intensity is ⁇ 2
  • the black-to-highlight ratio is ⁇ 2
  • the contrast is ⁇ 2 .
  • the color difference result ⁇ between LUT 1 and LUT 2 can be expressed by the following formula:
  • ( ⁇ 1 - ⁇ 2 ) 2 +( ⁇ 1 - ⁇ 2 ) 2 +( ⁇ 1 - ⁇ 2 ) 2 +( ⁇ 1 - ⁇ 2 ) 2 +( ⁇ 1 - ⁇ 2 ) 2
  • the electronic device believes that the style of the two recommended LUTs is not suitable for adjacent splicing.
  • the two adjacent sub-videos can be Adjust the LUT for at least one of the sub-videos.
  • the electronic device may select one of the candidate LUTs of the sub-video that needs to be adjusted as the recommended LUT.
  • the adjusted LUT is the priority of the picture attribute of the current sub-video in the candidate LUT set of the sub-video Highest LUT.
  • the electronic device may preset the priority of the LUT elements corresponding to each picture attribute, and the electronic device recommends LUTs for each picture attribute in order of priority.
  • the electronic device After adjusting the LUT of at least one sub-video in two adjacent sub-videos, the electronic device still needs to judge the style consistency of the overall film. If the overall style is not uniform, continue to adjust the LUT until the overall film is finished. The style of the film reaches a state of balance.
  • Fig. 6 is a schematic diagram of a video editing interface provided by an embodiment of the present application.
  • Figure 6 includes three interfaces, interface a, interface b and interface c.
  • the user can click the "Gallery" icon on interface a to enter the video editing interface shown in interface b.
  • interface b the user can select one of the multiple Log video files saved in the gallery as the target video for Log editing.
  • the user selects video 3 as the target video, so the complete target video can be displayed and played in the video display area 601 .
  • the electronic device may display the Log segment recommendation interface as shown in interface c.
  • Interface c includes a viewing area 602 , a multi-segment sub-video display area 603 and a LUT element display area 604 .
  • the length of the target video is 8s
  • the electronic device divides the target video into 4 sub-videos as shown in the multi-segment sub-video display area 603, and the length of each sub-video is 2s.
  • the LUT element display area 604 displays LUT elements including "mist”, "modern”, “youth”, and "milk tea” (you can also slide the LUT element display area left and right to display more LUT elements, which are not fully displayed here).
  • the electronic device can add a recommended LUT element to the current sub-video on interface c, and display the video after LUT processing in the viewing area 602, and the user can view it in the viewing area 602 Check out the target video after adding the LUT.
  • the electronic device may recommend a "youth" style LUT element for the second sub-video, and display it in the viewing area 602 .
  • the currently recommended LUT in the LUT element display area 604 will also change. For example, when the user switches to sub-video 2, the currently recommended LUT in the LUT element display area 604 is "Youth" style, and when the user slides to switch to sub-video 3, the currently recommended LUT may change to "Modern” style.
  • FIG. 7 is a schematic flow chart of another video editing method 700 provided in the embodiment of the present application.
  • the method 700 includes:
  • the electronic device In response to a first operation in which a user clicks a "gallery” icon, the electronic device displays a video editing interface.
  • the electronic device may receive an instruction from the user to click the "Gallery" icon in interface a, and in response to the instruction, the electronic device may display a video editing interface as shown in interface b in FIG. 6 .
  • Interface b has been described above, and will not be repeated here.
  • the electronic device In response to the user's second operation of clicking the "Log editing" option in the video editing interface, the electronic device displays a Log segment recommendation interface.
  • the electronic device can receive an instruction from the user to click the "Log Edit” option on the interface b in Figure 6, and in response to the instruction, the electronic device can display the Log segment recommendation interface as shown in the interface c in Figure 6 .
  • Interface c has been described above, and will not be repeated here.
  • the electronic device may divide the target video according to the sampling periods with different precisions described above to obtain multiple sub-videos with different picture attributes.
  • the electronic device can display the returned multi-segment sub-videos in the multi-segment sub-video display area 603 as shown in interface c in FIG. Snippets video.
  • the electronic device can select a suitable style LUT element for each sub-video from the candidate LUT set of each sub-video as the recommended LUT according to the picture attribute of each sub-video and the preset LUT mapping relationship.
  • the LUT recommended by the electronic device for each sub-video is a LUT with a consistent style as a whole after the style consistency detection.
  • the electronic device may display the returned multi-segment sub-videos after adding the LUT in the viewing area 602 as shown in interface c in FIG. 6 .
  • the electronic device After the above-mentioned electronic device completes recommending the LUT for each sub-video, it will determine whether to adjust the LUT for the sub-video according to the style consistency check, which is conducive to the unification of the video style.
  • users can also change the LUT by themselves, and adjust the LUT to the user's favorite style, which can meet the individual needs of different users.
  • the method 300 may include: the user may record the target video through the electronic device 200 .
  • FIG. 8 is a schematic diagram of an interface for recording a video provided by an embodiment of the present application.
  • Figure 8 includes three interfaces, interface a, interface b and interface c.
  • the mobile phone in response to the user's operation of clicking the "camera" icon 60 on interface a, the mobile phone displays a video recording interface as shown in interface b.
  • interface b includes a recording area 801 , a mode area 802 and a control area 803 .
  • the user can slide left and right in the mode area 802 to select a recording mode.
  • the function of recording video by the mobile phone can be realized by using the video recording mode of the mobile phone camera.
  • the function of the mobile phone to record video can be realized by using the professional mode of the mobile phone camera.
  • the function of recording video by the mobile phone can be realized by using the movie mode of the mobile phone camera.
  • the current b interface displays the video recording interface in professional mode.
  • the control area 803 includes a Log control 804 for activating the Log function and a LUT control 805 for activating the LUT function. Since the video image captured by the Log function can save the light and color at the time of shooting to the greatest extent, it is convenient for subsequent processing of the video image. optimization, and the color of the video image shot by using the LUT function has been processed, and the color is rich, so the Log control 804 and the LUT control 805 in the interface b cannot be turned on at the same time. That is to say, in the professional mode of the mobile phone camera, the Log function and the LUT function cannot run at the same time. It should be noted that, the Log control 804 shown in interface b in FIG. 6 is in the on state, and the LUT control 805 is in the off state.
  • the mobile phone In response to the user's operation of clicking the "record” button 61, the mobile phone displays an interface c, and starts to enable the Log function to record the target video in the professional mode.
  • FIG. 9 is a software structure diagram of an electronic device provided by an embodiment of the present application. It is understandable that a layered architecture divides the software into several layers, each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system may include an application layer (application, APP), a framework layer (framework, FWK), a hardware abstraction layer (hardware abstraction layer, HAL) and a kernel layer (kernel).
  • the handset also includes hardware (eg, a display screen).
  • the above application layer may include a user interface (user interface, UI) layer and a logic layer.
  • the UI layer includes camera, gallery and other applications.
  • the camera includes a Log control (such as the Log control 804 in the above embodiment) and a LUT control (such as the LUT control 805 in the above embodiment).
  • the logical layer includes LUT template module, encoding module, LUT control module, AI segmentation module, AI recommendation module and playback module, etc.
  • the above-mentioned hardware abstraction layer is an interface layer between the kernel layer and the hardware, and can be used to abstract the hardware.
  • the hardware abstraction layer includes a camera interface.
  • the above-mentioned kernel layer provides underlying drivers for various hardware of the mobile phone.
  • the kernel layer includes a camera driver module.
  • the framework layer above provides an application programming interface (application programming interface, API) and programming services for applications in the application layer.
  • the framework layer includes some predefined functions.
  • the framework layer provides programming services to the application layer through the API interface.
  • the programming service may be, for example, a camera service (camera service).
  • the framework layer includes a camera service framework and a media framework.
  • the media framework includes an encoder.
  • the Log file of the target video can be stored in the internal memory 121 of the electronic device 200, and can be clicked by the user on the "Gallery" icon It is displayed on the video editing interface (for example, the interface b in FIG. 8 of the above-mentioned embodiment).
  • the video editing operations performed by each layer in the layered architecture are shown in FIG. 10 .
  • Fig. 10 is a schematic flowchart of another video editing method 1000 provided by the embodiment of the present application.
  • Method 1000 includes the steps of:
  • the LUT control module acquires a Log file of a target video, and starts a LUT recommendation process.
  • the LUT control module sends the target video to the AI segmentation module.
  • the AI segmentation module receives the target video.
  • the AI segmentation module identifies the content of the target video, and divides the target video into multiple sub-videos based on segmentation algorithms with different precisions.
  • the AI segmentation module sends the multiple sub-videos to the LUT control module.
  • the LUT control module receives the multiple sub-videos.
  • the LUT control module sends the sub-video to the AI recommendation module.
  • the AI recommendation module receives sub-videos.
  • the LUT control module sends the sub-video to the encoding module.
  • the encoding module receives the sub-video.
  • the encoding module can save the received sub-video.
  • the AI recommendation module analyzes information such as scene, light and shade, and color of the sub-video according to the CV algorithm, and recommends a set of candidate LUTs for the sub-video.
  • the AI recommendation module sends a set of candidate LUTs recommended for the sub-video to the LUT control module.
  • the LUT control module receives a candidate LUT set corresponding to the sub-video.
  • the LUT control module sequentially sends the multiple sub-videos to the AI recommendation module, and the AI recommendation module executes S1007 and S1008 each time a sub-video is received, until recommending candidate LUT sets for all sub-videos.
  • the LUT control module sequentially sends the multiple sub-videos to the encoding module, and the encoding module saves each received sub-video until all the sub-videos are saved.
  • the AI recommendation module recommends a candidate LUT set for the first sub-video, and the LUT elements in the candidate set have been sorted according to priority, and the priority
  • the highest LUT element is the LUT element most suitable for the scene, light, color, etc. of the first sub-video in the candidate LUT set of the first sub-video.
  • the candidate LUT set of the first sub-video is [LUT 2, LUT 1, LUT 5], which means that the LUT element labeled 2 (that is, LUT 2) is the most suitable LUT element for the first sub-video, and LUT 1
  • the priority of LUT 5 is the second, and the priority of LUT 5 is the second.
  • the forms of the candidate LUT sets of other sub-videos are similar to those of the first sub-video, and will not be repeated here.
  • the LUT control module determines the target LUT of each sub-video among the candidate LUTs of each sub-video.
  • the LUT control module first determines the LUT element with the highest priority in the candidate LUT set of each sub-video as the target LUT, and then integrates the LUT styles of all sub-videos to detect the consistency of the overall video style. If the style conflict of the target LUT of two adjacent sub-videos is detected, the LUT of at least one sub-video in the two adjacent sub-videos is adjusted.
  • the candidate LUT set of the first sub-video is [LUT 2, LUT 1 , LUT 5], then the LUT control module determines that LUT 2 is the target LUT of the first sub-video.
  • the candidate LUT set of the second sub-video is [LUT 3, LUT 4, LUT 5], then the LUT control module determines that LUT 3 is the target LUT of the second sub-video. If the LUT control module obtains the style conflict between the target LUT (i.e. LUT 2) of the first sub-video and the target LUT (i.e.
  • LUT 3 of the second sub-video through style consistency detection then it is considered as the first sub-video and/or the second sub-video Word video replacement target LUT.
  • the target LUT of the first sub-video can be replaced with LUT 1, that is, the first sub-video finally uses LUT 1.
  • the LUT control module performs style consistency detection again, and if the overall style is detected to be uniform, the LUT of the sub-video is no longer adjusted.
  • the LUT control module sends a request message to the LUT template module, and the request message is used to request the target LUT of each sub-video.
  • the LUT template module receives the request message.
  • the LUT template module sends target LUTs of all sub-videos to the encoding module.
  • the encoding module receives the target LUTs of all sub-videos.
  • the encoding module encodes each sub-video according to the target LUT of each sub-video, and combines the encoded sub-videos to generate a complete video, that is, the encoded target video.
  • the encoding module can encode each sub-video based on the target LUT of each sub-video, and obtain a complete encoded video.
  • the encoding module sends the complete video to the playing module, and correspondingly, the playing module receives the complete video.
  • the playing module plays the complete video.
  • the electronic device as shown in FIG. 2 or FIG. 8 includes a display screen
  • the playing module receives an instruction to play a video, so as to display the complete video on the display screen.
  • sequence numbers of the above processes do not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
  • FIG. 11 shows a schematic block diagram of a video editing apparatus 1100 provided by an embodiment of the present application, and the apparatus 1100 includes an acquisition module 1110 and a processing module 1120 .
  • the obtaining module 1110 is used for: obtaining the Log file of the target video.
  • the processing module 1120 is used to: segment the target video based on the Log file to obtain multiple sub-videos; determine the picture attributes of the multiple sub-videos, the picture attributes include scene attributes and/or color attributes; according to the picture attributes of the multiple sub-videos and a preset mapping relationship, determining LUTs of multiple sub-videos, where the mapping relationship is used to represent correspondence between multiple picture attributes and multiple LUT elements; and editing the target video based on the LUTs of multiple sub-videos.
  • FIG. 12 shows a schematic block diagram of another video editing apparatus 1200 provided by an embodiment of the present application.
  • the device 1200 includes an acquisition module 1110 and a processing module 1120 .
  • the processing module 1120 of the device 1200 may specifically include an AI segmentation module 21 , an AI recommendation module 22 , a LUT control module 23 , and an encoding module 24 .
  • the processing module 1120 further includes a LUT template module 25 and a playback module 26 .
  • the AI segmentation module 21 is configured to: sample the Log file according to at least one sampling period, determine a plurality of sampling frames in each sampling period in at least one sampling period, and the plurality of sampling frames are used to Periodically sample the image frame obtained by the target video; based on a plurality of sampling frames in each sampling period, mark candidate segmentation symbols for the target video in each sampling period; and, based on the target video in each sampling period
  • the candidate segmentation symbols determine the segmentation symbols of the target video, and the segmentation symbols divide the target video into multiple sub-videos.
  • the AI segmentation module 21 is configured to: sample the Log file according to the first sampling period in at least one sampling period, and determine a plurality of first sampling frames; the degree of difference between adjacent first sampling frames; and marking the candidate segment symbol between two adjacent first sampling frames whose degree of difference is greater than or equal to a first threshold.
  • the AI segmentation module 21 is configured to: sample the Log file according to the first sampling period in at least one sampling period, determine a plurality of first frames and a plurality of end frames; calculate a plurality of first frames and a plurality of end frames The degree of difference between two adjacent first and last frames in the frame; the candidate segment symbol is marked in the time period when the difference between two adjacent first and last frames is greater than or equal to the first threshold.
  • the AI segmentation module 21 is configured to: determine a plurality of candidate segment symbols according to each sampling period in at least one sampling period, and determine overlapping candidate segment symbols among the plurality of candidate segment symbols as the target video The segment symbol.
  • At least one sampling period includes three sampling periods, which are respectively a first sampling period of 1 s, a second sampling period of 100 ms, and a third sampling period of 10 ms.
  • the AI recommendation module 22 is configured to: determine the light sensitivity levels of multiple sub-videos according to the color attributes of multiple sub-videos; and, according to the scene attributes and/or light sensitivity levels of multiple sub-videos, select the corresponding A LUT corresponding to scene attributes and light sensitivity levels of multiple sub-videos.
  • the LUT control module 23 is used to: determine the color difference result of the LUTs of two adjacent sub-videos in the multiple sub-videos according to the LUTs of the multiple sub-videos; if there is a LUT whose color difference result is greater than or equal to the second threshold, Adjusting the LUT of at least one sub-video in the two adjacent sub-videos; the encoding module 24 is configured to: edit the target video based on the adjusted LUT, which belongs to the same candidate LUT set as the pre-adjusted LUT.
  • the LUT control module 23 is configured to: determine the ratio of two adjacent sub-videos in the plurality of sub-videos according to the brightness, exposure, light source intensity, black-highlight ratio and contrast of the LUTs of the two adjacent sub-videos in the multiple sub-videos. The color difference result of the LUT.
  • the encoding module 24 is configured to: encode the plurality of sub-videos according to the LUTs of the plurality of sub-videos to obtain a plurality of encoded sub-videos; merge the plurality of encoded sub-videos to obtain an encoded target video .
  • the playing module 26 is configured to: play the encoded target video.
  • the device 1100 or the device 1200 may specifically be the electronic device in the above embodiment, or the functions of the electronic device in the above embodiment may be integrated in the device 1100 or the device 1200 .
  • the above functions can be implemented by hardware, or can be implemented by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • Apparatus 1100 or apparatus 1200 may be used to execute various processes and/or steps corresponding to electronic devices in the foregoing method embodiments.
  • the device 1100 or the device 1200 here is embodied in the form of functional modules.
  • the term "module” here may refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and memory, incorporated logic, and/or other suitable components to support the described functionality.
  • ASIC application specific integrated circuit
  • the device 1100 or the device 1200 may also be a chip or a chip system, for example, a system on chip (system on chip, SoC).
  • Fig. 13 shows a schematic block diagram of another video editing apparatus 1300 provided by the embodiment of the present application.
  • the apparatus 1300 includes a processor 1310 , a transceiver 1320 and a memory 1330 .
  • the processor 1310, the transceiver 1320 and the memory 1330 communicate with each other through an internal connection path, the memory 1330 is used to store instructions, and the processor 1310 is used to execute the instructions stored in the memory 1330 to control the transceiver 1320 to send signals and /or to receive a signal.
  • the apparatus 1300 may specifically be the electronic device in the above embodiment, or the functions of the electronic device in the above embodiment may be integrated in the apparatus 1300, and the apparatus 1300 may be used to execute each of the above method embodiments corresponding to the electronic device. steps and/or processes.
  • the memory 1330 may include read-only memory and random-access memory, and provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory.
  • the memory may also store device type information.
  • the processor 1310 may be configured to execute instructions stored in the memory, and when the processor executes the instructions, the processor may execute various steps and/or processes corresponding to the electronic device in the foregoing method embodiments.
  • the processor 1310 may be a central processing unit (central processing unit, CPU), and the processor may also be other general processors, digital signal processors (DSPs), application specific integrated circuits ( ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSPs digital signal processors
  • ASIC application specific integrated circuits
  • FPGA Field Programmable Gate Array
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
  • the steps of the methods disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
  • the storage medium is located in the memory, and the processor executes the instructions in the memory, and completes the steps of the above method in combination with its hardware. To avoid repetition, no detailed description is given here.
  • modules and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • the disclosed systems, devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the modules is only a logical function division. In actual implementation, there may be other division methods.
  • multiple modules or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or modules may be in electrical, mechanical or other forms.
  • the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or may be distributed to multiple network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing module, each module may exist separately physically, or two or more modules may be integrated into one module.
  • the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Image Processing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

本申请提供了一种视频编辑方法和视频编辑装置,有利于提高LUT的智能优化效果。该方法包括:获取目标视频的Log文件。基于该Log文件,对该目标视频进行分段,获得多个子视频。确定多个子视频的画面属性,该画面属性包括场景属性和色彩属性。根据多个子视频的画面属性和预设的映射关系,确定多个子视频的LUT,该映射关系用于表示多个画面属性与多个LUT元素之间的对应关系。基于多个子视频的LUT,渲染该目标视频。

Description

视频编辑方法和视频编辑装置
本申请要求于2021年8月12日提交中国国家知识产权局、申请号为202110926932.9、申请名称为“视频编辑方法和视频编辑装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及多媒体技术领域,更具体地,涉及一种视频编辑方法和视频编辑装置。
背景技术
随着电子设备越来越智能化,电子设备拍摄视频和图片的功能方便人们随时记录风景和人物,可以满足用户的日常需求。为了优化拍摄的画面,用户往往期望为画面添加颜色查找表(look-up table,LUT),经过LUT处理后的画面可以带来更好的视觉效果。
当前,以电子设备为手机为例,用户在使用手机拍摄视频后可以获得录像机(recorder,Rec)709标准格式的视频文件,用户可以从图库编辑界面下方的列表中为该视频手动选择一种LUT元素。
然而,如果一段完整视频使用同一种LUT元素可能存在有些视频段落与LUT元素风格不匹配的情况,无法达到智能优化效果,影响视觉体验。
发明内容
本申请提供一种视频编辑方法和视频编辑装置,有利于提高LUT的智能优化效果。
第一方面,提供了一种视频编辑方法,包括:获取目标视频的Log文件。基于该Log文件,对该目标视频进行分段,获得多个子视频。确定多个子视频的画面属性,该画面属性包括场景属性和/或色彩属性。根据多个子视频的画面属性和预设的映射关系,确定多个子视频的LUT,该映射关系用于表示多个画面属性与多个LUT元素之间的对应关系。基于多个子视频的LUT,渲染该目标视频。
在本申请实施例中,视频推荐设备可以将目标视频划分为多个子视频,并且为每个子视频推荐合适的LUT,这样有利于提高LUT对视频优化效果。
结合第一方面,在第一方面的某些实现方式中,基于Log文件,对目标视频进行分段,获得多个子视频,包括:按照至少一个采样周期对Log文件进行采样,确定至少一个采样周期中每个采样周期的多个采样帧,该多个采样帧用于根据该采样周期采样该目标视频而获得的图像帧。基于每个采样周期的多个采样帧,在每个采样周期下为该目标视频标记候选分段符号。基于每个采样周期下该目标视频的候选分段符号,确定该目标视频的分段符号,该分段符号将该目标视频划分为多个子视频。
在本申请实施例中,视频推荐设备可以在不同精度的采样周期下对目标视频进行采样,这样最终划分的子视频可以更好的适配不同的LUT。
结合第一方面,在第一方面的某些实现方式中,按照至少一个采样周期对Log文件进行采样,确定至少一个采样周期中每个采样周期的多个采样帧,包括:按照至少一个采样周期中的第一采样周期对该Log文件进行采样,确定多个第一采样帧。计算多个第一采样帧中的两个相邻第一采样帧之间的差异度。在该差异度大于或等于第一阈值的两个相邻第一采样帧之间标记该候选分段符号。
结合第一方面,在第一方面的某些实现方式中,按照至少一个采样周期对Log文件进行采样,确定至少一个采样周期中每个采样周期的多个采样帧,包括:按照至少一个采样周期中的第一采样周期对该Log文件进行采样,确定多个首帧和多个尾帧。计算多个首帧和多个尾帧中两个相邻的首帧和尾帧之间的差异度。在两个相邻的首帧和尾帧之间的差异度大于或等于第一阈值的时间段标记候选分段符号。
结合第一方面,在第一方面的某些实现方式中,基于每个采样周期下目标视频的候选分段符号,确定该目标视频的分段符号,包括:依据至少一个采样周期中的每个采样周期确定多个候选分段符号,将多个候选分段符号中重合的候选分段符号确定为该目标视频的分段符号。
结合第一方面,在第一方面的某些实现方式中,至少一个采样周期包括三个采样周期,分别为第一采样周期1s、第二采样周期100ms和第三采样周期10ms。
结合第一方面,在第一方面的某些实现方式中,根据多个子视频的色彩属性,确定多个子视频的光感级别。根据所述多个子视频的画面属性和预设的映射关系,确定多个子视频的LUT,包括:根据多个子视频的场景属性和/或光感级别,从映射关系中选择与多个子视频的场景属性和/或光感级别对应的LUT。
在本申请实施例中,电子设备可以根据预设的场景属性和光感级别与推荐LUT的映射关系,分别为每个子视频推荐合适风格的LUT,这样更加智能化,可以发挥LUT的优化效果。
结合第一方面,在第一方面的某些实现方式中,在确定多个子视频的LUT之后,根据多个子视频的LUT,确定多个子视频中相邻两段子视频的LUT的色彩差异结果。若存在该色彩差异结果大于或等于第二阈值的LUT,调整该相邻两段子视频中至少一段子视频的LUT。基于多个子视频的LUT,渲染该目标视频,包括:基于调整后的LUT,渲染该目标视频,该调整后的LUT与调整前的LUT属于同一个候选LUT集合。
结合第一方面,在第一方面的某些实现方式中,根据多个子视频的LUT,确定多个子视频中相邻两段子视频的LUT的色彩差异结果,包括:根据多个子视频中相邻两段子视频的LUT的亮度、曝光度、光源强度、黑色-高光比例以及对比度,确定多个子视频中相邻两段子视频的LUT的色彩差异结果。
第二方面,提供了一种视频编辑装置,包括:用于执行上述第一方面中任一种可能的实现方式中的方法。具体地,该装置包括用于执行上述第一方面中任一种可能的实现方式中的方法的模块。
第三方面,提供了另一种视频编辑装置,包括处理器,该处理器与存储器耦合,可用于执行存储器中的指令,以实现上述任一方面中任一种可能实现方式中的方法。可选地,该装置还包括存储器。可选地,该装置还包括通信接口,处理器与通信接口耦合。
在一种实现方式中,该视频编辑装置为电子设备。当该视频编辑装置为电子设备时,通信接口可以是收发器,或,输入/输出接口。
在另一种实现方式中,该视频编辑装置为配置于电子设备中的芯片。当该视频编辑装置为配置于电子设备中的芯片时,通信接口可以是输入/输出接口。
第四方面,提供了一种处理器,包括:输入电路、输出电路和处理电路。处理电路用于通过输入电路接收信号,并通过输出电路发射信号,使得处理器执行上述第一方面中任一种可能实现方式中的方法。
在具体实现过程中,上述处理器可以为芯片,输入电路可以为输入管脚,输出电路可以为输出管脚,处理电路可以为晶体管、门电路、触发器和各种逻辑电路等。输入电路所接收的输入的信号可以是由例如但不限于接收器接收并输入的,输出电路所输出的信号可以是例如但不限于输出给发射器并由发射器发射的,且输入电路和输出电路可以是同一电路,该电路在不同的时刻分别用作输入电路和输出电路。本申请实施例对处理器及各种电路的具体实现方式不做限定。
第五方面,提供了一种处理装置,包括处理器和存储器。该处理器用于读取存储器中存储的指令,并可通过接收器接收信号,通过发射器发射信号,以执行上述第一方面中任一种可能实现方式中的方法。
可选地,处理器为一个或多个,存储器为一个或多个。
可选地,存储器可以与处理器集成在一起,或者存储器与处理器分离设置。
在具体实现过程中,存储器可以为非瞬时性(non-transitory)存储器,例如只读存储器(read only memory,ROM),其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型以及存储器与处理器的设置方式不做限定。
应理解,相关的数据交互过程例如发送指示信息可以为从处理器输出指示信息的过程,接收能力信息可以为处理器接收输入能力信息的过程。具体地,处理输出的数据可以输出给发射器,处理器接收的输入数据可以来自接收器。其中,发射器和接收器可以统称为收发器。
上述第五方面中的处理装置可以是一个芯片,该处理器可以通过硬件来实现也可以通过软件来实现,当通过硬件实现时,该处理器可以是逻辑电路、集成电路等;当通过软件来实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现,该存储器可以集成在处理器中,可以位于该处理器之外,独立存在。
第六方面,提供了一种计算机程序产品,计算机程序产品包括:计算机程序(也可以称为代码,或指令),当计算机程序被运行时,使得计算机执行上述第一方面中任一种可能实现方式中的方法。
第七方面,提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序(也可以称为代码,或指令)当其在计算机上运行时,使得计算机执行上述第一方面中任一种可能实现方式中的方法。
附图说明
图1是一种不同LUT的风格示意图;
图2是本申请实施例适用的一种电子设备的结构示意图;
图3是本申请实施例提供的一种视频编辑方法的示意性流程图;
图4是本申请实施例提供的一种划分视频的示意图;
图5是本申请实施例提供的另一种划分视频的示意图;
图6是本申请实施例提供的一种视频编辑的界面示意图;
图7是本申请实施例提供的另一种视频编辑方法的示意性流程图;
图8是本申请实施例提供的一种录制视频的界面示意图;
图9是本申请实施例提供的一种电子设备的软件结构图;
图10是本申请实施例提供的再一种视频编辑方法的示意性流程图;
图11是本申请实施例提供的一种视频编辑装置的示意性框图;
图12是本申请实施例提供的另一种视频编辑装置的示意性框图;
图13是本申请实施例提供的再一种视频编辑装置的示意性框图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
大部分滤镜是通过基础的“曝光、对比度、色温”等配合滤镜算法生成的一种色彩模式,LUT是一种与滤镜类似的颜色转换模板,比如可以是一种红蓝绿(red green blue,RGB)的映射表。LUT能够将实际采样到的像素灰度值经过一定的变换(如阈值、反转、对比度调整以及线性变换等),变成了另外一个与之对应的灰度值,这样可以起到突出图像的有用信息,增强图像的光对比度的作用。
一张图像包括很多像素,每个像素由RGB值表示。电子设备的显示屏可以根据该图像中每个像素点的RGB值来显示该图像。也就是说,这些RGB值会指示显示屏如何发光,以混合出各种各样的色彩呈现给用户。
LUT是一种RGB的映射表,用于表征调整前后的RGB值的对应关系。例如,请参考表一,其示出一种LUT的示例。
表一
Figure PCTCN2022092061-appb-000001
当原始RGB值为(14,22,24)时,经过表一所示的LUT的映射,输出RGB值为(6,9,4)。当原始RGB值为(61,34,67)时,经过表一所示的LUT的映射,输出RGB值为(66,17,47)。当原始RGB值为(94,14,171)时,经过表一所示的LUT的映射,输出RGB值为(117,82,187)。当原始RGB值为(241,216,222)时,经过表一所示的LUT的映射,输出RGB值为(255,247,243)。
需要说明的是,采用不同的LUT处理同一张图像时,可以得到不同风格图像效果。例如,图1是一种不同LUT的风格示意图,示出了在LUT 1、LUT 2和LUT 3这三种不同的颜色查找表下对原始图像100的处理结果。如图1所示,采用LUT 1处理摄像头采集的原始图像100,可得到图1所示的图像101。采用LUT 2处理摄像头采集的原始图像100,可得到图1所示的图像102。采用LUT3处理摄像头采集的原始图像100,可得到图1所示的图像103。对比图1所示的图像101、图像102和图像103可知,图像101、图像102和图像103图像效果或者风格不同。
目前用户通过不同型号的电子设备(例如手机)、镜头拍摄视频经过转换Rec.709标准格式后会丢失一部分信息,而未经转换Rec.709标准格式的原始Log视频文件具有很高的色域范围,可以最大限度地保存拍摄时的光线和色彩。
用户在拍摄完视频进入图库编辑页面,可以手动为视频文件选择一种LUT元素,对于非专业用户而言,在选择的过程中可能会产生混淆,选择了与视频内容不合适的LUT元素。此外,一段视频可能包含多个角度和场景,如果整段视频都采用同一种LUT元素,可能会导致有些段落与LUT风格不匹配,不利于LUT对视频的优化。
有鉴于此,本申请实施例提供一种视频编辑方法和视频编辑装置。可以基于原始Log视频文件,结合实际拍摄场景将整段视频切分为多个子视频,针对每段子视频智能推荐一种LUT元素,这样有利于提高LUT对视频的智能优化效果。
在介绍本申请实施例提供的视频编辑方法之前,先做出以下几点说明。
第一,在下文示出的实施例中,各术语及英文缩略语,如画面属性、场景属性、色彩属性、采样帧等,均为方便描述而给出的示例性举例,不应对本申请构成任何限定。本申请并不排除在已有或未来的协议中定义其它能够实现相同或相似功能的术语的可能。
第二,在下文示出的实施例中第一、第二以及各种数字编号仅为描述方便进行的区分,并不用来限制本申请实施例的范围。例如,区分不同的采样帧、区分不同的阈值等。
第三,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,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可以是单个,也可以是多个。
图2是本申请实施例适用的一种电子设备的结构示意图。如图2所示,该电子设备200可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。可以理解的是,本实施例示意的结构并不构成对电子设备200 的具体限定。在本申请另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件,或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,显示处理单元(display process unit,DPU),和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。在一些实施例中,电子设备200也可以包括一个或多个处理器110。其中,处理器可以是电子设备200的神经中枢和指挥中心。处理器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。这就避免了重复存取,减少了处理器110的等待时间,因而提高了电子设备200的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或USB接口等。其中,USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备200充电,也可以用于电子设备200与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。
可以理解的是,本申请实施例示意的各模块间的接口连接关系为示意性说明,并不构成对电子设备200的结构限定。在本申请另一些实施例中,电子设备200也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备200的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备200供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管 理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备200的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。电子设备200中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备200上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备200上的包括无线局域网(wireless local area networks,WLAN),蓝牙,全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),NFC,红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备200的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备200可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括GSM,GPRS,CDMA,WCDMA,TD-SCDMA,LTE,GNSS,WLAN,NFC,FM,和/或IR技术等。上述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(bei dou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备200通过GPU、显示屏194以及应用处理器等可以实现显示功能。应用处理器可以包括NPU和/或DPU。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或 多个GPU,其执行指令以生成或改变显示信息。NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备200的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。DPU也称为显示子系统(display sub-system,DSS),DPU用于对显示屏194的色彩进行调整,DPU可以通过颜色三维查找表(3D look up table,3D LUT)对显示屏的色彩进行调整。DPU还可以对画面进行缩放、降噪、对比度增强、背光亮度管理、hdr处理、显示器参数Gamma调整等处理。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)、有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED)、柔性发光二极管(flex light-emitting diode,FLED)、Miniled、MicroLed、Micro-oLed或量子点发光二极管(quantum dot light emitting diodes,QLED)。在一些实施例中,电子设备200可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备200可以通过ISP,一个或多个摄像头193,视频编解码器,GPU,一个或多个显示屏194以及应用处理器等实现拍摄功能。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备200的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐、照片、视频等数据文件保存在外部存储卡中。
内部存储器121可以用于存储一个或多个计算机程序,该一个或多个计算机程序包括指令。处理器110可以通过运行存储在内部存储器121的上述指令,从而使得电子设备200执行各种功能应用以及数据处理等。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统;该存储程序区还可以存储一个或多个应用程序(比如图库、联系人等)等。存储数据区可存储电子设备200使用过程中所创建的数据(比如照片,联系人等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。在一些实施例中,处理器110可以通过运行存储在内部存储器121的指令,和/或存储在设置于处理器110中的存储器的指令,来使得电子设备200执行各种功能应用及数据处理。
内部存储器121用于存储本申请实施例中的LUT集合、预设的映射关系、以及预设的LUT色彩差异信息。其中,LUT集合中包括电子设备200所能支持的所有LUT元素,也可以将LUT元素称为LUT模板。预设的映射关系用于表示多个画面属性与多个LUT元素之间的对应关系,可以如下表二所示。预设的LUT色彩差异信息包括每两种LUT元素之间的色彩差异,示例性地,LUT色彩差异信息可以以色彩差异表的形式体现。
电子设备200可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放、录音等。其中,音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转 换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备200可以通过扬声器170A收听音乐,或收听免提通话。受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备200接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。麦克风170C,也称“话筒”或“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备200可以设置至少一个麦克风170C。在另一些实施例中,电子设备200可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备200还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,还可以是美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
传感器180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
其中,压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备200根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备200根据压力传感器180A检测所述触摸操作强度。电子设备200也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备200的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备200围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备200抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备200的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景等。
加速度传感器180E可检测电子设备200在各个方向上(一般为三轴)加速度的大小。当电子设备200静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备200可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备200可以利用距离传感器180F测距以实现快速对焦。
按键190包括开机键,音量键等。按键190可以是机械按键,也可以是触摸式按键。电子设备200可以接收按键输入,产生与电子设备200的用户设置以及功能控制有关的键信号输入。
马达191可以为转子马达和/或线性马达,线性马达如X轴线性马达或Z轴线性马达。电子设备中可以包括至少一个马达191。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备200的接触和分离。电子设备200可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备200通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备200采用eSIM,即:嵌入式SIM卡,eSIM卡可以嵌在电子设备200中。
图3是本申请实施例提供的一种视频编辑方法300的示意性流程图。该视频编辑方法300的步骤可以由电子设备200执行,电子设备200具有对视频进行智能分段和为每段子视频推荐合适的LUT的功能。方法300包括如下步骤:
S301,获取目标视频的Log文件。
S302,基于该Log文件,对该目标视频进行分段,获得多个子视频。
S303,确定多个子视频的画面属性,该画面属性包括场景属性和/或色彩属性。
S304,根据多个子视频的画面属性和预设的映射关系,确定多个子视频的LUT,该映射关系用于表示多个画面属性与多个LUT元素之间的对应关系。
S305,基于多个子视频的LUT,渲染该目标视频。
电子设备可以基于目标视频的原始Log文件进行编辑,原始Log文件是灰度图像,具有很高的色域范围,可以在该Log文件基础上增加不同滤镜实现不同效果,因此使用原始Log文件作为原片编辑视频可以带来更大的优化空间。
本申请实施例可以对目标视频智能分段,确定多个子视频,并可以为每段子视频推荐合适风格的LUT元素,这样LUT滤镜对视频的优化效果更好。
在本申请实施例中,电子设备200有预设的LUT集合,针对每一个画面属性都有其对应的候选LUT集合。
作为一个可选的实施例,S302包括:按照至少一个采样周期对该Log文件进行采样,确定至少一个采样周期中每个采样周期的多个采样帧,该多个采样帧代表该目标视频的多个段落。基于每个采样周期的多个采样帧,在每个采样周期下为该目标视频标记候选分段符号。基于每个采样周期下该目标视频的候选分段符号,确定该目标视频的分段符号,该分段符号将该目标视频划分为多个子视频。
本申请实施例可以按照采样的方式确定多个子视频。图4是本申请实施例提供的一种划分视频的示意图。
示例性地,电子设备首先按照第一采样周期对目标视频进行采样,得到多个第一采样帧。之后电子设备可以计算该多个第一采样帧中每两个相邻的采样帧之间的差异度。如果计算得到的差异度大于或等于第一阈值,则电子设备认为两个相邻的采样帧为不同的段落,并在这两个相邻的采样帧之间标记候选分段符号(如图4中的候选分段符号1所示)。如果计算得到的差异度小于第一阈值,则电子设备认为两个相邻的采样帧为同一个段落,不在两个相邻的采样帧之间标记候选分段符号。
其中,第一采样周期可以为1s或者100帧,第一阈值可以为20%。
示例性地,电子设备可以继续按照第二采样周期和第三采样周期为目标视频标记候选分段符号(如图4中的候选分段符号2和候选分段符号3所示)。由图4可知,不同精度的采样周期下可能存在重合的候选分段符号,电子设备可以按照目标视频的长度,获取不同精度下重合的候选分段符作为该目标视频的分段符号,每个分段符号的左右两侧即为不同的子段落,这样便完成了划分多个子段落的操作。
其中,第二采样周期可以为100ms或者20帧,第三采样周期可以为10ms或者10帧。
应理解,本申请实施例中将在1ms内出现的不同的候选分段符认为是重合的候选分段符,也就是若在1ms时间范围内出现了不同采样周期下的候选分段符号,则可认为该不同采样周期下的候选分段符号是重合的候选分段符号。如图4所示,最终可划分得到四段子视频,即图中的子视频1、子视频2、子视频3和子视频4。
图5是本申请实施例提供的另一种划分视频的示意图。以第一采样周期为1s,第二采样周期为100ms,第三采样周期为10ms为例,电子设备可以在每个采样周期的开始时刻和结束时刻对视频画面进行采样,得到首帧和尾帧。图5中的图例1表示首帧和尾帧之间的差异度超过20%的第一采样周期对应的时间段,即1s,也就是电子设备认为在这1s的采样时间内视频画面有所变化。同样地,图例2表示首帧和尾帧之间的差异度超过20%的第二采样周期对应的时间段,即100ms,也就是电子设备认为在这100ms的采样时间内视频画面有所变化。图例3表示首帧和尾帧之间的差异度超过20%的第三采样周期对应的时间段,即10ms,也就是电子设备认为在这10ms的采样时间内视频画面有所变化。其中,三种图例所代表的采样周期重合的时间段表示在这三种精度的采样周期下都可以识别到视频画面的变化,因此电子设备可以在重合的时间段标记最终的分段符号。如图5所示,最终可划分得到四段子视频,即图中的子视频1、子视频2、子视频3和子视频4。
应理解,图4和图5是以三个不同精度的采样周期为例介绍子段落的划分,电子设备还可以继续提高采样精度为目标视频标记候选分段符号。在精度较低的采样周期下,有可能将拍摄的同一个场景划分在了不同的子视频中,这可能会导致最终为同一个场景推荐了不同风格的LUT,影响视频整体的风格统一。因此需要更高精度的采样周期将目标视频划分为可以适配不同LUT的子视频。但是如果仅以较高采样精度,也就是较短的采样周期为例,则有可能将目标视频划分为过于零碎、数量过多的子视频。因此采用不同精度的采样周期划分多个子视频可以有效避免段落划分不准确和过度划分的问题。
在基于以上描述获得多个子视频后,电子设备可以识别出每段子视频的画面属性, 其中,画面属性包括场景属性和色彩属性。
对于场景属性,电子设备可以依赖于底层的计算机视觉(computer vision,CV)算法识别出单帧画面的场景属性,包括人物、城市、海洋、夜色、美食、车辆、花朵、蓝天等上百种具体场景。对于一个场景单一的视频,CV算法采样分析其中几帧画面即可确认场景属性。
对于色彩属性,电子设备同样可以依赖于CV算法分析单帧画面的色彩属性,包括亮度、曝光度、光源强度、黑色-高光比例等维度,并经过计算确定该单帧画面的光感级别,光感级别包括:高调、中间调、低调、偏亮、曝光、少光源、平衡、偏不足等。表二示出了色彩属性与光感级别的对应关系。
表二
色彩属性 光感级别
黑色>5%,高光<10% 高调(偏亮)
黑色<5%,高光>20% 中间调(曝光)
黑色>5%,高光<10% 低调(少光源)
高光>20% 高调(平衡)
黑色>5%,高光<10% 中间调(偏不足)
黑色>10%,高光>20% 高调(曝光)
应理解,在划分子视频之后,可以认为每段子视频中的每帧画面内容相似。以多个子视频中的第一子视频为例,电子设备可以基于CV算法对该第一子视频进行采样,例如采样第一子视频的长度为5s,可以以固定周期均匀采样出100帧画面,然后分析这100帧画面中的场景属性。例如,分析发现100帧画面中有80帧为城市这种场景属性,10帧为海洋这种场景属性,还有10帧为美食这种场景属性,因此电子设备可以确定该第一子视频的场景属性为城市。其他子视频的画面属性的确定过程与该第一子视频类似,此处不再赘述。
同样地,以在第一子视频中采样100帧画面为例,电子设备可以基于CV算法确定这100帧的色彩属性,并根据色彩属性计算得到每帧画面对应的光感级别,最后同样统计不同光感级别下的帧数,将帧数占比最大的光感级别确定为该第一子视频的光感级别。其他子视频的光感级别的确定过程与该第一子视频类似,此处不再赘述。
在确定了场景属性和光感级别之后,电子设备可以根据预先设置的映射关系选择出与多个子视频的场景属性和光感级别对应的LUT。
应理解,由于光感级别是根据色彩属性确定的,而画面属性包括场景属性和色彩属性,因此也可以称为画面属性包括场景属性和光感级别,进而S304具体可以包括:根据场景属性、光感级别与预设的映射关系,确定多个子视频的LUT。
示例性地,视频内是室内人物场景,适合使用人像大光圈虚化效果的LUT来突出人物细节,如果此时视频内的光线较为突出,偏亮色,则优先推荐具有高饱和度的LUT,例如“人像特写”LUT。如果此时视频内的光线昏暗,画面光源偏少,则优先推荐可以渲染年代感的“七零年代”LUT。
示例性地,视频内是室外自然风光场景,视频内的光线柔和,色彩均衡,则推荐 使用可以抑制高光、保留更多拍摄主体细节的“风景如画”LUT。
示例性地,视频内是城市远景,在夜晚霓虹灯映衬下的夜景风光推荐现代气息浓郁的“赛博朋克”LUT。表三示出了部分场景属性、光感级别与推荐LUT的对应关系。
表三
Figure PCTCN2022092061-appb-000002
应理解,对于每种画面属性(下面以[场景属性,光感级别]这种形式表示),电子设备都有预设的候选LUT集合。上述表二中的推荐LUT是该候选LUT集合中的LUT元素。
例如,对于[人像,高调(偏亮)]的画面属性,其候选LUT集合为(LUT 1,LUT 2,LUT 3),其中,LUT 1是该LUT集合中针对[人像,高调(偏亮)]的画面属性的优先级最高的LUT,也就是与[人像,高调(偏亮)]的画面属性匹配度最高的LUT,电子设备优先为与该画面属性对应的子视频推荐LUT 1。
例如,对于[美食,中间调(偏不足)]的画面属性,其候选LUT集合为(LUT 5,LUT 3,LUT 4),其中LUT 5是该LUT集合中针对[美食,中间调(偏不足)]的画面属性的优先级最高的LUT,也就是与[美食,中间调(偏不足)]的画面属性匹配度最高的LUT,电子设备优先为与该画面属性对应的子视频推荐LUT 5。
作为一个可选的实施例,在确定多个子视频的LUT之后,方法300方法还包括:根据多个子视频的LUT,确定多个子视频中相邻两段子视频的LUT的色彩差异结果;若存在色彩差异结果大于或等于第二阈值的LUT,调整相邻两段子视频中至少一段子视频的LUT;S305包括:基于调整后的LUT,编辑目标视频,调整后的LUT与调整前的LUT属于同一个候选LUT集合。
在本申请实施例中,在为各个子视频独立推荐LUT之后,有可能会出现整体风格不统一的情况。例如,视频的前半部分采用了高饱和度、高对比度的LUT(例如,城市夜景),后半段采用了较为柔和、自然的LUT(例如,人像特写),或者是后半段采用了怀旧气息浓厚的黑白色LUT,因此整个成片的风格怪异。考虑这种情况,电子设备可以根据预先设置的LUT色彩差异信息对相邻两段子视频中至少一段子视频的LUT进行调整,这样有利于整体成片风格更加统一,视觉效果更佳。应理解,每个LUT有自身的色彩属性,该色彩属性包括亮度、曝光度、光源强度、黑色-高光比例或对比度中的至少一种。此处比较的是两个LUT自身的色彩差异值,而不是添加LUT后两段子视频的色彩差异值,也不是两段子视频自身的色彩差异值。
其中,LUT色彩差异信息包括每两种LUT之间的色彩差异结果。以电子设备所支持的LUT集合中的两个LUT元素为例,将其标记为LUT 1和LUT 2。其中,LUT 1 的亮度为α 1,曝光度为β 1,光源强度为γ 1,黑色-高光比例为δ 1,对比度为ε 1。LUT 2的亮度为α 2,曝光度为β 2,光源强度为γ 2,黑色-高光比例为δ 2,对比度为ε 2。则LUT 1和LUT 2之间的色彩差异结果Δ可用如下公式表示:
Δ=(α 12) 2+(β 12) 2+(γ 12) 2+(δ 12) 2+(ε 12) 2
如果为相邻两段子视频推荐的LUT的色彩差异结果Δ大于或等于第二阈值,则电子设备认为这两个推荐LUT的风格不适合作为相邻的拼接,此时可以为这两段相邻子视频中至少一段子视频调整LUT。具体地,电子设备可以在需要调整LUT的子视频的候选LUT中选择一个作为推荐LUT,应理解,该调整后的LUT为该子视频的候选LUT集合中针对当前子视频的画面属性的优先级最高的LUT。其中,电子设备可以预设每个画面属性对应的LUT元素的优先级,电子设备为每个画面属性按优先级的排序推荐LUT。
在调整完相邻两段子视频中至少一段子视频的LUT后,电子设备仍需要对整体成片的风格一致性进行判断,若仍然存在整体风格不统一的问题,则继续调整LUT,直至整体成片的风格达到一个平衡状态。
下面将结合图6和图7,以具体的界面示例介绍本申请实施例的视频编辑方法。图6是本申请实施例提供的一种视频编辑的界面示意图。图6中包括3个界面,界面a、界面b和界面c。其中,用户可以点击界面a上的“图库”图标进入如界面b所示的视频编辑界面,在界面b中,用户可以选择图库中保存的多个Log视频文件中的一个作为目标视频进行Log编辑。示例性地,用户选择视频3作为目标视频,因此完整的目标视频可以在视频显示区域601显示并播放。在用户选择界面b右上角的“Log编辑”选项之后,电子设备可显示如界面c所示的Log分段推荐界面。
界面c包括查看区域602、多段子视频显示区域603以及LUT元素显示区域604。示例性地,目标视频的长度为8s,电子设备将目标视频划分如多段子视频显示区域603所示的4段子视频,每段子视频的长度为2s。LUT元素显示区域604显示了包括“薄雾”、“摩登”、“青春”、“奶茶”等LUT元素(还可以左右滑动LUT元素显示区域显示更多的LUT元素,此处未显示完全)。
在电子设备接收用户点击“智能推荐”选项之后,电子设备可以在界面c为当前的子视频添加推荐的LUT元素,并将经过LUT处理后的视频在查看区域602显示,用户可以在查看区域602查看添加LUT之后的目标视频。示例性地,电子设备可以为第2段子视频推荐“青春”风格的LUT元素,并在查看区域602显示。
用户在多段子视频显示区域603中左右滑动时切换子视频时,LUT元素显示区域604的当前推荐LUT也会有所变化。例如,用户切换至子视频2,LUT元素显示区域604当前推荐LUT为“青春”风格,在用户滑动切换至子视频3时,当前推荐LUT可能变为“摩登”风格。
图7是本申请实施例提供的另一种视频编辑方法700的示意性流程图,方法700包括:
S701,响应于用户点击“图库”图标的第一操作,电子设备显示视频编辑界面。
结合上述图6,电子设备可以接收用户点击界面a中的“图库”图标的指令,响应于该指令,电子设备可以显示如图6中界面b所示的视频编辑界面。上文已对界面 b进行可描述,此处不再赘述。
S702,响应于用户点击视频编辑界面中“Log编辑”选项的第二操作,电子设备显示Log分段推荐界面。
结合上述图6,电子设备可以接收用户点击如图6中界面b上的“Log编辑”选项的指令,响应于该指令,电子设备可以显示如图6中界面c所示的Log分段推荐界面。上文已对界面c进行了描述,此处不再赘述。
S703,根据目标视频的长度,将该目标视频划分为多段子视频。
在本步骤中,电子设备可以根据上文中描述的以不同精度的采样周期的方式将目标视频进行划分,得到多个画面属性不同的子视频。
S704,将多段子视频返回Log分段推荐界面。
结合上述图6,电子设备可以将返回的多段子视频在如图6中界面c所示的多段子视频显示区域603显示,也就是说多段子视频显示区域603中显示的是已经划分好的多段子视频。
S705,为每段子视频推荐LUT。
在本步骤中,电子设备可以根据每段子视频的画面属性与预设的LUT映射关系,在每段子视频的候选LUT集合中为每段子视频选择合适风格的LUT元素作为推荐的LUT。
应理解,在本步骤中,电子设备为每段子视频推荐的LUT是经过风格一致性检测后的整体成片风格一致的LUT。
S706,将添加LUT后的多段子视频返回Log分段推荐界面。
结合上述图6,电子设备可以将返回的添加LUT后的多段子视频在如图6中界面c所示的查看区域602显示。
S707,通过Log分段推荐界面将整体成片返回视频编辑界面。
在本步骤中,若用户接受为每段子视频推荐的LUT,可以通过点击如图6中的“保存”图标65将经LUT渲染后的整体成片返回如图6中界面b所示的视频编辑界面。
上述电子设备在完成为每段子视频推荐LUT后,会根据风格一致性检查确定是否需要为子视频调整LUT,这样有利于视频风格的统一。
除了通过电子设备为子视频智能调整LUT外,用户还可以自行更换LUT,将LUT调整为用户喜爱的风格,这样可以满足不同用户的个性化需求。
以上结合图1-图7详细描述了在获取目标视频的Log文件后如何编辑目标视频的过程。其中,在获取目标视频的Log文件之前,方法300可以包括:用户可以通过电子设备200录制目标视频。
图8是本申请实施例提供的一种录制视频的界面示意图。图8中包括3个界面,界面a、界面b和界面c。以上述电子设备200为手机为例,响应于用户点击界面a的“相机”图标60的操作,手机显示如界面b所示的视频录制界面。其中,界面b包括录制区域801、模式区域802和控件区域803。
用户可以在模式区域802左右滑动选择录制模式,在一些实施例中,手机录制视频的功能可以采用手机相机的录像模式实现。在另一些实施例中,手机录制视频的功能可以采用手机相机的专业模式实现。在又一些实施例中,手机录制视频的功能可以 采用手机相机的电影模式实现。当前b界面显示的是专业模式下的视频录制界面。
控件区域803包括用于启动Log功能的Log控件804和用于启动LUT功能的LUT控件805,由于采用Log功能拍摄的视频图像可以最大限度地保存拍摄时的光线和色彩,便于后续对视频图像进行优化,而采用LUT功能所拍摄的视频图像的色彩已经经过处理,颜色丰富,因此界面b中的Log控件804和LUT控件805不能同时开启。也就是说,在手机相机的专业模式下,Log功能和LUT功能不能同时运行。需要说明的是,图6中b界面所示的Log控件804处于开启状态,LUT控件805处于关闭的状态。
响应于用户点击“录制”按钮61的操作,手机显示界面c,开始在专业模式下启用Log功能录制目标视频。
图9是本申请实施例提供的一种电子设备的软件结构图。可以理解的是,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,安卓(Android)系统可以包括应用程序层(application,APP)、框架层(framework,FWK)、硬件抽象层(hardware abstraction layer,HAL)以及内核层(kernel)。在一些实施例中,手机还包括硬件(例如显示屏)。
示例性的,上述应用层可以包括用户界面(user interface,UI)层和逻辑层。如图9所示,UI层包括相机、图库以及其它应用。其中,相机包括Log控件(例如上述实施例中的Log控件804)和LUT控件(例如上述实施例中的LUT控件805)。逻辑层包括LUT模板模块、编码模块、LUT控制模块、AI分段模块、AI推荐模块以及播放模块等。
上述硬件抽象层是位于内核层与硬件之间的接口层,可以用于将硬件抽象化。示例性的,如图9所示,硬件抽象层包括相机接口。
上述内核层为手机的各种硬件提供了底层驱动。示例性的,如图9所示,内核层包括相机驱动模块。
上述框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程服务。框架层包括一些预先定义的函数。框架层通过API接口将编程服务提供给应用程序层调用。需要说明的是,在本申请实施例中,编程服务例如可以为相机服务(camera service)。在一些实施例中,如图9所示,框架层包括相机服务框架和媒体框架。其中,媒体框架包括编码器。
在一种可能的实现方式中,当用户根据如图8所示的操作拍摄目标视频之后,目标视频的Log文件可以存储在电子设备200的内部存储器121中,并可通过用户点击“图库”图标在视频编辑界面显示(例如上述实施例图8中的界面b)。响应于用户点击Log编辑的操作,分层架构中各层执行的视频编辑操作如图10所示。
图10是本申请实施例提供的再一种视频编辑方法1000的示意性流程图。方法1000包括如下步骤:
S1001,LUT控制模块获取目标视频的Log文件,启动LUT推荐流程。
S1002,LUT控制模块向AI分段模块发送目标视频。相应地,AI分段模块接收该目标视频。
S1003,AI分段模块识别目标视频的内容,基于不同精度下的分段算法,将目标视频划分为多个子视频。
S1004,AI分段模块向LUT控制模块发送该多个子视频。相应地,LUT控制模块接收该多个子视频。
S1005,LUT控制模块向AI推荐模块发送子视频。相应地,AI推荐模块接收子视频。
S1006,LUT控制模块向编码模块发送子视频。相应地,编码模块接收子视频。
在本步骤中,编码模块可以将接收到的子视频进行保存。
S1007,AI推荐模块根据CV算法分析子视频的场景、光线明暗和色彩等信息,为子视频推荐一个候选LUT集合。
S1008,AI推荐模块向LUT控制模块发送为子视频推荐的候选LUT集合。相应地,LUT控制模块接收子视频对应的候选LUT集合。
应理解,上述S1005中,LUT控制模块是向AI推荐模块依次发送该多个子视频,AI推荐模块每接收一个子视频便执行S1007和S1008,直至为所有子视频推荐候选LUT集合。同样地,在S1006中,LUT控制模块是向编码模块依次发送该多个子视频,编码模块每接收一个子视频便将其进行保存,直至保存完所有子视频。
应理解,在本步骤中,以多个子视频中的第一子视频为例,AI推荐模块为第一子视频推荐候选LUT集合,并且该候选集合中的LUT元素已经按照优先级排序,优先级最高的LUT元素是该第一子视频的候选LUT集合中与该第一子视频的场景、光线、色彩等最合适的LUT元素。示例性地,第一子视频的候选LUT集合为[LUT 2,LUT 1,LUT 5],则表示标号为2的LUT元素(即LUT 2)为最适合第一子视频的LUT元素,LUT 1的优先级次之,LUT 5的优先级再次之。其他子视频的候选LUT集合的形式与第一子视频类似,此处不再赘述。
S1009,LUT控制模块在每个子视频的候选LUT中确定每个子视频的目标LUT。
应理解,在本步骤中,LUT控制模块首先将每个子视频的候选LUT集合中优先级最高的LUT元素确定为目标LUT,之后整合所有子视频的LUT风格,检测整体视频风格的一致性。若检测得到相邻两段子视频的目标LUT的风格冲突,则对相邻两段子视频中至少一段子视频的LUT进行调整。
以多个子视频中的第一子视频和第二子视频为例,假设第一子视频和第二字视频为两段相邻的子视频,第一子视频的候选LUT集合为[LUT 2,LUT 1,LUT 5],则LUT控制模块确定LUT 2为第一子视频的目标LUT。第二子视频的候选LUT集合为[LUT 3,LUT 4,LUT 5],则LUT控制模块确定LUT 3为第二子视频的目标LUT。若LUT控制模块经过风格一致性检测得到第一子视频的目标LUT(即LUT 2)和第二字视频的目标LUT(即LUT 3)风格冲突,则考虑为第一子视频和/或第二字视频更换目标LUT。示例性地,可以将第一子视频的目标LUT更换为LUT 1,即第一子视频最终使用的是LUT 1。LUT控制模块再次进行风格一致性检测,若检测整体风格统一,则不再对子视频的LUT进行调整。
应理解,上述是以相邻的第一子视频和第二子视频为例进行描述,若检测到其他相邻的子视频的LUT存在风格冲突,同样需要调整LUT,确定每个子视频最终的目标LUT,其调整过程与第一子视频的调整过程类似,此处不再赘述。
S1010,LUT控制模块向LUT模板模块发送请求消息,该请求消息用于请求每个 子视频的目标LUT。相应地,LUT模板模块接收该请求消息。
S1011,LUT模板模块向编码模块发送所有子视频的目标LUT。相应地,编码模块接收所有子视频的目标LUT。
S1012,编码模块根据每个子视频的目标LUT对每个子视频进行编码,将编码后的子视频合并生成一段完整的视频,也就是编码后的目标视频。
由于编码模块在S1006中接收并保存该多个子视频,在本步骤中,编码模块可以基于每个子视频的目标LUT对每个子视频进行编码,并得到一段完整的经过编码后的视频。
S1013,编码模块向播放模块发送该完整的视频,相应地,播放模块接收该完整的视频。
S1014,播放模块播放该完整的视频。在如图2或图8所示的电子设备包括显示屏的情况下,播放模块接收播放视频的指令,以在显示屏上显示该完整的视频。
应理解,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
上文中结合图1至图10,详细描述了根据本申请实施例的视频编辑方法,下面将结合图11至图13详细描述根据本申请实施例的视频编辑装置。
图11示出了本申请实施例提供的一种视频编辑装置1100的示意性框图,该装置1100包括获取模块1110和处理模块1120。
其中,获取模块1110用于:获取目标视频的Log文件。处理模块1120用于:基于Log文件,对该目标视频进行分段,获得多个子视频;确定多个子视频的画面属性,该画面属性包括场景属性和/或色彩属性;根据多个子视频的画面属性和预设的映射关系,确定多个子视频的LUT,该映射关系用于表示多个画面属性与多个LUT元素之间的对应关系;以及,基于多个子视频的LUT,编辑该目标视频。
图12示出了本申请实施例提供的另一种视频编辑装置1200的示意性框图。装置1200包括获取模块1110和处理模块1120,相较于装置1000,装置1200的处理模块1120可具体包括AI分段模块21、AI推荐模块22、LUT控制模块23、编码模块24。可选地,处理模块1120还包括LUT模板模块25和播放模块26。
可选地,AI分段模块21用于:按照至少一个采样周期对该Log文件进行采样,确定至少一个采样周期中每个采样周期的多个采样帧,该多个采样帧用于根据该采样周期采样该目标视频而获得的图像帧;基于每个采样周期的多个采样帧,在每个采样周期下为该目标视频标记候选分段符号;以及,基于每个采样周期下该目标视频的候选分段符号,确定该目标视频的分段符号,该分段符号将该目标视频划分为多个子视频。
可选地,AI分段模块21用于:按照至少一个采样周期中的第一采样周期对该Log文件进行采样,确定多个第一采样帧;计算多个第一采样帧中的两个相邻第一采样帧之间的差异度;以及,在该差异度大于或等于第一阈值的两个相邻第一采样帧之间标记该候选分段符号。
可选地,AI分段模块21用于:按照至少一个采样周期中的第一采样周期对该Log文件进行采样,确定多个首帧和多个尾帧;计算多个首帧和多个尾帧中两个相邻的首 帧和尾帧之间的差异度;在两个相邻的首帧和尾帧之间的差异度大于或等于第一阈值的时间段标记候选分段符号。
可选地,AI分段模块21用于:依据至少一个采样周期中的每个采样周期确定多个候选分段符号,将多个候选分段符号中重合的候选分段符号确定为该目标视频的分段符号。
可选地,至少一个采样周期包括三个采样周期,分别为第一采样周期1s、第二采样周期100ms和第三采样周期10ms。
可选地,AI推荐模块22用于:根据多个子视频的色彩属性,确定多个子视频的光感级别;以及,根据多个子视频的场景属性和/或光感级别,从映射关系中选择与多个子视频的场景属性和光感级别对应的LUT。
可选地,LUT控制模块23用于:根据多个子视频的LUT,确定多个子视频中相邻两段子视频的LUT的色彩差异结果;若存在该色彩差异结果大于或等于第二阈值的LUT,调整该相邻两段子视频中至少一段子视频的LUT;编码模块24用于:基于调整后的LUT,编辑该目标视频,该调整后的LUT与调整前的LUT属于同一个候选LUT集合。
可选地,LUT控制模块23用于:根据多个子视频中相邻两段子视频的LUT的亮度、曝光度、光源强度、黑色-高光比例以及对比度,确定多个子视频中相邻两段子视频的LUT的色彩差异结果。
可选地,编码模块24用于:根据多个子视频的LUT,对该多个子视频进行编码,得到多个编码后的子视频;合并该多个编码后的子视频,得到编码后的目标视频。
可选地,播放模块26用于:播放该编码后的目标视频。
在一个可选的例子中,本领域技术人员可以理解,装置1100或装置1200可以具体为上述实施例中的电子设备,或者,上述实施例中电子设备的功能可以集成在装置1100或装置1200中。上述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。装置1100或装置1200可以用于执行上述方法实施例中与电子设备对应的各个流程和/或步骤。
应理解,这里的装置1100或装置1200以功能模块的形式体现。这里的术语“模块”可以指应用特有集成电路(application specific integrated circuit,ASIC)、电子电路、用于执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、合并逻辑电路和/或其它支持所描述的功能的合适组件。在本申请的实施例,装置1100或装置1200也可以是芯片或者芯片系统,例如:片上系统(system on chip,SoC)。
图13示出了本申请实施例提供的再一种视频编辑装置1300的示意性框图。该装置1300包括处理器1310、收发器1320和存储器1330。其中,处理器1310、收发器1320和存储器1330通过内部连接通路互相通信,该存储器1330用于存储指令,该处理器1310用于执行该存储器1330存储的指令,以控制该收发器1320发送信号和/或接收信号。
应理解,装置1300可以具体为上述实施例中的电子设备,或者,上述实施例中电子设备的功能可以集成在装置1300中,装置1300可以用于执行上述方法实施例中与 电子设备对应的各个步骤和/或流程。可选地,该存储器1330可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器的一部分还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。该处理器1310可以用于执行存储器中存储的指令,并且该处理器执行该指令时,该处理器可以执行上述方法实施例中与电子设备对应的各个步骤和/或流程。
应理解,在本申请实施例中,该处理器1310可以是中央处理单元(central processing unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器执行存储器中的指令,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的模块及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。
所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设 备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请实施例揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应所述以权利要求的保护范围为准。

Claims (21)

  1. 一种视频编辑方法,其特征在于,包括:
    获取目标视频的Log文件;
    基于所述Log文件,对所述目标视频进行分段,获得多个子视频;
    确定所述多个子视频的画面属性,所述画面属性包括场景属性和/或色彩属性;
    根据所述多个子视频的画面属性和预设的映射关系,确定所述多个子视频的颜色查找表LUT,所述映射关系用于表示多个画面属性与多个LUT元素之间的对应关系;
    基于所述多个子视频的LUT,渲染所述目标视频。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述Log文件,对所述目标视频进行分段,获得多个子视频,包括:
    按照至少一个采样周期对所述Log文件进行采样,确定所述至少一个采样周期中每个采样周期的多个采样帧,所述采样帧用于根据所述采样周期采样所述目标视频而获得的图像帧;
    基于所述每个采样周期的多个采样帧,在所述每个采样周期下为所述目标视频标记候选分段符号;
    基于所述每个采样周期下所述目标视频的候选分段符号,确定所述目标视频的分段符号,所述分段符号将所述目标视频划分为所述多个子视频。
  3. 根据权利要求2所述的方法,其特征在于,所述按照至少一个采样周期对所述Log文件进行采样,确定所述至少一个采样周期中每个采样周期的多个采样帧,包括:
    按照所述至少一个采样周期中的第一采样周期对所述Log文件进行采样,确定多个第一采样帧;
    所述基于所述每个采样周期的多个采样帧,在所述每个采样周期下为所述目标视频标记候选分段符号,包括:
    计算所述多个第一采样帧中的两个相邻第一采样帧之间的差异度;
    在所述差异度大于或等于第一阈值的两个相邻第一采样帧之间标记所述候选分段符号。
  4. 根据权利要求2所述的方法,其特征在于,所述按照至少一个采样周期对所述Log文件进行采样,确定所述至少一个采样周期中每个采样周期的多个采样帧,包括:
    按照所述至少一个采样周期中的第一采样周期对所述Log文件进行采样,确定多个首帧和多个尾帧;
    所述基于所述每个采样周期的多个采样帧,在所述每个采样周期下为所述目标视频标记候选分段符号,包括:
    计算所述多个首帧和多个尾帧中两个相邻的首帧和尾帧之间的差异度;
    在所述两个相邻的首帧和尾帧之间的差异度大于或等于第一阈值的时间段标记候选分段符号。
  5. 根据权利要求3或4所述的方法,其特征在于,所述基于所述每个采样周期下所述目标视频的候选分段符号,确定所述目标视频的分段符号,包括:
    依据所述至少一个采样周期中的每个采样周期确定多个候选分段符号,将所述多个候选分段符号中重合的候选分段符号确定为所述目标视频的分段符号。
  6. 根据权利要求2-5中任一项所述的方法,其特征在于,所述至少一个采样周期包括三个采样周期,分别为第一采样周期1s、第二采样周期100ms和第三采样周期10ms。
  7. 根据权利要求1-6中任一项所述的方法,其特征在于,所述方法还包括:
    根据所述多个子视频的色彩属性,确定所述多个子视频的光感级别;
    所述根据所述多个子视频的画面属性和预设的映射关系,确定所述多个子视频的LUT,包括:
    根据所述多个子视频的场景属性和/或光感级别,从所述映射关系中选择与所述多个子视频的场景属性和/或光感级别对应的LUT。
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,在所述确定所述多个子视频的LUT之后,所述方法还包括:
    根据所述多个子视频的LUT,确定所述多个子视频中相邻两段子视频的LUT的色彩差异结果;
    若存在所述色彩差异结果大于或等于第二阈值的LUT,调整所述相邻两段子视频中至少一段子视频的LUT;
    所述基于所述多个子视频的LUT,渲染所述目标视频,包括:
    基于调整后的LUT,渲染所述目标视频,所述调整后的LUT与调整前的LUT属于同一个候选LUT集合。
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述多个子视频的LUT,确定所述多个子视频中相邻两段子视频的LUT的色彩差异结果,包括:
    根据所述多个子视频中相邻两段子视频的LUT的亮度、曝光度、光源强度、黑色-高光比例以及对比度中的至少一个参数,确定所述多个子视频中相邻两段子视频的LUT的色彩差异结果。
  10. 一种视频编辑装置,其特征在于,包括:
    获取模块,用于获取目标视频的Log文件;
    处理模块,用于基于所述Log文件,对所述目标视频进行分段,获得多个子视频;确定所述多个子视频的画面属性,所述画面属性包括场景属性和/或色彩属性;根据所述多个子视频的画面属性和预设的映射关系,确定所述多个子视频的颜色查找表LUT,所述映射关系用于表示多个画面属性与多个LUT元素之间的对应关系;以及,基于所述多个子视频的LUT,渲染所述目标视频。
  11. 根据权利要求10所述的装置,其特征在于,所述处理模块包括人工智能AI分段模块,具体用于:
    按照至少一个采样周期对所述Log文件进行采样,确定所述至少一个采样周期中每个采样周期的多个采样帧,所述采样帧用于根据所述采样周期采样所述目标视频而获得的图像帧;
    基于所述每个采样周期的多个采样帧,在所述每个采样周期下为所述目标视频标记候选分段符号;
    基于所述每个采样周期下所述目标视频的候选分段符号,确定所述目标视频的分段符号,所述分段符号将所述目标视频划分为所述多个子视频。
  12. 根据权利要求11所述的装置,其特征在于,所述AI分段模块具体用于:
    按照所述至少一个采样周期中的第一采样周期对所述Log文件进行采样,确定多个第一采样帧;
    计算所述多个第一采样帧中的两个相邻第一采样帧之间的差异度;
    在所述差异度大于或等于第一阈值的两个相邻第一采样帧之间标记所述候选分段符号。
  13. 根据权利要求11所述的方法,其特征在于,所述AI分段模块具体用于:
    按照所述至少一个采样周期中的第一采样周期对所述Log文件进行采样,确定多个首帧和多个尾帧;
    计算所述多个首帧和多个尾帧中两个相邻的首帧和尾帧之间的差异度;
    在所述两个相邻的首帧和尾帧之间的差异度大于或等于第一阈值的时间段标记候选分段符号。
  14. 根据权利要求12或13所述的装置,其特征在于,所述AI分段模块具体用于:
    依据所述至少一个采样周期中的每个采样周期确定多个候选分段符号,将所述多个候选分段符号中重合的候选分段符号确定为所述目标视频的分段符号。
  15. 根据权利要求11-14中任一项所述的装置,其特征在于,所述至少一个采样周期包括三个采样周期,分别为第一采样周期1s、第二采样周期100ms和第三采样周期10ms。
  16. 根据权利要求10-15中任一项所述的装置,其特征在于,所述处理模块还包括AI推荐模块,具体用于:
    根据所述多个子视频的色彩属性,确定所述多个子视频的光感级别;
    根据所述多个子视频的场景属性和/或光感级别,从所述映射关系中选择与所述多个子视频的场景属性和/或光感级别对应的LUT。
  17. 根据权利要求10-16中任一项所述的装置,其特征在于,所述处理模块还包括LUT控制模块和编码模块;
    所述LUT控制模块用于:根据所述多个子视频的LUT,确定所述多个子视频中相邻两段子视频的LUT的色彩差异结果;以及,若存在所述色彩差异结果大于或等于第二阈值的LUT,调整所述相邻两段子视频中至少一段子视频的LUT;
    所述编码模块用于:基于调整后的LUT,渲染所述目标视频,所述调整后的LUT与调整前的LUT属于同一个候选LUT集合。
  18. 根据权利要求17所述的装置,其特征在于,所述LUT控制模块具体用于:
    根据所述多个子视频中相邻两段子视频的LUT的亮度、曝光度、光源强度、黑色-高光比例以及对比度,确定所述多个子视频中相邻两段子视频的LUT的色彩差异结果。
  19. 一种视频编辑装置,其特征在于,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储计算机程序,当所述处理器调用所述计算机程序时,使得所述装置执行如权利要求1-9中任一项所述的方法。
  20. 一种计算机可读存储介质,其特征在于,用于存储计算机程序,所述计算机程序包括用于实现如权利要求1-9中任一项所述的方法的指令。
  21. 一种计算机程序产品,其特征在于,所述计算机程序产品中包括计算机程序代码,当所述计算机程序代码在计算机上运行时,使得计算机实现如权利要求1-9中任一项所述的方法。
PCT/CN2022/092061 2021-08-12 2022-05-10 视频编辑方法和视频编辑装置 WO2023015997A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110926932.9A CN113810764B (zh) 2021-08-12 2021-08-12 视频编辑方法和视频编辑装置
CN202110926932.9 2021-08-12

Publications (1)

Publication Number Publication Date
WO2023015997A1 true WO2023015997A1 (zh) 2023-02-16

Family

ID=78893567

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/092061 WO2023015997A1 (zh) 2021-08-12 2022-05-10 视频编辑方法和视频编辑装置

Country Status (2)

Country Link
CN (1) CN113810764B (zh)
WO (1) WO2023015997A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810764B (zh) * 2021-08-12 2022-12-06 荣耀终端有限公司 视频编辑方法和视频编辑装置
CN114449354B (zh) * 2022-02-07 2023-12-08 上海幻电信息科技有限公司 视频编辑方法和系统
CN116389831B (zh) * 2023-06-06 2023-08-15 湖南马栏山视频先进技术研究院有限公司 一种基于云原生的离线渲染系统及方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170070740A1 (en) * 2015-09-03 2017-03-09 Intel Corporation Encoding techniques for display of text and other high-frequency content
CN111416950A (zh) * 2020-03-26 2020-07-14 腾讯科技(深圳)有限公司 视频处理方法、装置、存储介质及电子设备
CN111444819A (zh) * 2020-03-24 2020-07-24 北京百度网讯科技有限公司 切割帧确定方法、网络训练方法、装置、设备及存储介质
CN111510698A (zh) * 2020-04-23 2020-08-07 惠州Tcl移动通信有限公司 图像处理方法、装置、存储介质及移动终端
CN112954450A (zh) * 2021-02-02 2021-06-11 北京字跳网络技术有限公司 视频处理方法、装置、电子设备和存储介质
CN113810764A (zh) * 2021-08-12 2021-12-17 荣耀终端有限公司 视频编辑方法和视频编辑装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107358141B (zh) * 2016-05-10 2020-10-23 阿里巴巴集团控股有限公司 数据识别的方法及装置
CN108664931B (zh) * 2018-05-11 2022-03-01 中国科学技术大学 一种多阶段视频动作检测方法
CN109525901B (zh) * 2018-11-27 2020-08-25 Oppo广东移动通信有限公司 视频处理方法、装置、电子设备及计算机可读介质
CN110188625B (zh) * 2019-05-13 2021-07-02 浙江大学 一种基于多特征融合的视频精细结构化方法
CN110602552B (zh) * 2019-09-16 2022-02-22 广州酷狗计算机科技有限公司 视频合成的方法、装置、终端及计算机可读存储介质
US11803947B2 (en) * 2020-03-18 2023-10-31 Intel Corporation Brightness and contrast enhancement for video
CN112399269B (zh) * 2020-11-12 2023-06-20 广东小天才科技有限公司 视频分割方法、装置、设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170070740A1 (en) * 2015-09-03 2017-03-09 Intel Corporation Encoding techniques for display of text and other high-frequency content
CN111444819A (zh) * 2020-03-24 2020-07-24 北京百度网讯科技有限公司 切割帧确定方法、网络训练方法、装置、设备及存储介质
CN111416950A (zh) * 2020-03-26 2020-07-14 腾讯科技(深圳)有限公司 视频处理方法、装置、存储介质及电子设备
CN111510698A (zh) * 2020-04-23 2020-08-07 惠州Tcl移动通信有限公司 图像处理方法、装置、存储介质及移动终端
CN112954450A (zh) * 2021-02-02 2021-06-11 北京字跳网络技术有限公司 视频处理方法、装置、电子设备和存储介质
CN113810764A (zh) * 2021-08-12 2021-12-17 荣耀终端有限公司 视频编辑方法和视频编辑装置

Also Published As

Publication number Publication date
CN113810764B (zh) 2022-12-06
CN113810764A (zh) 2021-12-17

Similar Documents

Publication Publication Date Title
WO2023015997A1 (zh) 视频编辑方法和视频编辑装置
US9536479B2 (en) Image display device and method
WO2020077511A1 (zh) 一种拍摄场景下的图像显示方法及电子设备
CN112532892B (zh) 图像处理方法及电子装置
WO2021052342A1 (zh) 电子设备调整画面色彩的方法和装置
US20220319077A1 (en) Image-text fusion method and apparatus, and electronic device
WO2020134877A1 (zh) 一种皮肤检测方法及电子设备
CN111179282A (zh) 图像处理方法、图像处理装置、存储介质与电子设备
CN112887582A (zh) 一种图像色彩处理方法、装置及相关设备
WO2022022731A1 (zh) 一种拍摄的补光方法及相关装置
CN113963659A (zh) 显示设备的调整方法及显示设备
US9122098B2 (en) Image display device, photography device, image display system and method that adjusts display backlight luminance based on image tag information
CN113542580B (zh) 去除眼镜光斑的方法、装置及电子设备
US20220245778A1 (en) Image bloom processing method and apparatus, and storage medium
CN113747060B (zh) 图像处理的方法、设备、存储介质
CN113810603A (zh) 点光源图像检测方法和电子设备
WO2023160295A1 (zh) 视频处理方法和装置
WO2023016067A1 (zh) 视频处理方法、装置及电子设备
CN114222187B (zh) 视频编辑方法和电子设备
CN115730091A (zh) 批注展示方法、装置、终端设备及可读存储介质
CN114070916A (zh) 一种拍摄的补光方法及相关装置
WO2024082976A1 (zh) 文本图像的ocr识别方法、电子设备及介质
WO2023005882A1 (zh) 拍摄方法、拍摄参数训练方法、电子设备及存储介质
CN115705663B (zh) 图像处理方法与电子设备
CN115619628B (zh) 图像处理方法和终端设备

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE