Low-delay image acquisition method

文档序号:1524364 发布日期:2020-02-11 浏览:17次 中文

阅读说明:本技术 低延时图像采集方法 (Low-delay image acquisition method ) 是由 朱洪庆 于 2019-10-31 设计创作,主要内容包括:本发明涉及图像传输技术领域,具体公开了低延时图像采集方法,包括如下步骤:S1、采集LED屏的图像信息并基于RUDP协议传输至共享服务器,图像信息包括视频流数据;S2、共享服务器将视频流数据基于RTMP协议传输至流媒体服务器;S3、流媒体服务器将视频流数据编码为H.264格式视频流;S4、流媒体服务器对访问的用户端进行身份验证,当身份验证通过时,根据预置的时间表判断该用户端当前是否处于推送时间内,如果处于推送时间内,流媒体服务器将H.264格式视频流推送至该用户端。采用本发明的技术方案能降低整个图像传输过程中的延迟。(The invention relates to the technical field of image transmission, and particularly discloses a low-delay image acquisition method, which comprises the following steps of S1, acquiring image information of an LED screen and transmitting the image information to a shared server based on an RUDP protocol, wherein the image information comprises video stream data; s2, the sharing server transmits the video stream data to the streaming media server based on the RTMP protocol; s3, the streaming media server encodes the video stream data into H.264 format video stream; and S4, the streaming media server performs identity authentication on the accessed user side, when the identity authentication is passed, whether the user side is currently in the pushing time is judged according to a preset time table, and if the user side is in the pushing time, the streaming media server pushes the H.264 format video stream to the user side. By adopting the technical scheme of the invention, the delay in the whole image transmission process can be reduced.)

1. The low-delay image acquisition method is characterized by comprising the following steps of:

s1, collecting image information of the LED screen and transmitting the image information to a sharing server based on an RUDP protocol, wherein the image information comprises video stream data;

s2, the sharing server transmits the video stream data to the streaming media server based on the RTMP protocol;

s3, the streaming media server encodes the video stream data into H.264 format video stream;

and S4, the streaming media server performs identity authentication on the accessed user side, when the identity authentication is passed, whether the user side is currently in the pushing time is judged according to a preset time table, and if the user side is in the pushing time, the streaming media server pushes the H.264 format video stream to the user side.

2. The low-latency image acquisition method according to claim 1, wherein: in S4, if the current media server is not in the push time, the streaming media server pushes the preset information to the user end.

3. The low-latency image acquisition method according to claim 2, wherein: in S4, the preset information includes a static image.

4. The low-latency image acquisition method according to claim 1, wherein: in S4, the streaming media server is further configured to determine a network connection condition with the user end, and when it is determined that the network is congested, the streaming media server adjusts parameters of the h.264 format video stream during encoding.

5. The low-latency image acquisition method according to claim 4, wherein: in S4, the streaming media server includes an encoding unit, a caching unit, a determining unit, and a pushing unit; the encoding unit encodes the video stream data into H.264 format video stream according to the set parameters, and each frame of H.264 format video frame encoded by the encoding unit is cached in the cache unit;

the pushing unit acquires the coded H.264 format video frame from the cache unit and pushes the coded H.264 format video frame to a user side; deleting the H.264 format video frame from the buffer unit after the pushing unit finishes pushing one frame of H.264 format video frame;

the judging unit acquires the number of the H.264 format video frames in the cache unit every preset time, and judges the network connection condition with the user side based on the number of the H.264 format video frames; when the number is larger than the first threshold value, the judging unit judges that the network is congested, and the judging unit reduces the current parameters; when the number is smaller than the second threshold value, the judging unit judges that the network is smooth, and the judging unit increases the current parameters; when the number is greater than or equal to the second threshold and less than or equal to the first threshold, the determining unit determines that the network is normal, and the determining unit maintains the current parameter.

6. The low-latency image acquisition method according to claim 5, wherein: in S4, when the streaming media server performs authentication on the accessed user side, the streaming media server obtains a user ID and a user password from the user side; and the streaming media server verifies the validity of the user ID and the user password, and when the user ID and the user password are both valid, the authentication is passed.

