Media stream sending method, system, processing equipment and storage medium

文档序号:1820102 发布日期:2021-11-09 浏览:18次 中文

阅读说明:本技术 一种媒体流发送方法、系统、处理设备及存储介质 (Media stream sending method, system, processing equipment and storage medium ) 是由 王思华 于 2020-05-07 设计创作,主要内容包括:本发明实施例提供了一种媒体流发送方法、系统、处理设备及存储介质,所述方法应用于媒体流发送系统中的处理设备,媒体流发送系统还包括媒体平台及多个媒体流采集设备,方法包括:接收媒体平台发送的取流请求;从多个媒体流采集设备中,确定设备标识对应的目标媒体流采集设备;从目标媒体流采集设备获取目标媒体流;将获取的目标媒体流发送至媒体平台。由于处理设备在接收到媒体平台发送的取流请求时,才从取流请求对应的目标媒体流采集设备获取媒体流,此时无需将非目标媒体流采集设备采集的媒体流发送至媒体平台,与目前技术中所有视频采集设备实时将视频流发送至视频平台的方式相比,可以大大降低整个系统所需的网络带宽。(The embodiment of the invention provides a media stream sending method, a system, a processing device and a storage medium, wherein the method is applied to the processing device in the media stream sending system, the media stream sending system also comprises a media platform and a plurality of media stream acquisition devices, and the method comprises the following steps: receiving a stream fetching request sent by a media platform; determining target media stream acquisition equipment corresponding to equipment identification from a plurality of media stream acquisition equipment; acquiring a target media stream from target media stream acquisition equipment; and sending the acquired target media stream to a media platform. The processing equipment acquires the media stream from the target media stream acquisition equipment corresponding to the stream taking request when receiving the stream taking request sent by the media platform, and at the moment, the media stream acquired by the non-target media stream acquisition equipment does not need to be sent to the media platform.)

1. A media stream sending method is applied to a processing device in a media stream sending system, the media stream sending system further includes a media platform and a plurality of media stream collecting devices, the media platform and the plurality of media stream collecting devices are respectively in communication connection with the processing device, the method includes:

receiving a stream fetching request sent by the media platform, wherein the stream fetching request comprises a device identifier;

determining target media stream acquisition equipment corresponding to the equipment identification from the plurality of media stream acquisition equipment;

acquiring a target media stream from the target media stream acquisition equipment, wherein the target media stream is a media stream to be sent to the media platform;

and sending the acquired target media stream to the media platform.

2. The method of claim 1, wherein prior to the step of obtaining a target media stream from the target media stream capture device, the method further comprises:

determining whether the current residual resources can process the target media stream of the target media stream acquisition equipment or not according to the code stream parameters of the target media stream acquisition equipment and the processing resource parameters of the target media stream acquisition equipment;

if yes, executing the step of acquiring the target media stream from the target media stream acquisition equipment;

and if not, sending a first error message to the media platform.

3. The method of claim 2, wherein the code stream parameters of the target media stream acquisition device are determined by the following steps:

acquiring a detection media stream of the target media stream acquisition equipment; decoding the detected media stream, and determining code stream parameters of the target media stream acquisition equipment; or the like, or, alternatively,

acquiring code stream parameters from the target media stream acquisition equipment at regular time; or the like, or, alternatively,

and acquiring the code stream parameters reported by the target media stream acquisition equipment at regular time.

4. The method of claim 3, wherein the step of obtaining a target media stream from the target media stream capturing device comprises:

sending a first acquisition request to the target media stream acquisition equipment;

receiving a target media stream sent by the target media stream acquisition equipment;

the step of obtaining the detection media stream of the target media stream acquisition device includes:

sending a second acquisition request to the target media stream acquisition equipment;

and receiving the detection media stream sent by the target media stream acquisition equipment.

5. The method of claim 4, wherein the step of receiving the target media stream sent by the target media stream capturing device comprises:

and receiving an initial media stream sent by the target media stream acquisition equipment, and processing the initial media stream according to a target code stream type to obtain a target media stream of the target code stream type, wherein the target code stream type is a code stream type included in the stream fetching request or a preset code stream type.

6. The method of any one of claims 1-5, further comprising:

receiving a stop instruction sent by the media platform;

and closing the stream fetching channel indicated by the stopping instruction to stop acquiring the media stream of the media stream acquisition equipment corresponding to the stream fetching channel.

7. The method of any one of claims 1-5, wherein prior to the step of obtaining a target media stream from the target media stream capture device, the method further comprises:

determining whether the target media stream acquisition device is online;

if the target media stream is online, executing the step of acquiring the target media stream from the target media stream acquisition equipment;

and if the mobile terminal is not on-line, sending a second error message to the media platform.

8. The media stream sending system is characterized by comprising a processing device, a media platform and a plurality of media stream collecting devices, wherein the media platform and the plurality of media stream collecting devices are respectively in communication connection with the processing device, and the media platform and the plurality of media stream collecting devices are respectively in communication connection with the processing device, wherein:

the media platform is configured to send a streaming request to the processing device, where the streaming request includes a device identifier;

the processing device is configured to determine, when the stream fetching request is received, a target media stream acquisition device corresponding to a device identifier from the multiple media stream acquisition devices; acquiring a target media stream from the target media stream acquisition equipment; and sending the acquired target media stream to the media platform.

9. The processing equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;

a memory for storing a computer program;

a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.

10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.

Technical Field

The present invention relates to the technical field of media stream processing, and in particular, to a media stream transmitting method, system, processing device, and storage medium.

Background

The current monitoring system includes a plurality of video capture devices at the front end and a video platform at the rear end, where the video capture devices are typically cameras for capturing audio and video streams. When the video monitoring system works, each video acquisition device sends video streams to a rear-end video platform through a corresponding video channel in real time.

