Video source transmission device, video source transmission method and computer storage medium
By using a cyclic queue to cache the video source in the video source transmission device and adjusting the write speed according to the read speed of the external host device, the problem of lag and loss of video sources during fast or slow reading of the UVC channel in the prior art is solved, and more efficient and flexible video source transmission is achieved.
Patent Information
- Application Number
- CN202311134044.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-04
- Publication Date
- 2025-03-04
AI Technical Summary
In the prior art, video frames cannot be written in time when the video source quickly acquires the data buffer area in the UVC channel, resulting in stuttering of the video source; and when the UVC channel reads slowly, it will lead to the problem of losing the video source.
The video source to be transmitted is cached in the form of a circular queue, and the speed of video frame writing to the circular queue is adaptively adjusted in combination with the reading speed of the external host device to avoid saturation or starvation of the video frame.
It effectively avoids the problem of video source lag and loss caused by the impact of read speed, improves the efficiency and flexibility of video source transmission, and saves memory space.
Smart Images

Figure CN119562086A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video source transmission equipment, and in particular to a video source transmission equipment, a video source transmission method and a computer storage medium. Background Art
[0002] In the related art, the transmission of the video source is realized through the ping-pong cache mechanism, that is, each video frame in the video source is allocated to two data cache areas, and then transmitted to the UVC (USB video class) channel through the two data cache areas, and then the video frames in the video source are written into the two data cache areas. However, in the above-mentioned video frame transmission method, when the UVC channel quickly obtains the video source in the data cache area, the video frame cannot be written into the data cache area in time, which causes the video source to become stuck, and when the UVC channel reads the video source in the data cache area slowly, it will cause the video source to be lost. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, one object of the present invention is to provide a video source transmission device, which can realize video source transmission through a circular queue, thereby avoiding the problem of video source freeze and loss caused by the influence of reading speed.
[0004] A second objective of the present invention is to provide a video source transmission method.
[0005] A third object of the present invention is to provide a computer storage medium.
[0006] In order to solve the above problems, an embodiment of the first aspect of the present invention provides a video source transmission device, which includes: a video source acquisition module, which is used to acquire video sources in various formats; a video source transmission module, which is used to transmit video sources; a control module, which is connected to the video source acquisition module and the video source transmission module, and the control module is configured to: obtain video sources to be transmitted from video sources in various formats; cache the video sources to be transmitted in the form of a circular queue; and after receiving a transmission control instruction, sequentially transmit the video sources to be transmitted in the circular queue through the video source transmission module.
[0007] According to the video source transmission device of the embodiment of the present invention, in the process of the video source transmission device transmitting the video source to be transmitted to the external host device, the control module writes the video frames in the video source to be transmitted into the circular queue, and then transmits the video frames cached in the circular queue to the external host device. That is to say, when the control module performs transmission processing on the video source to be transmitted, the control module no longer caches the video frames of the video source to be transmitted through two data buffer areas, but writes the video frames in the video source to be transmitted into the circular queue, and adaptively adjusts the speed of writing the video frames into the circular queue in combination with the reading speed of the external host device. Therefore, compared with the method of realizing video source transmission through the ping-pong cache mechanism, the video source transmission device in the present application adaptively adjusts the speed of writing the video frames into the circular queue in combination with the reading speed, so that the video frames cached in the circular queue will not be saturated or starved, thereby avoiding the problem of video source jamming and loss due to the influence of the reading speed.
[0008] In some embodiments, the control module includes: a video source management unit, the video source management unit is connected to the video source acquisition module, and the video source management unit is used to manage the video sources of various formats acquired by the video source acquisition module; a service management unit, the service management unit is connected to the video source management unit, and the service management unit is used to obtain the video source to be transmitted from the video sources of various formats according to the target video format selected by the user, and cache the video source to be transmitted in the form of a circular queue; a transmission management unit, the transmission management unit is connected to the service management unit and the video source transmission module, and the transmission management unit is used to control the video source transmission module to sequentially transmit the video sources to be transmitted in the circular queue after receiving a transmission control instruction.
[0009] In some embodiments, the target video format includes at least dynamic images, static images, and static video files.
[0010] In some embodiments, the service management unit also includes a queue management subunit, which is connected to the video source management unit, and the queue management subunit is specifically configured to: obtain transmission control parameters; write and cache each video frame in the video source to be transmitted from the end of the circular queue in sequence according to the transmission control parameters; transmit and process the cached video frames in sequence starting from the head of the circular queue until a stop transmission control instruction is received; based on the stop transmission control instruction, control the circular queue to stop writing and clear the video source to be transmitted in the circular queue.
[0011] In some embodiments, the service management unit also includes an encoding management subunit, the transmission control parameters include a target video encoding format, and the encoding management subunit is specifically configured to: obtain the target video encoding format selected by the user; obtain the supported video encoding format of the video source transmission device; determine whether the target video encoding format exists in the supported video encoding format; and encode the video source to be transmitted according to the target encoding format.
[0012] In some embodiments, the service management unit further includes a drive management subunit, and the drive management subunit is specifically configured to: control the switch state of the video channel after receiving the transmission control instruction.
[0013] In some embodiments, the video channel is a UVC channel.
[0014] In some embodiments, before receiving the transmission control instruction, the transmission management unit is further used to execute a device enumeration instruction to detect an external host device connected to the video source transmission device, and receive a transmission control parameter provided by the external host device.
[0015] In some embodiments, the video source transmission device further comprises: a data transmission interface, one end of which is connected to the control module, and the other end of which is suitable for connecting to an external host device via a data connection line.
[0016] In some embodiments, the data transmission interface is a USB transmission interface.
[0017] A second aspect of the present invention provides a video source transmission method, the method comprising: obtaining a video source to be transmitted from video sources of multiple formats; caching the video source to be transmitted in the form of a circular queue; and after receiving a transmission control instruction, sequentially transmitting the video sources to be transmitted in the circular queue.
[0018] According to the video source transmission method of an embodiment of the present invention, in the process of the video source transmission device transmitting the video source to be transmitted to the external host device, the video frames in the video source to be transmitted are written into the circular queue, and then the video frames cached in the circular queue are transmitted to the external host device. That is to say, when the video source to be transmitted is transmitted and processed, the video frames of the video source to be transmitted are no longer cached through two data buffer areas, but the video frames in the video source to be transmitted are written into the circular queue, and the speed of writing the video frames into the circular queue is adaptively adjusted in combination with the reading speed of the external host device. Therefore, compared with the method of realizing video source transmission through the ping-pong cache mechanism, the speed of writing the video frames into the circular queue is adaptively adjusted in combination with the reading speed in the present application, so that the video frames cached in the circular queue will not be saturated or starved, thereby avoiding the problem of video source jamming and loss due to the influence of the reading speed.
[0019] In some embodiments, the video sources to be transmitted are cached in the form of a circular queue, and the video sources to be transmitted in the circular queue are sequentially transmitted, including: obtaining transmission control parameters; writing each video frame in the video source to be transmitted from the end of the circular queue in sequence and caching them according to the transmission control parameters; transmitting and processing the cached video frames in sequence from the head of the circular queue until a stop transmission control instruction is received; based on the stop transmission control instruction, controlling the circular queue to stop writing and clearing the video sources to be transmitted in the circular queue.
[0020] In some embodiments, obtaining a video source to be transmitted from video sources in multiple formats includes: obtaining a target video format selected by a user; and obtaining the video source to be transmitted from video sources in multiple formats according to the target video format.
[0021] In some embodiments, obtaining a video source to be transmitted includes: obtaining a target video encoding format selected by a user; obtaining an initial video source and a supporting video encoding format; determining whether the target video encoding format exists in the supporting video encoding format; encoding the initial video source according to the target encoding format, and using the encoded initial video source as the video source to be transmitted.
[0022] In some embodiments, the method further includes: sequentially transmitting the video sources to be transmitted in the circular queue through a UVC channel.
[0023] In some embodiments, the method further includes: obtaining a transmission status of the video source to be transmitted; and after determining that the transmission status is an abnormal state, controlling the UVC channel to be closed to stop the transmission of the video source to be transmitted.
[0024] In some embodiments, before receiving the transmission control instruction, the method further includes: executing a device enumeration instruction to detect an external host device connected to the video source transmission device; and receiving a transmission control parameter provided by the external host device.
[0025] A fourth aspect of the present invention provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the video source transmission method described in the above embodiment.
[0026] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0028] Figure 1 is a structural block diagram of a video source transmission device according to an embodiment of the present invention;
[0029] Figure 2 is a structural block diagram of a video source transmission device according to another embodiment of the present invention;
[0030] Figure 3 is a structural block diagram of a video source transmission device according to another embodiment of the present invention;
[0031] Figure 4 is a schematic diagram of a circular queue according to an embodiment of the present invention;
[0032] Figure 5 is a flow chart of a video source transmission method according to an embodiment of the present invention;
[0033] Figure 6 is a schematic diagram of connecting a video source transmission device and an external host device according to an embodiment of the present invention;
[0034] Figure 7 is a flow chart of a video source transmission method according to another embodiment of the present invention;
[0035] Figure 8 is a flowchart of a video source transmission method according to another embodiment of the present invention.
[0036] Reference numerals:
[0037] Video source transmission device 1000;
[0038] Video source acquisition module 1; video source transmission module 2; control module 3; USB device terminal 6; UVC service station 5; external host device 7; USB connection line 8; video source management unit 31; service management unit 32; transmission management unit 33; queue management subunit 321. DETAILED DESCRIPTION
[0039] Embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention are described in detail below.
[0040] In order to solve the above problems, a first aspect of the present invention provides a video source transmission device, which can realize video source transmission through a circular queue, thereby avoiding the problem of video source freeze and loss due to the influence of reading speed.
[0041] Reference below Figure 1 Describe the video source transmission device 1000 according to an embodiment of the present invention, such as Figure 1 As shown, the video source transmission device includes: a video source acquisition module 1, a video source transmission module 2 and a control module 3.
[0042] The video source acquisition module 1 is used to acquire video sources in various formats; the video source transmission module 2 is used to transmit the video source; and the control module 3 is connected to the video source acquisition module 1 and the video source transmission module 2 .
[0043] The control module 3 is configured to perform the following steps.
[0044] First, a video source to be transmitted is obtained from video sources in multiple formats.
[0045] Specifically, the video source acquisition module 1 acquires video sources in various formats in real time, or the video source acquisition module 1 stores video sources in various formats, wherein the format of the video source can be static image data or dynamic image data or video data or image file or video file, etc., without limitation, and the control module obtains the video source to be transmitted from the video sources in various formats.
[0046] Then, the video source to be transmitted is cached in the form of a circular queue.
[0047] Specifically, in the process of the video source transmission device transmitting the video source to the external host device 7, the control module 3 writes the video frames in the video source to be transmitted into the circular queue.
[0048] Finally, after receiving the transmission control instruction, the video source transmission module sequentially transmits the video sources to be transmitted in the circular queue.
[0049] Specifically, in the related art, the transmission of the video source is realized through the ping-pong cache mechanism, that is, each video frame in the video source is allocated to two data cache areas, and then transmitted to the UVC channel established by the video source transmission device and the external host device 7 through the two data cache areas, and then the video frames in the video source are written into the two data cache areas. However, in the above-mentioned video frame transmission method, when the UVC channel quickly obtains the video source in the data cache area, the video frame cannot be written into the data cache area in time, thereby causing the video source to be stuck, and when the UVC channel reads the video source in the data cache area slowly, it will cause the video source to be lost. In order to solve this problem, in the present application, the video source to be transmitted is cached in the form of a circular queue, and the video source to be transmitted in the circular queue is transmitted and processed in sequence, and the video source is no longer buffered by the data buffer, thereby avoiding the problem of video source stuck and loss due to the influence of the reading speed. That is to say, after the video source transmission device receives the transmission control instruction input by the user through the external host device 7, the video source transmission device transmits the video source to the external host device 7, that is, the video frame in the video source to be transmitted is written into the circular queue, and then the circular queue is The video sources to be transmitted in the column are transmitted to the external host device 7 in sequence, and during the transmission process, after the video frames in the transmission video source in the circular queue are transmitted, the remaining video frames in the video source to be transmitted are written into the circular queue. When the external host device 7 reads the video frames quickly, the speed of writing the video frames into the circular queue is increased, and when the external host device 7 reads the video frames slowly, the speed of writing the video frames into the circular queue is slowed down, so that the video frames cached in the circular queue will not be saturated or starved. Compared with the method of realizing video source transmission through the ping-pong cache mechanism, the video source transmission is realized through a circular queue in the present application, and the video source to be transmitted is no longer cached through two data cache areas, so that the speed of writing the video frames into the circular queue can be adaptively adjusted in combination with the reading speed, so that the video frames cached in the circular queue will not be saturated or starved, thereby avoiding the problem of video source jamming and loss caused by the influence of the reading speed, improving work efficiency and flexibility, facilitating rapid docking and development of utilities, and when the circular queue is used to cache the video source, the memory can be reused, which is beneficial to saving memory space, so as to maximize the thread processing efficiency of video source transmission. In addition, the circular queue is a queue that reuses the queue space, and the head of the circular queue is connected to the tail of the queue. The video source transmission device can be a terminal, a camera device or other device with a camera, etc., and there is no limitation on this.
[0050] According to the video source transmission device of the embodiment of the present invention, in the process of the video source transmission device transmitting the video source to be transmitted to the external host device 7, the control module 3 writes the video frames in the video source to be transmitted into the circular queue, and then transmits the video frames cached in the circular queue to the external host device 7. That is to say, when the control module 3 performs transmission processing on the video source to be transmitted, it no longer caches the video frames of the video source to be transmitted through two data buffer areas, but writes the video frames in the video source to be transmitted into the circular queue, and adaptively adjusts the speed of writing the video frames into the circular queue in combination with the reading speed of the external host device 7. Therefore, compared with the method of realizing video source transmission through the ping-pong cache mechanism, the video source transmission device in the present application adaptively adjusts the speed of writing the video frames into the circular queue in combination with the reading speed, so that the video frames cached in the circular queue will not be saturated or starved, thereby avoiding the problem of video source jamming and loss due to the influence of the reading speed.
[0051] In some embodiments, Figure 2 As shown, the control module 3 includes: a video source management unit 31, a service management unit 32 and a transmission management unit 33. Among them, the video source management unit 31 is connected to the video source acquisition module 1, and the video source management unit 31 is used to manage the video sources of various formats acquired by the video source acquisition module 1; the service management unit 32 is connected to the video source management unit 31, and the service management unit 32 is used to obtain the video source to be transmitted from the video sources of various formats according to the target video format selected by the user, and cache the video source to be transmitted in the form of a circular queue; the transmission management unit 33 is connected to the service management unit 32 and the video source transmission module 2, and the transmission management unit 33 is used to control the video source transmission module 2 to sequentially transmit the video sources to be transmitted in the circular queue after receiving the transmission control instruction.
[0052] Specifically, the video source management unit 31 receives video sources of various formats captured by the video source acquisition module 1, and receives the target video format selected by the user through the external host device 7, so as to obtain the video source to be transmitted from the video sources of various formats captured by the video source acquisition module 1, and cache the video source to be transmitted in the form of a circular queue, that is, write the video frames in the video source to be transmitted into the circular queue. After receiving the transmission control instruction, the transmission management unit 33 controls the video source transmission module 2 to perform transmission processing on the video sources to be transmitted in the circular queue in sequence. During the transmission process, after the video frames in the transmission video source in the circular queue are transmitted, the remaining video frames in the video source to be transmitted are written into the circular queue. When the external host device 7 reads the video frames quickly, the speed of writing the video frames into the circular queue is increased, and when the external host device 7 reads the video frames slowly, the speed of writing the video frames into the circular queue is increased. When reading video frames, the speed of writing video frames into the circular queue is slowed down so that the video frames cached in the circular queue will not be saturated or hungry. Compared with the method of realizing video source transmission through the ping-pong cache mechanism, the transmission of the video source is realized through the circular queue in the present application, and the video source to be transmitted is no longer cached through two data buffer areas, so that the speed of writing video frames into the circular queue can be adaptively adjusted in combination with the reading speed, so that the video frames cached in the circular queue will not be saturated or hungry, thereby avoiding the problem of freezing and loss of the video source due to the influence of the reading speed, improving work efficiency and flexibility, facilitating rapid docking and development of utilities, and using the circular queue to cache the video source. When the memory can be reused, it is beneficial to save memory space, so that the thread processing efficiency of the video source transmission is maximized. In addition, the circular queue is a queue that reuses the queue space, and the head of the circular queue is connected to the tail of the queue.
[0053] In some embodiments, the target video format includes at least dynamic images, static images and static video files, that is, the target video format selected by the user through the external host device 7 is a dynamic image, a static image or a static video file, and the video source management unit 31 obtains the target video format selected by the user through the external host device 7, and obtains the video source to be transmitted in the corresponding video format from the video sources of multiple formats according to the target video format selected by the user. For example, if the target video format selected by the user is a dynamic image, the video source management unit 31 obtains the dynamic image from the video sources of multiple formats and uses the dynamic image as the video source to be transmitted. In addition, the static video file can be an ES (Elementary Streams, encoded stream) file, which is not limited to this, and the target video format also includes image data files, etc.
[0054] In some embodiments, Figure 3As shown, the service management unit 32 also includes a queue management subunit 321, which is connected to the video source management unit 31. The queue management subunit 321 is specifically configured to: obtain transmission control parameters; write each video frame in the video source to be transmitted from the end of the circular queue in turn and cache it according to the transmission control parameters; start from the head of the circular queue and process the cached video frames in turn until a stop transmission control instruction is received; based on the stop transmission control instruction, control the circular queue to stop writing and clear the video source to be transmitted in the circular queue.
[0055] In the embodiment, the length of the user-defined circular queue is N, and the head and tail of the user-defined circular queue, the head pointer points to the address corresponding to the head of the circular queue, wherein the head of the circular queue refers to the end of the circular queue where data can be deleted, and the tail pointer points to the address corresponding to the tail of the circular queue, wherein the tail of the circular queue refers to the end of the circular queue where data can be inserted, that is, in the process of writing each video frame in the video source to be transmitted into the circular queue, the tail pointer points to the address corresponding to the tail of the circular queue, and then the video frame in the video source to be transmitted is written into the address corresponding to the tail of the circular queue, and the head pointer points to the address corresponding to the head of the circular queue, and the video frame stored in the address corresponding to the head of the circular queue is transmitted to the external host device 7. Therefore, when the circular queue is used to cache the video source, the memory can be reused, which is conducive to saving memory space.
[0056] In addition, when the tail pointer catches up with the head pointer, an empty queue appears, and when the head pointer catches up with the tail pointer, a full queue appears. At this time, you need to wait to enter or exit the queue, and the head and tail of the queue move relative to each other.
[0057] Specifically, the queue management subunit 321 obtains the transmission control parameters input by the user through the external host device 7, wherein the transmission control parameters at least include the frame interval, such as Figure 4As shown, each video frame in the video source to be transmitted is written and cached from the end of the circular queue in sequence according to the transmission control parameters, that is, the speed of writing each video frame into the circular queue is controlled by the transmission control parameters selected by the user in the external host device 7, and the cached video frames are transmitted and processed in sequence starting from the head of the circular queue, that is, the cached video frames are transmitted in sequence starting from the head of the circular queue according to the transmission control parameters, and during the transmission process, after the video frames in the transmission video source in the circular queue are transmitted, the remaining video frames in the video source to be transmitted are written into the circular queue according to the transmission control parameters, so that the video frames cached in the circular queue will not be saturated or starved until the stop transmission control instruction input by the user through the external host device 7 is received, and based on the stop transmission control instruction, the circular queue is controlled to stop writing and clear the video source to be transmitted in the circular queue. Therefore, in the present application, based on the different frame intervals of different video sources, the queue management subunit 321 in the present application controls the speed of writing each video frame into the circular queue through the transmission control parameter selected by the user in the external host device 7, that is, the frame interval, that is, the speed of reading the video frame by the selected frame interval of different video sources to control the speed of writing each video frame into the circular queue, so that the circular queue will not be hungry or backlogged, that is, the circular queue will not be empty or full, but will continuously insert the remaining video frames in the video source to be transmitted into the circular queue, thereby avoiding the problem of freezing and loss of the video source due to the influence of the reading speed, and in addition, when the video frame is entered and exited, only the head and tail pointers are moved, the CPU utilization rate is high, and the processing efficiency of the ping-pong or data receiving and sending threads can be maximized. The head and tail of the circular queue are connected, and the head and tail move relative to each other during the entry and exit operations.
[0058] In some embodiments, the service management unit 32 also includes an encoding management subunit, the transmission control parameters include a target video encoding format, and the encoding management subunit is specifically configured to: obtain the target video encoding format selected by the user; obtain the supported video encoding formats of the video source transmission device; determine whether the target video encoding format exists in the supported video encoding formats; and encode the video source to be transmitted according to the target encoding format.
[0059] Specifically, the external host device 7 obtains all video encoding formats supported by the video source transmission device by enumeration and displays them on the screen of the external host device 7, so that the user can select the video encoding format through the screen of the external host device 7. After receiving the target video encoding format selected by the user, the external host device 7 sends it to the encoding management subunit of the video source transmission device, and the encoding management subunit can obtain the target video encoding format selected by the user, and the encoding management subunit obtains the supported video encoding formats of the video source transmission device, and determines that there is a target video encoding format in the supported video encoding formats, then encodes the video source to be transmitted according to the target encoding format, so as to convert the format of the video source to be transmitted into the target video encoding format. In this way, the video source to be transmitted is encoded according to the target video encoding format selected by the user, so that the transmission of the video source can be ensured.
[0060] In addition, the video encoding format can be YUYV, MJPEG (Motion Joint Photographic Experts Group, technology is motion still image (or frame by frame) compression technology) and H264, etc., without limitation, and the UVC driver supports the framebased format of H264. For example, if the target video encoding format is H264 and the initial video source format is YUYV, the initial video source is encoded according to the target encoding format to convert the initial video source format into the target encoding format. It should be noted that after the user selects the target video encoding format in the external host device 7, the video source transmission device needs to generate a video source to be transmitted in the same video encoding format.
[0061] In some embodiments, the service management unit 32 also includes a drive management subunit, which is specifically configured to: control the switching state of the video channel after receiving a transmission control instruction, that is, the drive management subunit controls the switching state of the video channel after receiving a transmission control instruction input by the user through the screen of the external host device 7. For example, if the transmission control instruction input by the user through the screen of the external host device 7 is a start transmission control instruction, the video channel is controlled to be opened; if the transmission control instruction input by the user through the screen of the external host device 7 is a stop transmission control instruction, the video channel is controlled to be closed, thereby realizing the control of the video source transmission.
[0062] In some embodiments, the video channel is a UVC channel, that is, the video source transmission device is connected to the external host device 7 through a USB cable to establish a UVC channel, wherein the UVC channel adopts the UVC protocol to transmit data, and the video sources to be transmitted in the circular queue are sequentially transmitted and processed through the UVC channel, and the speed of writing each video frame into the circular queue is controlled by the selected transmission control parameters, and the cached video frames are transmitted to the UVC channel in sequence starting from the head of the circular queue, so that the UVC channel obtains the cached video frames from the head of the circular queue according to the transmission control parameters, i.e., the fixed frame interval, so that the video source in the circular queue will not be hungry or backlogged, thereby avoiding the problem of video source jamming and loss due to the influence of reading speed.
[0063] In some embodiments, before receiving the transmission control instruction, the transmission management unit 33 is also used to execute a device enumeration instruction to detect the external host device 7 connected to the video source transmission device. The external host device 7 controls the transmission management unit 33 to execute the device enumeration instruction. The external host device 7 obtains the transmission control parameters supported by the video source transmission device and displays them on the screen of the external host device 7. For example, the transmission control parameter can be a frame interval. The user can select the transmission control parameter through the screen of the external host device 7. The external host device 7 then transmits the transmission control parameter to the transmission management unit 33 of the video source transmission device through the video channel. The transmission management unit 33 can receive the transmission control parameter provided by the external host device 7. Therefore, in this application, the speed of writing each video frame into the circular queue is controlled by the transmission control parameter selected by the user in the external host device 7, that is, the frame interval, that is, different video sources control the speed of writing each video frame into the circular queue at the selected frame interval, that is, the speed of reading the video frame, so that the circular queue will not be hungry or backlogged, that is, the circular queue will not be empty or full, but will continuously insert the remaining video frames in the video source to be transmitted into the circular queue, thereby avoiding the problem of video source jamming and loss due to the influence of the reading speed.
[0064] In some embodiments, the video source transmission device further includes: a data transmission interface. One end of the data transmission interface is connected to the control module 3, and the other end of the data transmission interface is suitable for connecting to the external host device 7 through a data connection line. According to this design, the external host device 7 is connected to the control module 3 through the data connection line and the data transmission interface, so that the control module 3 can send the video source to be transmitted to the external host device 7 through the data connection line and the data transmission interface.
[0065] In some embodiments, the data transmission interface is a USB transmission interface or other interface, which is not limited.
[0066] A second aspect of the present invention provides a video source transmission method, such as Figure 5 As shown, the method at least includes: step S1 to step S3.
[0067] Step S1, obtaining a video source to be transmitted from video sources in multiple formats.
[0068] Specifically, the video source acquisition module acquires video sources in various formats in real time, or the video source acquisition module 1 stores video sources in various formats, wherein the format of the video source may be static image data, dynamic image data, or video data, etc., without limitation.
[0069] Step S2: caching the video source to be transmitted in the form of a circular queue.
[0070] Specifically, in the process of the video source transmission device transmitting the video source to the external host device, the video frames in the video source to be transmitted are written into the circular queue.
[0071] Step S3, after receiving the transmission control instruction, the video source transmission module sequentially transmits the video sources to be transmitted in the circular queue.
[0072] Specifically, in the related art, the transmission of the video source is realized through the ping-pong cache mechanism, that is, each video frame in the video source is allocated to two data cache areas, and then transmitted to the UVC channel established between the video source transmission device and the external host device through the two data cache areas, and then the video frames in the video source are written into the two data cache areas. However, in the above-mentioned video frame transmission method, when the UVC channel quickly obtains the video source in the data cache area, the video frame cannot be written into the data cache area in time, thereby causing the video source to be stuck, and when the UVC channel reads the video source in the data cache area slowly, it will cause the video source to be lost. In order to solve this problem, in the present application, the video source to be transmitted is cached in the form of a circular queue, and the video source to be transmitted in the circular queue is transmitted and processed in sequence, and the video source is no longer buffered by the data buffer, thereby avoiding the problem of video source stuck and loss due to the influence of the reading speed. That is to say, after the video source transmission device receives the transmission control instruction input by the user through the external host device, the video source transmission device writes the video frame in the video source to be transmitted into the circular queue during the process of transmitting the video source to the external host device, and writes the circular queue into the video source to be transmitted. The video sources to be transmitted in the queue are transmitted to the external host device in sequence, and during the transmission process, after the video frames in the transmission video source in the circular queue are transmitted, the remaining video frames in the video source to be transmitted are written into the circular queue, and when the external host device reads the video frames quickly, the speed of writing the video frames into the circular queue is increased, and when the external host device reads the video frames slowly, the speed of writing the video frames into the circular queue is slowed down, so that the video frames cached in the circular queue will not be saturated or starved. Compared with the method of realizing video source transmission through a ping-pong cache mechanism, the video source transmission is realized through a circular queue in the present application, and the video source to be transmitted is no longer cached through two data cache areas, so that the speed of writing the video frames into the circular queue can be adaptively adjusted in combination with the reading speed, so that the video frames cached in the circular queue will not be saturated or starved, thereby avoiding the problem of video source jamming and loss caused by the influence of the reading speed, improving work efficiency and flexibility, and quickly docking with the development utility program, and when the circular queue is used to cache the video source, the memory can be reused, which is conducive to saving memory space, so as to maximize the thread processing efficiency of video source transmission. In addition, the circular queue is a queue that reuses queue space, and the head and tail of the circular queue are connected.
[0073] According to the video source transmission method of the embodiment of the present invention, in the process of the video source transmission device transmitting the video source to be transmitted to the external host device, the video frames in the video source to be transmitted are written into the circular queue, and then the video frames cached in the circular queue are transmitted to the external host device. That is to say, when the video source to be transmitted is transmitted, the video frames of the video source to be transmitted are no longer cached through two data buffer areas, but the video frames in the video source to be transmitted are written into the circular queue, and the speed of writing the video frames into the circular queue is adaptively adjusted in combination with the reading speed of the external host device. Therefore, compared with the method of realizing video source transmission through the ping-pong cache mechanism, the speed of writing the video frames into the circular queue is adaptively adjusted in combination with the reading speed in the present application, so that the video frames cached in the circular queue will not be saturated or starved, thereby avoiding the problem of video source jamming and loss due to the influence of the reading speed.
[0074] In some embodiments, the video source to be transmitted is cached in the form of a circular queue, and the video source to be transmitted in the circular queue is sequentially transmitted, including: obtaining transmission control parameters; writing each video frame in the video source to be transmitted from the end of the circular queue in sequence according to the transmission control parameters and caching them; starting from the head of the circular queue, sequentially transmitting and processing the cached video frames until a stop transmission control instruction is received; based on the stop transmission control instruction, controlling the circular queue to stop writing and clearing the video source to be transmitted in the circular queue. Specifically, the transmission control parameters input by the user through the external host device are obtained, wherein the transmission control parameters at least include a frame interval, such as Figure 4As shown, each video frame in the video source to be transmitted is written and cached from the end of the circular queue in sequence according to the transmission control parameters, that is, the speed of writing each video frame into the circular queue is controlled by the transmission control parameters selected by the user in the external host device, and the cached video frames are transmitted and processed in sequence starting from the head of the circular queue, that is, the cached video frames are transmitted in sequence starting from the head of the circular queue according to the transmission control parameters, and during the transmission process, after the video frames in the transmission video source in the circular queue are transmitted, the remaining video frames in the video source to be transmitted are written into the circular queue according to the transmission control parameters, so that the video frames cached in the circular queue will not be saturated or starved until the stop transmission control instruction input by the user through the external host device 7 is received, and based on the stop transmission control instruction, the circular queue is controlled to stop writing and clear the video source to be transmitted in the circular queue. Therefore, in the present application, based on the different frame intervals of different video sources, the speed of writing each video frame into the circular queue is controlled by the transmission control parameter selected by the user in the external host device, that is, the frame interval, that is, the speed of reading the video frame at the selected frame interval of different video sources to control the speed of writing each video frame into the circular queue, so that the circular queue will not be hungry or backlogged, that is, the circular queue will not be empty or full, but the remaining video frames in the video source to be transmitted will be continuously inserted into the circular queue, thereby avoiding the problem of freezing and loss of the video source due to the influence of the reading speed. In addition, when the video frame is entered and exited, only the head and tail pointers are moved, the CPU utilization rate is high, and the processing efficiency of the ping-pong or data receiving and sending threads can be maximized. The length of the circular queue can be customized, the head and tail of the circular queue are connected, and the head and tail move relative to each other during the entry and exit operations.
[0075] In an embodiment, the video source transmission device may be a USB (Universal Serial Bus) device end, such as Figure 6 As shown, the UVC service station (Service) 5 of the USB device end 6 is connected to the external host device 7. When the UVC service station 5 captures the video source, the video source is sent to the external host device 7 through the USB cable 8, so that the external host device 7 can obtain the video source, thereby ensuring that the external host device 7 can decode or preview the video source and other related functions. In addition, the USB device end includes a USB driver, a Gadget driver and a UDC, and provides UVC device enumeration and transmission through a USB EP (Endpoint). In an embodiment, in addition to docking the acquisition of video sources and USB device end management, the UVC service station also supports the construction of Pipeline (pipeline) and the management of circular queues.
[0076] In addition, the external host device may be a Windows / Linux / AndRoid / Mac operating system, and the external host device may have a UVC driver.
[0077] In some embodiments, the external host device obtains all video encoding formats supported by the video source transmission device by enumeration and displays them on the screen of the external host device, so that the user can select the video encoding format through the screen of the external host device. After receiving the target video encoding format selected by the user, the external host device sends it to the video source transmission device, and the video source transmission device obtains the target video encoding format selected by the user, and the video source transmission device obtains the initial video source and the supported video encoding format, and determines that there is a target video encoding format in the supported video encoding format, then encodes the video source to be transmitted according to the target video encoding format, so as to convert the format of the video source to be transmitted into the target video encoding format, and uses the encoded initial video source as the video source to be transmitted. In this way, the initial video source is encoded according to the target video encoding format, so that the transmission of the video source can be ensured.
[0078] In addition, the video encoding format can be YUYV, MJPEG (Motion Joint Photographic Experts Group, technology that is, motion still image (or frame-by-frame) compression technology) and H264, etc., without limitation. The UVC driver supports the framebased format of H264. For example, if the target video encoding format is H264 and the initial video source format is YUYV, the initial video source is encoded according to the target encoding format to convert the initial video source format into the target encoding format. It should be noted that after the user selects the target video encoding format on the external host device, the video source transmission device needs to send the video source to be transmitted in the same video encoding format.
[0079] In an embodiment, the transmission of the video source may be tested by printing a Log timestamp.
[0080] In some embodiments, the external host device detects the video resolutions supported by the video source transmission device through enumeration and displays it on the screen of the external host device, so that the user can select the video resolution through the external host device. The external host device receives the target video resolution selected by the user, and the video source transmission device can obtain the target video resolution selected by the user. The video source transmission device then obtains the initial video source and switches the resolution of the initial video source according to the target video resolution. For example, if the target video resolution is 1080P and the resolution of the initial video source is 4K, the resolution of the initial video source is scaled from 4K to 1080, and the switched initial video source is used as the video source to be transmitted. In this way, the resolution of the initial video source is switched according to the target video resolution, so that the transmission of the video source can be ensured.
[0081] In addition, after the external host device successfully enumerates the video source transmission device, the external host device can control the transmission of the video source through corresponding applications or commands.
[0082] In an embodiment, there is no restriction on the order of switching the resolution of the initial video source and encoding the initial video source. The resolution of the initial video source can be switched according to the target video resolution first, and then the initial video source can be encoded according to the target encoding format to obtain the video source to be transmitted. Therefore, for different video sources corresponding to different frame intervals, video encoding formats and video resolutions, in this application, by selecting transmission control parameters, namely frame interval, target video encoding format and target video resolution on an external host device, the video source to be transmitted is transmitted and processed with the frame interval, target video encoding format and target video resolution selected by the user, so as to ensure the transmission of the video source to be transmitted, thereby avoiding the problem of freeze or error exit in the video source playback.
[0083] In some embodiments, a video source transmission device is connected to an external host device via a USB cable to establish a UVC channel, wherein the UVC channel uses the UVC protocol to transmit data, and the video sources to be transmitted in the circular queue are sequentially transmitted and processed through the UVC channel, and the speed of writing each video frame into the circular queue is controlled by the selected transmission control parameters, and the cached video frames are transmitted to the UVC channel in sequence starting from the head of the circular queue, so that the UVC channel obtains the cached video frames from the head of the circular queue at a fixed frame interval according to the transmission control parameters, so that the video sources in the circular queue will not be starved or backlogged, thereby avoiding the problem of video source freeze and loss due to the influence of reading speed.
[0084] In some embodiments, after the video source transmission device obtains the transmission status of the video source to be transmitted and determines that the transmission status of the video source to be transmitted is an abnormal state, where the abnormal state is that the external host device is stuck or the external host device is forced to close the playback video source or the enumeration process is abnormal or the transmission is abnormal, the UVC channel is controlled to be closed to stop the transmission of the video source to be transmitted. In addition, when the video source transmission status is an abnormal state, the external host device obtains the video source abnormality.
[0085] Reference below Figure 7 The video source transmission method according to the embodiment of the present invention is illustrated by way of example, and the specific contents are as follows.
[0086] Step S3, start.
[0087] Step S4, obtaining a static video file, wherein the static video file may be an ES file.
[0088] Step S5, creating a circular queue.
[0089] Step S6, the video frames in the static video file wait to be queued.
[0090] Step S7, determine whether to open the UVC channel transmission, if yes, execute step S8, otherwise execute step S11.
[0091] Step S8, writing each video frame in the static video file into the circular queue in sequence according to the transmission control parameter selected by the user in the external host device, namely the frame interval, that is, controlling the speed of writing each video frame into the circular queue by the reading speed of the external host device.
[0092] Step S9, transmitting the cached video frames from the head of the circular queue to the UVC channel, and the UVC channel then sends the received video frames to the external host device in sequence.
[0093] Step S10: receiving a transmission stop control instruction, ie, a flow shut-down instruction, inputted by a user through an external host device.
[0094] Step S11, stop writing the video frames in the static video file and clear the video frames cached in the circular queue, and execute step S6.
[0095] Step S12, end.
[0096] In summary, in this application, after receiving the start transmission control instruction, i.e., the open stream instruction, the UVC channel is opened, and the speed of writing each video frame into the circular queue is controlled according to the outdoor transmission control parameter, i.e., the frame interval, selected by the user in the external host device, that is, the speed of reading the video frames by different video sources is used to control the speed of writing each video frame into the circular queue, so that the circular queue will not be hungry or backlogged, that is, the circular queue will not be empty or full, but the remaining video frames in the video source to be transmitted will be continuously inserted into the circular queue, thereby avoiding the problem of freezing and loss of the video source due to the influence of the reading speed. In addition, after receiving the stop transmission control instruction, i.e., the close stream instruction, the video frame is controlled to stop being written into the circular queue, and the video source to be transmitted in the circular queue is cleared.
[0097] Reference below Figure 8 The video source transmission method according to the embodiment of the present invention is illustrated by way of example, and the specific contents are as follows.
[0098] Step S13, start.
[0099] Step S14: the user triggers an enumeration request through the external host device, and the external host device 7 enumerates the video encoding formats and video resolutions supported by the video source transmission device.
[0100] Step S15, determining whether a USB event is established, if so, executing step S17, otherwise executing step S16.
[0101] Step S16: the external host device responds with an error, and step S25 is executed.
[0102] Step S17, determining whether the external host device detects all supported video encoding formats, video resolutions and transmission control parameters, i.e., frame intervals, of the video source transmission device; if so, executing step S19, otherwise executing step S18.
[0103] Step S18: If an error occurs when the external host device detects whether the video source transmission device supports the video encoding format, the video resolution, and the transmission control parameter, ie, the frame interval, the process proceeds to step S25.
[0104] Step S19, determining whether the target encoding format, target video resolution and transmission control parameters selected by the user through the relevant video playback software on the external host device are incorrectly selected, if so, executing step S21, otherwise executing step S20.
[0105] Step S20: If an error occurs when the external host device selects the target encoding format, the target video resolution and the transmission control parameters, step S25 is executed.
[0106] In step S21, the user inputs a stream opening instruction through the relevant video playback software on the external host device, thereby controlling the UVC channel to open.
[0107] Step S22, according to the transmission control parameter selected by the user in the external host device, that is, the frame interval, each video frame in the video source to be transmitted is written into the circular queue in sequence, that is, the speed of writing each video frame into the circular queue is controlled by the reading speed of the external host device, and the cached video frame is transmitted from the head of the circular queue to the UVC channel. After the UVC channel receives the video frame in the video source to be transmitted, it will be transmitted to the external host device.
[0108] Step S23: If the video source to be transmitted is transmitted incorrectly, execute step S25.
[0109] In step S24, the user inputs a stop transmission control instruction, i.e., a flow-off instruction, through the relevant audio playback software on the external host device, thereby controlling the UVC channel to be closed and stopping the transmission of the video source to be transmitted to the external host device 7.
[0110] Step S25, end.
[0111] Therefore, for different frame intervals, video encoding formats and video resolutions corresponding to different video sources, the present application selects the transmission control parameters, i.e., frame interval, target video encoding format and target video resolution, in the external host device, so as to control the transmission of the video source to be transmitted with the frame interval selected by the user, so that the circular queue will not be starved or backlogged, that is, the circular queue will not be empty or full, but the remaining video frames in the video source to be transmitted will be continuously inserted into the circular queue, so as to avoid the problem of video source jamming and loss caused by the influence of reading speed. And before writing each video frame in the video source to be transmitted into the circular queue, the video source to be transmitted is processed by the target video encoding format and the target video resolution to ensure the transmission of the video source to be transmitted, so as to avoid the problem of jamming or error exit in the video source playback.
[0112] A third aspect of the present invention provides a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the video source transmission method of the above embodiment is implemented.
[0113] In the description of this specification, any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code including one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0114] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0115] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0116] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0117] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0118] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0119] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.
[0120] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A video source transmission device, characterized in that: The device comprises: A video source acquisition module, wherein the video source acquisition module is used to acquire video sources in various formats; A video source transmission module, wherein the video source transmission module is used to transmit a video source; A control module, the control module is connected to the video source acquisition module and the video source transmission module, and the control module is configured as follows: Obtain the video source to be transmitted from video sources in various formats; Buffering the video source to be transmitted in the form of a circular queue; After receiving the transmission control instruction, the video source transmission module sequentially transmits the video sources to be transmitted in the circular queue.
2. The video source transmission device according to claim 1, characterized in that: The control module comprises: A video source management unit, the video source management unit is connected to the video source acquisition module, and the video source management unit is used to manage the video sources of various formats acquired by the video source acquisition module; A service management unit, the service management unit is connected to the video source management unit, the service management unit is used to obtain the video source to be transmitted from video sources of multiple formats according to the target video format selected by the user, and cache the video source to be transmitted in the form of a circular queue; A transmission management unit, the transmission management unit is connected to the service management unit and the video source transmission module, and the transmission management unit is used to control the video source transmission module to sequentially transmit the video sources to be transmitted in the circular queue after receiving a transmission control instruction.
3. The video source transmission device according to claim 2, characterized in that: The target video format includes at least dynamic images, static images and static video files.
4. The video source transmission device according to claim 2, characterized in that: The service management unit further includes a queue management subunit, which is connected to the video source management unit, and the queue management subunit is specifically configured as follows: Get transmission control parameters; Writing each video frame in the to-be-transmitted video source into the tail of the circular queue in sequence and caching the frame according to the transmission control parameter; Starting from the head of the circular queue, the buffered video frames are sequentially transmitted and processed until a transmission stop control instruction is received; Based on the transmission stop control instruction, the circular queue is controlled to stop writing and the video source to be transmitted in the circular queue is cleared.
5. The video source transmission device according to claim 4, characterized in that: The service management unit further includes a coding management subunit, the transmission control parameter includes a target video coding format, and the coding management subunit is specifically configured as follows: Get the target video encoding format selected by the user; Obtaining a supported video encoding format of the video source transmission device; Determining that the target video encoding format exists in the supported video encoding formats; The to-be-transmitted video source is encoded according to the target encoding format.
6. The video source transmission device according to claim 5, characterized in that: The service management unit further includes a drive management subunit, and the drive management subunit is specifically configured to control the switch state of the video channel after receiving the transmission control instruction.
7. The video source transmission device according to claim 6, characterized in that: The video channel is a UVC channel.
8. The video source transmission device according to claim 2, characterized in that: Before receiving the transmission control instruction, the transmission management unit is further used to execute a device enumeration instruction to detect an external host device connected to the video source transmission device, and receive a transmission control parameter provided by the external host device.
9. The video source transmission device according to claim 1, characterized in that: The video source transmission device also includes: A data transmission interface, one end of which is connected to the control module, and the other end of which is suitable for connecting to an external host device via a data connection line.
10. The video source transmission device according to claim 9, characterized in that: The data transmission interface is a USB transmission interface.
11. A video source transmission method, characterized in that: For use in the video source transmission device according to any one of claims 1 to 10, the method comprising: Obtain the video source to be transmitted from video sources in various formats; Buffering the video source to be transmitted in the form of a circular queue; After receiving the transmission control instruction, the video sources to be transmitted in the circular queue are sequentially transmitted.
12. The video source transmission method according to claim 11, characterized in that: Get video sources to be transmitted from video sources in various formats, including: Get the target video format selected by the user; The video source to be transmitted is obtained from video sources in multiple formats according to the target video format.
13. The video source transmission method according to claim 11, characterized in that: The video sources to be transmitted are cached in the form of a circular queue, and the video sources to be transmitted in the circular queue are sequentially transmitted, including: Get transmission control parameters; Writing each video frame in the to-be-transmitted video source into the tail of the circular queue in sequence and caching the frame according to the transmission control parameter; Starting from the head of the circular queue, the buffered video frames are sequentially transmitted and processed until a transmission stop control instruction is received; Based on the transmission stop control instruction, the circular queue is controlled to stop writing and the video source to be transmitted in the circular queue is cleared.
14. The video source transmission method according to claim 13, characterized in that: After obtaining the video source to be transmitted, the method further includes: Get the target video encoding format selected by the user; Obtaining a supported video encoding format of the video source transmission device; Determining that the target video encoding format exists in the supported video encoding formats; The to-be-transmitted video source is encoded according to the target encoding format.
15. The video source transmission method according to claim 11, characterized in that: Also includes: The video sources to be transmitted in the circular queue are sequentially transmitted through the UVC channel.
16. The video source transmission method according to claim 11, characterized in that: Also includes: Obtaining the transmission status of the video source to be transmitted; After determining that the transmission state is an abnormal state, the UVC channel is controlled to be closed to stop the transmission of the video source to be transmitted.
17. The video source transmission method according to claim 11, characterized in that: Before receiving the transmission control instruction, it also includes: Executing a device enumeration instruction to detect an external host device connected to the video source transmission device; Receive a transmission control parameter provided by the external host device.
18. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the video source transmission method according to any one of claims 11 to 17 is implemented.