CN112533016B - Method for triggering mobile phone HTML5 low-delay live video based on early warning information - Google Patents

Method for triggering mobile phone HTML5 low-delay live video based on early warning information Download PDF

Info

Publication number
CN112533016B
CN112533016B CN202011363634.5A CN202011363634A CN112533016B CN 112533016 B CN112533016 B CN 112533016B CN 202011363634 A CN202011363634 A CN 202011363634A CN 112533016 B CN112533016 B CN 112533016B
Authority
CN
China
Prior art keywords
data
client
video
server
html5
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.)
Active
Application number
CN202011363634.5A
Other languages
Chinese (zh)
Other versions
CN112533016A (en
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.)
Sichuan Honghe Digital Intelligence Group Co ltd
Original Assignee
Sichuan Honghe Communication 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 Sichuan Honghe Communication Co ltd filed Critical Sichuan Honghe Communication Co ltd
Priority to CN202011363634.5A priority Critical patent/CN112533016B/en
Publication of CN112533016A publication Critical patent/CN112533016A/en
Application granted granted Critical
Publication of CN112533016B publication Critical patent/CN112533016B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 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/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/64Addressing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • H04N21/6437Real-time Transport Protocol [RTP]

Abstract

The invention discloses a method for triggering a mobile phone HTML5 low-delay live video based on early warning information, which comprises the following steps: s1: the server acquires real-time video stream data from the video acquisition terminal; s2: when playing a video, a client acquires a random address and then sends a request of the random address to a server; s3: the server obtains the acquisition condition of the client data according to the request of the random address; s4: the server sends real-time video stream data to the client by combining the acquisition condition of the client data and adopting a long polling method and a loan prediction method; s5: and the client plays the real-time video stream data. The invention improves the standard html5, so that the low-delay effect of special app is achieved, codes are written once, the whole platform is universal, and the development cost is reduced.

Description