Because each video acquisition device pushes the acquired video stream to a video platform at the back end in real time, the required network bandwidth is large. For example, if the monitoring system includes 64 video capture devices, 64 video streams are simultaneously transmitted to the video platform, and the required network bandwidth is large.

Disclosure of Invention

Embodiments of the present invention provide a method, a system, a processing device, and a storage medium for transmitting a media stream, so as to reduce a network bandwidth required for transmitting the media stream. The specific technical scheme is as follows:

in a first aspect, an embodiment of the present invention provides a media stream sending method, which is applied to a processing device in a media stream sending system, where the media stream sending system further includes a media platform and a plurality of media stream acquisition devices, and the media platform and the plurality of media stream acquisition devices are respectively in communication connection with the processing device, and the method includes:

receiving a stream fetching request sent by the media platform, wherein the stream fetching request comprises a device identifier;

determining target media stream acquisition equipment corresponding to the equipment identification from the plurality of media stream acquisition equipment;

acquiring a target media stream from the target media stream acquisition equipment, wherein the target media stream is a media stream to be sent to the media platform;

and sending the acquired target media stream to the media platform.

Optionally, before the step of acquiring the target media stream from the target media stream acquisition device, the method further includes:

determining whether the current residual resources can process the target media stream of the target media stream acquisition equipment or not according to the code stream parameters of the target media stream acquisition equipment and the processing resource parameters of the target media stream acquisition equipment;

if yes, executing the step of acquiring the target media stream from the target media stream acquisition equipment;

and if not, sending a first error message to the media platform.

Optionally, the code stream parameter of the target media stream acquisition device is determined by the following steps:

acquiring a detection media stream of the target media stream acquisition equipment; decoding the detected media stream, and determining code stream parameters of the target media stream acquisition equipment; or the like, or, alternatively,

acquiring code stream parameters from the target media stream acquisition equipment at regular time; or the like, or, alternatively,

and acquiring the code stream parameters reported by the target media stream acquisition equipment at regular time.

Optionally, the step of obtaining the target media stream from the target media stream collecting device includes:

sending a first acquisition request to the target media stream acquisition equipment;

receiving a target media stream sent by the target media stream acquisition equipment;

the step of obtaining the detection media stream of the target media stream acquisition device includes:

sending a second acquisition request to the target media stream acquisition equipment;

and receiving the detection media stream sent by the target media stream acquisition equipment.

Optionally, the step of receiving the target media stream sent by the target media stream collecting device includes:

and receiving an initial media stream sent by the target media stream acquisition equipment, and processing the initial media stream according to a target code stream type to obtain a target media stream of the target code stream type, wherein the target code stream type is a code stream type included in the stream fetching request or a preset code stream type.

Optionally, the method further includes:

receiving a stop instruction sent by the media platform;

and closing the stream fetching channel indicated by the stopping instruction to stop acquiring the media stream of the media stream acquisition equipment corresponding to the stream fetching channel.

Optionally, before the step of acquiring the target media stream from the target media stream acquisition device, the method further includes:

determining whether the target media stream acquisition device is online;

if the target media stream is online, executing the step of acquiring the target media stream from the target media stream acquisition equipment;

and if the mobile terminal is not on-line, sending a second error message to the media platform.

In a second aspect, an embodiment of the present invention provides a media stream transmitting apparatus, which is applied to a processing device in a media stream transmitting system, where the media stream transmitting system further includes a media platform and a plurality of media stream collecting devices, where the media platform and the plurality of media stream collecting devices are respectively in communication connection with the processing device, and the apparatus includes:

a streaming request receiving module, configured to receive a streaming request sent by the media platform, where the streaming request includes a device identifier;

the acquisition equipment determining module is used for determining target media stream acquisition equipment corresponding to the equipment identification from the plurality of media stream acquisition equipment;

a media stream acquiring module, configured to acquire a target media stream from the target media stream acquisition device, where the target media stream is a media stream to be sent to the media platform;

and the media stream sending module is used for sending the acquired target media stream to the media platform.

Optionally, the apparatus further comprises:

a resource determining module, configured to determine whether a current remaining resource can process a target media stream of the target media stream acquisition device according to a code stream parameter of the target media stream acquisition device and a processing resource parameter of the resource determining module before the target media stream is acquired from the target media stream acquisition device; if the current residual resources can process the target media stream of the target media stream acquisition equipment, triggering the media stream acquisition module;

and the first message sending module is used for sending a first error message to the media platform if the current residual resources cannot process the target media stream of the target media stream acquisition equipment.

Optionally, the apparatus further includes a code stream parameter obtaining module;

the code stream parameter acquisition module is used for acquiring the detection media stream of the target media stream acquisition equipment; decoding the detected media stream, and determining code stream parameters of the target media stream acquisition equipment; or, the device is used for acquiring the code stream parameters from the target media stream acquisition equipment at regular time; or, the method is used for acquiring the code stream parameters reported by the target media stream acquisition device at regular time.

Optionally, the media stream acquiring module includes:

the first request sending unit is used for sending a first acquisition request to the target media stream acquisition equipment;

the first media stream receiving unit is used for receiving the target media stream sent by the target media stream acquisition equipment;

the code stream parameter acquisition module comprises:

the second request sending unit is used for sending a second acquisition request to the target media stream acquisition equipment;

and the second media stream receiving unit is used for receiving the detection media stream sent by the target media stream acquisition equipment.

Optionally, the first media stream receiving unit includes:

and the media stream processing subunit is configured to receive an initial media stream sent by the target media stream acquisition device, and process the initial media stream according to a target bitstream type to obtain a target media stream of the target bitstream type, where the target bitstream type is a bitstream type included in the stream fetching request or a preset bitstream type.

