Video stream processing method and apparatus, electronic device, and storage medium

By receiving, cropping, and converting video streams, the problem of useless pixels and black borders on non-standard resolution screens is solved, achieving efficient video stream adaptation and display optimization.

CN122496676APending Publication Date: 2026-07-31深圳嘀佳科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
深圳嘀佳科技有限公司
Filing Date
2026-04-10
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Terminal devices only support video streams within standard protocols, resulting in useless pixels and black borders on non-standard resolution screens, affecting display quality and wasting resources.

Method used

The system receives the raw video stream, extracts the effective pixel region according to the target cropping parameters, stores it in the target memory, and converts it into the output corresponding to the resolution of the peripheral screen using a bilinear interpolation algorithm.

Benefits of technology

It achieves precise adaptation to screens of different resolutions, removes black borders, improves display experience and data utilization efficiency, and reduces FPGA resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122496676A_ABST
    Figure CN122496676A_ABST
Patent Text Reader

Abstract

This application relates to the field of video processing technology, and more particularly to a video stream processing method, apparatus, electronic device, and storage medium, comprising: receiving a raw video stream from a front end; processing video frames in the raw video stream according to target cropping parameters to extract effective pixel regions from the video frames as effective video frames corresponding to each video frame; storing the effective video frames in a target memory according to preset storage rules; reading the effective video frames from the target memory; converting the effective video frames into output video frames corresponding to an external screen; and outputting the output video frames to the external screen for display. Thus, the input raw video stream can be cropped to remove useless black border pixels from the frames, perform corresponding scaling and resolution conversion to adapt to screens of any resolution on the terminal, meet the display needs of external screens with different resolutions, and improve the display experience and data utilization efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video processing technology, and in particular to a method, apparatus, electronic device and storage medium for processing video streams. Background Technology

[0002] Some terminal devices typically only support video streams within the requested standard protocol, such as the Video Electronics Standards Association Protocol (VESA). However, peripherals, such as some circular screens, have resolutions that are not covered by the protocol, so they need to be adapted to fit the corresponding screen.

[0003] Meanwhile, because the aspect ratio of the front-end host (such as a mobile phone) screen often differs from that of the VESA protocol standard resolution, directly transmitting the video stream requested by the front-end to the back-end peripheral screen without any processing will result in useless pixels and black borders. For example, requesting a 720*1280 resolution video from a mobile phone will result in useless black pixels at the edges in the output video stream because mobile phones do not all have a 720:1280 aspect ratio. This not only affects the display effect but also wastes transmission bandwidth and display resources. Summary of the Invention

[0004] This application provides a video stream processing method and apparatus, which can solve at least one of the technical problems in the background art to a certain extent.

[0005] To achieve the above objectives, this application adopts the following technical solution: Firstly, a method for processing video streams is provided, the method comprising: Receive the raw video stream from the front end; Based on the target cropping parameters, the video frames in the original video stream are processed to extract the effective pixel regions in the video frames, which are then used as the effective video frames corresponding to each video frame. According to the preset storage rules, the valid video frames are stored in the target memory; Read the valid video frame from the target memory; Convert the valid video frames into output video frames corresponding to the peripheral screen; The output video frames are then displayed on the peripheral screen.

[0006] Secondly, a video stream processing apparatus is provided, comprising: The receiving module is used to receive the raw video stream from the front end; The processing module is used to process the video frames in the original video stream according to the target cropping parameters, and extract the effective pixel regions in the video frames as the effective video frames corresponding to each video frame; A storage module is used to store the valid video frames in a target memory according to preset storage rules; A reading module is used to read the valid video frames from the target memory; A conversion module is used to convert the valid video frames into output video frames corresponding to the peripheral screen; The output module is used to output the video frames to the peripheral screen for display.

[0007] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a video stream processing method as described in any of the first aspects above.

[0008] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the video stream processing method as described in any one of the first aspects above.

[0009] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to execute the video stream processing method described in any of the first aspects above.

[0010] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.

