CN116320295A - Video stream processing method and device, electronic equipment and storage medium - Google Patents

Video stream processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116320295A
CN116320295A CN202310153835.XA CN202310153835A CN116320295A CN 116320295 A CN116320295 A CN 116320295A CN 202310153835 A CN202310153835 A CN 202310153835A CN 116320295 A CN116320295 A CN 116320295A
Authority
CN
China
Prior art keywords
video stream
state
target
queue
determining
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
CN202310153835.XA
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.)
GRG Banking Equipment Co Ltd
Original Assignee
GRG Banking Equipment 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 GRG Banking Equipment Co Ltd filed Critical GRG Banking Equipment Co Ltd
Priority to CN202310153835.XA priority Critical patent/CN116320295A/en
Publication of CN116320295A publication Critical patent/CN116320295A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies

Landscapes

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

Abstract

The application discloses a video stream processing method, a video stream processing device, electronic equipment and a storage medium, and belongs to the technical field of video stream processing. The method is applied to a target device, the target device comprising a target state machine, the method comprising: receiving a video stream acquisition request of a client; determining that a target video stream corresponding to the video stream acquisition request does not exist in target equipment, and jumping to a video stream input state by a target state machine; determining that the return condition of the video stream input state is a success condition, jumping to a video stream request state by a target state machine, and requesting a target video stream from video source equipment corresponding to the target video stream; determining that the return condition of the video stream request state is a success condition, and jumping to the video stream output state by the target state machine; and determining that the output confirmation of the video stream output state is received, jumping to the video stream transmission state by the target state machine, and transmitting the target video stream to the client. The method can improve the processing efficiency and stability of the video stream through the state machine processing.

Description