Optionally, the apparatus further comprises:

a stop instruction receiving module, configured to receive a stop instruction sent by the media platform;

and the channel closing module is used for closing the stream taking channel indicated by the stopping instruction so as to stop obtaining the media stream of the media stream acquisition equipment corresponding to the stream taking channel.

Optionally, the apparatus further comprises:

the online determining module is used for determining whether the target media stream acquisition equipment is online or not before the target media stream is acquired from the target media stream acquisition equipment; if the target media stream acquisition equipment is on line, triggering the media stream acquisition module;

and the second message sending module is used for sending a second error message to the media platform if the target media stream acquisition equipment is not on-line.

In a third aspect, an embodiment of the present invention provides a media stream sending system, where the system includes a processing device, a media platform, and multiple media stream acquisition devices, where the media platform and the multiple media stream acquisition devices are respectively in communication connection with the processing device, where:

the media platform is configured to send a streaming request to the processing device, where the streaming request includes a device identifier;

the processing device is configured to determine, when the stream fetching request is received, a target media stream acquisition device corresponding to a device identifier from the multiple media stream acquisition devices; acquiring a target media stream from the target media stream acquisition equipment; and sending the acquired target media stream to the media platform.

In a fourth aspect, an embodiment of the present invention provides a processing device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;

a memory for storing a computer program;

a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.

In a fifth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of any one of the above first aspects.

The embodiment of the invention has the following beneficial effects:

in the scheme provided by the embodiment of the invention, when receiving a stream fetching request sent by a media platform, a processing device determines a target media stream acquisition device corresponding to a device identifier from a plurality of media stream acquisition devices, wherein the stream fetching request comprises the device identifier, and then obtains the target media stream from the target media stream acquisition device and sends the obtained target media stream to the media platform. The processing equipment acquires the media stream from the target media stream acquisition equipment corresponding to the stream taking request when receiving the stream taking request sent by the media platform, so that the media stream does not need to be acquired from the non-target media stream acquisition equipment, and the media stream acquired by the non-target media stream acquisition equipment does not need to be sent to the media platform.

Meanwhile, the situation that the media platform needs to check the media stream of the maximum path number which can be supported by the processing equipment at the same time almost does not exist, so that the processing equipment can be added with the media stream collecting equipment which is larger than the maximum path number which can be supported by the processing equipment, and the equipment cost can be saved. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.

Fig. 1 is a schematic structural diagram of a media stream transmission system according to an embodiment of the present invention;

fig. 2 is a flowchart of a method for transmitting a media stream according to an embodiment of the present invention;

FIG. 3 is a flowchart of a current remaining resource determination method according to the embodiment shown in FIG. 2;

FIG. 4 is a flow chart illustrating a manner of closing the flow channel according to the embodiment shown in FIG. 2;

FIG. 5 is a schematic diagram illustrating an interaction flow of the media streaming system shown in FIG. 1;

fig. 6 is a schematic structural diagram of a media stream transmitting apparatus according to an embodiment of the present invention;

fig. 7 is a schematic structural diagram of a media stream transmitting apparatus according to an embodiment of the present invention;

fig. 8 is a schematic structural diagram of a processing apparatus according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

In order to reduce the network bandwidth required for media stream transmission, embodiments of the present invention provide a method, an apparatus, a system, and a processing device for media stream transmission, that is, a computer-readable storage medium. First, a method for transmitting a media stream according to an embodiment of the present invention is described below.

The media stream transmission method provided by the embodiment of the present invention may be applied to the processing device 102 in the media stream transmission system shown in fig. 1. The media stream transmission system further comprises a media platform 103 and a plurality of media stream collecting devices 101.

In one embodiment, the processing device 102 may access the media platform 103 through RTSP (Real Time Streaming Protocol), proprietary Protocol or national standard GB28181 Protocol to establish a communication connection with the media platform 103. The processing device 102 may log in the multiple media stream capturing devices 101 according to a preset login manner to establish a communication connection with the multiple media stream capturing devices 101. For example, the media stream capturing device may be logged in through an IP (Internet Protocol) address, an account password, and the like of the media stream capturing device.

The multiple media stream collection devices 101 are configured to collect media streams, and may specifically be devices with audio and Video collection and storage functions, such as a Video camera and a Network Video Recorder (NVR), where the media stream collection devices 101 may collect real-time code streams and may also store Video code streams, and when the processing device 102 obtains a media stream from the media stream, the media stream collection devices may obtain the collected real-time code streams and may also obtain the stored Video code streams. The media streams may include audio streams, video streams, and the like. The processing device 102 is configured to obtain the media streams collected by the media stream collecting devices 101, and perform processing such as storage, decoding, packaging, and/or compression on the media streams, and may be a device such as a compression box. The media platform 103 is configured to receive the media stream processed by the processing device 102 and play the media stream for the user to watch.

As shown in fig. 2, a media stream transmitting method is applied to a processing device in a media stream transmitting system, and the method includes:

s201, receiving a stream fetching request sent by the media platform;

wherein the streaming request comprises a device identification.

S202, determining target media stream acquisition equipment corresponding to equipment identification from the plurality of media stream acquisition equipment;

s203, acquiring a target media stream from the target media stream acquisition equipment;

and the target media stream is a media stream to be sent to the media platform.

And S204, sending the acquired target media stream to the media platform.

