Video processing method and device, electronic equipment, storage medium and program product
By storing video frames to memory in video processing and directly communicating with memory for editing processing, the problem of video size and speed limitation caused by cache limitation in the prior art is solved, and more efficient video processing and larger Support for size videos.
Patent Information
- Application Number
- CN202411529041.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-07
AI Technical Summary
In the video processing process, the prior art relies on cache storage, which limits the size and speed of video rotation processing, and is low efficiency, which can easily cause garbled code or errors in video frame images.
By storing the video frames of the to-process video to memory, and when the editing processing conditions are met, the target video frame is read from the memory for editing and processing, and then written to the memory, and reading and writing are performed through direct communication with the memory. to avoid cache restrictions.
This method reduces the limitations on video size and transmission bandwidth, supports editing processing of larger video frames, improves processing efficiency and performance, and reduces resource consumption and the occurrence of video frame image errors.
Smart Images

Figure CN119402706A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a video processing method, device, electronic device, storage medium and program product. Background Art
[0002] In the process of video processing, there is often a demand for video rotation or other editing processing. In the related technology, when rotating a video, a cache is usually used to store the row data of the video frame. When there is a certain amount of row data in the cache, the row data in the cache is rotated. However, this method requires additional cache. Due to the limitation of cache capacity, the size and speed of the video for rotation processing are greatly limited. Summary of the invention
[0003] The present disclosure provides a video processing method, device, electronic device, storage medium and program product.
[0004] In a first aspect, the present disclosure provides a video processing method, the video processing method comprising:
[0005] In response to the video editing instruction, each video frame of the acquired video to be processed is sequentially stored in a memory;
[0006] When the editing processing condition is met, a target video frame is read from the video frames stored in the memory, the target video frame is edited, and the edited target video frame is written into the memory;
[0007] When the playing condition is met, the edited target video frame is read from the memory, and the edited target video frame is played.
[0008] In a second aspect, the present disclosure provides a video processing device, the video processing device comprising:
[0009] A storage module, configured to store each video frame of the acquired video to be processed in sequence into a memory in response to a video editing instruction;
[0010] An editing processing module, used for reading a target video frame from the video frames stored in the memory, editing the target video frame, and writing the edited target video frame into the memory when an editing processing condition is met;
[0011] The playing module is used to read the edited target video frame from the memory and play the edited target video frame when the playing condition is met.
[0012] In a third aspect, the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and one or more of the computer programs are executed by the at least one processor so that the at least one processor can perform the above-mentioned video processing method.
[0013] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned video processing method when executed by a processor.
[0014] In a fifth aspect, the present disclosure provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned video processing method.
[0015] The video processing method provided by the embodiment of the present disclosure stores the video frames of the video to be processed in a memory, and when the editing processing conditions are met, reads the target video frames from the memory, performs editing processing, and then writes them into the memory. Then, the edited target video frames can be read from the memory, and the edited target video frames can be played. In this way, in the process of editing the video, both reading and writing adopt direct communication with the memory, which reduces the limitations caused by the need to increase the cache, reduces the limitations on the video size and transmission bandwidth, can support the editing and processing of video frames of larger sizes, and improves the processing efficiency and processing performance.
[0016] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1 An application scenario diagram of the video processing method and device provided in the embodiments of the present disclosure;
[0019] Figure 2 A flowchart of a video processing method provided by an embodiment of the present disclosure;
[0020] Figure 3 A schematic diagram of the logical architecture of video processing in an embodiment of the present disclosure;
[0021] Figure 4 A block diagram of a video processing device provided by an embodiment of the present disclosure;
[0022] Figure 5 A block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0024] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0025] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0026] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0027] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0028] In the technical solution disclosed in this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution complies with relevant national laws and regulations (for example, the "Information Security Technology Personal Information Security Specification", etc.). For example: corresponding prescribed measures are taken for personal information access control; prescribed restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; when using personal information, clear identity orientation is eliminated to avoid precise positioning of specific individuals.
[0029] In the related art, during the video processing process, a cache is usually used to store the row data of the video frame, and then rotate or other editing processes are performed. This method mainly depends on the size of the cache capacity, resulting in limitations on the size and speed of the video that can be rotated, and this method requires processing for each video frame, and the efficiency is also low. In addition, after the rotation process is performed in the related art, the rotated data is written to the memory through the bus. In this process, usually more than one video path is written to the memory. When multiple video paths are written to the memory, the bus bandwidth requirement is also high. If the bandwidth is insufficient, it may cause garbled or errors in the video frame image.
[0030] A video processing method is provided in the embodiment of the present disclosure. The method adopts direct communication with the memory to store the video frames of the video to be processed in the memory, and then reads the video frames in the memory for editing and processing, and then writes them into the memory. Thereafter, the rotated video frames are read from the memory for display and playback. The video data read and written each time are not limited by the cache, and the editing and processing of videos of larger sizes can be supported. In addition, the method of directly communicating with the memory also effectively improves the utilization rate of the communication bandwidth.
[0031] Figure 1 The application scenario diagram of the video processing method and device provided by the embodiments of the present disclosure is schematically shown.
[0032] like Figure 1 As shown, the application scenario of the embodiment of the present disclosure may include a terminal device 101, a network 103 and a server 102. The network 103 is used to provide a medium for a communication link between the terminal device 101 and the server 102. The network 103 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0033] The user can use the terminal device 101 to interact with the server 102 through the network 103 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0034] The terminal device 101 may be any electronic device having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.
[0035] The server 102 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the terminal device 101. The background management server may analyze and process received data such as user requests, and feed back processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0036] It should be noted that the video processing method and apparatus provided in the embodiments of the present disclosure may be executed by the server 102. Accordingly, the video processing method and apparatus provided in the embodiments of the present disclosure may be arranged in the server 102. The video processing method and apparatus provided in the embodiments of the present disclosure may also be executed by a server or server cluster that is different from the server 102 and that can communicate with the terminal device 101 and / or the server 102. Accordingly, the video processing method and apparatus provided in the embodiments of the present disclosure may also be arranged in a server or server cluster that is different from the server 102 and that can communicate with the terminal device 101 and / or the server 102.
[0037] Alternatively, the video processing method and apparatus provided in the embodiments of the present disclosure may be executed by the terminal device 102. For example, the terminal device 102 may obtain the video to be processed from the server 102, and then the terminal device 102 may edit the video to be processed based on the video processing method in the embodiments of the present disclosure, and play the edited video.
[0038] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0039] Figure 2 A flowchart of a video processing method provided by an embodiment of the present disclosure. Figure 2 , the method comprising:
[0040] Step S201: In response to a video editing instruction, each video frame of the acquired video to be processed is sequentially stored in a memory.
[0041] In the embodiments of the present disclosure, various real-time analyses and processing can be performed on the video to be processed, such as rotating the video. For example, different playback platforms may have different requirements for the direction of the video. Through rotation processing, the video can be converted into a format suitable for playback on a specific platform, etc. The video processing method in the embodiments of the present disclosure is not limited to the application scenarios. For example, it can be applied to live broadcast, monitoring, video conferencing, online education and other scenarios.
[0042] In the disclosed embodiment, during the video processing process, the video to be processed can be obtained from an input source, such as network stream acquisition, camera acquisition, etc., and then the video to be processed can be stored in a memory through a bus instead of being stored in a cache area.
[0043] Furthermore, the video editing instructions in the embodiments of the present disclosure can be triggered by, for example, a user clicking an editing function button, or according to preset video format requirements, or by editing gestures or posture changes on a device that plays the video, etc., and there are no limitations on this.
[0044] Step S202: when the editing processing condition is met, a target video frame is read from the video frames stored in the memory, and the target video frame is edited, and the edited target video frame is written into the memory.
[0045] The editing process includes at least one of the following: rotation, scaling, translation, cropping, and special effect processing, which is not limited in the embodiments of the present disclosure.
[0046] In this step S202, satisfying the editing processing condition includes: determining that the number of video frames stored in the memory is greater than or equal to a threshold; or determining that a preset processing cycle is satisfied.
[0047] When performing editing processing, when a certain number of video frames are stored, unified processing can be performed to improve processing efficiency and reduce the number of read interactions, or video frames can be read from the memory for processing at certain processing intervals, wherein the preset processing cycle usually needs to be determined based on the video playback resolution, processing speed, etc.
[0048] With respect to reading the target video frame from the video frame stored in the memory in step S202, the present disclosure also provides several possible embodiments, specifically:
[0049] In a possible embodiment, reading the target video frame from the video frames stored in the memory includes: reading the target video frame from the video frames stored in the memory every first number of frames according to a preset first number of frames.
[0050] In the embodiments of the present disclosure, compared with the storage in the cache area in the related art, which is usually stored in the cache area in the form of a video stream and needs to be edited frame by frame, the video frames of the video to be processed are stored in the memory in the embodiments of the present disclosure, and the editing process of the video frames is controllable. For example, the number of video frames to be edited per second can be set, that is, the number of first frames to be edited can be obtained, and then a video frame can be read from the memory every first frame number as the target video frame for editing. In this way, there is no need to edit every frame, which can improve efficiency and reduce resource consumption.
[0051] In another possible embodiment, reading the target video frame from the video frames stored in the memory includes: determining the second frame number according to current processing resource information; and reading the target video frame every second frame number from the video frames stored in the memory.
[0052] Among them, the current processing resource information includes, for example, bandwidth information, computing resource information, current remaining memory in the memory, etc., and there is no restriction on this. In this way, the number of second frames for interval processing can be determined dynamically in real time to better meet current needs and improve efficiency and processing performance.
[0053] In another possible embodiment, reading the target video frame from the video frames stored in the memory includes: sequentially reading each video frame stored in the memory, wherein each read video frame is used as the target video frame.
[0054] In the disclosed embodiment, it is also possible to read each video frame in sequence for editing instead of processing at intervals, which can improve the resolution and playback effect of the video after editing.
[0055] Step S203: when the playing condition is met, the edited target video frame is read from the memory, and the edited target video frame is played.
[0056] Among them, the playback conditions are, for example, playing the target video frame when it is determined that the editing process is completed, so that the edited video can be played in real time. For example, in a non-real-time playback scenario, when a playback instruction is received, it is determined that the playback conditions are met, and then the edited target video frame is read from the memory for playback.
[0057] For example, the frame rate of the video to be processed is 60 video frames displayed per second. The high frame rate can provide clearer and richer picture quality, but it will also generate more data volume, requiring a larger transmission bandwidth, processing power, etc. In the embodiment of the present disclosure, when performing editing processing, interval processing can be performed as needed. For example, a target video frame is read for editing processing every other frame, and the edited target video frame is written into the memory. Then, when playing, only the edited target video frame can be read for playback. Then, the number of video frames that can be played per second is 30, and the frame rate is lower than before, but it usually has less impact on the video display effect, and can save resources and reduce bandwidth requirements.
[0058] In the disclosed embodiment, each video frame of the video to be processed is stored in the memory in sequence. When the editing processing conditions are met, the target video frame is read from the memory, edited and then written to the memory. Then, the edited target video frame can be read from the memory for playback. In this way, in the process of editing the video, direct communication with the memory is adopted, which reduces the limitations caused by the need for additional cache, such as limitations on video size and transmission bandwidth, and improves processing efficiency and performance.
[0059] See also Figure 3 FIG. 1 is a schematic diagram of the logical architecture of video processing in an embodiment of the present disclosure.
[0060] like Figure 3 As shown, the embodiment of the present disclosure includes a video input device, a memory, a video output device and a video editor, wherein the video editor can be a video rotator, a video scaler, etc., and there is no limitation on the editing processing method.
[0061] The video input device, the video output device and the video editor are respectively connected to the memory, for example, directly connected to the memory through a bus. The video input device stores the video frames of the video to be processed in the memory. The video editor communicates with the memory through the bus, reads the video frames stored in the memory, and writes them back to the memory after editing. In this process, each bus communication with the memory is not limited by the size of the cache area, which effectively improves the bus bandwidth utilization rate and also reduces the size of the video frames read and written, which can support editing and processing of larger video sizes.
[0062] Furthermore, when the playback conditions are met, the video output device can read the edited target video frame from the memory through bus communication, and can play the edited target video frame, so that the edited effect of the video can be displayed.
[0063] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0064] In addition, the present disclosure also provides a video processing device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any video processing method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to in the corresponding records of the method part and will not be repeated here.
[0065] Figure 4 A block diagram of a video processing device provided in an embodiment of the present disclosure.
[0066] Reference Figure 4 , an embodiment of the present disclosure provides a video processing device, the video processing device comprising:
[0067] The storage module 41 is used to store each video frame of the acquired video to be processed in sequence into the memory in response to the video editing instruction;
[0068] The editing processing module 42 is used to read the target video frame from the video frames stored in the memory, edit the target video frame, and write the edited target video frame into the memory when the editing processing condition is met;
[0069] The playing module 43 is used to read the edited target video frame from the memory and play the edited target video frame when the playing condition is met.
[0070] In a possible embodiment, when the editing processing condition is met, the editing processing module 42 is used to:
[0071] Determining that the number of video frames stored in the memory is greater than or equal to a threshold; or,
[0072] Determine whether the preset processing period is met.
[0073] In a possible embodiment, when the target video frame is read from the video frames stored in the memory, the editing processing module 42 is used to: read the target video frame from the video frames stored in the memory every first number of frames according to a preset first number of frames.
[0074] In a possible embodiment, when reading the target video frame from the video frame stored in the memory, the editing processing module 42 is used to:
[0075] Determine the second frame number according to current processing resource information;
[0076] From the video frames stored in the memory, a target video frame is read every second number of frames.
[0077] In a possible embodiment, when reading the target video frame from the video frames stored in the memory, the editing processing module 42 is used to: sequentially read each video frame stored in the memory, wherein each read video frame is used as the target video frame.
[0078] In a possible embodiment, the editing process includes at least one of the following: rotation, scaling, translation, cropping, and special effect processing.
[0079] Each module in the above video processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0080] Figure 5 A block diagram of an electronic device provided in an embodiment of the present disclosure.
[0081] Reference Figure 5 An embodiment of the present disclosure provides an electronic device, which includes: at least one processor 501; at least one memory 502, and one or more I / O interfaces 503, connected between the processor 501 and the memory 502; wherein the memory 502 stores one or more computer programs that can be executed by the at least one processor 501, and the one or more computer programs are executed by the at least one processor 501 so that the at least one processor 501 can execute the above-mentioned video processing method.
[0082] Each module in the above electronic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0083] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned video processing method when executed by a processor. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0084] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned video processing method.
[0085] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0086] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0087] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0088] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0089] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0090] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0091] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0092] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0093] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0094] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A video processing method, characterized in that: include: In response to the video editing instruction, each video frame of the acquired video to be processed is sequentially stored in a memory; When the editing processing condition is met, a target video frame is read from the video frames stored in the memory, the target video frame is edited, and the edited target video frame is written into the memory; When the playing condition is met, the edited target video frame is read from the memory, and the edited target video frame is played.
2. The video processing method according to claim 1, characterized in that: The editing processing conditions are met, including: Determining that the number of video frames stored in the memory is greater than or equal to a threshold; or, Determine whether the preset processing period is met.
3. The video processing method according to claim 1 or 2, characterized in that: The step of reading a target video frame from the video frames stored in the memory comprises: According to a preset first frame number, target video frames are read from the video frames stored in the memory at intervals of the first frame number.
4. The video processing method according to claim 1 or 2, characterized in that: The step of reading a target video frame from the video frames stored in the memory comprises: Determine the second frame number according to current processing resource information; From the video frames stored in the memory, a target video frame is read every second number of frames.
5. The video processing method according to claim 1 or 2, characterized in that: The step of reading a target video frame from the video frames stored in the memory comprises: Each video frame stored in the memory is read in sequence, wherein each read video frame is used as a target video frame.
6. The video processing method according to claim 1, characterized in that: The editing process includes at least one of the following: Rotate, scale, translate, crop, and perform special effects processing.
7. A video processing device, characterized in that: include: A storage module, configured to store each video frame of the acquired video to be processed in sequence into a memory in response to a video editing instruction; An editing processing module, used for reading a target video frame from the video frames stored in the memory, editing the target video frame, and writing the edited target video frame into the memory when an editing processing condition is met; The playing module is used to read the edited target video frame from the memory and play the edited target video frame when the playing condition is met.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the video processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the video processing method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer-readable code or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the video processing method as described in any one of claims 1 to 6.