Video stream processing method and device, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of video stream processing, and particularly relates to a video stream processing method, a video stream processing device, electronic equipment and a storage medium.
Background
With the rapid development of high-definition intelligent video, a video monitoring system is widely applied to smart city construction, and a streaming media processing technology is generally used when video streams are processed.
At present, the streaming media processing technology is generally a process processing mode, the acquisition of video streams and the distribution of the video streams are completed, the video stream acquisition process is complex in the mode, the target video streams requested by the client cannot be acquired quickly, and the target video streams cannot be sent to the client quickly.
Disclosure of Invention
The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides a video stream processing method, a device, electronic equipment and a storage medium, which can improve the efficiency and stability of video stream processing.
In a first aspect, the present application provides a video stream processing method, where the method is applied to a target device, and the target device includes a target state machine, and the method includes:
receiving a video stream acquisition request of a client;
determining that a target video stream corresponding to the video stream acquisition request does not exist in the target device, and jumping to a video stream input state by the target state machine;
determining that the return condition of the video stream input state is a success condition, and jumping to a video stream request state by the target state machine to request the target video stream from video source equipment corresponding to the target video stream;
determining that the return condition of the video stream request state is a success condition, and jumping to a video stream output state by the target state machine;
and determining that the output confirmation of the video stream output state is received, and jumping to a video stream sending state by the target state machine to send the target video stream to the client.
According to the video stream processing method, the target video stream is processed and distributed through state jump of the target state machine, uncertain factors and unknown errors caused by different logic judgment in the video stream request process can be reduced, and the video stream processing efficiency and stability are improved.
According to one embodiment of the present application, after the receiving the video stream acquisition request of the client, before the determining that the output acknowledgement of the video stream output state is received, the method further includes:
and determining that the target video stream exists in the target device, and jumping to the video stream output state by the target state machine.
According to one embodiment of the present application, the determining that the target video stream exists in the target device includes:
searching a play state queue, a login state queue and a logout state queue of the target equipment;
and searching a state corresponding to the target video stream in any one of the play state queue, the login state queue and the logout state queue, and determining that the target video stream exists in the target device.
According to one embodiment of the present application, after the state corresponding to the target video stream is found in any one of the play state queue, the login state queue, and the logout state queue, before the target state machine jumps to the video stream output state, the method further includes:
determining that the state corresponding to the target video stream exists in the play state queue, and returning the target video stream according to play state logic;
or determining that the state corresponding to the target video stream exists in the login state queue, generating a play state corresponding to the target video stream, inserting the play state corresponding to the target video stream into the play state queue, and returning to the target video stream according to play state logic;
or determining that the state corresponding to the target video stream exists in the log-out state queue, reconnecting the video source equipment, generating a playing state corresponding to the target video stream, inserting the playing state corresponding to the target video stream into the playing state queue, and returning to the target video stream according to playing state logic.
According to one embodiment of the present application, the searching the play status queue, the login status queue, and the logout status queue of the target device includes:
and searching the state corresponding to the target video stream in the play state queue, the login state queue and the logout state queue in sequence.
According to one embodiment of the present application, the requesting the target video stream from the video source device corresponding to the target video stream includes:
and controlling the video source equipment to sequentially execute equipment login operation and equipment playing operation, and acquiring the target video stream of the video source equipment.
According to one embodiment of the present application, the controlling the video source device to sequentially perform a device login operation and a device play operation includes:
controlling the video source equipment to execute equipment login operation, generating a login state of the target video stream, and storing the login state into a login state queue of the target equipment;
and controlling the video source equipment to execute equipment playing operation, generating the playing state of the target video stream, and storing the playing state into a playing state queue of the target equipment.
In a second aspect, the present application provides a video stream processing apparatus, the apparatus being applied to a target device, the target device including a target state machine, the apparatus comprising:
the receiving module is used for receiving a video stream acquisition request of the client;
the first processing module is used for determining that a target video stream corresponding to the video stream acquisition request does not exist in the target device, and the target state machine jumps to a video stream input state;
the second processing module is used for determining that the return condition of the video stream input state is a success condition, the target state machine jumps to a video stream request state, and requests the target video stream to the video source equipment corresponding to the target video stream based on the video stream request state;
the third processing module is used for determining that the return condition of the video stream request state is a success condition, and the target state machine jumps to a video stream output state;
and the fourth processing module is used for determining that the output confirmation of the video stream output state is received, the target state machine jumps to a video stream sending state, and sends the target video stream to the client.
According to the video stream processing device, the target video stream is processed and distributed through the state jump of the target state machine, uncertain factors and unknown errors caused by different logic judgment in the video stream request process can be reduced, and the efficiency and stability of video stream processing are improved.
In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the video stream processing method according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a video stream processing method as described in the first aspect above.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements a video stream processing method as described in the first aspect above.
Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, wherein:
fig. 1 is a schematic flow chart of a video stream processing method according to an embodiment of the present application;
FIG. 2 is a second flowchart of a video stream processing method according to an embodiment of the present disclosure;
FIG. 3 is a third flow chart of a video stream processing method according to the embodiment of the present application;
fig. 4 is a schematic structural diagram of a video stream processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application are within the scope of the protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The video stream processing method, the video stream processing device, the electronic device and the readable storage medium provided in the embodiments of the present application are described in detail below with reference to fig. 1 to 5 by specific embodiments and application scenarios thereof.
The video stream processing method can be applied to the terminal, and can be specifically executed by hardware or software in the terminal.
The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet having a touch sensitive surface (e.g., a touch screen display and/or a touch pad). It should also be appreciated that in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or a touch pad).
In the following various embodiments, a terminal including a display and a touch sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
As shown in fig. 1, the video stream processing method includes steps 110 to 150.
In this embodiment, the video stream processing method is applied to a target device, and the target device includes a target state machine.
In actual implementation, the target device may be a video monitoring system, which may include a plurality of video source devices, and the target device may acquire and play video streams of the plurality of video source devices.
The state machine is a control center which is composed of a state register and a combinational logic circuit and can perform state skipping according to a preset state according to a control signal, and in the embodiment, the target state machine is arranged in the target device and is used for completing the skipping of the video stream state.
Step 110, receiving a video stream acquisition request of a client.
The client can send a video stream acquisition request to the target device for acquiring the target video stream, and can send a video stream disconnection request, a video stream video recording request and other requests to the target device.
Step 120, determining that the target video stream corresponding to the video stream obtaining request does not exist in the target device, and skipping to the video stream input state by the target state machine.
The video stream input state may be a state in which the video source device needs to input a video stream to the target device.
For example, the target video stream corresponding to the video stream acquisition request may be determined to be absent from the target device by searching in the target device using the I-frame information of the video stream as an index based on the information of the target video stream, and failing to find the target video stream in the target device.
Step 130, determining that the return condition of the video stream input state is a success condition, and the target state machine jumps to a video stream request state to request the target video stream from the video source device corresponding to the target video stream.
The video stream request state may be a state in which the target device requests the input target video stream from the video source device.
The video source device may be a device that is connected to the target device to provide a video stream to the target device, e.g., the target device is a monitoring system, and the video source device may be a camera or other image capturing apparatus of the monitoring system.
In actual implementation, the video source device may establish a connection channel with the target device, and when the target state machine of the target device jumps to the video stream input state, the video source device inputs the video stream to the target device through the connection channel.
When the video stream input is completed, an input completion signal is sent to the target device, the return condition that the target state machine in the target device receives the video stream input state is a success condition, and the target state machine jumps to a video stream request stage.
If the video source equipment and the target equipment cannot establish a connection channel, the target state machine directly changes to an input failure state, or the video source equipment cannot input video streams to the target equipment, the video source equipment sends an input failure signal to the target equipment, and the target state machine jumps to the input failure state.
Step 140, determining that the return condition of the video stream request state is a success condition, and jumping to the video stream output state by the target state machine.
The video stream output state may be a state in which the target device successfully acquires the target video stream and may perform configuration output on the target video stream.
In actual implementation, after the target device obtains the target video stream and the output configuration information of the target video stream from the video source device, the target state machine jumps to the video stream output state.
If the target device cannot acquire the target video stream of the video source device or cannot acquire the output configuration information of the target video stream, the target state machine jumps to a request failure state.
Step 150, determining that the output confirmation of the video stream output state is received, and skipping to the video stream sending state by the target state machine, and sending the target video stream to the client.
The method comprises the steps that output confirmation of a video stream output state is received, the fact that the target device has completed configuration of the target video stream based on output configuration information of the target video stream is characterized, then the target video stream can be sent to a client, and the video stream sending state can be a state that the target device sends the target video stream to the client.
If the target device fails to configure the target video stream, the output confirmation of the output state of the video stream is not received, or the target state machine waits for the output confirmation to send overtime, and the target state machine jumps to the sending failure state.
It should be noted that, in the process of the client requesting the target video stream, both the failure state skipped by the target state machine and the successful state of video stream transmission are skipped to the end state.
In the related art, a process processing mode is generally used for realizing the processing from video stream acquisition to video stream distribution, the process of video stream acquisition by using the mode is complex, branches which need to be converted in the acquisition process are more, so that branch conversion is disordered, the acquisition or distribution process of the video stream is caused to enter unpredictable branches, and the efficiency and stability of video stream processing are poor.
In the embodiment of the application, the state machine is used for processing the logic of the video stream acquisition and forwarding process, and the state machine is used for rapidly carrying out state processing and conversion by confirming the possible subsequent conditions of each video stream acquisition and video stream forwarding process, so that the middle judgment problem and the logic problem of converting branches are reduced, the video stream acquisition process is simple, the probability of branch conversion disorder is reduced, and the efficiency and the stability of video stream processing are improved.
According to the video stream processing method provided by the embodiment of the application, the target video stream is processed and distributed through the state jump of the target state machine, uncertain factors and unknown errors caused by different logic judgment in the video stream request process can be reduced, and the video stream processing efficiency and stability are improved.
An embodiment is described below for specifically describing the state jump procedure of the target state machine.
As shown in fig. 3, the target device is configured to receive a video acquisition request from the client, search a play state queue, a login state queue, and a logout state queue in the target device, determine that the requested video stream is already in the target device when a state corresponding to the target video stream is found, and determine that the requested video stream is not in the target device when a state corresponding to the target video stream is not found.
When judging that the requested video stream does not exist, requesting video stream input from a video source, when the video stream input request from the video source is successful, jumping the target state machine to a video stream request state, and when the video stream input request from the video source fails, replying that the client video stream acquisition fails.
The IN protocol represents that the IN protocol can be used for video stream data transmission between the video source and the target device, so that higher data arrival rate and lower data energy consumption rate are obtained.
When the video stream is successfully requested from the video source, the target state machine jumps to a video stream output state, when the video stream is unsuccessfully requested from the video source, the video stream input is requested to be closed from the video source, and the failure of obtaining the video stream of the client is replied.
When the requested video stream is judged to exist, the state corresponding to the target video stream is directly found from the state queue in the target device, the target video stream is returned according to the video stream playing state logic, and the target state machine jumps to the video stream output state.
And when receiving the output confirmation of the video stream output state, the target state machine jumps to a video stream sending state, sends the target video stream to the client, and jumps to an ending state.
The ACK event is used for indicating that the video stream sent by the video source to the target device is confirmed to be received without errors, and the VDUOUT-SDP is used for indicating that the connection between the video source and the target device is trusted and successfully outputting the video stream to the target device.
And under the conditions that the video stream output fails and the confirmation information waiting for receiving the video stream output state is overtime, requesting the video source to close the video stream output, and replying that the client video stream acquisition fails.
After all state processing is completed, the target state machine jumps to the end state and the service ends.
In some embodiments, after receiving the video stream acquisition request of the client, before determining that an output acknowledgement of the video stream output state is received, the method further comprises:
and determining that the target video stream exists in the target device, and jumping to a video stream output state by the target state machine.
In actual implementation, after determining that the target video stream exists in the target device, the target state machine may directly jump to a video stream output state, perform output configuration on the target video stream according to the target video stream and output configuration information of the target video stream, and after completing the output configuration on the target video stream, jump to a video stream sending state, and send the target video stream to the client.
In some embodiments, determining that the target video stream is present at the target device comprises:
searching a play state queue, a login state queue and a logout state queue of the target equipment;
and searching a state corresponding to the target video stream in any one of the play state queue, the login state queue and the logout state queue, and determining that the target video stream exists in the target device.
The states stored in the play state queue, the login state queue and the logout state queue may be states generated by a target state machine in the video stream processing process.
For example, the play status queue stores play status of video streams, the login status queue stores login status of video source devices, and the login status queue stores login status of video source devices.
In this embodiment, the play state queue, the login state queue, and the logout state queue may be searched according to the video information of the target video stream and the device information of the video source device corresponding to the target video stream as indexes, so as to find the state corresponding to the target video stream, and determine whether the target video stream exists in the target device.
And searching a state corresponding to the target video stream in any one of the play state queue, the login state queue and the logout state queue, and determining that the target video stream exists in the target device.
For example, the state corresponding to the target video stream may be found in the play state queue, it may be determined that the target video stream exists in the target device, the state corresponding to the target video stream may be found in the login state queue, it may be determined that the target video stream exists in the target device, or the state corresponding to the target video stream may be found in the logout state queue, and it may be determined that the target video stream exists in the target device.
In some embodiments, after finding a state corresponding to the target video stream in any one of the play state queue, the login state queue, and the logout state queue, before the target state machine jumps to the video stream output state, the method further includes:
determining that a state corresponding to the target video stream exists in a play state queue, and returning the target video stream according to play state logic;
or determining that the state corresponding to the target video stream exists in the login state queue, generating the playing state corresponding to the target video stream, inserting the playing state corresponding to the target video stream into the playing state queue, and returning the target video stream according to the playing state logic;
or determining that the state corresponding to the target video stream exists in the log-out state queue, reconnecting the video source equipment, generating the playing state corresponding to the target video stream, inserting the playing state corresponding to the target video stream into the playing state queue, and returning to the target video stream according to the playing state logic.
In actual implementation, it is determined that the state corresponding to the target video stream exists in the play state queue, which is characterized in that the state corresponding to the target video stream is a play state, and the target video stream can be returned according to the play state logic of the video stream.
Determining that a state corresponding to the target video stream exists in the login state queue, wherein the state corresponding to the target video stream is a login state, generating a playing state of the target video stream according to the login state of the target video stream, and returning the target video stream according to the playing state logic of the video stream.
The state corresponding to the target video stream is determined to exist in the log-out state queue, and the state corresponding to the target video stream is characterized in that the state corresponding to the target video stream is the log-out state, and the state corresponding to the target video stream can be found in the log-out state queue, so that the relevant resources of the target video stream are not released yet.
In the case where the relevant resources of the target video stream have not been released, the video source device may be reconnected, a play state of the target video stream may be generated according to the log-out state of the target video stream, and the target video stream may be returned according to the play state logic of the video stream.
After generating the playing state of the target video stream according to the login state of the target video stream or the logout state of the target video stream, the playing state of the target video stream is inserted into the playing state queue, so that the playing state of the target video stream can be directly obtained from the playing state queue when the target video stream is obtained next time, the target video stream is returned according to the playing state logic, and the operation steps required to be executed for obtaining the target video stream are reduced.
In some embodiments, looking up the play status queue, the login status queue, and the logout status queue of the target device includes:
and searching the state corresponding to the target video stream in the play state queue, the login state queue and the logout state queue in sequence.
In this embodiment, when searching for the play state queue, the login state queue, and the logout state queue, the order needs to be searched in a certain order.
The search priority of the play state queue is greater than the search priority of the login state queue, the search priority of the login state queue is greater than the search priority of the login state queue, and the search priority characterizes the search sequence of different state queues when searching the play state queue, the login state queue and the login state queue.
In actual execution, according to the searching priority of the state queue, the target device searches the play state queue, searches the login state queue, and searches the logout state queue.
By setting the play state queue, the login state queue and the logout state queue and setting the search priorities corresponding to different state queues, when a large number of video stream acquisition requests are faced, the video stream can be requested to the video source equipment without frequency, and under the condition that the state corresponding to the target video stream is preferentially searched in the play state queue, the complexity of the system can be effectively reduced, and the video stream processing efficiency is improved.
In some embodiments, requesting a target video stream from a video source device corresponding to the target video stream includes:
and controlling the video source equipment to sequentially execute equipment login operation and equipment playing operation, and obtaining a target video stream of the video source equipment.
In actual implementation, after the video streaming device executes the device login operation and the device play operation, the target device acquires the target video stream in the video source device, the target state machine jumps to the video stream output state, and under the condition that the target video stream cannot be acquired, the target state machine jumps to the request failure state.
In some embodiments, controlling the video source device to sequentially perform a device login operation and a device play operation includes:
controlling a video source device to execute device login operation, generating a login state of a target video stream, and storing the login state into a login state queue of the target device;
and controlling the video source equipment to execute equipment playing operation, generating the playing state of the target video stream, and storing the playing state into a playing state queue of the target equipment.
In this embodiment, when the video source device is controlled to sequentially perform the device login operation and the device play operation, the login state and the play state of the target video stream are generated, and the login state of the target video stream is stored in the login state queue of the target device, and the play state of the target video stream is stored in the play state queue of the target device, respectively.
When other clients also request the target video stream, the target device can directly find the state corresponding to the target video stream from the login state queue and the play state queue, and return the target video stream according to the play state logic.
In some embodiments, the target device further includes a start state queue, after receiving the video stream acquisition request of the client, before requesting the target video stream from the video source device corresponding to the target video stream, further including:
and controlling the video source equipment to fall back to a starting state, inserting the starting state into a starting state queue, sequentially performing state transition according to the equipment starting state, the login state and the playing state, acquiring a state corresponding to the target video stream, and logically returning the target video stream according to the playing state.
An embodiment is described below for describing the overall flow of the video stream processing method.
As shown in fig. 2, the target device receives a video stream acquisition request from the client and determines whether a target video stream already exists.
And under the condition that the target video stream is determined to be free of target equipment, the target state machine sequentially jumps to a video stream input state, a video stream request state, a video stream output state and a video stream transmission state according to the preset state. And under the condition that the target video stream is determined to exist in the target device, the target state machine sequentially jumps to a video stream output state and a video stream transmission state according to the preset state.
And for the normal flow, the target video stream is successfully acquired, the client is sent, and for the abnormal flow, the failure information of sending the video stream of the client is returned.
After all the state processing is finished, the request service is finished.
The implementation main body of the video stream processing method provided in the embodiment of the present application may be an electronic device or a functional module or a functional entity capable of implementing the video stream processing method in the electronic device, where the electronic device mentioned in the embodiment of the present application includes, but is not limited to, a mobile phone, a tablet computer, a camera, a wearable device, and the like, and the video stream processing method provided in the embodiment of the present application is described below by taking the electronic device as an implementation main body as an example.
According to the video stream processing method provided by the embodiment of the application, the execution subject can be a video stream processing device. In the embodiment of the present application, a video stream processing device executes a video stream processing method as an example, and the video stream processing device provided in the embodiment of the present application is described.
The embodiment of the application also provides a video stream processing device, which is applied to target equipment, wherein the target equipment comprises a target state machine.
As shown in fig. 4, the video stream processing apparatus includes:
a receiving module 410, configured to receive a video stream acquisition request of a client;
a first processing module 420, configured to determine that a target video stream corresponding to the video stream acquisition request does not exist in the target device, and jump to a video stream input state by the target state machine;
the second processing module 430 is configured to determine that a return condition of the video stream input state is a success condition, skip to a video stream request state by the target state machine, and request a target video stream from a video source device corresponding to the target video stream based on the video stream request state;
a third processing module 440, configured to determine that the return condition of the video stream request state is a success condition, and the target state machine jumps to the video stream output state;
the fourth processing module 450 is configured to determine that an output acknowledgement of the output state of the video stream is received, and the target state machine jumps to the video stream sending state and sends the target video stream to the client.
According to the video stream processing device provided by the embodiment of the application, the target video stream is processed and distributed through the state jump of the target state machine, so that uncertain factors and unknown errors caused by different logic judgment in the video stream request process can be reduced, and the efficiency and stability of video stream processing are improved.
In some embodiments, the third processing module 440 is configured to determine that the target video stream exists at the target device, and the target state machine jumps to the video stream output state.
In some embodiments, the third processing module 440 is further configured to find a play status queue, a login status queue, and a logout status queue of the target device;
and searching a state corresponding to the target video stream in any one of the play state queue, the login state queue and the logout state queue, and determining that the target video stream exists in the target device.
In some embodiments, the third processing module 440 is further configured to determine that a state corresponding to the target video stream exists in the play state queue, and return the target video stream according to the play state logic;
or determining that the state corresponding to the target video stream exists in the login state queue, generating the playing state corresponding to the target video stream, inserting the playing state corresponding to the target video stream into the playing state queue, and returning the target video stream according to the playing state logic;
or determining that the state corresponding to the target video stream exists in the log-out state queue, reconnecting the video source equipment, generating the playing state corresponding to the target video stream, inserting the playing state corresponding to the target video stream into the playing state queue, and returning to the target video stream according to the playing state logic.
In some embodiments, the third processing module 440 is further configured to search the play status queue, the login status queue, and the logout status queue for a status corresponding to the target video stream in sequence.
In some embodiments, the second processing module 430 is configured to control the video source device to sequentially perform a device login operation and a device play operation, and obtain a target video stream of the video source device.
In some embodiments, the second processing module 430 is further configured to control the video source device to perform a device login operation, generate a login state of the target video stream, and store the login state to a login state queue of the target device;
and controlling the video source equipment to execute equipment playing operation, generating the playing state of the target video stream, and storing the playing state into a playing state queue of the target equipment.
The video stream processing device in the embodiment of the application may be an electronic device, or may be a component in the electronic device, for example, an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The video stream processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which is not specifically limited in the embodiments of the present application.
The video stream processing device provided in the embodiment of the present application can implement each process implemented by the embodiments of the methods of fig. 1 to 5, and in order to avoid repetition, a detailed description is omitted here.
In some embodiments, as shown in fig. 5, the embodiment of the present application further provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and capable of running on the processor 501, where the program when executed by the processor 501 implements the respective processes of the video stream processing method embodiment described above, and the same technical effects can be achieved, so that repetition is avoided, and no further description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device described above.
The embodiment of the present application further provides a non-transitory computer readable storage medium, on which a computer program is stored, where the computer program when executed by a processor implements each process of the embodiment of the video stream processing method, and the same technical effects can be achieved, so that repetition is avoided, and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application also provides a computer program product, which comprises a computer program, and the computer program realizes the video stream processing method when being executed by a processor.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solutions of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the application, the scope of which is defined by the claims and their equivalents.