As can be seen, in the solution provided in the embodiment of the present invention, when receiving a stream fetching request sent by a media platform, a processing device determines, from a plurality of media stream acquisition devices, a target media stream acquisition device corresponding to a device identifier, where the stream fetching request includes the device identifier, and further obtains a target media stream from the target media stream acquisition device, and sends the obtained target media stream to the media platform. The processing equipment acquires the media stream from the target media stream acquisition equipment corresponding to the stream taking request when receiving the stream taking request sent by the media platform, so that the media stream does not need to be acquired from the non-target media stream acquisition equipment, and the media stream acquired by the non-target media stream acquisition equipment does not need to be sent to the media platform.

Meanwhile, the situation that the media platform needs to check the media stream of the maximum path number which can be supported by the processing equipment at the same time almost does not exist, so that the processing equipment can be added with the media stream collecting equipment which is larger than the maximum path number which can be supported by the processing equipment, and the equipment cost can be saved. For example, if the maximum number of media streams that can be supported by the processing device is 16, then if there are 64 media stream acquisition devices in total, with the solution provided in the embodiment of the present invention, only 1 processing device is needed, and the 1 processing device may monitor the communication connection with the 64 media stream acquisition devices, but does not perform real-time stream acquisition, and when the media platform needs which media stream, it is only necessary to acquire the corresponding media stream.

When a user wants to watch or play back a media stream collected by one media stream collection device, a watching instruction may be issued through the media platform, for example, the user may input a device identifier of the media stream collection device in a preset interface to issue the watching instruction. At this time, the media platform may send a streaming request to the processing device. The streaming request may include a preview request and a playback request, and the streaming request may include a device identifier. If the request to fetch a stream is a playback request, the request to fetch a stream may also include a start time point and an end time point.

In an embodiment, the device identifier of the media stream capturing device may be an IP address of the media stream capturing device, or an id (identification) number of the media stream capturing device, which can be uniquely located to the media stream capturing device.

Each media stream capturing device is assigned a channel number when the processing device adds it, for example, 64 media stream capturing devices are added to the processing device, and each media stream capturing device corresponds to a channel number, which may be, for example, 1 to 64. In this case, in order to determine the target media stream capture device more accurately, the stream fetching request sent by the media platform may further include a channel number. Thus, after receiving the stream fetching request, the processing device can determine the target acquisition device according to the device identifier and the channel number.

When receiving a stream fetching request sent by the media platform, the processing device may determine, from the multiple media stream acquisition devices, a target media stream acquisition device corresponding to a device identifier included in the stream fetching request. For example, there are 64 media stream capturing devices with IP addresses of IP1-IP64, respectively, so that if the device identifier included in the streaming request is IP7, the processing device may determine that the media stream capturing device with IP address IP7 is the target media stream capturing device.

After determining the target media stream acquisition device, the processing device may execute step S203, that is, obtain the target media stream from the target media stream acquisition device, where the target media stream is a media stream to be sent to the media platform. The target media stream may be a media stream acquired by the media stream acquisition device in real time, or a video media stream stored by the media stream acquisition device. If the streaming request includes a start time point and an end time point, the acquired target media stream is a segment of media stream acquired by the target media stream acquisition device from the start time point to the end time point, that is, a segment of video media stream.

After the target media stream is obtained, the processing device may perform corresponding processing on the target media stream according to a communication protocol between the processing device and the media platform, a code stream type of the media stream required by the media platform, and the like. In an implementation manner, taking a media stream as an example of a video stream, after receiving the media stream sent by a target media stream acquisition device, a processing device may perform encapsulation processing on the video stream. For example, the video stream sent by the target media stream acquisition device is a video stream in a PS encapsulation format, and since the video stream generally sent to the media platform needs to be in an RTP (Real-time Transport Protocol) format, the processing device may encapsulate the video stream in the PS encapsulation format into the target video stream in the RTP format according to the RTP Protocol.

Further, in step S204, the processing device may send the acquired target media stream to the media platform. After receiving the media stream sent by the processing device, the media platform can perform processing such as decoding, and then play video or audio for the user to watch.

As an implementation manner of the embodiment of the present invention, as shown in fig. 3, before the step of acquiring the target media stream from the target media stream acquisition device, the method may further include:

s301, determining whether the current residual resource can process the target media stream of the target media stream acquisition equipment or not according to the code stream parameter of the target media stream acquisition equipment and the processing resource parameter of the target media stream acquisition equipment, and if so, executing the step S302; if not, executing step S303;

because the processing device may process multiple media streams simultaneously, and the current remaining resources are limited, in order to determine whether the processing device can smoothly acquire the target media stream and send the acquired target media stream to the media platform, the processing device may determine whether the current remaining resources can process the target media stream of the target media stream acquisition device according to the code stream parameters of the target media stream acquisition device and the processing resource parameters of the processing device.

The code stream parameters of the target media stream acquisition device may include a format, a frame rate, a resolution, a code rate, etc. of the media stream acquired by the target media stream acquisition device, and may also include software parameters and hardware parameters of the target media stream acquisition device, which are all reasonable. The own processing resource parameters of the processing device may include current codec resource parameters, system bandwidth parameters, and the like.

If the resources required for processing the target media stream of the target media stream collecting device are not greater than the current remaining resources of the processing device, which indicates that the processing device can process the target media stream, step S302 may be executed, i.e., the target media stream is obtained from the target media stream collecting device.

If the resources required for processing the target media stream of the target media stream acquisition device are greater than the current remaining resources of the processing device, which indicates that the processing device cannot process the target media stream, step S303 may be executed.

S302, acquiring a target media stream from the target media stream acquisition equipment;

s303, sending a first error message to the media platform.

To inform the media platform when the target media stream cannot be processed, the processing device may send a first error message to the media platform. Specifically, the first error message may include information of the type of error, the cause of the error, and the like.

