CN115190262A - Electronic device, video stream processing method, device and medium - Google Patents

Electronic device, video stream processing method, device and medium Download PDF

Info

Publication number
CN115190262A
CN115190262A CN202110360094.3A CN202110360094A CN115190262A CN 115190262 A CN115190262 A CN 115190262A CN 202110360094 A CN202110360094 A CN 202110360094A CN 115190262 A CN115190262 A CN 115190262A
Authority
CN
China
Prior art keywords
video stream
resolution
hdmi
analysis instruction
received
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110360094.3A
Other languages
Chinese (zh)
Inventor
陈维强
李蕾
高雪松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Group Holding Co Ltd
Original Assignee
Hisense Group Holding Co Ltd
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 Hisense Group Holding Co Ltd filed Critical Hisense Group Holding Co Ltd
Priority to CN202110360094.3A priority Critical patent/CN115190262A/en
Publication of CN115190262A publication Critical patent/CN115190262A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/01Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
    • H04N7/0125Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level one of the standards being a high definition standard

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses electronic equipment, a video stream processing method, a video stream processing device, equipment and a medium, which are used for quickly and accurately determining an analysis instruction corresponding to an HDMI video stream so as to guarantee a playing effect and improve the automation degree. The controller can determine the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which can be directly processed by the controller and corresponds to the received HDMI video stream; and can quickly and accurately determine the target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame; based on the target analysis instruction, the video stream can be accurately analyzed, so that the playing effect can be ensured. The method and the device can rapidly and accurately determine the analysis instruction corresponding to the received HDMI video stream, and can ensure the playing effect and improve the automation degree.

Description