Claims (10)

1. A method of video stream processing, the method being applied to a target device, the target device comprising a target state machine, the method comprising:
receiving a video stream acquisition request of a client;
determining that a target video stream corresponding to the video stream acquisition request does not exist in the target device, and jumping to a video stream input state by the target state machine;
determining that the return condition of the video stream input state is a success condition, and jumping to a video stream request state by the target state machine to request the target video stream from video source equipment corresponding to the target video stream;
determining that the return condition of the video stream request state is a success condition, and jumping to a video stream output state by the target state machine;
and determining that the output confirmation of the video stream output state is received, and jumping to a video stream sending state by the target state machine to send the target video stream to the client.
2. The video stream processing method according to claim 1, wherein after the receiving the video stream acquisition request of the client, before the determining that the output acknowledgement of the video stream output state is received, the method further comprises:
and determining that the target video stream exists in the target device, and jumping to the video stream output state by the target state machine.
3. The video stream processing method according to claim 2, wherein the determining that the target video stream exists in the target device includes:
searching a play state queue, a login state queue and a logout state queue of the target equipment;
and searching a state corresponding to the target video stream in any one of the play state queue, the login state queue and the logout state queue, and determining that the target video stream exists in the target device.
4. The video stream processing method according to claim 3, wherein after finding a state corresponding to the target video stream in any one of the play state queue, the login state queue, and the logout state queue, before the target state machine jumps to the video stream output state, the method further comprises:
determining that the state corresponding to the target video stream exists in the play state queue, and returning the target video stream according to play state logic;
or determining that the state corresponding to the target video stream exists in the login state queue, generating a play state corresponding to the target video stream, inserting the play state corresponding to the target video stream into the play state queue, and returning to the target video stream according to play state logic;
or determining that the state corresponding to the target video stream exists in the log-out state queue, reconnecting the video source equipment, generating a playing state corresponding to the target video stream, inserting the playing state corresponding to the target video stream into the playing state queue, and returning to the target video stream according to playing state logic.
5. The video stream processing method according to claim 4, wherein the searching the play state queue, the login state queue, and the logout state queue of the target device comprises:
and searching the state corresponding to the target video stream in the play state queue, the login state queue and the logout state queue in sequence.
6. The method for processing a video stream according to any one of claims 1 to 5, wherein the requesting the target video stream from the video source device corresponding to the target video stream includes:
and controlling the video source equipment to sequentially execute equipment login operation and equipment playing operation, and acquiring the target video stream of the video source equipment.
7. The video stream processing method according to claim 6, wherein the controlling the video source device to sequentially perform a device login operation and a device play operation includes:
controlling the video source equipment to execute equipment login operation, generating a login state of the target video stream, and storing the login state into a login state queue of the target equipment;
and controlling the video source equipment to execute equipment playing operation, generating the playing state of the target video stream, and storing the playing state into a playing state queue of the target equipment.
8. A video stream processing apparatus, the apparatus being applied to a target device, the target device comprising a target state machine, the apparatus comprising:
the receiving module is used for receiving a video stream acquisition request of the client;
the first processing module is used for determining that a target video stream corresponding to the video stream acquisition request does not exist in the target device, and the target state machine jumps to a video stream input state;
the second processing module is used for determining that the return condition of the video stream input state is a success condition, the target state machine jumps to a video stream request state, and requests the target video stream to the video source equipment corresponding to the target video stream based on the video stream request state;
the third processing module is used for determining that the return condition of the video stream request state is a success condition, and the target state machine jumps to a video stream output state;
and the fourth processing module is used for determining that the output confirmation of the video stream output state is received, the target state machine jumps to a video stream sending state, and sends the target video stream to the client.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the video stream processing method of any of claims 1-7 when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the video stream processing method according to any of claims 1 to 7.
CN202310153835.XA 2023-02-21 2023-02-21 Video stream processing method and device, electronic equipment and storage medium Pending CN116320295A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310153835.XA CN116320295A (en) 2023-02-21 2023-02-21 Video stream processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310153835.XA CN116320295A (en) 2023-02-21 2023-02-21 Video stream processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116320295A true CN116320295A (en) 2023-06-23