Therefore, when receiving the first error message, the media platform may determine that the processing device cannot currently push the target media stream acquired by the target acquisition device to itself, and the media platform may resend the stream fetching request to the processing device after a certain time period, and may also display the prompt information to inform the user that the video or audio that the user wants to view cannot be played, or may not perform any processing, which is reasonable.

In one embodiment, the first error message sent by the processing device includes an error type of: the stream type indicates that the processing device cannot process the stream due to too large processing resources required by the stream type of the media stream required by the media platform. Then the media platform, upon receiving the first error message, may determine whether it is necessary to convert the bitstream type and send the stream fetch request to the processing device again.

As can be seen, in this embodiment, before the target media stream is acquired from the target media stream acquisition device, the processing device may determine whether the current remaining resources can process the target media stream of the target media stream acquisition device according to the code stream parameter of the target media stream acquisition device and the processing resource parameter of the processing device, and if not, send a first error message to the media platform. Therefore, the media platform can be informed in time when the target media stream cannot be processed, so that the media platform can perform corresponding processing.

As an implementation manner of the embodiment of the present invention, the code stream parameter of the target media stream acquisition device may be determined in any manner as follows.

The first embodiment: acquiring a detection media stream of target media stream acquisition equipment; and decoding the detected media stream, and determining the code stream parameters of the target media stream acquisition equipment.

In order to determine the code stream parameter of the target media stream acquisition device, the processing device may obtain the media stream of the target media stream acquisition device as a detection media stream for detecting the code stream parameter of the target media stream acquisition device.

After the detection media stream is acquired, the processing device may decode the detection media stream, determine the code rate, frame rate, resolution, etc. of the detection media stream, and use the determined code rate, frame rate, resolution, etc. as the code stream parameters of the target media stream acquisition device.

As an embodiment, after determining the target media stream acquisition device corresponding to the device identifier, the processing device may obtain the detection media stream of the target media stream acquisition device. As another implementation, the processing device may obtain the detected media stream of the target media stream acquisition device after adding the target media stream acquisition device and before receiving the stream fetching request sent by the media platform, and further determine the code stream parameter of the target media stream acquisition device.

Of course, the processing device may also obtain the detected media streams of all the media stream acquisition devices, and further perform decoding processing on each detected media stream, and determine the code stream parameter of each media stream acquisition device, so as to determine whether the media stream of the media stream acquisition device can be processed when the media stream of the media stream acquisition device needs to be obtained subsequently.

If the processing device determines that the current remaining resources can process the target media stream of the target media stream acquisition device, both the detected media stream and the target media stream may be sent to the media platform, or of course, only the target media stream may be sent to the media platform, which is reasonable. If the processing device determines that the current residual resources cannot process the target media stream of the target media stream acquisition device, the detection media stream does not need to be sent to the media platform.

The second embodiment: and acquiring code stream parameters from the target media stream acquisition equipment at regular time.

In this embodiment, the processing device may detect the stream parameters of the multiple media stream acquisition devices at regular time. For example, the processing device may obtain the stream parameters of each media stream acquisition device through RTSP, a private protocol, or a GB28181 protocol.

Specifically, the processing device may send a parameter reporting instruction to each media stream acquisition device at regular time, and after receiving the parameter reporting instruction, each media stream acquisition device may send its own code stream parameter to the processing device. Furthermore, the processing device can store the code stream parameters of each media stream acquisition device, so as to be used when the media stream of the media stream acquisition device needs to be processed.

Third embodiment: and acquiring the code stream parameters reported by the target media stream acquisition equipment at regular time.

In this embodiment, each media stream acquisition device may report its own stream parameter to the processing device at regular time. For example, each media stream collection device may report its own stream parameters to the processing device through RTSP, private protocol, GB28181 protocol, or the like.

Therefore, in this embodiment, the processing device may obtain the code stream parameter of the target media stream acquisition device in any one of the three manners, and may flexibly select the acquisition manner of the code stream parameter, which is more convenient.

As an implementation manner of the embodiment of the present invention, after the processing device sends the first error message to the media platform, as shown in fig. 4, the method may further include:

s401, receiving a closing instruction sent by the media platform;

after receiving the first error message, the media platform may determine whether the processing device is required to close one media stream, so as to release the current remaining resources of the processing device. If desired, a shut down command may be sent to the processing device. The closing instruction may include a device identifier of the media stream acquisition device corresponding to the media stream that needs to be closed.

The media platform may prompt the user to select one media stream to close, or may randomly determine one media stream to close, which is reasonable.

S402, closing the stream taking channel indicated by the closing instruction to stop obtaining the media stream of the media stream acquisition equipment corresponding to the stream taking channel.

After receiving the closing instruction, the processing device may close the stream fetching channel indicated by the instruction, that is, stop obtaining the media stream of the media stream acquisition device corresponding to the stream fetching channel, and may release the current remaining resources of the processing device.

For example, if the closing instruction includes that the device identifier of the media stream acquisition device corresponding to the media stream to be closed is 09, and the stream fetching channel corresponding to the media stream acquisition device with the device identifier of 09 is channel number 09, the processing device may close the channel number 09.

It can be seen that, in this embodiment, when the processing device receives a closing instruction sent by the media platform, the stream fetching channel indicated by the closing instruction may be closed, so as to stop obtaining the media stream of the media stream acquisition device corresponding to the stream fetching channel, and release the current remaining resources, so that when the stream fetching request sent by the media platform is received again, enough remaining resources may be available to perform the processing of the media stream.

As an implementation manner of the embodiment of the present invention, the step of acquiring the target media stream from the target media stream acquisition device may include:

sending a first acquisition request to the target media stream acquisition equipment; and receiving the target media stream sent by the target media stream acquisition equipment.