7. The low-latency image acquisition method according to claim 6, wherein: in S4, when the user ID and the user password are both valid, the streaming media server further determines whether there is a user side that passes the authentication with the same user ID, and if so, cancels the authentication of the user side.

8. The low-latency image acquisition method according to claim 1, wherein: in S4, the schedule includes a user ID and an advertisement playing time corresponding to the user ID.

9. The low-latency image acquisition method according to claim 5, wherein: in S4, the parameters include resolution and frame rate.

10. The low-latency image acquisition method according to claim 5, wherein: in the step S4, the first threshold value is 30-60; the second threshold is 2-5.

Technical Field

The invention relates to the technical field of image transmission, in particular to a low-delay image acquisition method.

Background

With the wave of informatization and digitization, the outdoor advertising industry in China has a large scale, at present, outdoor advertisements are played in a dynamic LED screen mode, and the outdoor dynamic LED screen becomes one of the main modes of mass media and is an important channel for people to learn information. In a city with a large scale at home, many places with large people flow, such as commercial buildings, bus stations, residential communities and the like, outdoor dynamic LED screens playing advertisements are visible everywhere.

However, compared with television advertisement or network advertisement, it is difficult for advertisers to effectively monitor outdoor advertisement LED screens and to know the real-time playing conditions of outdoor advertisement LED screens. Therefore, the content played by the LED screen needs to be collected, and then the collected content is sent to the advertiser in real time, so that the advertiser can monitor the playing condition of the advertisement at any time and any place.

Currently, the real-time advertisement pushing generally adopts an HLS protocol, but due to the inherent defects of the HLS, the content monitored by the HLS protocol is live broadcast to an advertiser with higher delay, which is usually about 10-30 s. Higher latency may degrade the user experience. Moreover, the network environment for the advertiser to watch the push video is not determined, and when the advertiser is in a complex network environment, the delay may be further increased, which may greatly affect the user experience.

For this reason, a method for maintaining low-delay image transmission in a poor network environment is required.

Disclosure of Invention

The invention aims to provide a low-delay image acquisition method to reduce delay in the whole image transmission process.

In order to solve the technical problems, the technical scheme of the invention is as follows:

the low-delay image acquisition method comprises the following steps:

s1, collecting image information of the LED screen and transmitting the image information to a sharing server based on an RUDP protocol, wherein the image information comprises video stream data;

s2, the sharing server transmits the video stream data to the streaming media server based on the RTMP protocol;

s3, the streaming media server encodes the video stream data into H.264 format video stream;

and S4, the streaming media server performs identity authentication on the accessed user side, when the identity authentication is passed, whether the user side is currently in the pushing time is judged according to a preset time table, and if the user side is in the pushing time, the streaming media server pushes the H.264 format video stream to the user side.

The basic scheme principle and the beneficial effects are as follows:

in the scheme, the streaming media server only pushes the H.264 format video stream to the client within the pushing time, so that the transmission load of the streaming media server can be effectively reduced, the single client is prevented from occupying the bandwidth for a long time, and particularly, the congestion can be effectively relieved and the delay is reduced when the network resources are in shortage. The sharing server transmits the video stream data to the streaming media server based on the RTMP protocol, and compared with the HLS protocol, the RTMP protocol is adopted to have lower delay. The RUDP protocol has high reliability, stable transmission can be realized in the environment with poor network, the acquisition module transmits the video stream data to the shared server based on the RUDP protocol, and compared with the method of simply adopting HLS protocol transmission, the acquisition module can ensure the transmission of the video stream data in the poor network environment.

Further, in S4, if the current time is not within the push time, the streaming media server pushes the preset information to the user end.

Because an LED screen typically plays advertisements in a recurring fashion according to a preset schedule (i.e., a predetermined sequence of advertisement play schedules), a single advertisement for each advertiser typically lasts only a few seconds to a dozen seconds. A certain advertiser monitors the LED screen, and whether the advertisement of the advertiser is played normally in the push time of the advertiser in the monitoring schedule is only needed. When the advertisement is not in the pushing time of the advertiser, the content played by the LED screen is the advertisement of other advertisers and is irrelevant to the advertiser, so that the H.264 format video stream does not need to be pushed to a user end of the advertiser, and the aim of saving server resources can be achieved.