Family

ID=86828006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310153835.XA Pending CN116320295A (en) 2023-02-21 2023-02-21 Video stream processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116320295A (en)

Similar Documents

Publication Publication Date Title
CN107566786B (en) Method and device for acquiring monitoring video and terminal equipment
RU2631137C2 (en) Connection of devices
CN108174248B (en) Video playing method, video playing control device and storage medium
CN113595968B (en) Login method and system based on cloud application instance and related equipment
CN109951547B (en) Transaction request parallel processing method, device, equipment and medium
CN108965907B (en) Method, device and system for playing video
CN104602102B (en) Transmission response method, apparatus, server and the system of video intercepting content
CN109951546A (en) Transactions requests processing method, device, equipment and medium based on intelligent contract
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN109033814A (en) intelligent contract triggering method, device, equipment and storage medium
CN110209557B (en) User operation recording and restoring method, device and equipment and readable storage medium
CN109218338B (en) Information processing system, method and device
CN101815071B (en) Method, device and system for applying for digital certificate
CN116320295A (en) Video stream processing method and device, electronic equipment and storage medium
CN114501084B (en) Play method, device, equipment and medium of player
CN115671723A (en) Resource processing method, device, equipment and medium
KR20200108348A (en) Data transfer
JP2020013419A (en) Information processing method, information processing device, and program
CN112040328B (en) Data interaction method and device and electronic equipment
CN113918849A (en) Page display method, device and system, electronic equipment and storage medium
CN109614137B (en) Software version control method, device, equipment and medium
WO2020078049A1 (en) User information processing method and device, server, and readable medium
CN111246313A (en) Video association method and device, server, terminal equipment and storage medium
US20110072304A1 (en) Application server and method of controlling operation of same
US20170134486A1 (en) Method and device for information synchronization

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