When the processing device obtains the target media stream from the target media stream collecting device, an active request mode may be adopted instead of the target media stream collecting device actively pushing the target media stream. Specifically, the processing device may send a first obtaining request to the target media stream acquisition device, and the processing device may generate the first obtaining request according to a communication protocol between the processing device and the target media stream acquisition device, and send the first obtaining request to the target media stream acquisition device.

After receiving the first acquisition request, the target media stream acquisition device may send the media stream acquired by itself to the processing device, and the processing device may also receive the media stream as the target media stream.

Similarly, the step of acquiring the detection media stream of the target media stream acquisition device may include:

sending a second acquisition request to the target media stream acquisition equipment; and receiving the detection media stream sent by the target media stream acquisition equipment.

When the processing device obtains the detection media stream from the target media stream collecting device, an active request mode may also be adopted instead of the target media stream collecting device actively pushing the detection media stream. Specifically, the processing device may send the second obtaining request to the target media stream acquisition device, and the processing device may generate the second obtaining request according to a communication protocol between the processing device and the target media stream acquisition device, and send the second obtaining request to the target media stream acquisition device.

After receiving the second acquisition request, the target media stream acquisition device may send the media stream acquired by itself to the processing device, and the processing device may also receive the media stream as a detection media stream.

As can be seen, in this embodiment, no matter the target media stream is acquired from the target media stream acquisition device or the detected media stream is acquired, the processing device may actively acquire the corresponding media stream by sending the acquisition request, so that the target acquisition device may not push the media stream to the processing device in real time, and system resource consumption of the processing device may be further reduced.

As an implementation manner of the embodiment of the present invention, the step of receiving the target media stream sent by the target media stream acquisition device may include:

and receiving the initial media stream sent by the target media stream acquisition equipment, and processing the initial media stream according to the target code stream type to obtain the target media stream of the target code stream type.

Since the code stream type of the media stream required by the media platform may be different from the code stream type of the media stream acquired by the target media stream acquisition device, the stream fetching request may include the code stream type in order to inform the processing device of the code stream type of the media stream required by the media platform, and the processing device may acquire the code stream type after receiving the stream fetching request, and use the code stream type as the target code stream type.

Certainly, the media platform may also not limit the code stream type, and the stream fetching request sent by the media platform may not include the code stream type.

After receiving the initial media stream sent by the target media stream acquisition device, the processing device may perform corresponding processing on the initial media stream according to the target code stream type, so as to obtain the target media stream of the target code stream type.

In one embodiment, taking the media stream as the video stream as an example, the target bitstream type may be a compressed bitstream type, and the video stream needs to be compressed. The compression is performed by decoding the original video stream and then encoding the decoded video stream. Decoding is decoding from the original video stream into a bare stream. The encoding method may be various, for example, encoding may be performed according to protocols such as H264, H265, a preset private protocol, and the like, so as to obtain a video stream of a corresponding encoding type. In the encoding process, the resolution, the code rate and the frame rate of the video stream can be re-encoded, and the code stream parameters of the target video stream of the target code stream type are not larger than the code stream parameters of the initial video stream, so that the compression effect is achieved.

Since the resolution directly affects the viewing effect of the video, the resolution is generally kept unchanged during the compression process, and the video stream is compressed by modifying the encoding type, the bit rate, the frame rate, and the like, and of course, the compression efficiency and the compression ratio can also be accelerated by a specific GPU (Graphics Processing Unit) chip and a compression algorithm.

For example, a monitoring system of a bank outlet includes 64 video capturing devices, and when a media platform in the prior art simultaneously views 4 video streams captured by 4 video capturing devices, a problem of blocking occurs because a required network bandwidth is too large. By adopting the scheme provided by the embodiment of the invention, the video stream can be compressed, and the network bandwidth required by the whole system is small, so that the problem of media platform blockage can not occur even if the media platform simultaneously views more than 4 paths of video streams.

Therefore, in this embodiment, the processing device may receive the initial media stream sent by the target media stream acquisition device, and process the initial media stream according to the target code stream type to obtain the target media stream of the target code stream type, so that the initial media stream may be correspondingly processed to obtain the target media stream meeting the requirements of the media platform, and the user requirements may be met. And can provide stronger compression function, and can configure the code stream parameters such as the coding type, code rate and the like of the code stream at will. Processing of the media stream by the GPU chip and compression algorithms may also be supported.

As an implementation manner of the embodiment of the present invention, before the step of acquiring the target media stream from the target media stream acquisition device, the method may further include:

determining whether the target media stream acquisition device is online; if the target media stream is online, executing the step of acquiring the target media stream from the target media stream acquisition equipment; and if the mobile terminal is not on-line, sending a second error message to the media platform.

Since the media stream collection device may not be online in real time, to ensure smooth acquisition of the target media stream, the processing device may determine whether the target media stream collection device is online before acquiring the target media stream from the target media stream collection device. If the target media stream is online, executing the step of acquiring the target media stream from the target media stream acquisition equipment; if the target media stream cannot be acquired from the target media stream acquisition device at the moment, a second error message can be sent to the media platform to inform the media platform that the stream acquisition request cannot be responded.

In an embodiment, after the processing device establishes a communication connection with the media stream acquisition device, it is reasonable that the online condition of each media stream acquisition device can be detected at regular time, or each media stream acquisition device can report the online condition of itself at regular time. Optionally, the processing device may detect the on-line condition of each media stream acquisition device while detecting the code stream parameter of each media stream acquisition device, or each media stream acquisition device may report the on-line condition to the processing device while reporting its own code stream parameter at regular time.