[0011] In this embodiment, the raw video stream from the front end is first received. Then, according to the target cropping parameters, the video frames in the raw video stream are processed to extract the effective pixel regions from the video frames, which are then used as the effective video frames corresponding to each video frame. Next, the effective video frames are stored in the target memory according to preset storage rules. Then, the effective video frames are read from the target memory and converted into output video frames corresponding to the peripheral screen. Finally, the output video frames are output to the peripheral screen for display. Thus, the input raw video stream can be cropped to remove useless black border pixels from the frames, and the video can be scaled and resized to adapt to any resolution screen of the terminal. This method requires relatively few FPGA resources, and FPGA implementation can achieve low latency, high throughput, and high robustness, meeting the display requirements of peripheral screens with different resolutions, achieving precise adaptation between the video stream and the peripheral screen, and improving the display experience and data utilization efficiency.

[0012] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0013] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiments below. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a flowchart illustrating the video stream processing method provided in an embodiment of this application; Figure 2 This is a block diagram of the video processing system provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of the video stream processing apparatus provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0014] The embodiments of the technical solutions of this application will now be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of this application, and are therefore merely examples and should not be used to limit the scope of protection of this application. When the following description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. Various changes, modifications, and equivalents of the methods, apparatus, and / or systems described herein will become apparent upon understanding this disclosure. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but can be changed as will become apparent upon understanding this disclosure, except for operations that must be performed in a specific order. Furthermore, for clarity and conciseness, descriptions of features known in the art may be omitted.

[0015] The embodiments described in the following examples of this disclosure are not representative of all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0016] Currently, the closest existing technologies to this invention mainly fall into two categories: The first category is medical image processing technology, which is mainly applied in medical scenarios such as endoscopes and ultrasound equipment. Doctors need to perform local magnification processing on the medical image video stream to clearly observe the lesion area. The second category is video format conversion and transcoding equipment. This type of equipment can perform format conversion, resolution adjustment, and cropping processing on the input video stream, and is suitable for video adaptation scenarios of different terminal devices.

[0017] See Figure 1 This is a schematic flowchart illustrating the video stream processing method provided in this application embodiment. The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0018] like Figure 1 As shown, the video stream processing method provided in this embodiment includes the following steps: Step 101: Receive the raw video stream from the front end.

[0019] Specifically, it can receive continuous raw video streams output from the front-end host. These raw video streams can be VESA protocol video streams (Video Electronics Standards Association protocol video streams).

[0020] The front-end host can be any type of device with VESA protocol video stream output function, such as a mobile phone. The receiving process is implemented through a preset interface to ensure the stability and real-time performance of the video stream transmission.

[0021] Step 102: Based on the target cropping parameters, process the video frames in the original video stream to extract the effective pixel regions in the video frames, which are then used as the effective video frames corresponding to each video frame.

[0022] One possible approach is to first obtain the target cropping parameters issued by the MCU. These parameters include the number of pixels to be cropped on the left, right, top, and bottom. Then, based on the target cropping parameters, the effective pixel region is located from the video frames of the VESA protocol video stream. The effective pixel region in the video frame is then extracted to obtain the effective video frame corresponding to the video frame.

[0023] Specifically, the received raw video stream can be cropped to remove effective pixels. First, the target cropping parameters are received from the microcontroller unit (MCU), the effective pixel areas in the video frames are located and extracted, and invalid pixels (mainly black border pixels) are discarded.

[0024] The target cropping parameters are customizable and include the number of pixels to be cropped on the left, right, top, and bottom. These parameters can be flexibly adjusted based on the differences between the aspect ratio of the front-end host and the resolution of the VESA protocol standard, as well as the display requirements of the peripheral screen.

[0025] For example, when the resolution of the input raw video stream is 720×1280, if the left and right 30 pixels of each of the 720 pixels in each video frame are detected as black useless pixels, the useless pixels can be cropped by setting the target cropping parameters, leaving the middle 660 effective pixels. This achieves accurate extraction of effective pixels and reduces the occupation of transmission bandwidth and display resources by useless pixels.

[0026] Step 103: Store the valid video frames in the target memory according to the preset storage rules.

[0027] Among them, the target memory can be pseudo static random access memory (PSRAM). PSRAM combines the high-speed read and write characteristics of static random access memory (SRAM) with the high integration and low cost advantages of dynamic random access memory (DRAM), which can meet the high-speed caching requirements of video frames.

[0028] The preset storage rules can be set according to the resolution, frame rate and reading requirements of the peripheral screen of the effective video frame, ensuring the orderly storage of video frames. At the same time, through reasonable storage rule design, the space occupied by PSRAM can be reduced, alleviating the dependence on large-capacity memory in the existing technology.

[0029] The core of the preset storage rules is to adapt to the storage of valid video frames, the timing of screen frame reading from backend peripherals, and the characteristics of the target memory (PSRAM). Specifically, the following implementation methods can be adopted: For example, each valid video frame can be stored sequentially in a designated contiguous storage area of ​​the target memory (PSRAM) according to the receiving order of valid video frames. Each frame of data corresponds to an independent storage address segment. The start and end addresses of the address segments are pre-marked to ensure that adjacent frame data do not overlap, and at the same time, it is convenient to quickly locate and read the corresponding valid video frame according to the frame reading timing.

[0030] Alternatively, the target memory (PSRAM) can be divided into several storage partitions that match the resolution of the effective video frames, based on the resolution parameters of the effective video frames. Valid video frames of different resolutions are stored in the corresponding partitions, while each partition reserves a preset redundant space to prevent frame data storage overflow.

[0031] Alternatively, the storage timing of valid video frames can be synchronized with the frame reading timing of the back-end peripheral screen by combining the frame reading timing of the back-end peripheral screen. After each valid video frame is stored, a storage completion feedback signal is generated to ensure that when the back-end peripheral screen sends a frame reading request, the corresponding complete and valid video frame has been stored in the target memory, thus avoiding reading failure or frame loss due to storage lag.

[0032] Step 104: Read valid video frames from the target memory.

[0033] Optionally, in response to receiving an output frame request signal, a valid video frame is read from the target memory.

[0034] The target memory is a pseudo-static random access memory (PSRAM), and the target memory is configured to cache at least one complete valid video frame.

[0035] Optionally, once at least one complete valid video frame is cached in the PSRAM, a frame read request is sent to the PSRAM according to the frame structure timing corresponding to the resolution of the backend peripheral screen to read the previously stored valid video frame. This design ensures the continuity of video stream output, avoids issues such as stuttering and frame loss, improves display smoothness, and meets real-time display requirements.

[0036] Step 105: Convert the valid video frames into output video frames corresponding to the peripheral screen.

[0037] Optionally, a bilinear interpolation algorithm is used to scale the effective video frames, converting the resolution of the effective video frames to a target resolution that matches the peripheral screen, thus obtaining the output video frames.

[0038] Specifically, the effective video frames can be scaled up and down. The bilinear interpolation algorithm is used to calculate the resolution of the effective video frames and convert it to the target resolution that perfectly matches the screen of the backend peripheral device to obtain the output video frames.

[0039] Among them, the bilinear interpolation algorithm uses the four real pixel values ​​around the virtual point in the source video frame to jointly determine the pixel value in the target video frame. It achieves a good trade-off between algorithm complexity and display effect, and has high computational efficiency. It can adapt to the low latency processing requirements of FPGA, ensure the real-time performance of video stream processing, and retain the effective information of the source video frame to the maximum extent, thereby improving the display effect of the peripheral screen.

[0040] Step 106: Output the video frames to the external screen for display.

[0041] Optionally, the output video frames can be sent to an external screen for display via the MIPI interface.

[0042] Among them, the MIPI interface has the advantages of low power consumption, high bandwidth and small package size, adapts to the connection needs of mobile terminals and peripheral screens, and can ensure the stability of video stream transmission.

[0043] In this embodiment, the raw video stream from the front end is first received. Then, according to the target cropping parameters, the video frames in the raw video stream are processed to extract the effective pixel regions from the video frames, which are then used as the effective video frames corresponding to each video frame. Next, the effective video frames are stored in the target memory according to preset storage rules. Then, the effective video frames are read from the target memory and converted into output video frames corresponding to the peripheral screen. Finally, the output video frames are output to the peripheral screen for display. This allows for cropping of the input raw video stream to remove useless black border pixels from the frames, and performs corresponding scaling and resolution conversion to adapt to any resolution screen on the terminal. It consumes relatively few FPGA resources, and FPGA implementation achieves low latency, high throughput, and high robustness, meeting the display requirements of peripheral screens with different resolutions. It achieves precise adaptation between the video stream and the peripheral screen, improving the display experience and data utilization efficiency. It also eliminates the problem of black borders in the output video stream caused by the inconsistency between the aspect ratio of the mobile phone and the VESA standard resolution. It solves the adaptation and optimization between peripherals and the host, and can output to screens with different resolutions, not limited to a single resolution screen, which greatly improves flexibility.