Method for triggering mobile phone HTML5 low-delay live video based on early warning information
Technical Field
The invention relates to a method for live broadcasting of a video, in particular to a method for triggering a mobile phone HTML5 low-delay live broadcasting of a video based on early warning information.
Background
In the traditional alarm, videos are generally kept as evidence for later viewing, and in order to improve user experience, event images need to be viewed immediately while events occur, so that the images and texts can be presented in time.
With the development and popularization of mobile internet technology, mobile video playing is just needed, but currently, low-delay video playing at a mobile phone end is mostly realized based on customized apps and cannot be applied to qq and WeChat, meanwhile, the mobile phone has multiple platforms such as andoid, iphone, ipad and windows phone, and a large amount of labor cost is consumed for independently developing the apps for each platform.
The standard html5 video playing delay supported by qq, WeChat, andoid, iphone, ipad and windows phone platforms is generally over 10S, and the requirement of timely and synchronous display of early warning information and image content cannot be met.
The existing http protocol has the following disadvantages:
(1) stateless and data-non-continuity: the two requests are unrelated, the data requests are not in sequence, and the video playing is an ordered continuous action;
(2) mode of operation of the request receipt: only the client can actively send data, the server cannot actively send data, the video data cannot be sent out in time, and time delay is increased;
(3) the HLS protocol developed by apple requires that the video file table be reported first and then the video be downloaded: only the real-time video can be cached, a file table is generated and then sent to the client, and the client downloads the video for playing, so that the time delay is further increased;
(4) by integrating the above 3 files, the file size of the server becomes a factor affecting the delay again when the file is generated due to the difference of the client, the file table is generated too slowly due to the too large file, too much invalid network transmission overhead is increased due to the too small file, and meanwhile, the file which is not started by the key frame cannot be decoded independently due to the fact that the video playing is started by the key frame, so that the infinite reduction of the file is limited.
Disclosure of Invention
The invention aims to solve the technical problems that the standard HTML5 video playing delay is generally more than 10S, and the requirement of timely and synchronous display of early warning information and image content cannot be met, and provides a method for triggering a mobile phone HTML5 low-delay live video based on the early warning information, so that the problems in the background technology are solved.
The invention is realized by the following technical scheme:
the method for triggering the mobile phone HTML5 low-delay live video based on the early warning information comprises the following steps:
s1: the server acquires real-time video stream data from the video acquisition terminal;
s2: when playing a video, a client acquires a random address and then sends a request of the random address to a server;
s3: the server obtains the acquisition condition of the client data according to the request of the random address;
s4: the server sends real-time video stream data to the client according to the acquisition condition of the client data;
s5: and the client plays the real-time video stream data.
On the basis of the scheme, the method further comprises the following steps:
the client data in step S3 includes: acquired video data and non-acquired video data.
On the basis of the scheme, the method further comprises the following steps:
the method between the step S3 and the step S4 further comprises the steps of:
s31: and the server controls the transmission sequence of the real-time video stream data according to the acquisition conditions of the acquired video data and the video data which are not acquired.
On the basis of the scheme, the method further comprises the following steps:
the step S4 includes the sub-steps of:
s41: the server analyzes the real-time video stream data and judges whether effective data is used for requesting receipt, if the effective data exists, the step S42 is executed, otherwise, the step S43 is executed;
s42: sending the valid data to the client;
s43: waiting for the data required by the client, if the data required by the client is received within the preset time, executing the step S42, otherwise, executing the step S44;
s44: stop sending all data to this client.
On the basis of the scheme, the method further comprises the following steps:
the S4 specifically includes:
s41: the method comprises the steps that a server generates a file table before video data are obtained, video data which do not have files in the file table are recorded as liability data, and when a client requests a specific file table, if the video data in the file table are not generated, the video data are recorded as overdue data; analyzing the real-time video stream data and judging whether effective data is used for requesting receipt, if so, executing a step S42, otherwise, executing a step S43;
s42: sending the valid data to the client;
s43: setting a overdue grace period for the client, waiting for data required by the client, if receiving supplementary data required by the client within the overdue grace period, executing the step S42 and continuing to play the video on the client, otherwise executing the step S44;
s44: and taking the video playing request as a bad account, stopping sending the video data to the client and finishing playing the video.
On the basis of the scheme, the method further comprises the following steps:
and in the program operation process, the program predicts the data volume of the liability to the client side in the next batch according to the liability data and the overdue data, so as to balance the liability data volume and the overdue data volume.
Compared with the prior art, the invention has the following advantages and beneficial effects:
the invention improves the standard html5 supported by qq, WeChat, andoid, iphone, ipad, windows phone and other platforms, so that the low-delay effect of the special app is achieved, the codes are written once, the whole platform is universal, and the development cost is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention. In the drawings:
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a flow chart of playing a conventional html5 video;
FIG. 3 is a flow chart of the improved html5 video playing method;
FIG. 4 is a graph of data liability versus overdue amount for the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to examples and accompanying drawings, and the exemplary embodiments and descriptions thereof are only used for explaining the present invention and are not meant to limit the present invention.
Example (b):
as shown in fig. 1, the method for triggering the mobile phone HTML5 live video with low delay based on the warning information includes:
s1: the server acquires real-time video stream data from the video acquisition terminal;
s2: when playing a video, a client acquires a random address and then sends a request of the random address to a server;
s3: the server obtains the acquisition condition of the client data according to the request of the random address;
s4: the server sends real-time video stream data to the client by combining the acquisition condition of the client data and adopting a long polling method and a loan prediction method;
s5: and the client plays the real-time video stream data.
The client data in S3 includes the acquired video data and the non-acquired video data.
The method further comprises the step that the server controls the transmission sequence of the real-time video stream data according to the acquired video data and the acquired video data.
The S4 includes: when receiving a request of a random address, the server analyzes real-time video stream data and judges whether valid data are used for requesting receipt, and if the valid data exist, the server sends the valid data to the client; if the data is not valid, adding overdue, sending the data to the client when the data required by the client can be provided, and if the data required by the client cannot be prepared for a long time, considering the data as bad account and stopping all the data of the client.
The S4 further includes: the method comprises the steps that a server firstly generates a file table before video data are obtained, video data which do not have files in the file table are recorded as liability data, and when a client requests a specific file table, if the video data in the file table are not generated, the video data are recorded as overdue data; if the video data is supplemented in the grace period, the video data is sent to the client and the video is continuously played at the client; and if the video data are not supplemented after the grace period is exceeded, stopping sending the video data to the client and ending playing the video.
The S4 further includes: and in the program operation, the program predicts the data volume of the liability to the client side in the next batch according to the liability data and the overdue data, so as to balance the liability and the overdue volume.
Adopting a random address method: when the client plays the video, a random address is obtained first, then the random address is only used by the client, the server can know which data of the client are obtained and which data are not obtained according to the request condition of the random address, the transmission sequence of the data is controlled, and the problem of stateless and disordered http is solved;
adopting a long polling method: after adopting the random address method, the server can already analyze the working state of the client, when having a request, the server sends video data to the client at a proper time after balancing the effectiveness of the data (such as a client requests a file list, at the moment, the server finds that the file list of the server is not changed after the client requests for the last time, at the moment, if the file list sent to the client is invalid data, the connection is maintained for later processing, and the file list is immediately returned to the client when the file list is changed);
as shown in fig. 4, the loan prediction method: the logic of playing the video by the html5 is that a file list is taken first and then the video is downloaded, the file list and the video can be transmitted to a client in time by using a random address method and a long polling method, but the file list can be generated only after the video file is generated; in order to solve the contradiction, the server generates a file table when no video exists, data which does not exist in the file table is recorded as liability, when a client requests a specific file, the file is not generated yet, the file is recorded as overdue, a long polling mechanism exists, a certain grace period exists, if the data is supplemented within the grace period, the video playing can still work, and if the data cannot be supplemented within the grace period, all the data of the client is finally played; during program operation, the program predicts the data volume of the liability for the next batch to the client according to the liability and overdue data, balances the liability and the overdue volume, and avoids the situation that data cannot be supplemented in the grace period.
Taking a Haikang video stream with a key frame interval of 50 and 25 frames/second (2 seconds and one frame key frame) as an example, as shown in FIG. 2, according to a standard flow of hls, 3 fragments need to be generated, each fragment needs to contain one frame key frame, 6S is needed for generating a file table for the first time, 2S is needed for generating (the previous two fragments use historical data) in a cache manner, as shown in FIG. 3, and after improvement, the file table can be generated directly without data, that is, the time for generating the file table is 0, the detailed comparison is as follows:
Figure BDA0002804763570000041
Figure BDA0002804763570000051
the above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (6)