In another embodiment, the processing device may execute the step of acquiring the target media stream from the target media stream acquisition device to determine whether the target media stream can be acquired, and if so, the processing device may indicate that the target media stream acquisition device is online, and may continue to acquire the target media stream from the target media stream acquisition device. If not, the target media stream acquisition device is not on-line, and a second error message can be sent to the media platform.

As can be seen, in this embodiment, before the target media stream is acquired from the target media stream acquisition device, the processing device may determine whether the target media stream acquisition device is online, if so, acquire the target media stream from the target media stream acquisition device, and if not, send a second error message to the media platform, so that the media platform may be notified in time when the target media stream acquisition device is not online.

As an implementation manner of the embodiment of the present invention, the method may further include:

receiving a stop instruction sent by the media platform; and closing the stream fetching channel indicated by the stopping instruction to stop acquiring the media stream of the media stream acquisition equipment corresponding to the stream fetching channel.

When the media stream of a certain media stream acquisition device no longer needs to be acquired, the media platform may send a stop instruction to the processing device, where the stop instruction may include a device identifier, and may also include a channel number. After receiving the stop instruction, the processing device may determine the stream fetching channel indicated by the stop instruction, and then stop obtaining the media stream of the media stream acquisition device corresponding to the stream fetching channel.

As an implementation manner of the embodiment of the present invention, in the process of processing the media stream, the processing device may record relevant information of each processing state for subsequent query and management.

For example, after the processing device sends the target media stream required by the media platform to the media platform, the media platform may send a stream fetching stop instruction to the processing device, and then the processing device may stop obtaining the target media stream, and at this time, the recorded stream fetching related information may be updated.

The following describes, by way of example, a media stream transmitting method provided in an embodiment of the present invention with reference to an interaction flow diagram of a media stream transmitting system shown in fig. 5. The media stream sending method provided by the embodiment of the invention can comprise the following steps:

s501, the media platform sends a stream fetching request to a processing device;

when a certain path of media stream needs to be acquired, the media platform may send a stream-fetching request to the processing device.

S502, the processing equipment determines target media stream acquisition equipment corresponding to equipment identification from a plurality of media stream acquisition equipment;

s503, the processing equipment determines whether the target media stream acquisition equipment is on line;

s504, if not online, the processing device sends a second error message to the media platform;

s505, if the device is on line, the processing device determines whether the current residual resource can process the target media stream of the target media stream acquisition device according to the code stream parameter of the target media stream acquisition device and the processing resource parameter of the processing device;

s506, if not, the processing equipment sends a first error message to the media platform;

s507, if yes, the processing equipment sends a first acquisition request to the target media stream acquisition equipment;

s508, the target media stream collecting device sends the initial media stream to the processing device;

s509, a processing device receives an initial media stream sent by the target media stream collecting device, and processes the initial media stream according to a target code stream type to obtain a target media stream of the target code stream type;

s510, the processing equipment sends the target media stream to a media platform;

s511, the media platform sends a stop instruction to the processing equipment;

when the acquisition of the media stream needs to be stopped, the media platform may send a stop instruction to the processing device.

And S512, the processing equipment closes the stream taking channel corresponding to the target media stream acquisition equipment.

And after the processing equipment receives the stop instruction, closing the stream taking channel corresponding to the target media stream acquisition equipment to stop acquiring the media stream of the target media stream acquisition equipment.

As can be seen, in the media stream sending method, when receiving a stream fetching request sent by a media platform, a processing device determines a target media stream collecting device corresponding to a device identifier from a plurality of media stream collecting devices, where the stream fetching request includes the device identifier, and further obtains a target media stream from the target media stream collecting device, and sends the obtained target media stream to the media platform. The processing equipment acquires the media stream from the target media stream acquisition equipment corresponding to the stream taking request when receiving the stream taking request sent by the media platform, so that the media stream does not need to be acquired from the non-target media stream acquisition equipment, and the media stream acquired by the non-target media stream acquisition equipment does not need to be sent to the media platform.

Corresponding to the media stream sending method, an embodiment of the present invention further provides a media stream sending device, and a description is provided below for the media stream sending device provided in the embodiment of the present invention.

As shown in fig. 6, a media stream transmitting apparatus is applied to a processing device in a media stream transmitting system, where the media stream transmitting system further includes a media platform and a plurality of media stream collecting devices, and the media platform and the plurality of media stream collecting devices are respectively in communication connection with the processing device, and the apparatus includes:

a streaming request receiving module 610, configured to receive a streaming request sent by the media platform;

wherein the streaming request comprises a device identification.

An acquiring device determining module 620, configured to determine, from the multiple media stream acquiring devices, a target media stream acquiring device corresponding to the device identifier;

a media stream acquiring module 630, configured to acquire a target media stream from the target media stream acquiring device;

and the target media stream is a media stream to be sent to the media platform.

And a media stream sending module 640, configured to send the obtained target media stream to the media platform.

As can be seen, in the solution provided in the embodiment of the present invention, when receiving a stream fetching request sent by a media platform, a processing device determines, from a plurality of media stream acquisition devices, a target media stream acquisition device corresponding to a device identifier, where the stream fetching request includes the device identifier, and further obtains a target media stream from the target media stream acquisition device, and sends the obtained target media stream to the media platform. The processing equipment acquires the media stream from the target media stream acquisition equipment corresponding to the stream taking request when receiving the stream taking request sent by the media platform, so that the media stream does not need to be acquired from the non-target media stream acquisition equipment, and the media stream acquired by the non-target media stream acquisition equipment does not need to be sent to the media platform.

As an implementation manner of the embodiment of the present invention, as shown in fig. 7, the apparatus may further include:

a resource determining module 650, configured to determine, before the target media stream is obtained from the target media stream acquisition device, whether a current remaining resource can process the target media stream of the target media stream acquisition device according to a code stream parameter of the target media stream acquisition device and a processing resource parameter of the resource determining module; if the current remaining resources can process the target media stream of the target media stream acquisition device, triggering the media stream acquisition module 630;