Further, in S4, the preset information includes a static image.

The user experience of viewing a displayed still image is better than with a direct black screen, and the still image occupies less bandwidth in transmission than with a video. Moreover, with the static image, rich information can be displayed, such as displaying the advertisement of the merchant to which the LED screen belongs, for example, a preferential event for purchasing the LED screen advertisement, and the like.

Further, in S4, the streaming media server is further configured to determine a network connection condition with the user end, and when it is determined that the network is congested, the streaming media server adjusts parameters of the h.264 format video stream during encoding.

By adjusting the parameters of the H.264 format video stream when the network is congested, the H.264 format video stream can make targeted changes according to the network environment, the influence caused by network congestion is reduced, and smooth pushing from the streaming media server to the user side and low delay are ensured.

Further, in S4, the streaming media server includes an encoding unit, a buffering unit, a determining unit, and a pushing unit; the encoding unit encodes the video stream data into H.264 format video stream according to the set parameters, and each frame of H.264 format video frame encoded by the encoding unit is cached in the cache unit;

the pushing unit acquires the coded H.264 format video frame from the cache unit and pushes the coded H.264 format video frame to a user side; deleting the H.264 format video frame from the buffer unit after the pushing unit finishes pushing one frame of H.264 format video frame;

the judging unit acquires the number of the H.264 format video frames in the cache unit every preset time, and judges the network connection condition with the user side based on the number of the H.264 format video frames; when the number is larger than the first threshold value, the judging unit judges that the network is congested, and the judging unit reduces the current parameters; when the number is smaller than the second threshold value, the judging unit judges that the network is smooth, and the judging unit increases the current parameters; when the number is greater than or equal to the second threshold and less than or equal to the first threshold, the determining unit determines that the network is normal, and the determining unit maintains the current parameter.

When the network from the streaming media server to the user terminal is congested, the speed of the pushing unit acquiring the encoded h.264 format video frame from the buffer unit and pushing the encoded h.264 format video frame to the user terminal is slowed, and the speed of the encoding unit encoding the h.264 format video frame is inconvenient, so the h.264 format video frame is gradually accumulated in the buffer unit. The judging unit can effectively judge whether the network is congested or not through the number of H.264 format video frames in the cache unit, dynamically adjusts current parameters according to the network condition, can guarantee the smoothness of pushing, and reduces delay.

Further, in S4, when the streaming media server performs authentication on the accessed user side, the streaming media server obtains the user ID and the user password from the user side; and the streaming media server verifies the validity of the user ID and the user password, and when the user ID and the user password are both valid, the authentication is passed.

Through the link of authentication, illegal login can be avoided, so that the number of login users can be effectively controlled, and the pressure of the streaming media server is reduced.

Further, in S4, when the user ID and the user password are both valid, the streaming media server further determines whether a user side that passes the authentication with the same user ID exists, and if so, cancels the authentication of the user side.

The streaming media server can avoid the situation that a plurality of user sides log in by using the same user ID by judging whether the user sides which pass the authentication of the same user ID exist at present or not, and can effectively reduce the pressure of the streaming media server.

Further, in S4, the schedule includes a user ID and an advertisement playing time corresponding to the user ID.

And the corresponding advertisement playing time can be matched quickly through the user ID.

Further, in S4, the parameters include resolution and frame rate.

By adjusting the resolution and the frame rate, the bandwidth occupied by the H.264 format video frame can be effectively adjusted, and the smoothness and low delay of pushing are ensured.

Further, in S4, the first threshold is 30-60; the second threshold is 2-5.

The judging unit can acquire the network state information in time by acquiring the number of the H.264 format video frames in the cache unit at preset time intervals.

Drawings

Fig. 1 is a flowchart of a first embodiment of a low-latency image acquisition method.

Detailed Description

The following is further detailed by way of specific embodiments:

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种视频传输方法、装置、系统、设备及存储介质

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!

技术分类