1. A method for triggering a mobile phone HTML5 low-delay live video based on early warning information is characterized by comprising the following steps:
s1: the server acquires real-time video stream data from the video acquisition terminal;
s2: when playing a video, a client acquires a random address and then sends a request of the random address to a server;
s3: the server obtains the acquisition condition of the client data according to the request of the random address;
s4: the server sends real-time video stream data to the client according to the acquisition condition of the client data and by combining a long polling method and a loan prediction method;
s5: the client plays real-time video stream data;
the loan prediction method in the S4 is as follows: the server generates a file table before the video file is generated, data which does not have files in the file table is recorded as liability, and when the client requests a specific file, the file is not generated yet and is recorded as overdue; and in the program operation, the program predicts the data volume of the liability given to the client at the next time according to the liability and overdue data, so as to balance the liability and the overdue volume.
2. The method for triggering mobile phone HTML5 low-latency live video based on pre-warning information, according to claim 1, wherein said client data in step S3 includes: acquired video data and non-acquired video data.
3. The method for triggering the mobile phone HTML5 live video with low delay based on the warning information as claimed in claim 2, wherein between step S3 and step S4 further comprising the steps of:
s31: and the server controls the transmission sequence of the real-time video stream data according to the acquisition conditions of the acquired video data and the video data which are not acquired.
4. The method for triggering mobile phone HTML5 low-latency live video based on pre-warning information as claimed in claim 1, wherein said step S4 comprises the sub-steps of:
s41: the server analyzes the real-time video stream data and judges whether effective data is used for requesting receipt, if the effective data exists, the step S42 is executed, otherwise, the step S43 is executed;
s42: sending the valid data to the client;
s43: waiting for the data required by the client, if the data required by the client is received within the preset time, executing the step S42, otherwise, executing the step S44;
s44: stop sending all data to this client.
5. The method for triggering mobile phone HTML5 low-latency live video based on early warning information according to claim 1, wherein said S4 specifically comprises:
s41: the method comprises the steps that a server generates a file table before video data are obtained, video data which do not have files in the file table are recorded as liability data, and when a client requests a specific file table, if the video data in the file table are not generated, the video data are recorded as overdue data; analyzing the real-time video stream data and judging whether effective data is used for requesting receipt, if so, executing a step S42, otherwise, executing a step S43;
s42: sending the valid data to the client;
s43: setting a overdue grace period for the client, waiting for data required by the client, if receiving supplementary data required by the client within the overdue grace period, executing the step S42 and continuing to play the video on the client, otherwise executing the step S44;
s44: and taking the video playing request as a bad account, stopping sending the video data to the client and finishing playing the video.
6. The method for triggering the mobile phone HTML5 live video with low delay based on the early warning information as claimed in claim 5, wherein in the program running process, the program predicts the data volume of liability to be given to the client next time according to the liability data and the overdue data, so as to balance the liability data volume and the overdue data volume.
CN202011363634.5A 2020-11-27 2020-11-27 Method for triggering mobile phone HTML5 low-delay live video based on early warning information Active CN112533016B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011363634.5A CN112533016B (en) 2020-11-27 2020-11-27 Method for triggering mobile phone HTML5 low-delay live video based on early warning information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011363634.5A CN112533016B (en) 2020-11-27 2020-11-27 Method for triggering mobile phone HTML5 low-delay live video based on early warning information

Publications (2)

Publication Number Publication Date
CN112533016A CN112533016A (en) 2021-03-19
CN112533016B true CN112533016B (en) 2021-12-14

Family

ID=74994728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011363634.5A Active CN112533016B (en) 2020-11-27 2020-11-27 Method for triggering mobile phone HTML5 low-delay live video based on early warning information

Country Status (1)