a first message sending module 660, configured to send a first error message to the media platform if the current remaining resources cannot process the target media stream of the target media stream acquisition device.

As an implementation manner of the embodiment of the present invention, the apparatus may further include a code stream parameter obtaining module;

the code stream parameter acquisition module is used for acquiring the detection media stream of the target media stream acquisition equipment; decoding the detected media stream, and determining code stream parameters of the target media stream acquisition equipment; or, the device is used for acquiring the code stream parameters from the target media stream acquisition equipment at regular time; or, the method is used for acquiring the code stream parameters reported by the target media stream acquisition device at regular time.

As an implementation manner of the embodiment of the present invention, the apparatus may further include:

a stop instruction receiving module, configured to receive a stop instruction sent by the media platform;

and the channel closing module is used for closing the stream taking channel indicated by the stopping instruction so as to stop obtaining the media stream of the media stream acquisition equipment corresponding to the stream taking channel.

As an implementation manner of the embodiment of the present invention, the media stream acquiring module 630 may include:

the first request sending unit is used for sending a first acquisition request to the target media stream acquisition equipment;

the first media stream receiving unit is used for receiving the target media stream sent by the target media stream acquisition equipment;

the code stream parameter obtaining module may include:

the second request sending unit is used for sending a second acquisition request to the target media stream acquisition equipment;

and the second media stream receiving unit is used for receiving the detection media stream sent by the target media stream acquisition equipment.

As an implementation manner of the embodiment of the present invention, the first media stream receiving unit may include:

and the media stream processing subunit is configured to receive an initial media stream sent by the target media stream acquisition device, and process the initial media stream according to a target bitstream type to obtain a target media stream of the target bitstream type, where the target bitstream type is a bitstream type included in the stream fetching request or a preset bitstream type.

As an implementation manner of the embodiment of the present invention, the apparatus may further include:

the online determining module is used for determining whether the target media stream acquisition equipment is online or not before the target media stream is acquired from the target media stream acquisition equipment; if the target media stream acquisition device is online, triggering the media stream acquisition module 630;

and the second message sending module is used for sending a second error message to the media platform if the target media stream acquisition equipment is not on-line.

Corresponding to the media stream sending method, an embodiment of the present invention further provides a media stream sending system, and a description is provided below for the media stream sending system provided in the embodiment of the present invention.

As shown in fig. 1, a media stream sending system includes a processing device 102, a media platform 103, and a plurality of media stream collecting devices 101, where the media platform 103 and the plurality of media stream collecting devices 101 are respectively connected to the processing device 102 in a communication manner, where:

the media platform 103 is configured to send a streaming request to the processing device 102;

wherein the streaming request comprises a device identification.

The processing device 102 is configured to execute the steps of the media stream sending method according to any of the embodiments.

As can be seen, in the solution provided in the embodiment of the present invention, when receiving a stream fetching request sent by a media platform, a processing device determines, from a plurality of media stream acquisition devices, a target media stream acquisition device corresponding to a device identifier, where the stream fetching request includes the device identifier, and further obtains a target media stream from the target media stream acquisition device, and sends the obtained target media stream to the media platform. The processing equipment acquires the media stream from the target media stream acquisition equipment corresponding to the stream taking request when receiving the stream taking request sent by the media platform, so that the media stream does not need to be acquired from the non-target media stream acquisition equipment, and the media stream acquired by the non-target media stream acquisition equipment does not need to be sent to the media platform.

The embodiment of the invention also provides a processing device, which can be a processing device in a media stream sending system and a video monitoring system, and the system also comprises a media platform and a plurality of media stream acquisition devices, wherein the media platform and the plurality of media stream acquisition devices are respectively in communication connection with the processing device. As shown in fig. 8, the processing device may include a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802 and the memory 803 communicate with each other through the communication bus 804.

A memory 803 for storing a computer program;

the processor 801 is configured to implement the steps of the media stream transmission method according to any of the embodiments described above when executing the program stored in the memory 803.

As can be seen, in the solution provided in the embodiment of the present invention, when receiving a stream fetching request sent by a media platform, a processing device determines, from a plurality of media stream acquisition devices, a target media stream acquisition device corresponding to a device identifier, where the stream fetching request includes the device identifier, and further obtains a target media stream from the target media stream acquisition device, and sends the obtained target media stream to the media platform. The processing equipment acquires the media stream from the target media stream acquisition equipment corresponding to the stream taking request when receiving the stream taking request sent by the media platform, so that the media stream does not need to be acquired from the non-target media stream acquisition equipment, and the media stream acquired by the non-target media stream acquisition equipment does not need to be sent to the media platform.

The communication bus mentioned in the above processing device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.

The communication interface is used for communication between the processing device and other devices.

The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.

The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.

In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the media stream transmission method according to any of the above embodiments.

As can be seen, in the solution provided in the embodiment of the present invention, when being executed by a processor, a computer program receives a stream fetching request sent by a media platform, and determines a target media stream acquisition device corresponding to a device identifier from a plurality of media stream acquisition devices, where the stream fetching request includes the device identifier, and then obtains a target media stream from the target media stream acquisition device, and sends the obtained target media stream to the media platform. The processing equipment acquires the media stream from the target media stream acquisition equipment corresponding to the stream taking request when receiving the stream taking request sent by the media platform, so that the media stream does not need to be acquired from the non-target media stream acquisition equipment, and the media stream acquired by the non-target media stream acquisition equipment does not need to be sent to the media platform.

In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

22页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:在线视频内嵌恶意域名获取及危害性评估的方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类