Electronic device, video stream processing method, device and medium
Technical Field
The present application relates to the field of video stream processing technologies, and in particular, to an electronic device, a video stream processing method, an apparatus, a device, and a medium.
Background
The Linux operating system is a clone system of the UNIX operating system, and is born in 1991, 10 and 5 (which is the first time to be formally published outwards). With the help of the Internet network, and through the concerted efforts of computer enthusiasts around the world, it is now the UNIX-like operating system that is the most used in the world, and the number of users is also growing dramatically.
The High Definition Multimedia Interface (HDMI) is a digital video/audio Interface technology, and is a special digital Interface suitable for video transmission, which can simultaneously transmit audio and video signals, and the maximum data transmission speed is 2.25GB/s.
At present, when an HDMI video stream generated by an HDMI camera or the like is parsed in a Linux operating system, the HDMI video stream can be generally parsed based on a Linux video device driver (video for Linux 2, V4L 2). The resolution of the HDMI video stream can be varied, and when the HDMI video streams with different resolutions are analyzed, a user needs to manually select an analysis instruction suitable for the HDMI video stream in V4L2 to analyze the HDMI video stream, so that the operation is complex, and the automation degree is low. And if the resolution of the currently selected parsing instruction is not matched with the resolution of the current HDMI video stream, phenomena that the playing effect is affected by wrong lines of images and the like can also occur.
Therefore, a technical solution that can quickly and accurately determine the parsing instruction corresponding to the HDMI video stream to ensure the playing effect and improve the automation degree is needed.
Disclosure of Invention
The application provides an electronic device, a high-definition multimedia interface HDMI video stream processing method, a high-definition multimedia interface HDMI video stream processing device and a high-definition multimedia interface HDMI video stream processing medium, which are used for quickly and accurately determining an analysis instruction corresponding to an HDMI video stream so as to guarantee a playing effect and improve the automation degree.
In a first aspect, the present application provides an electronic device, comprising:
a receiver for receiving a high definition multimedia interface, HDMI, video stream;
a controller to perform:
determining the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which can be directly processed by the controller and corresponds to the HDMI video stream; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the video stream based on the target analysis instruction.
In a second aspect, the present application further provides a method for processing an HDMI video stream, where the method includes:
determining the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which can be directly processed and corresponds to the received HDMI video stream; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the video stream based on the target analysis instruction.
In a third aspect, the present application further provides an HDMI video stream processing apparatus, including:
the device comprises a determining module, a processing module and a processing module, wherein the determining module is used for determining the resolution of a video stream according to information carried in the received video stream, and the video stream is a video stream which is corresponding to the received HDMI video stream and can be directly processed; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and the analysis module is used for analyzing the video stream based on the target analysis instruction.
In a fourth aspect, the present application further provides an electronic device, including:
the conversion chip is used for converting the received HDMI video stream into an MIPI video stream;
a control platform to perform:
determining the resolution of the MIPI video stream according to information carried in the received MIPI video stream, wherein the MIPI video stream is a video stream which can be directly processed by the control platform corresponding to the HDMI video stream; determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the MIPI video stream based on the target analysis instruction.
In a fifth aspect, the present application further provides a method for processing an HDMI video stream, where the method includes:
converting the received HDMI video stream into an MIPI video stream;
determining the resolution of the MIPI video stream according to information carried in the received MIPI video stream, wherein the MIPI video stream is a video stream which can be directly processed by the control platform and corresponds to the HDMI video stream; determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the MIPI video stream based on the target analysis instruction.
In a sixth aspect, the present application further provides an HDMI video stream processing apparatus, including:
the conversion unit is used for converting the received HDMI video stream into an MIPI video stream;
the determining unit is used for determining the resolution of the MIPI video stream according to information carried in the received MIPI video stream, wherein the MIPI video stream is a video stream which can be directly processed by the control platform and corresponds to the HDMI video stream; determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and the analyzing unit is used for analyzing the MIPI video stream based on the target analyzing instruction.
In a seventh aspect, the present application further provides an electronic device, which at least includes a processor and a memory, and the processor is configured to implement the steps of the method for processing the HDMI video stream according to any one of the above embodiments when executing the computer program stored in the memory.
In an eighth aspect, the present application further provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps of any of the HDMI video stream processing methods described above.
The controller can determine the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which can be directly processed by the controller and corresponds to the received HDMI video stream; and can quickly and accurately determine the target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame; based on the target analysis instruction, the video stream can be accurately analyzed, so that the playing effect can be ensured. The method and the device can rapidly and accurately determine the analysis instruction corresponding to the received HDMI video stream, and can ensure the playing effect and improve the automation degree.
Drawings
In order to more clearly illustrate the embodiments of the present application or the implementation manner in the related art, a brief description will be given below of the drawings required for the description of the embodiments or the related art, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a schematic diagram of a first electronic device according to some embodiments;
fig. 2 illustrates a process diagram of an electronic device processing an HDMI video stream according to some embodiments;
fig. 3 illustrates a process diagram of another electronic device processing an HDMI video stream provided by some embodiments;
fig. 4 is a schematic diagram illustrating a conversion process of the rondst LT6911UXC conversion chip provided by some embodiments to convert an HDMI video stream into an MIPI video stream;
FIG. 5 is a schematic diagram illustrating a process for loading a LOSON LT6911UXC conversion chip driver according to some embodiments;
fig. 6 is a schematic diagram illustrating an HDMI video stream processing procedure according to some embodiments;
fig. 7 is a schematic diagram of an HDMI video stream processing apparatus according to some embodiments;
FIG. 8 is a schematic diagram of a second electronic device according to some embodiments;
FIG. 9 illustrates a third electronic device in accordance with certain embodiments;
fig. 10 illustrates a process diagram for processing an HDMI video stream according to some embodiments;
fig. 11 is a schematic diagram illustrating another HDMI video stream processing procedure provided by some embodiments;
fig. 12 is a schematic diagram of another HDMI video stream processing apparatus provided in some embodiments;
fig. 13 is a schematic structural diagram of a fourth electronic device according to some embodiments.
Detailed Description
In order to quickly and accurately determine an analysis instruction corresponding to an HDMI video stream, embodiments of the present application provide an electronic device, a video stream processing method, an apparatus, a device, and a medium.
To make the purpose and embodiments of the present application clearer, the following will clearly and completely describe the exemplary embodiments of the present application with reference to the attached drawings in the exemplary embodiments of the present application, and it is obvious that the described exemplary embodiments are only a part of the embodiments of the present application, and not all the embodiments.
It should be noted that the brief descriptions of the terms in the present application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of the present application. These terms should be understood in their ordinary and customary meaning unless otherwise indicated.
The terms "first," "second," "third," and the like in the description and claims of this application and in the above-described drawings are used for distinguishing between similar or analogous objects or entities and not necessarily for describing a particular sequential or chronological order, unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances.
The terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to all elements expressly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and/or software code that is capable of performing the functionality associated with that element.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.
The foregoing description, for purposes of explanation, has been presented in conjunction with specific embodiments. However, the illustrative discussions above are not intended to be exhaustive or to limit the embodiments to the precise forms disclosed above. Many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles and the practical application, to thereby enable others skilled in the art to best utilize the embodiments and various embodiments with various modifications as are suited to the particular use contemplated.
In an actual use process, a controller of the electronic device may determine a resolution of a received video stream according to information carried in the video stream, where the video stream is a video stream that can be directly processed by the controller and corresponds to the received HDMI video stream; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame; and analyzing the video stream based on the target analysis instruction, thereby realizing the purpose of quickly and accurately determining the analysis instruction corresponding to the received HDMI video stream, ensuring the playing effect and improving the automation degree.
Fig. 1 shows a schematic structural diagram of a first electronic device provided by some embodiments, where the device includes:
a receiver 11, the receiver 11 being configured to receive a high definition multimedia interface, HDMI, video stream;
a controller 12, the controller 12 configured to perform:
determining the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which can be directly processed by the controller and corresponds to the HDMI video stream; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the video stream based on the target analysis instruction.
In a possible implementation manner, the operating system of the electronic device of the present application may be a Linux operating system. In order to realize the control of the electronic device, a receiver 11 and a controller 12 are provided in the electronic device, wherein the receiver 11 and the controller 12 are connected. The receiver 11 may receive a High Definition Multimedia Interface (HDMI) video stream, and in a possible implementation, the HDMI video stream received by the receiver 11 may be acquired by an HDMI image acquisition module (such as an HDMI camera) in an electronic device and sent to the receiver 11, or may be sent to the receiver 11 by another device, which is not specifically limited in this application.
In one possible implementation, after the receiver 11 receives the HDMI video stream, the received HDMI video stream may be sent to the controller 12. The controller 12 may determine whether the received HDMI video stream is a video stream that can be directly processed by the controller itself, for example, the controller 12 may pre-store format identification information of the video stream that can be directly processed by itself, and may determine whether the received HDMI video stream is a video stream that can be directly processed by the controller itself according to the format identification information carried by the received HDMI video stream and the pre-stored format identification information of the video stream that can be directly processed by itself. Specifically, if the format identification information of the video stream that can be directly processed by the controller 12 includes the format identification information of the HDMI video stream, the HDMI video stream is the video stream that can be directly processed by the controller 12, and after the controller 12 receives the HDMI video stream, the resolution of the HDMI video stream can be directly determined according to the information such as the resolution carried in the received HDMI video stream.
In one possible embodiment, if the format identification information of the HDMI video stream is not included in the format identification information of the video stream that the controller 12 pre-stores and can directly process itself, the controller 12 may be considered to be unable to directly process the HDMI video stream, for example, when the electronic device is a home brain and the main control platform of the home brain is english avida (NVIDIA) Xavier, the NVIDIA Xavier platform is unable to directly process the HDMI video stream, and the controller 12 in the electronic device is unable to directly process the HDMI video stream. In order to parse an HDMI video stream, on the basis of the foregoing embodiments, in an embodiment of the present application, the apparatus further includes:
a conversion chip, configured to convert the received HDMI video stream into a video stream that can be directly processed by the controller 12;
the controller 12 is further configured to perform:
and sending the received HDMI video stream to the conversion chip, and receiving the converted video stream sent by the conversion chip.
In a possible embodiment, the conversion chip may be disposed inside an electronic device, such as a brain of a home, or may be disposed in other devices, which is not specifically limited in this application. After the controller 12 receives the HDMI video stream, if the controller 12 cannot directly process the HDMI video stream, the controller 12 may first send the received HDMI video stream to the conversion chip. After receiving the HDMI video stream, the conversion chip may convert the HDMI video stream into a video stream that can be directly processed by the controller 12. The conversion process of the HDMI video stream by the conversion chip is prior art, and is not described herein again.
In a possible implementation manner, after the conversion chip converts the received HDMI video stream into a video stream that can be directly processed by the controller 12, the converted video stream may be sent to the controller 12, and after the controller 12 receives the converted video stream sent by the conversion chip, the step of determining the resolution of the converted video stream according to information such as the resolution carried in the converted video stream may be performed based on the converted video stream.
In a possible embodiment, the specific type of the conversion chip can be flexibly selected according to actual requirements, for example, the conversion chip can be selected according to a video stream or the like which can be directly processed by the controller 12 of the electronic device. When the conversion chip converts the HDMI video stream into a video stream that can be directly processed by the controller 12, the resolution and the like of the video stream before and after conversion can be maintained unchanged. For example, after an HDMI video stream with a resolution of 4K is converted into a Mobile Industry Processor Interface (MIPI) video stream, the resolution of the MIPI video stream may still be 4K.
For convenience of description, in the embodiment of the present application, video streams that can be directly processed by the controller 12, such as HDMI video streams, converted video streams, and the like, are collectively referred to as video streams. It is understood that the video stream is a video stream that the controller can directly process corresponding to the HDMI video stream received by the controller.
In a possible implementation manner, in order to quickly and accurately determine the parsing instruction corresponding to the video stream, the controller 12 may pre-store a corresponding relationship between the resolution and the parsing instruction of the gsstreamer frame, where the resolution and the parsing instruction of the gsstreamer frame corresponding to the resolution may be flexibly set according to a requirement, and this application is not particularly limited thereto. Specifically, the Gstreamer framework is an open source multimedia framework used for constructing streaming media applications, and the Gstreamer framework can be deployed in an electronic device with an operating system being a Linux operating system. When the analysis instruction corresponding to the video stream is determined, the target analysis instruction corresponding to the video stream can be quickly and accurately determined according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame, and then the video stream can be analyzed based on the target analysis instruction.
Illustratively, if the mapping relationship between the resolution stored in advance and the parsing instruction of the gsstreamer frame, the parsing instruction of the gsstreamer frame corresponding to the 4K resolution (3840 pixels × 2160 pixels) is: "$ gst-launch-1.0v4l2src device =/dev/video0! 'video/x-raw, format = (string) UYVY, width = (int) 3840, height = (int) 2160, frame = (fraction) 32/1'! xvimagesink-ev "(for convenience of description, this parse instruction is referred to as a first parse instruction). The parsing instruction of the Gstreamer frame corresponding to the 2K resolution (1920 pixels × 1080 pixels) is as follows: "$ gst-launch-1.0v4l2src device =/dev/video0! 'video/x-raw, format = (string) UYVY, width = (int) 1920, height = (int) 1080, frame = (fraction) 38/1'! xvimagesink-ev "(for convenience of description, this resolving instruction is referred to as a second resolving instruction). When the resolution of the video stream is 4K, the target analysis instruction corresponding to the video stream is a first analysis instruction; and when the resolution of the video stream is 2K, the target parsing instruction corresponding to the video stream is a second parsing instruction.
After the target parsing instruction is determined, the video stream may be parsed based on the target parsing instruction. The process of parsing the video stream is the prior art, and is not described herein again.
For convenience of understanding, the following describes, by way of a specific embodiment, a process of processing an HDMI video stream by an electronic device provided in an embodiment of the present application. Fig. 2 is a schematic diagram illustrating a process of processing an HDMI video stream by an electronic device according to some embodiments, where the process includes the following steps, as shown in fig. 2:
s201: the controller 12 determines the resolution of the received HDMI video stream according to the information carried in the HDMI video stream, where the HDMI video stream is a video stream that the controller 12 can directly process.
S202: and determining a target analysis instruction corresponding to the HDMI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame.
S203: and analyzing the HDMI video stream based on the target analysis instruction.
For convenience of understanding, the following describes, by way of a specific embodiment, a process of processing an HDMI video stream by an electronic device according to an embodiment of the present application. Fig. 3 is a schematic diagram illustrating another electronic device processing an HDMI video stream according to some embodiments, where the process includes the following steps, as shown in fig. 3:
s301: the controller 12 sends the received HDMI video stream to the conversion chip.
S302: the conversion chip converts the HDMI video stream into a video stream that the controller 12 can directly process, and transmits the converted video stream to the controller 12.
S303: the controller 12 receives the converted video stream sent by the conversion chip; the controller 12 determines the resolution of the converted video stream according to the information carried in the received converted video stream, where the converted video stream is a video stream that can be directly processed by the controller 12 corresponding to the HDMI video stream.
S304: the controller 12 determines a target parsing instruction corresponding to the converted video stream according to the correspondence between the stored resolution and the parsing instruction of the gsstreamer frame.
S305: the controller 12 parses the converted video stream based on the target parsing instruction.
In this application, the controller 12 may determine the resolution of the video stream according to information carried in the received video stream, where the video stream is a video stream that the controller 12 can directly process and corresponds to the received HDMI video stream; the target analysis instruction corresponding to the video stream can be quickly and accurately determined according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame; based on the target analysis instruction, the video stream can be accurately analyzed, so that the playing effect can be ensured. The method and the device can rapidly and accurately determine the analysis instruction corresponding to the received HDMI video stream, and can ensure the playing effect and improve the automation degree.
In a possible embodiment, the controller 12 may send the parsed video stream to a display in the electronic device for displaying (playing), or may send the parsed video stream to another display device for displaying (playing), which is not specifically limited in this application. In a possible embodiment, the controller 12 may send the parsed video stream to a display in the electronic device for displaying (playing), and in particular, in order to display (play) the video stream, the device further includes: a display;
the controller 12 is further configured to perform:
sending the parsed video stream to the display;
the display is used for displaying the analyzed video stream.
Specifically, the display may be connected to the controller 12, the controller 12 may send the parsed video stream to the display, and the display may display the received parsed video stream. The process of displaying the video stream by the display may be the prior art, and is not described herein again.
In order to accurately store the corresponding relationship between the resolution and the parsing instruction of the gsstreamer frame, on the basis of the foregoing embodiment, in this embodiment of the present application, the controller 12 is configured to:
reading an analysis instruction, obtaining the resolution carried in the analysis instruction, and storing the corresponding relation between the resolution and the analysis instruction.
In a possible embodiment, in order to accurately store the corresponding relationship between the resolution and the parsing instruction of the gsstreamer frame, the controller 12 in the electronic device may first read the stored parsing instruction of each gsstreamer frame, where the parsing instruction carries a resolution of a video stream that the parsing instruction is suitable for parsing, and the controller 12 may obtain the resolution carried in the parsing instruction, so that the corresponding relationship between the obtained resolution and the parsing instruction may be stored.
For convenience of understanding, the process of saving the corresponding relationship between the resolution and the parsing instruction provided by the present application is still explained by taking the above embodiment as an example. Taking the first parsing instruction as an example, if the resolution carried in the first parsing instruction is 4K (3840 pixels × 2160 pixels), the first parsing instruction may be considered as a video stream suitable for parsing 4K (3840 pixels × 2160 pixels), and the corresponding relationship between 4K (3840 pixels × 2160 pixels) and the first parsing instruction may be stored. Similarly, taking the second parsing instruction as an example, if the resolution carried in the second parsing instruction is 2K (1920 pixels × 1080 pixels), the second parsing instruction may be considered as a video stream suitable for parsing 2K (1920 pixels × 1080 pixels), and the correspondence between 2K (1920 pixels × 1080 pixels) and the first parsing instruction may be stored.
In order to accurately determine the parsing instruction corresponding to the video stream, on the basis of the foregoing embodiments, in this embodiment of the present application, the controller 12 is configured to perform:
the device use mode flag in the Linux video device driver V4L2 is set to the out-of-use state.
In Linux, an image capture module (image capture device) such as a camera may be a device file, which can be read and written as accessing a normal file, and the image capture module may be set in a dev directory, for example, if there is one image capture module in an electronic device, the image capture module is usually set to/dev/video 0.
In one possible embodiment, if the device usage mode identifier (use _ sensor _ mode _ id) of V4L2 is set to "true" or the like, the device usage mode identifier of V4L2 may be considered to be in a usable state, and when the HDMI video stream is parsed in the Linux operating system, the HDMI video stream may be parsed typically based on the parsing instruction of V4L 2. However, if the HDMI video stream is parsed based on the parsing instruction of V4L2, when the HDMI video stream of different resolutions needs to be parsed, the user is usually required to manually select the parsing instruction in V4L2 that is suitable for the resolution of the HDMI video stream.
Illustratively, one of the parsing instructions in V4L2 is: "$ v4l2-ctrl-set-ctrl = sensor _ mode =0" (for convenience of description, referred to as a third parsing instruction) adapted to parse a video stream having a resolution of 4K (3840 pixels × 2160 pixels). Another parse instruction in V4L2 is: "$ v4l2-ctrl-set-ctrl = sensor _ mode =1" (for convenience of description, referred to as a fourth parsing instruction) adapted to parse a video stream having a resolution of 2K (1920 pixels × 1080 pixels). If the resolution of the video stream is 2K, the selected parsing instruction is the third parsing instruction, and the selected parsing instruction is not matched with the resolution of the video stream, phenomena affecting the playing effect, such as image missing, may occur.
In order to quickly and accurately determine an analysis instruction corresponding to a video stream to ensure a playing effect and improve an automation degree, in this embodiment of the present application, before determining a target analysis instruction corresponding to the video stream according to a correspondence between a stored resolution and an analysis instruction of a Gstreamer frame, a device use mode identifier (use _ sensor _ mode _ id) in V4L2 may be set to a use stop state. It can be understood that, after the device usage mode flag in V4L2 is set to the usage-stopped state, the controller 12 may not parse the video stream based on the parsing instruction of V4L2 when receiving the video stream, but may determine, after determining the resolution of the video stream, a target parsing instruction corresponding to the received video stream according to the corresponding relationship between the saved resolution and the parsing instruction of the Gstreamer frame; based on the target analysis instruction, the video stream is analyzed, so that the analysis instruction corresponding to the received video stream can be quickly and accurately determined, the playing effect can be ensured, and the automation degree is improved.
Specifically, the present application does not specifically limit the manner in which the device use mode identifier (use _ sensor _ mode _ id) in V4L2 is set to the use stop state. For example, in a device tree file of the electronic device, such as a "tegra194-camera-lt6911uxc.dtsi" file, the device usage pattern identifier in V4L2 may be modified from the available state to the out-of-use state, i.e., "use _ sensor _ mode _ id = true" to "use _ sensor _ mode _ id = False".
In a possible implementation, still taking the above embodiment as an example, when the electronic device is a home brain, the video stream that can be directly processed by the controller 12 includes a Mobile Industry Processor Interface (MIPI) video stream, and the conversion chip is a conversion chip that can convert an HDMI video stream into an MIPI video stream, and illustratively, the conversion chip can be Long Xun LT6911UXC, and the conversion chip can be Long Xun LT6911UXC. Fig. 4 is a schematic diagram illustrating a conversion process of the rongst LT6911UXC conversion chip to convert an HDMI video stream into an MIPI video stream according to some embodiments, as shown in fig. 4, when the electronic device is a home brain, a main control development platform of an HDMI image acquisition module (such as a visual quality sensor) in the home brain is haisi Hi3559V100, an HDMI interface of the platform outputs the HDMI video stream, the main control platform nvidiaxariavier of the home brain cannot directly process the HDMI video stream, and the main control platform nvidiia Xavier of the home brain can directly process the MIPI video stream, and the receiver 11 in the home brain (the electronic device) can send the HDMI video stream to the controller 12 after receiving the HDMI video stream sent by the HDMI image acquisition module; the controller 12 in the home brain can send the HDMI video stream to Long Xun LT6911UXC conversion chip, long Xun LT6911UXC conversion chip converts the HDMI video stream into an MIPI video stream, the longxun LT6911UXC conversion chip sends the converted MIPI video stream to the controller 12 in the home brain, and the controller 12 determines the resolution of the MIPI video stream according to the information carried in the received MIPI video stream; determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame; the controller 12 parses the MIPI video stream based on the target parsing instruction.
In one possible implementation, when the dragon gate LT6911UXC conversion chip is provided in an electronic device, such as a home brain or the like, and the HDMI video stream is converted based on Long Xun LT6911UXC conversion chip, the driver of Long Xun LT6911UXC conversion chip may be loaded in the electronic device first. Fig. 5 shows a schematic diagram of a process for loading the rongson LT6911UXC conversion chip driver according to some embodiments, and as shown in fig. 5, the process includes the following steps:
calling system level Inter-Integrated Circuit (I2C) control interface function: module _ i2c _ driver (lt 6911uxc _ i2c _ driver).
The loading of the probe (lt 6911uxc _ probe) is realized in the interface function lt6911uxc _ i2c _ driver.
In one possible embodiment, the process of loading the probe (lt 6911uxc _ probe) can be implemented by the following code:
Figure BDA0003005204780000091
Figure BDA0003005204780000101
in one possible embodiment, a pointer function "tc _ dev- > sensor _ ops = & 6911uxc _ common _ ops can be called based on the probe; "; by this pointer function, the first ARRAY ". Numfrmfts = ARRAY _ SIZE (lt 6911uxc _ frmfmt),. Frmfmt _ table = lt6911uxc _ frmfmt,". Then, a second array which can set parameters such as resolution, frame rate and the like of the HDMI video stream which can be processed by the Longxun LT6911UXC conversion chip can be called out through the first array, and the second array can be exemplarily "static control structure camera _ common _ frmfmt LT6911uxc _ frmfmt [ ]". In one possible implementation, parameters such as resolution, frame rate and the like of the HDMI video stream that the loonfo LT6911UXC conversion chip can process can be set in the second array. The application does not specifically limit the parameters of the resolution, the frame rate and the like of the HDMI video stream which can be processed by the Long Xun LT6911UXC conversion chip, and can be flexibly set according to the requirements.
Illustratively, if the Long Xun LT6911UXC conversion chip can process an HDMI video stream with a resolution of 4K (3840 pixels × 2160 pixels) and a frame rate of 32, the "{ {3840, 2160}, LT6911uxc _32fps,1,0, lt6911uxc _mode3840 × 2160}" parameter can be set in a second array; if the Long Xun LT6911UXC conversion chip can also process an HDMI video stream with resolution of 2K (1920 pixels × 1080 pixels) and frame rate of 38, the "{ {1920, 1080}, LT6911uxc _38fps,1,0, LT6911UXC _MODE1920 × 1080}" parameters can also be set in the second array. For example, the specific content of the second array may be:
“static const struct camera_common_frmfmt lt6911uxc_frmfmt[]={
{{3840,2160},lt6911uxc_32fps,1,0,LT6911UXC_MODE_3840×2160},
{{1920,1080},lt6911uxc_38fps,1,0,LT6911UXC_MODE_1920×1080},
};”。
correspondingly, in a possible implementation manner, the parsing instruction of the gsstreamer frame may carry parameters such as a frame rate (frame) in addition to the resolution, and specific values of the parameters such as the frame rate may be flexibly set according to requirements. For convenience of understanding, still taking the above embodiment as an example, the frame rate of the video stream with the resolution of 4K (3840 pixels × 2160 pixels) may be set to 32, and the frame rate (frame rate) carried in the first parsing instruction may be 32. The frame rate of the video stream with the resolution of 2K (1920 pixels × 1080 pixels) may be set to 38, and the frame rate (frame rate) carried in the second parsing instruction may be 38.
In one possible implementation, after the Long Xun LT6911UXC conversion chip receives the HDMI video stream, a conversion mode corresponding to the resolution of the HDMI video stream may be called for conversion based on the probe, so that the resolution and the like of the video stream before and after conversion are maintained. Illustratively, after converting an HDMI video stream with a resolution of 4K to a MIPI video stream, the resolution of the MIPI video stream may still be 4K.
In one possible embodiment, after the probe loading is completed, the step of loading Long Xun LT6911UXC driver of the conversion chip may be started, and "LT6911uxc _ board _ setup" may be implemented by the following code.
In one possible embodiment, the drivers for the Long Xun LT6911UXC conversion chip may be loaded by an Interrupt Service routine (Interrupt Service Routines). Specifically, the process may be implemented by the following code: "INIT _ WORK (& priv- > process _ isr, lt6911uxc _ process _ isr)".
In response to the code, the function "lt6911uxc _ isr" may be called out. Thereafter, the process of initializing the handler may be performed to complete the process of initializing the loading of the driver of LT6911UXC conversion chip. Specifically, the initialization handle may be implemented by the following code: "lt6911uxc _ hdmi _ int _ handle".
In one possible implementation, when the driver of the LT6911UXC conversion chip is loaded in the electronic device, the information in the device tree (dts) of the electronic device may be set. Specifically, information of parameters such as resolution, frame rate, and the like of the HDMI video stream that can be processed by the Long Xun LT6911UXC conversion chip set in the second array may be added to the information of the device tree, for example, to the tegra194-camera-LT6911uxc. Specifically, still taking the above embodiment as an example, the longxun LT6911UXC conversion chip can process an HDMI video stream with a resolution of 4K (3840 pixels × 2160 pixels) and a frame rate of 32; for an HDMI video stream with a resolution of 2K (1920 pixels × 1080 pixels) and a frame rate of 38, adding the information of parameters such as resolution and frame rate of the HDMI video stream that the loosoon LT6911UXC conversion chip can process to the information of the device tree can be realized by the following codes:
Figure BDA0003005204780000111
Figure BDA0003005204780000121
Figure BDA0003005204780000131
in one possible implementation, when a driver of Long Xun LT6911UXC conversion chip is loaded in an electronic device, a kernel file (kernel object,. Ko) of the longxun LT6911UXC conversion chip may be loaded. In one possible implementation, when the ko file is loaded, long Xun LT6911UXC conversion chip ko files can be copied to corresponding positions in the electronic device, for example, "lt6911uxc.ko" files can be copied to "/lib/modules/4.9.140-tegra/kernel/drivers/media/i2c/" directories of the home brain. Then, a load command such as "$ sudo insmod lt6911uxc.ko" can be executed, and the load of the.ko file is realized.
In one possible implementation, the user can see Long Xun LT6911UXC conversion chip driver is loaded correctly. The user can check whether the driver of the Long Xun LT6911UXC conversion chip is loaded correctly by inputting a "$ v4l 2-compatibility-d/dev/video 0" command line and the like in the electronic equipment. After receiving the command line, the electronic device may respond to the command line and display a corresponding loading result. The process of the electronic device responding to the command line and displaying the corresponding loading result is the prior art, and is not described herein again. In a possible implementation manner, if the loading result displayed by the electronic device includes information such as the name (Driver name) and the Driver version (Driver version) of the Long Xun LT6911UXC conversion chip, the Driver may be considered to have been loaded successfully. For example, after the driver of the Long Xun LT6911UXC conversion chip is loaded successfully, the electronic device may display the following information:
hibrain@hibrain-desktop:~$v4l2-compliance-d/dev/video0
v4l2-compliance SHA:not available
Driver Info:
Driver name:tegra-video
Card type:vi-output,lt6911uxc 8-002b
Bus info:platform:15c10000.vi:0
Driver version:4.9.140
Capabilities:0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps:0x04200001
Video Capture
Streaming
Extended Pix Format
on the basis of the foregoing embodiments, the present application further provides a method for processing an HDMI video stream, where fig. 6 shows a schematic diagram of a process of processing an HDMI video stream according to some embodiments, and as shown in fig. 6, the method includes:
s601: determining the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which can be directly processed and corresponds to the received HDMI video stream; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
s602: and analyzing the video stream based on the target analysis instruction.
In a possible implementation manner, the HDMI video stream processing method provided in this embodiment of the present application is applied to an electronic device, which may be, for example, a device such as a PC or a mobile terminal, or a server. In one possible implementation, the electronic device may be a home brain. The operating system of the electronic device may be a Linux operating system.
In a possible implementation, the process of saving the correspondence between the resolution and the parsing instruction of the Gstreamer frame includes:
reading an analysis instruction, obtaining the resolution carried in the analysis instruction, and storing the corresponding relation between the resolution and the analysis instruction.
In a possible implementation manner, before determining a target parsing instruction corresponding to the video stream according to a correspondence between the stored resolution and a parsing instruction of a gsstreamer frame, the method further includes:
the device use mode flag in the Linux video device driver V4L2 is set to the out-of-use state.
In a possible implementation manner, before determining the resolution of the video stream according to information carried in the received video stream, the method further includes:
sending the received HDMI video stream to a conversion chip, converting the received HDMI video stream into a video stream capable of being directly processed by the conversion chip, receiving the converted video stream sent by the conversion chip, and determining the resolution of the video stream according to information carried in the received video stream based on the video stream.
In one possible implementation, the directly processable video stream comprises: a mobile industry processor interface MIPI video stream.
In one possible embodiment, the method further comprises:
and sending the analyzed video stream to a display, so that the display displays the analyzed video stream.
The method and the device can determine the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which is corresponding to the received HDMI video stream and can be directly processed; and can quickly and accurately determine the target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame; based on the target analysis instruction, the video stream can be accurately analyzed, so that the playing effect can be ensured. The method and the device can rapidly and accurately determine the analysis instruction corresponding to the received HDMI video stream, and can ensure the playing effect and improve the automation degree.
On the basis of the foregoing embodiments, the present application provides an HDMI video stream processing apparatus with a high definition multimedia interface, and fig. 7 shows a schematic diagram of an HDMI video stream processing apparatus provided in some embodiments, and as shown in fig. 7, the apparatus includes:
a determining module 71, configured to determine a resolution of a received video stream according to information carried in the video stream, where the video stream is a video stream that can be directly processed and corresponds to the received HDMI video stream; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and the parsing module 72 is configured to parse the video stream based on the target parsing instruction.
In a possible implementation manner, the determining module 71 is specifically configured to read an analysis instruction, obtain a resolution carried in the analysis instruction, and store a corresponding relationship between the resolution and the analysis instruction.
In a possible embodiment, the determining module 71 is further configured to set the device usage mode identifier in the Linux video device driver V4L2 to the state of being out of use before determining the target parsing instruction corresponding to the video stream according to the correspondence between the saved resolution and the parsing instruction of the Gstreamer frame.
In a possible implementation manner, the determining module 71 is further configured to, before determining the resolution of the video stream according to information carried in the received video stream, send the received HDMI video stream to a conversion chip, so that the conversion chip converts the received HDMI video stream into a video stream capable of being directly processed, receives the converted video stream sent by the conversion chip, and perform, based on the video stream, a step of determining the resolution of the video stream according to the information carried in the received video stream.
In one possible embodiment, the apparatus further comprises:
a display module;
the parsing module 72 is further configured to send the parsed video stream to the display module;
and the display module is used for displaying the analyzed video stream.
On the basis of the foregoing embodiments, the present application further provides an electronic device, and fig. 8 shows a schematic structural diagram of a second electronic device provided in some embodiments, as shown in fig. 8, including: the system comprises a processor 81, a communication interface 82, a memory 83 and a communication bus 84, wherein the processor 81, the communication interface 82 and the memory 83 are communicated with each other through the communication bus 84;
the memory 83 has stored therein a computer program which, when executed by the processor 81, causes the processor 81 to perform the steps of:
determining the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which can be directly processed and corresponds to the received HDMI video stream; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the video stream based on the target analysis instruction.
In a possible implementation manner, the processor 81 is specifically configured to read an analysis instruction, obtain a resolution carried in the analysis instruction, and store a corresponding relationship between the resolution and the analysis instruction.
In a possible implementation manner, the processor 81 is further configured to set the device usage mode identifier in the Linux video device driver V4L2 to a usage stop state before determining the target parsing instruction corresponding to the video stream according to the correspondence between the stored resolution and the parsing instruction of the gsstreamer framework.
In a possible implementation manner, the processor 81 is further configured to, before determining the resolution of the video stream according to information carried in the received video stream, send the received HDMI video stream to a conversion chip, enable the conversion chip to convert the received HDMI video stream into a video stream capable of being directly processed, receive the converted video stream sent by the conversion chip, and perform, based on the video stream, a step of determining the resolution of the video stream according to the information carried in the received video stream.
In a possible implementation, the processor 81 is further configured to send the parsed video stream to a display, so that the display displays the parsed video stream.
Because the principle of the electronic device for solving the problem is similar to the HDMI video stream processing method, the implementation of the electronic device may refer to the implementation of the HDMI video stream processing method, and repeated parts are not described again.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface 82 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
On the basis of the foregoing embodiments, the present application provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to execute the following steps:
determining the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which can be directly processed and corresponds to the received HDMI video stream; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the HDMI video stream based on the target analysis instruction.
In a possible implementation, the process of saving the correspondence between the resolution and the parsing instruction of the Gstreamer frame includes:
reading an analysis instruction, obtaining the resolution carried in the analysis instruction, and storing the corresponding relation between the resolution and the analysis instruction.
In a possible implementation manner, before determining a target parsing instruction corresponding to the video stream according to a correspondence between the stored resolution and a parsing instruction of a gsstreamer frame, the method further includes:
the device use mode flag in the Linux video device driver V4L2 is set to the out-of-use state.
In a possible implementation manner, before determining the resolution of the video stream according to information carried in the received video stream, the method further includes:
sending the received HDMI video stream to a conversion chip, converting the received HDMI video stream into a video stream capable of being directly processed by the conversion chip, receiving the converted video stream sent by the conversion chip, and determining the resolution of the video stream according to information carried in the received video stream based on the video stream.
In one possible implementation, the directly processable video stream comprises: a mobile industry processor interface MIPI video stream.
In one possible embodiment, the method further comprises:
and sending the analyzed video stream to a display, so that the display displays the analyzed video stream.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tape, magneto-optical disks (MO), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), solid State Disks (SSDs), etc.
The method and the device can determine the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which is corresponding to the received HDMI video stream and can be directly processed; the target analysis instruction corresponding to the video stream can be quickly and accurately determined according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame; based on the target analysis instruction, the video stream can be accurately analyzed, so that the playing effect can be ensured. According to the method and the device, the received analytic instruction corresponding to the HDMI video stream can be determined quickly and accurately, the playing effect can be guaranteed, and the automation degree is improved.
On the basis of the foregoing embodiments, the present application further provides an electronic device, and fig. 9 shows a schematic structural diagram of a third electronic device provided in some embodiments, where the electronic device includes:
the conversion chip 91 is used for converting the received HDMI video stream into an MIPI video stream;
a control platform 92, the control platform 92 for performing:
determining the resolution of the MIPI video stream according to information carried in the received MIPI video stream, wherein the MIPI video stream is a video stream which can be directly processed by the control platform and corresponds to the HDMI video stream; determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the MIPI video stream based on the target analysis instruction.
In a possible implementation manner, the operating system of the electronic device of the present application may be a Linux operating system. The electronic device may directly process MIPI video streams, which may be, for example, the home brain.
In order to realize the control of the electronic device, a conversion chip 91 and a control platform 92 are provided in the electronic device, wherein the conversion chip 91 is connected with the control platform 92. The conversion chip 91 may receive a High Definition Multimedia Interface (HDMI) video stream, and in a possible implementation, the HDMI video stream received by the conversion chip 91 may be acquired by an HDMI image acquisition module (such as an HDMI camera) in an electronic device and sent to the conversion chip 91, or may be sent to the conversion chip 91 by another device, which is not specifically limited in this application.
In a possible implementation, after the HDMI video stream is received by the conversion chip 91, the received HDMI video stream may be converted into a video stream that can be directly processed by the control platform 92, i.e., an MIPI video stream. The conversion chip 91 may adopt Long Xun LT6911UXC conversion chip in the above embodiment, which is not described herein again. After the conversion chip 91 converts the received HDMI video stream into the MIPI video stream, the MIPI video stream may be sent to the control platform 92.
In a possible implementation, after receiving the MIPI video stream, the control platform 92 may determine the resolution of the MIPI video stream directly according to information such as resolution carried in the received MIPI video stream. In order to quickly and accurately determine the parsing instruction corresponding to the video stream, the control platform 92 may pre-store a corresponding relationship between the resolution and the parsing instruction of the gsstreamer frame, where the resolution and the parsing instruction of the gsstreamer frame corresponding to the resolution may be flexibly set according to a requirement, and this is not specifically limited in this application. When determining the parsing instruction corresponding to the received MIPI video stream, the control platform 92 may quickly and accurately determine the target parsing instruction corresponding to the MIPI video stream according to the correspondence between the stored resolution and the parsing instruction of the Gstreamer frame, and further may parse the MIPI video stream based on the target parsing instruction.
In a possible embodiment, the control platform 92 in the electronic device may send the parsed video stream to a display in the electronic device for displaying (playing), or send the parsed video stream to another display device for displaying (playing), which is not specifically limited in this application. In a possible implementation, the control platform 92 may send the parsed video stream to a display in the electronic device for displaying (playing), and in particular, in order to display (play) the video stream, the device further includes: a display;
the control platform 92 is further configured to perform:
sending the parsed video stream to the display;
the display is used for displaying the analyzed video stream.
Specifically, the display may be connected to the control platform 92, the control platform 92 may send the parsed video stream to the display, and the display may display the received parsed video stream. The process of displaying the video stream by the display may be the prior art, and is not described herein again.
In a possible embodiment, the control platform 92 is configured to perform:
reading an analysis instruction, obtaining the resolution carried in the analysis instruction, and storing the corresponding relation between the resolution and the analysis instruction.
In one possible embodiment, the control platform 92 is configured to perform:
the device use mode flag in the Linux video device driver V4L2 is set to the out-of-use state.
For convenience of understanding, the process of processing the HDMI video stream by the electronic device provided in the embodiment of the present application is described by taking the electronic device as an example of a home brain. Fig. 10 shows a schematic diagram of a process for processing an HDMI video stream according to some embodiments, as shown in fig. 10:
an HDMI image acquisition module (such as an HDMI camera and the like) in the brain of the family sends an acquired HDMI video stream to a conversion chip 91 (such as a Longxun LT6911UXC conversion chip); the conversion chip 91 converts the received HDMI video stream into an MIPI video stream, and sends the converted MIPI video stream to the control platform 92 in the brain of the home. After receiving the MIPI video stream, the control platform 92 may directly determine the resolution of the MIPI video stream according to information such as resolution carried in the received MIPI video stream; and determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame, and analyzing the MIPI video stream based on the target analysis instruction. In one possible embodiment, the control platform 92 may send the parsed video stream to a display (not shown) in the brain of the home for display (playing).
The conversion chip can convert the received HDMI video stream into the MIPI video stream, and the control platform can determine the resolution of the MIPI video stream according to information carried in the received MIPI video stream, wherein the MIPI video stream is a video stream which can be directly processed by the control platform and corresponds to the received HDMI video stream; according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame, the target analysis instruction corresponding to the MIPI video stream can be quickly and accurately determined; based on the target analysis instruction, the MIPI video stream can be accurately analyzed, so that the playing effect can be ensured. The method and the device can rapidly and accurately determine the analysis instruction corresponding to the received HDMI video stream, and can ensure the playing effect and improve the automation degree.
On the basis of the foregoing embodiments, the present application further provides another method for processing an HDMI video stream, where fig. 11 shows a schematic diagram of another HDMI video stream processing process provided in some embodiments, as shown in fig. 11: the method comprises the following steps:
s1101: and converting the received HDMI video stream into an MIPI video stream.
S1102: determining the resolution of the MIPI video stream according to information carried in the received MIPI video stream, wherein the MIPI video stream is a video stream which can be directly processed by the control platform and corresponds to the HDMI video stream; and determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame.
S1103: and analyzing the MIPI video stream based on the target analysis instruction.
In a possible implementation manner, the HDMI video stream processing method provided in this embodiment of the present application is applied to an electronic device, which may be, for example, a device such as a PC or a mobile terminal, or a server. In one possible implementation, the electronic device may be a home brain. The operating system of the electronic device may be a Linux operating system.
In a possible implementation, the process of saving the correspondence between the resolution and the parsing instruction of the Gstreamer frame includes:
reading an analysis instruction, obtaining the resolution carried in the analysis instruction, and storing the corresponding relation between the resolution and the analysis instruction.
In a possible implementation manner, before determining a target parsing instruction corresponding to the MIPI video stream according to a correspondence between the stored resolution and a parsing instruction of a Gstreamer frame, the method further includes:
the device use mode flag in the Linux video device driver V4L2 is set to the out-of-use state.
In one possible embodiment, the method further comprises:
and sending the analyzed video stream to a display, and enabling the display to display the analyzed video stream.
On the basis of the foregoing embodiments, the present application provides another HDMI video stream processing apparatus for high definition multimedia interface, and fig. 12 shows a schematic diagram of another HDMI video stream processing apparatus provided in some embodiments, and as shown in fig. 12, the apparatus includes:
a conversion unit 121, configured to convert the received HDMI video stream into an MIPI video stream;
a determining unit 122, configured to determine, according to information carried in a received MIPI video stream, a resolution of the MIPI video stream, where the MIPI video stream is a video stream that can be directly processed by the control platform and corresponds to the HDMI video stream; determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and the parsing unit 123 is configured to parse the MIPI video stream based on the target parsing instruction.
In a possible implementation manner, the determining unit 122 is specifically configured to read an analysis instruction, obtain a resolution carried in the analysis instruction, and store a corresponding relationship between the resolution and the analysis instruction.
In a possible implementation manner, the determining unit 122 is further configured to set the device usage mode identifier in the Linux video device driver V4L2 to the out-of-use state before determining the target parsing instruction corresponding to the MIPI video stream according to the correspondence between the stored resolution and the parsing instruction of the Gstreamer frame.
In a possible embodiment, the apparatus further comprises:
a display unit;
the parsing unit 123 is further configured to send the parsed video stream to a display unit;
and the display unit is used for displaying the analyzed video stream.
On the basis of the foregoing embodiments, the present application further provides an electronic device, and fig. 13 shows a schematic structural diagram of a fourth electronic device provided in some embodiments, as shown in fig. 13, including: the system comprises a processor 131, a communication interface 132, a memory 133 and a communication bus 134, wherein the processor 131, the communication interface 132 and the memory 133 complete mutual communication through the communication bus 134;
the memory 133 has stored therein a computer program which, when executed by the processor 131, causes the processor 131 to perform the steps of:
converting the received HDMI video stream into an MIPI video stream;
determining the resolution of the MIPI video stream according to information carried in the received MIPI video stream, wherein the MIPI video stream is a video stream which can be directly processed by the control platform corresponding to the HDMI video stream; determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the MIPI video stream based on the target analysis instruction.
In a possible implementation manner, the processor 131 is specifically configured to read an analysis instruction, obtain a resolution carried in the analysis instruction, and store a corresponding relationship between the resolution and the analysis instruction.
In a possible implementation manner, the processor 131 is further configured to set the device usage mode identifier in the Linux video device driver V4L2 to the out-of-use state before determining the target parsing instruction corresponding to the MIPI video stream according to the correspondence between the saved resolution and the parsing instruction of the Gstreamer frame.
In a possible implementation, the processor 131 is further configured to send the parsed video stream to a display, so that the display displays the parsed video stream.
Because the principle of the electronic device for solving the problem is similar to the HDMI video stream processing method, the implementation of the electronic device can refer to the implementation of the HDMI video stream processing method, and repeated details are not repeated.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface 132 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the aforementioned processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc.
On the basis of the foregoing embodiments, the present application provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to execute the following steps:
converting the received HDMI video stream into an MIPI video stream;
determining the resolution of the MIPI video stream according to information carried in the received MIPI video stream, wherein the MIPI video stream is a video stream which can be directly processed by the control platform and corresponds to the HDMI video stream; determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the MIPI video stream based on the target analysis instruction.
In one possible implementation, the process of saving the correspondence between the resolution and the parsing instruction of the Gstreamer framework includes:
reading an analysis instruction, obtaining the resolution carried in the analysis instruction, and storing the corresponding relation between the resolution and the analysis instruction.
In a possible implementation manner, before determining, according to a correspondence between the saved resolution and a parsing instruction of a Gstreamer frame, a target parsing instruction corresponding to the MIPI video stream, the method further includes:
the device use mode flag in the Linux video device driver V4L2 is set to the out-of-use state.
In one possible embodiment, the method further comprises:
and sending the analyzed video stream to a display, and enabling the display to display the analyzed video stream.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tape, magneto-optical disks (MO), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), solid State Disks (SSDs), etc.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. An electronic device, characterized in that the device comprises:
a receiver to receive a High Definition Multimedia Interface (HDMI) video stream;
a controller to perform:
determining the resolution of the video stream according to information carried in the received video stream, wherein the video stream is a video stream which can be directly processed by the controller and corresponds to the HDMI video stream; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the video stream based on the target analysis instruction.
2. The apparatus of claim 1, wherein the controller is configured to perform:
reading an analysis instruction, obtaining the resolution carried in the analysis instruction, and storing the corresponding relation between the resolution and the analysis instruction.
3. The apparatus of claim 1, wherein the controller is configured to perform:
the device use mode flag in the Linux video device driver V4L2 is set to the out-of-use state.
4. The apparatus of claim 1, further comprising:
the conversion chip is used for converting the received HDMI video stream into a video stream which can be directly processed by the controller;
the controller is further configured to perform:
and sending the received HDMI video stream to the conversion chip, and receiving the converted video stream sent by the conversion chip.
5. The apparatus of claim 4, wherein the conversion chip is configured to perform:
and converting the HDMI video stream into a Mobile Industry Processor Interface (MIPI) video stream.
6. The apparatus of any of claims 1-5, further comprising: a display;
the controller is further configured to perform:
sending the parsed video stream to the display;
and the display is used for displaying the analyzed video stream.
7. A method for processing an HDMI video stream, the method comprising:
determining the resolution of a video stream according to information carried in the received video stream, wherein the video stream is a video stream which is corresponding to the received HDMI video stream and can be directly processed; determining a target analysis instruction corresponding to the video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the video stream based on the target analysis instruction.
8. The method according to claim 7, wherein the process of saving the correspondence of the resolution to the parsing instructions of the Gstreamer framework comprises:
reading an analysis instruction, obtaining the resolution carried in the analysis instruction, and storing the corresponding relation between the resolution and the analysis instruction.
9. An electronic device, characterized in that the electronic device comprises at least a processor and a memory, the processor being adapted to carry out the steps of the method of processing a high definition multimedia interface, HDMI, video stream according to any one of claims 7 to 8 when executing a computer program stored in the memory.
10. An electronic device, characterized in that the electronic device comprises:
the conversion chip is used for converting the received HDMI video stream into an MIPI video stream;
a control platform to perform:
determining the resolution of the MIPI video stream according to information carried in the received MIPI video stream, wherein the MIPI video stream is a video stream which can be directly processed by the control platform corresponding to the HDMI video stream; determining a target analysis instruction corresponding to the MIPI video stream according to the corresponding relation between the stored resolution and the analysis instruction of the Gstreamer frame;
and analyzing the MIPI video stream based on the target analysis instruction.
CN202110360094.3A 2021-04-02 2021-04-02 Electronic device, video stream processing method, device and medium Pending CN115190262A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110360094.3A CN115190262A (en) 2021-04-02 2021-04-02 Electronic device, video stream processing method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110360094.3A CN115190262A (en) 2021-04-02 2021-04-02 Electronic device, video stream processing method, device and medium