Country Link
CN (1) CN112533016B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107396205A (en) * 2017-07-25 2017-11-24 观止云(北京)信息技术有限公司 A kind of low delay fluidizes HLS implementation methods
CN107493510A (en) * 2017-09-19 2017-12-19 武汉斗鱼网络科技有限公司 Live TV stream player method, device, computer-readable storage medium and equipment in direct broadcasting room
JP2019003604A (en) * 2017-06-09 2019-01-10 富士ゼロックス株式会社 Methods, systems and programs for content curation in video-based communications
CN109756758A (en) * 2017-11-01 2019-05-14 腾讯科技(深圳)有限公司 Live-broadcast control method and device
CN111918093A (en) * 2020-08-13 2020-11-10 腾讯科技(深圳)有限公司 Live broadcast data processing method and device, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297452B (en) * 2012-02-24 2016-08-24 北京对角巷科技发展有限公司 A kind of in the Internet issue and the method and system of live broadcast stream media
CN110012300B (en) * 2018-01-04 2021-07-09 华为技术有限公司 Video live broadcasting method and device
CN111436009B (en) * 2019-01-11 2023-10-27 厦门雅迅网络股份有限公司 Real-time video stream transmission and display method and transmission and play system
CN111064972A (en) * 2019-11-28 2020-04-24 湖北工业大学 Live video control method based on IPV9

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019003604A (en) * 2017-06-09 2019-01-10 富士ゼロックス株式会社 Methods, systems and programs for content curation in video-based communications
CN107396205A (en) * 2017-07-25 2017-11-24 观止云(北京)信息技术有限公司 A kind of low delay fluidizes HLS implementation methods
CN107493510A (en) * 2017-09-19 2017-12-19 武汉斗鱼网络科技有限公司 Live TV stream player method, device, computer-readable storage medium and equipment in direct broadcasting room
CN109756758A (en) * 2017-11-01 2019-05-14 腾讯科技(深圳)有限公司 Live-broadcast control method and device
CN111918093A (en) * 2020-08-13 2020-11-10 腾讯科技(深圳)有限公司 Live broadcast data processing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112533016A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
KR101904244B1 (en) Enhanced streaming media playback
CN110933517B (en) Code rate switching method, client and computer readable storage medium
CN111135569A (en) Cloud game processing method and device, storage medium and electronic equipment
US20040015994A1 (en) Method and apparatus for sending/receiving VOD streaming service providing client-favored advertisement
EP2493191B1 (en) Method, device and system for realizing hierarchically requesting content in http streaming system
CN106998485B (en) Video live broadcasting method and device
WO2015120766A1 (en) Video optimisation system and method
US8725947B2 (en) Cache control for adaptive stream player
CN110636346A (en) Code rate self-adaptive switching method and device, electronic equipment and storage medium
CN110582012B (en) Video switching method, video processing device and storage medium
WO2019128800A1 (en) Content service implementation method and device, and content delivery network node
CN113141522B (en) Resource transmission method, device, computer equipment and storage medium
CN111726657A (en) Live video playing processing method and device and server
CN111083536B (en) Method and device for adjusting video code rate
WO2018233539A1 (en) Video processing method, computer storage medium, and device
CN111510789B (en) Video playing method, system, computer equipment and computer readable storage medium
CN107690093B (en) Video playing method and device
CN112354177A (en) Webrtc-based cloud game instant starting method, device and system
CN112218151A (en) Screen projection method, device, computer storage medium and system
CN111726641A (en) Live video playing processing method and device and server
CN111202980A (en) Information transmission method, streaming media cloud platform and computer readable storage medium
CN112533016B (en) Method for triggering mobile phone HTML5 low-delay live video based on early warning information
US20230388590A1 (en) Playback optimization method and system
CN114268830A (en) Cloud director synchronization method, device, equipment and storage medium
CN114666627A (en) Method and device for preloading streaming media video, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: No. 1, Floor 10, Building 2, No. 11, Wuke East 4th Road, Wuhou District, Chengdu, Sichuan, 610041

Patentee after: Sichuan Honghe Communication Group Co.,Ltd.

Address before: No.1, 10th floor, building 2, No.11, Wuke Dongsi Road, Wuhou District, Chengdu, Sichuan 610000

Patentee before: SICHUAN HONGHE COMMUNICATION Co.,Ltd.

CP03 Change of name, title or address
CP01 Change in the name or title of a patent holder

Address after: No. 1, Floor 10, Building 2, No. 11, Wuke East 4th Road, Wuhou District, Chengdu, Sichuan, 610041

Patentee after: Sichuan Honghe Digital Intelligence Group Co.,Ltd.

Address before: No. 1, Floor 10, Building 2, No. 11, Wuke East 4th Road, Wuhou District, Chengdu, Sichuan, 610041

Patentee before: Sichuan Honghe Communication Group Co.,Ltd.

CP01 Change in the name or title of a patent holder