[0044] Figure 2 The present invention provides a video processing system structural block diagram. The system includes a video input module, a video effective width and height cropping module, an MCU, a PSRAM write module, a PSRAM, a PSRAM read module, an output video frame composition module, a scaling module, a MIPI interface output module, and a video output module. The video input module transmits the video signal to the video effective width and height cropping module. The MCU transmits a parameter-defined signal to the video effective width and height cropping module. The video effective width and height cropping module transmits the processed video signal to the PSRAM write module. The PSRAM write module writes the video signal into the PSRAM, storing at least one frame of video signal. The PSRAM transmits the stored video signal to the PSRAM read module. The output video frame composition module outputs a frame request signal to the PSRAM read module. The PSRAM read module transmits the read video signal to the scaling module. The scaling module scales the video signal and then transmits it to the MIPI interface output module. The MIPI interface output module outputs the processed video signal to the video output module.

[0045] Corresponding to the video stream processing method described in the above embodiments, Figure 3It is a structural block diagram of a video stream processing device provided by an embodiment of the present application.

[0046] Referring to Figure 3 , the video stream processing device 200 includes: A receiving module 210, configured to receive an original video stream from the front end; A processing module 220, configured to process video frames in the original video stream according to target cropping parameters, and extract valid pixel regions in the video frames as valid video frames corresponding to each video frame; A storage module 230, configured to store the valid video frames in a target memory according to a preset storage rule; A reading module 240, configured to read the valid video frames from the target memory; A conversion module 250, configured to convert the valid video frames into output video frames corresponding to the peripheral screen; An output module 260, configured to output the output video frames to the peripheral screen for display.

[0047] Optionally, the original video stream is a VESA protocol video stream, The processing module is specifically configured to: Obtain target cropping parameters sent by the MCU, where the target cropping parameters include the number of left cropped pixels, the number of right cropped pixels, the number of upper cropped pixels, and the number of lower cropped pixels; Based on the target cropping parameters, locate the valid pixel regions in the video frames of the VESA protocol video stream; Extract the valid pixel regions in the video frames to obtain valid video frames corresponding to the video frames.

[0048] Optionally, the conversion module is specifically configured to: Perform scaling processing on the valid video frames using a bilinear interpolation algorithm, and convert the resolution of the valid video frames into a target resolution matching the peripheral screen to obtain the output video frames.

[0049] Optionally, the reading module 240 is specifically configured to: In response to receiving an output frame request signal, read the valid video frames from the target memory, where the target memory is a pseudo-static random access memory PSRAM, and the target memory is configured to cache at least one frame of complete valid video frames.

[0050] Optionally, the output module 260 is specifically configured to: Output the output video frames to the peripheral screen for display through a MIPI interface.

[0051] In this embodiment, the raw video stream from the front end is first received. Then, according to the target cropping parameters, the video frames in the raw video stream are processed to extract the effective pixel regions from the video frames, which are then used as the effective video frames corresponding to each video frame. Next, the effective video frames are stored in the target memory according to preset storage rules. Then, the effective video frames are read from the target memory and converted into output video frames corresponding to the peripheral screen. Finally, the output video frames are output to the peripheral screen for display. This allows for cropping of the input raw video stream to remove useless black border pixels from the frames, and performs corresponding scaling and resolution conversion to adapt to any resolution screen on the terminal. It consumes relatively few FPGA resources, and FPGA implementation achieves low latency, high throughput, and high robustness, meeting the display requirements of peripheral screens with different resolutions. It achieves precise adaptation between the video stream and the peripheral screen, improving the display experience and data utilization efficiency. It also eliminates the problem of black borders in the output video stream caused by the inconsistency between the aspect ratio of the mobile phone and the VESA standard resolution. It solves the adaptation and optimization between peripherals and the host, and can output to screens with different resolutions, not limited to a single resolution screen, which greatly improves flexibility.

[0052] in addition, Figure 3 The video stream processing device shown can be a software unit, hardware unit, or a combination of software and hardware built into existing electronic devices, or it can be integrated into electronic devices as a separate component, or it can exist as a standalone electronic device.

[0053] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0054] Figure 4 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 4 As shown, the electronic device 5 of this embodiment includes: at least one processor 50 ( Figure 4 (Only one is shown in the diagram) a processor, a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, wherein the processor 50 executes the computer program 52 to implement the steps in the embodiments of the processing methods for any of the video streams described above.

[0055] The electronic device may be a desktop computer, laptop, handheld computer, or cloud server, etc. This electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 4 This is merely an example of electronic device 5 and does not constitute a limitation on electronic device 5. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.

[0056] The processor 50 may be a central processing unit, or it may be other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0057] In some embodiments, the memory 51 may be an internal storage unit of the electronic device 5, such as a hard disk or memory of the electronic device 5. In other embodiments, the memory 51 may be an external storage device of the electronic device 5, such as a plug-in hard disk, smart memory card, secure digital card, flash memory card, etc., equipped on the electronic device 5. Further, the memory 51 may include both internal storage units and external storage devices of the electronic device 5. The memory 51 is used to store operating systems, applications, boot loaders, data, and other programs, such as the program code of the computer program. The memory 51 can also be used to temporarily store data that has been output or will be output.

[0058] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the above-described method embodiments.

[0059] This application provides a computer program product that, when run on an electronic device, enables the electronic device to implement the steps described in the various method embodiments above.

[0060] If the integrated unit is implemented as a software functional unit and used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / electronic device, a recording medium, a computer memory, a read-only memory, a random access memory, an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0061] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0062] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0064] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0065] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method of processing a video stream, characterized by, include: Receive the raw video stream from the front end; Based on the target cropping parameters, the video frames in the original video stream are processed to extract the effective pixel regions in the video frames, which are then used as the effective video frames corresponding to each video frame. According to the preset storage rules, the valid video frames are stored in the target memory; Read the valid video frame from the target memory; Convert the valid video frames into output video frames corresponding to the peripheral screen; The output video frames are then displayed on the peripheral screen.

2. The method of claim 1, wherein, The original video stream is a VESA protocol video stream. The step of processing video frames in the original video stream according to the target cropping parameters and extracting the effective pixel regions in the video frames as the effective video frames corresponding to each video frame includes: Obtain the target cropping parameters sent by the MCU. The target cropping parameters include the number of pixels to be cropped on the left, the number of pixels to be cropped on the right, the number of pixels to be cropped on the top, and the number of pixels to be cropped on the bottom. Based on the target cropping parameters, the effective pixel region is located from the video frames of the VESA protocol video stream; The effective pixel region in the video frame is extracted to obtain the effective video frame corresponding to the video frame.

3. The method of claim 2, wherein, The step of converting the valid video frame into an output video frame corresponding to the peripheral screen includes: The effective video frames are scaled using a bilinear interpolation algorithm to convert their resolution to a target resolution that matches the peripheral screen, thus obtaining the output video frames.

4. The method of claim 3, wherein, The step of reading the valid video frame from the target memory includes: In response to receiving an output frame request signal, the valid video frame is read from the target memory. The target memory is a pseudo-static random access memory (PSRAM), and the target memory is configured to cache at least one complete valid video frame.

5. The method of claim 1, wherein, The step of outputting the video frame to the peripheral screen for display includes: The output video frames are displayed on the peripheral screen via the MIPI interface.

6. An apparatus for processing a video stream, the apparatus comprising: include: The receiving module is used to receive the raw video stream from the front end; The processing module is used to process the video frames in the original video stream according to the target cropping parameters, and extract the effective pixel regions in the video frames as the effective video frames corresponding to each video frame; A storage module is used to store the valid video frames in a target memory according to preset storage rules; A reading module is used to read the valid video frames from the target memory; A conversion module is used to convert the valid video frames into output video frames corresponding to the peripheral screen; The output module is used to output the video frames to the peripheral screen for display.

7. The method of claim 6, wherein, The original video stream is a VESA protocol video stream. The processing module is specifically used for: Obtain the target cropping parameters sent by the MCU. The target cropping parameters include the number of pixels to be cropped on the left, the number of pixels to be cropped on the right, the number of pixels to be cropped on the top, and the number of pixels to be cropped on the bottom. Based on the target cropping parameters, the effective pixel region is located from the video frames of the VESA protocol video stream; The effective pixel region in the video frame is extracted to obtain the effective video frame corresponding to the video frame.

8. The method of claim 7, wherein, The conversion module is specifically used for: The effective video frames are scaled using a bilinear interpolation algorithm to convert their resolution to a target resolution that matches the peripheral screen, thus obtaining the output video frames.

9. An electronic device, comprising: The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method as described in any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, which is loaded by a processor to perform the steps of the method according to any one of claims 1 to 5.