Publications (1)

Publication Number Publication Date
CN115190262A true CN115190262A (en) 2022-10-14

Family

ID=83511507

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110360094.3A Pending CN115190262A (en) 2021-04-02 2021-04-02 Electronic device, video stream processing method, device and medium

Country Status (1)

Country Link
CN (1) CN115190262A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107613369A (en) * 2017-10-10 2018-01-19 青岛海信电器股份有限公司 Video broadcasting method, device and electronic equipment based on GStreamer frameworks
CN108668162A (en) * 2018-03-20 2018-10-16 青岛海信电器股份有限公司 Processing method, device and the intelligent terminal that video file plays
CN110858915A (en) * 2018-08-24 2020-03-03 北京字节跳动网络技术有限公司 Resolution switching method and device in media file playing process and storage medium
CN111147860A (en) * 2019-12-23 2020-05-12 视联动力信息技术股份有限公司 Video data decoding method and device
CN111479164A (en) * 2019-01-23 2020-07-31 上海哔哩哔哩科技有限公司 Hardware decoding dynamic resolution seamless switching method and device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107613369A (en) * 2017-10-10 2018-01-19 青岛海信电器股份有限公司 Video broadcasting method, device and electronic equipment based on GStreamer frameworks
CN108668162A (en) * 2018-03-20 2018-10-16 青岛海信电器股份有限公司 Processing method, device and the intelligent terminal that video file plays
CN110858915A (en) * 2018-08-24 2020-03-03 北京字节跳动网络技术有限公司 Resolution switching method and device in media file playing process and storage medium
CN111479164A (en) * 2019-01-23 2020-07-31 上海哔哩哔哩科技有限公司 Hardware decoding dynamic resolution seamless switching method and device and storage medium
CN111147860A (en) * 2019-12-23 2020-05-12 视联动力信息技术股份有限公司 Video data decoding method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一銤阳光: "Gstreamer视频传输测试gst-launch", pages 1 - 4, Retrieved from the Internet <URL:https://blog.csdn.net/CSDNhuaong/article/details/78015938> *
刘兴民;赵连军;: "基于GStreamer的远程视频监控系统的关键技术研究", 计算机应用与软件, no. 05, 15 May 2011 (2011-05-15) *

Similar Documents

Publication Publication Date Title
US7545386B2 (en) Unified mobile display emulator
CN110347587B (en) APP compatibility testing method and device, computer equipment and storage medium
JP5997867B2 (en) Device driver registration apparatus and device driver registration method using the same
CN107066377B (en) Page element obtaining method based on Android system and terminal equipment
CN109558331B (en) Application program defect detection method, device, equipment and storage medium
CN112181500A (en) Parameter adjusting method, device, terminal and storage medium
US10659321B2 (en) Electronic apparatus for recording debugging information and control method thereof
US8786710B2 (en) Test system and method for testing motherboard of camera
US11354214B2 (en) Judgment method for hardware compatibility
CN111817916B (en) Test method, device, equipment and storage medium based on mobile terminal cluster
CN111641823B (en) MIPI interface-based image algorithm verification system
CN115190262A (en) Electronic device, video stream processing method, device and medium
CN111651308B (en) Method and device for acquiring debugging data of DP-HDMI chip and intelligent device
CN115767095A (en) Video transcoding card performance testing method and device, electronic equipment and storage medium
CN111246214A (en) Video decoding method and device
CN115422058A (en) Method and device for testing face recognition application
JP2024500483A (en) Configuration method and device
CN114501140A (en) Video character superposition processing method, system and storage medium
CN113296984A (en) Compatibility parameter determining method and device, electronic equipment and storage medium
CN109982136B (en) Volume adjusting method and device
CN111639030A (en) Page testing method, device, equipment and storage medium
US20140049649A1 (en) Portable device and signal converting method thereof
CN110430175B (en) Encryption protocol implanting method, device and equipment based on AC35 platform
CN117475013B (en) Computer equipment and video data processing method
CN115623189A (en) Camera performance evaluation method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination