CN109819278B - Optimization method of live video - Google Patents

Optimization method of live video Download PDF

Info

Publication number
CN109819278B
CN109819278B CN201910008297.9A CN201910008297A CN109819278B CN 109819278 B CN109819278 B CN 109819278B CN 201910008297 A CN201910008297 A CN 201910008297A CN 109819278 B CN109819278 B CN 109819278B
Authority
CN
China
Prior art keywords
video
information
acquisition equipment
video acquisition
acquiring
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
CN201910008297.9A
Other languages
Chinese (zh)
Other versions
CN109819278A (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.)
CHENGDU IDEAL TECHNOLOGY DEVELOPMENT CO.,LTD.
Original Assignee
Chengdu Suianbao Network Technology 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 Chengdu Suianbao Network Technology Co ltd filed Critical Chengdu Suianbao Network Technology Co ltd
Priority to CN201910008297.9A priority Critical patent/CN109819278B/en
Publication of CN109819278A publication Critical patent/CN109819278A/en
Application granted granted Critical
Publication of CN109819278B publication Critical patent/CN109819278B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a method for optimizing live video, which is applied to a video playing server, wherein the playing server is connected with a video acquisition device and a video playing device, and the method for optimizing the live video comprises the following steps: judging whether a video playing request from video playing equipment is acquired; under the condition of acquiring a video playing request, acquiring first video information from video acquisition equipment; processing the first video information to obtain a first video file, caching the first video file and forwarding the first video file to video playing equipment; judging whether the first video information is played completely, and acquiring second video information from the video acquisition equipment when the first video information is played completely, wherein the second video information is continuous video information with the first video information; and processing the second video information to obtain a second video file, caching the second video file and forwarding the second video file to the video playing equipment.

Description

Optimization method of live video
Technical Field
The invention relates to the field of network communication, in particular to a method for optimizing a live video.
Background
With the continuous development of communication technology and the continuous popularization of intelligent terminals, live video becomes a technology of general popularization, and simultaneously, the remote watching of real-time video through a mobile phone also generates great demands in different fields. For example, a boss of a shop watches a live-action video of a shop of the family through a mobile phone, and a parent remotely watches the situation that a child is at home. Generally, a user installs a camera, downloads and installs corresponding application software on a mobile phone according to the specification of equipment, and can remotely watch videos through the application software after operations such as registration, verification, equipment binding and the like.
With the popularization of instant voice application software such as WeChat, a user can directly bind a camera and watch remote video through the software such as WeChat, so that the operation complexity of the user is greatly reduced, the user experience is improved, and in order to adapt to two mainstream operating systems such as android and apple, the conventional Live-action video/remote video adopts an HLS (HTTP Live streaming) scheme.
In a conventional HLS scheme, a video capture device continuously uploads real-time video image data to a video playing server, and the video playing server prepares to transmit video images to a video playing terminal, such as an intelligent terminal, at any time. However, in the actual application process, in a non-high concurrency occasion, the acquired video image is only open to a few authorized users, such as administrators, leaders and friends, and the like, and the use time of the users is short, so that the technical scheme of real-time data transmission and data caching adopted in the traditional video live broadcast scheme causes great network bandwidth waste, and meanwhile, the video playing server processes the received video data, thereby causing great waste of server resources, improving the operation cost of enterprises, and reducing the user experience.
Disclosure of Invention
In order to solve the technical problems of high network bandwidth occupation and high waste degree of server resources in the traditional video live broadcast technology in the prior art, the embodiment of the invention provides a live broadcast video optimization method.
In order to achieve the above object, an embodiment of the present invention provides an optimization method for a live video, which is applied to a video playing server, where the playing server is connected to a video acquisition device and a video playing device, and the optimization method includes: judging whether a video playing request from the video playing equipment is acquired or not; under the condition that the video playing request is obtained, first video information is obtained from the video acquisition equipment; processing the first video information to obtain a first video file, caching the first video file and forwarding the first video file to the video playing device; judging whether the first video information is played completely, and acquiring second video information from the video acquisition equipment when the first video information is played completely, wherein the second video information is continuous video information with the first video information; and processing the second video information to obtain a second video file, caching the second video file and forwarding the second video file to the video playing equipment.
Preferably, the video capture device includes a plurality of channels, and before determining whether to acquire a video playing request from the video playing device, the optimization method further includes: acquiring identity information of the video acquisition equipment; acquiring account information and password information set by a user and appointed channel information appointed by the user from the plurality of channels; generating initial link information based on the identity information, the specified channel information, the account information and the password information; and encrypting the initial link information to generate encrypted link information, and sending the encrypted link information to the video playing equipment.
Preferably, before the first video information is acquired from the video capture device, the optimization method includes: establishing connection with the video acquisition equipment; acquiring login authentication information of the video acquisition equipment, and acquiring an authentication result based on the login authentication information; and if the authentication result is valid equipment, acquiring first video information from the video acquisition equipment.
Preferably, after establishing a connection with the video capture device, the optimization method further comprises: sending message information to the video playing server through the video acquisition equipment according to a preset sending period; the video acquisition equipment judges whether response information fed back by the video playing server based on the message information is acquired or not, and acquires a judgment result; and the video acquisition equipment executes corresponding communication operation based on the judgment result.
Preferably, the video capture device performs a corresponding communication operation based on the determination result, including: if the judgment result is that response information fed back by the playing server based on the message information is obtained, continuing to send the message information; if the judgment result is that the response information fed back by the playing server based on the message information is not obtained, judging whether the abnormal time of not obtaining the response information reaches a preset abnormal time threshold value; if the abnormal time reaches the preset abnormal time threshold, disconnecting the video playing server, reestablishing the connection with the video playing server, and continuing to send the message information after reestablishing the connection.
Preferably, the obtaining login authentication information of the video capture device and obtaining an authentication result based on the login authentication information includes: acquiring a registration message uploaded by the video acquisition equipment, wherein the registration message comprises identity information and version information of the video acquisition equipment; judging whether the video acquisition equipment is valid equipment or not based on the registration message; if the video acquisition equipment is valid equipment, feeding back confirmation information to the video acquisition equipment and generating an authentication result of the valid equipment; and if the video acquisition equipment is invalid equipment, configuring new identity information for the video acquisition equipment, sending the new identity information to the video acquisition equipment and generating an authentication result of the invalid equipment.
Preferably, the optimization method further comprises: acquiring original video information and original audio information in real time through the video acquisition equipment; generating, by the video capture device, a plurality of information blocks based on the original video information and original audio information; storing the plurality of information blocks according to a preset sequence and a preset number through the video acquisition equipment; the acquiring of the first video information from the video capture device includes: and uploading an information block corresponding to the current time as first video information to the video playing server through the video acquisition equipment.
Preferably, the acquiring, by the video capture device, the original video information and the original audio information in real time includes: acquiring initial configuration parameters of the video acquisition equipment; obtaining the optimization operation of the user on the initial configuration parameters, and obtaining the optimized optimal configuration parameters; and acquiring original video information and original audio information in real time based on the optimal configuration parameters.
Preferably, the processing the first video information to obtain a first video file includes: and caching the information block and generating the first video file based on the information block.
Preferably, the optimization method further comprises: under the condition that the video playing request is not acquired, judging whether the waiting time for not receiving the video playing request reaches preset idle time or not; and if the waiting time reaches the preset idle time, deleting the currently cached video file.
Through the technical scheme provided by the invention, the invention at least has the following technical effects:
in the actual live video broadcasting process, the video playing server acquires real-time video image information according to the actual request information of the user instead of acquiring the video image information acquired by the video acquisition equipment in real time, so that the occupancy rate of network bandwidth is greatly reduced, the consumption of server resources is reduced, the waste of the server resources is effectively avoided, the operation cost of enterprises is greatly reduced, and the user experience is improved.
Additional features and advantages of embodiments of the invention will be set forth in the detailed description which follows.
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 specification, illustrate embodiments of the invention and together with the description serve to explain the embodiments of the invention without limiting the embodiments of the invention. In the drawings:
fig. 1 is a flowchart of a specific implementation of a live video optimization method provided in an embodiment of the present invention;
fig. 2 is a flowchart of a specific implementation of live video broadcast by a smart phone according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a video playback server generating encrypted link information according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a video playing server acquiring video information according to an embodiment of the present invention.
Detailed Description
In order to solve the technical problems of high network bandwidth occupation and high waste degree of server resources in the traditional video live broadcast technology in the prior art, the embodiment of the invention provides a live broadcast video optimization method.
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating embodiments of the invention, are given by way of illustration and explanation only, not limitation.
The terms "system" and "network" in embodiments of the present invention may be used interchangeably. The "plurality" means two or more, and in view of this, the "plurality" may also be understood as "at least two" in the embodiments of the present invention. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" generally indicates that the preceding and following related objects are in an "or" relationship, unless otherwise specified. In addition, it should be understood that the terms first, second, etc. in the description of the embodiments of the invention are used for distinguishing between the descriptions and are not intended to indicate or imply relative importance or order to be construed.
Referring to fig. 1, an embodiment of the present invention provides a method for optimizing a live video, which is applied to a video playing server, where the playing server is connected to a video acquisition device and a video playing device, and the method for optimizing the live video includes:
s10) judging whether a video playing request from the video playing device is obtained;
s20) under the condition that the video playing request is obtained, first video information is obtained from the video acquisition equipment;
s30) processing the first video information to obtain a first video file, caching the first video file and forwarding the first video file to the video playing device;
s40) judging whether the first video information is played completely, and acquiring second video information from the video acquisition equipment when the first video information is played completely, wherein the second video information is continuous video information with the first video information;
s50) processing the second video information to obtain a second video file, caching the second video file and forwarding the second video file to the video playing device.
In order to avoid occupying excessive network bandwidth, when the video playing server does not acquire the video playing request sent by the user, the video playing server does not acquire the video image information acquired by the video acquisition device, so that the network bandwidth is saved.
In a possible implementation manner, a video live broadcast is performed by using an HLS scheme, a video playing server first determines whether a video playing request sent by a user through a video playing device is obtained, and after the video playing request of the user is obtained, the video playing server obtains first video information from a video acquisition device, in an embodiment of the present invention, the first video information is a media fragment file, preferably, the media fragment file is a data block with a file suffix of ts, and then the video playing server processes the first video information to obtain a first video file, for example, in an embodiment of the present invention, each media fragment file is a ts data block with a duration of 2s, and the video playing server stores all ts data blocks after obtaining a preset number of ts data blocks (for example, the preset number is 10, that is, obtaining the ts data blocks with a total duration of 20 s), and generates a corresponding m3u8 file according to the 10 ts data blocks.
In the embodiment of the invention, after the corresponding m3u8 file is generated, the video playing server also records the survival time of each ts data block and the m3u8 file, and automatically deletes the ts data block after the storage time of the ts data block reaches the survival time of the ts data block; when the m3u8 file generates ts data blocks each time, for example, the video playing server reads the corresponding m3u8 file according to the video playing request of the user and generates the corresponding ts data blocks according to the m3u8 file, at this time, the video playing server automatically updates and re-records the expiration time of the m3u8 file, and when the storage time of the m3u8 file reaches the expiration time, the video playing server automatically deletes the m3u8 file.
At this time, the video playing server forwards the first video file to the video playing device, for example, forwards the generated m3u8 file to a smart phone of a user, the smart phone calls a corresponding ts data block according to the m3u8 file to obtain corresponding video image information and performs video live broadcast, in the process of live broadcast, the video playing server also monitors whether the playing of the first video file is completed, if the playing of the first video file is completed, second video information is immediately obtained from the video capturing device, in the embodiment of the present invention, the second video information is video information temporally continuous with the first video information, for example, a ts data block temporally continuous with the ts data block corresponding to the first video information, the video playing server generates a corresponding second video file according to the second video information, for example, an m3u8 file corresponding to the second video information, the video playback server then caches the m3u8 file and forwards it to the user's smartphone for continuous video playback.
Referring to fig. 2, in a possible implementation, a user performs live video broadcast through a wechat platform on a smart phone, the user first obtains live link information through the wechat platform, then obtains an m3u8 file corresponding to a current video according to the link information, at this time, extracts a ts data block list of the current video according to the m3u8 file, obtains ts data blocks according to the list in time sequence, immediately plays the video after obtaining the ts data blocks, the smart phone continues to obtain a next ts data block while playing a previous ts data block, so that a second ts data block is immediately played after playing the first ts data block, after reading the ts data block in the current m3u8 file, the smart phone automatically reads the m3u8 file in the video playing server again, and after updating the m3u8 file in the video playing server, the smart phone obtains the ts data block from a new data address according to the updated m3u8 file, for subsequent video playback.
Further, in the embodiment of the present invention, if a new m3u8 file does not exist in the video playing server in the process that the smartphone reads the m3u8 file in the video playing server again, the video playing server automatically sends a video data request to the video acquisition device, the video acquisition device immediately sends a ts data block to the video playing server again after acquiring the video data request, and the video playing server immediately sends the generated m3u8 file to the smartphone after acquiring the ts data block, so as to provide live video broadcast for the user in time; and if the video playing server sends a response result of the video data request to the video acquisition equipment that the equipment is not on-line or does not exist, feeding back feedback information that the playing data does not exist to the smart phone.
In the embodiment of the present invention, the video playing device includes, but is not limited to, an intelligent terminal such as a smart phone, a tablet computer, and a personal computer; the video acquisition equipment comprises intelligent video acquisition equipment, intelligent audio acquisition equipment and a main control chip.
In the embodiment of the invention, through improving the traditional HLS video scheme, the video playing server acquires the video image information acquired by the video acquisition equipment only under the condition of acquiring the video playing request of the user, instead of acquiring the video image information acquired from the video acquisition equipment in real time, so that the occupation of network bandwidth is greatly reduced, especially the occupation of the network bandwidth in non-concurrent occasions is greatly reduced, the waste of the network bandwidth is reduced, meanwhile, the invalid processing behavior of the video playing server is greatly reduced, the waste of server resources is greatly reduced, the enterprise operation cost is reduced, and the user experience is improved.
Referring to fig. 3, in the embodiment of the present invention, the video capture device includes a plurality of channels, and before determining whether to acquire a video playing request from the video playing device, the optimization method further includes: acquiring identity information of the video acquisition equipment; acquiring account information and password information set by a user and appointed channel information appointed by the user from the plurality of channels; generating initial link information based on the identity information, the specified channel information, the account information and the password information; and encrypting the initial link information to generate encrypted link information, and sending the encrypted link information to the video playing equipment.
In the embodiment of the present invention, the video playing server includes a management server and a video transit server.
In a possible implementation manner, before video live broadcast is performed through an intelligent terminal of a user, link information for performing video live broadcast needs to be acquired first. The method comprises the steps that a user firstly obtains identity information of video acquisition equipment through an intelligent terminal, for example, the user firstly logs in a WeChat platform through an intelligent mobile phone, then equipment adding operation is carried out through a video acquisition equipment adding interface on the WeChat platform, in the process of executing the equipment adding operation, the intelligent mobile phone automatically calls a camera on the intelligent mobile phone to scan a bar code on the video acquisition equipment so as to obtain the identity information of the video acquisition equipment, then the intelligent mobile phone obtains information such as an account number and a password input by the user, and sends the identity information, the account number information, the password information and appointed channel information appointed by the user from a plurality of channels of the video acquisition equipment to a video playing server, the video playing server generates corresponding initial link information according to the information, and further, in order to ensure the link safety, the video playing server also encrypts the initial link information, the encrypted link information is generated and sent to the smart phone, and the smart phone stores the encrypted link information after receiving the encrypted link information, for example, the encrypted link information is stored through a wechat web page management platform or a wechat applet management platform, so that the video acquisition device is bound with the encrypted link.
In the embodiment of the invention, the initial link information is generated according to the identity information of the video acquisition equipment and the account and password information input by the user, so that the video acquisition equipment is effectively bound with the account of the user, the video acquisition equipment is prevented from being stolen or mixed with the video acquisition equipment of other users, and further, the initial link information is encrypted by the video playing server to generate the encrypted link information, so that the safety of live video broadcast is greatly improved, the privacy of the user is protected, the privacy information of the user is prevented from being stolen or snooped by other illegal users, and the user experience is greatly improved.
In an embodiment of the present invention, before the obtaining the first video information from the video capturing device, the optimizing method includes: establishing connection with the video acquisition equipment; acquiring login authentication information of the video acquisition equipment, and acquiring an authentication result based on the login authentication information; and if the authentication result is valid equipment, acquiring first video information from the video acquisition equipment.
In a possible implementation manner, before obtaining video information uploaded by a video acquisition device, a video playing server needs to establish a connection with the video acquisition device first, in an embodiment of the present invention, the video acquisition device actively establishes a connection with a management server in the video playing server, and maintains a long-time connection in a communication manner of a Transmission Control Protocol (TCP), and meanwhile, a communication packet between the video acquisition device and the video playing server is encrypted by an Advanced Encryption Standard (AES) Encryption method. After the connection with the video acquisition equipment is established, the video playing server acquires login authentication information of the video acquisition equipment, authenticates the video acquisition equipment according to the acquired login authentication information to acquire an authentication result, and acquires first video information from the video acquisition equipment if the authentication result indicates that the video acquisition equipment is valid equipment.
In the embodiment of the invention, the login authentication is carried out on the video acquisition equipment in the process of carrying out the live video, so that the content displayed by the live video is ensured to be acquired by legal equipment, the illegal operation of illegal equipment is effectively avoided or the condition that the content of the live video is not in line with the expectation of a user is avoided, the safety of the live video is ensured, and the user experience is improved.
In this embodiment of the present invention, after establishing a connection with the video capture device, the optimization method further includes: sending message information to the video playing server through the video acquisition equipment according to a preset sending period; the video acquisition equipment judges whether response information fed back by the video playing server based on the message information is acquired or not, and acquires a judgment result; and the video acquisition equipment executes corresponding communication operation based on the judgment result.
Further, in this embodiment of the present invention, the video capture device performs a corresponding communication operation based on the determination result, including: if the judgment result is that response information fed back by the playing server based on the message information is obtained, continuing to send the message information; if the judgment result is that the response information fed back by the playing server based on the message information is not obtained, judging whether the abnormal time of not obtaining the response information reaches a preset abnormal time threshold value; if the abnormal time reaches the preset abnormal time threshold, disconnecting the video playing server, reestablishing the connection with the video playing server, and continuing to send the message information after reestablishing the connection.
After the video playing server is connected with the video acquisition equipment, the video acquisition equipment actively detects whether the communication of a communication link between the video playing server and the video acquisition equipment is normal. In a possible implementation manner, the video acquisition device sends message information to the video playing server according to a preset sending period (for example, the preset sending period is 100ms), the video playing server immediately feeds back corresponding response information after receiving the message information, the video acquisition device judges whether to acquire the response information of the video playing server after sending the message information, and if the video acquisition device determines that the response information is received, it determines that the communication of the current communication link is normal, and continues to send the message information; if the video acquisition equipment does not receive the response information, continuously monitoring abnormal time without receiving the response information, and judging whether the abnormal time reaches a preset abnormal time threshold (for example, the preset abnormal time threshold is 5s), if the abnormal time reaches the preset abnormal time threshold, determining that the communication of the current communication link is abnormal, actively disconnecting the video acquisition equipment from the video playing server, and establishing connection with the video playing server again, and after the video acquisition equipment authenticates or registers in the video playing server through login authentication information again, continuously sending the message information to continuously detect whether the communication of the communication link between the video playing server and the video acquisition equipment is normal.
In the embodiment of the invention, after the connection between the video acquisition equipment and the video playing server is established and the authentication is successful, the heartbeat message is periodically sent to the video playing server, so that whether the communication of the communication link between the video acquisition equipment and the video playing server is normal is effectively detected, the normal operation of the video live broadcast is ensured, the corresponding operation can be timely found and taken when the communication of the current communication link is abnormal, the disconnection time of the communication link is greatly reduced, the influence on the normal use of a user is avoided, and the user experience is greatly improved.
In this embodiment of the present invention, the obtaining login authentication information of the video capture device and obtaining an authentication result based on the login authentication information includes: acquiring a registration message uploaded by the video acquisition equipment, wherein the registration message comprises identity information and version information of the video acquisition equipment; judging whether the video acquisition equipment is valid equipment or not based on the registration message; if the video acquisition equipment is valid equipment, feeding back confirmation information to the video acquisition equipment and generating an authentication result of the valid equipment; and if the video acquisition equipment is invalid equipment, configuring new identity information for the video acquisition equipment, sending the new identity information to the video acquisition equipment and generating an authentication result of the invalid equipment.
In a possible implementation manner, a video playing server performs login authentication on a video acquisition device, and first acquires a registration message uploaded by the video acquisition device, where the registration message includes information such as identity information (e.g., ID information) and version information of the video acquisition device, and after acquiring the registration message, the video playing server automatically verifies the registration message, for example, automatically extracts the identity information and the version information in the registration message, and queries corresponding information in a database to determine whether the registration message is valid information, and if the message information is valid information, determines that the video acquisition device is valid device and generates an authentication result of the valid device, and simultaneously feeds back confirmation information to the video acquisition device; if the message is invalid information, for example, the identity information is invalid identity information, the video playing server configures new identity information for the video acquisition equipment, generates an authentication result of the invalid equipment, and simultaneously sends the new identity information to the video acquisition equipment.
After the video acquisition equipment acquires the new identity information, writing the new identity information into a log, writing the new identity information into a configuration file of the video acquisition equipment, automatically restarting the video acquisition equipment to enable the new identity information to be effective, and then starting authentication to the video playing server again by the video acquisition equipment to complete authentication in the video playing server.
In an embodiment of the present invention, the optimization method further includes: acquiring original video information and original audio information in real time through the video acquisition equipment; generating, by the video capture device, a plurality of information blocks based on the original video information and original audio information; storing the plurality of information blocks according to a preset sequence and a preset number through the video acquisition equipment; the acquiring of the first video information from the video capture device includes: and uploading an information block corresponding to the current time as first video information to the video playing server through the video acquisition equipment.
Further, in the embodiment of the present invention, the acquiring, in real time, original video information and original audio information by the video capture device includes: acquiring initial configuration parameters of the video acquisition equipment; obtaining the optimization operation of the user on the initial configuration parameters, and obtaining the optimized optimal configuration parameters; and acquiring original video information and original audio information in real time based on the optimal configuration parameters.
In a possible embodiment, after the video capture device completes the startup initialization, it first automatically obtains the initial configuration parameters of the video capture device, and then the video capture device further obtains the optimization operation of the user on the initial configuration parameters based on the current application scene, for example, the user may connect to the video capture device through a debugging tool provided by a manufacturer, and adjust the initial configuration parameters of the video capture device, for example, the initial configuration parameters include parameters such as white balance, brightness, contrast, exposure time, and the like, so as to obtain the optimized optimal configuration parameters and store the optimized optimal configuration parameters in the video capture device, and after the video capture device determines the startup stability (for example, the brightness and contrast are automatically adapted), the video capture device automatically obtains the original video information and the original audio information in the current application scene in real time, for example, according to the preset video configuration parameters (for example, the preset video configuration parameters are video I frames spaced 2 seconds apart by a preset video I frame interval), Frame rate 15fps) video H264 coding the original video data to generate H264 compressed data packets, slicing the original audio data according to preset audio configuration parameters (for example, the preset audio configuration parameters are 128ms in slice length), processing the sliced data to generate corresponding AAC packets, generating corresponding information blocks according to the H264 packets and the AAC packets at the moment, for example, generating corresponding ts data blocks, preferably, the time length of each ts data block is about 2s, storing the generated information blocks according to a preset storage sequence (for example, according to the time sequence) and a preset storage number (for example, the preset storage number is 5 ts data blocks) by the video acquisition equipment at the moment, deleting the ts data block with the longest storage time and storing the new ts data block when the storage space is full and a new ts data block is received by the video acquisition equipment, the video acquisition equipment stores the current time information in each ts data block after generating a plurality of ts data blocks. After the video playing server obtains the video playing request, the video playing server requests video data from the video acquisition device, and the video acquisition device sends the ts data block corresponding to the time when the video data request information is obtained to the video playing server, please refer to fig. 4.
In the embodiment of the invention, the corresponding data blocks are generated based on the original video information and the original audio information, and the data blocks are stored according to the preset storage mode instead of storing all the data blocks, so that on the basis of ensuring that enough data blocks are stored, the demand on the storage space can be greatly reduced, the operation cost of an enterprise is greatly reduced, the optimal user experience is ensured, and the enterprise benefit is improved.
In this embodiment of the present invention, the processing the first video information to obtain a first video file includes: and caching the information block and generating the first video file based on the information block.
In a possible implementation manner, the first video information is a ts data block, the video playing server caches the ts data block after obtaining the ts data block, and after receiving all ts data blocks, processes all cached ts data blocks to generate a corresponding first video file, in an embodiment of the present invention, the first video file is an m3u8 file.
Further, in the embodiment of the present invention, the optimization method further includes: under the condition that the video playing request is not acquired, judging whether the waiting time for not receiving the video playing request reaches preset idle time or not; and if the waiting time reaches the preset idle time, deleting the currently cached video file.
In a possible implementation manner, after a user views live video after a period of time, the interface of the smart phone is switched to other interfaces, that is, the live video interface is switched to background operation, and at this time, the smart phone stops sending a video playing request to the video playing server. At this time, the video playing server monitors that the video playing request sent by the video playing device is not obtained, so that the waiting time for not receiving the video playing request is monitored, and when the waiting time reaches a preset idle time (for example, the preset idle time is 30s), it is determined that the current user has no video live broadcast requirement, so that the video file cached in the current server is deleted.
Further, in the embodiment of the present invention, the video capture device also stores the time for obtaining the video playing request in the video playing server, and when it is determined that the waiting time reaches the preset idle time, the video capture device stops uploading the ts data block to the video playing server.
In the embodiment of the invention, the live video watching behavior of the user is monitored in real time, so that the transmission and processing of related data can be timely found and stopped when the user does not need to carry out live video or does not need live video, the occupation of network bandwidth is further reduced, the data processing amount of a video playing server is reduced, the waste of server resources is reduced, the operation cost of enterprises is reduced, and the user experience is greatly improved.
Although the embodiments of the present invention have been described in detail with reference to the accompanying drawings, the embodiments of the present invention are not limited to the details of the above embodiments, and various simple modifications can be made to the technical solutions of the embodiments of the present invention within the technical idea of the embodiments of the present invention, and the simple modifications all belong to the protection scope of the embodiments of the present invention.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, the embodiments of the present invention do not describe every possible combination.
Those skilled in the art will understand that all or part of the steps in the method according to the above embodiments may be implemented by a program, which is stored in a storage medium and includes several instructions to enable a single chip, a chip, or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In addition, any combination of various different implementation manners of the embodiments of the present invention is also possible, and the embodiments of the present invention should be considered as disclosed in the embodiments of the present invention as long as the combination does not depart from the spirit of the embodiments of the present invention.

Claims (7)

1. A method for optimizing live video is applied to a video playing server which adopts an HLS scheme to carry out live video, and the playing server is connected with a video acquisition device and a video playing device, and is characterized in that the method for optimizing the live video comprises the following steps:
the video playing server monitors the video live broadcast request behavior of the user;
when the video playing server does not acquire a video playing request sent by a user, the video playing server does not acquire video image information acquired by the video acquisition equipment;
judging whether a video playing request from the video playing equipment is acquired or not;
under the condition that the video playing request is obtained, first video information is obtained from the video acquisition equipment;
processing the first video information to obtain a first video file, caching the first video file and forwarding the first video file to the video playing device;
judging whether the first video information is played completely, and acquiring second video information from the video acquisition equipment when the first video information is played completely, wherein the second video information is continuous video information with the first video information;
processing the second video information to obtain a second video file, caching the second video file and forwarding the second video file to the video playing device;
the video acquisition device comprises a plurality of channels, and before judging whether a video playing request from the video playing device is acquired, the optimization method further comprises the following steps:
acquiring identity information of the video acquisition equipment;
acquiring account information and password information set by a user and appointed channel information appointed by the user from the plurality of channels;
generating initial link information based on the identity information, the specified channel information, the account information and the password information;
encrypting the initial link information to generate encrypted link information, and sending the encrypted link information to the video playing device;
before the first video information is acquired from the video acquisition equipment, connection is established with the video acquisition equipment;
acquiring login authentication information of the video acquisition equipment, and acquiring an authentication result based on the login authentication information;
if the authentication result is valid equipment, acquiring first video information from the video acquisition equipment;
the acquiring login authentication information of the video acquisition device and acquiring an authentication result based on the login authentication information comprises:
acquiring a registration message uploaded by the video acquisition equipment, wherein the registration message comprises identity information and version information of the video acquisition equipment;
judging whether the video acquisition equipment is valid equipment or not based on the registration message;
if the video acquisition equipment is valid equipment, feeding back confirmation information to the video acquisition equipment and generating an authentication result of the valid equipment;
and if the video acquisition equipment is invalid equipment, configuring new identity information for the video acquisition equipment, sending the new identity information to the video acquisition equipment and generating an authentication result of the invalid equipment.
2. The optimization method of claim 1, wherein after establishing the connection with the video capture device, the optimization method further comprises:
sending message information to the video playing server through the video acquisition equipment according to a preset sending period;
the video acquisition equipment judges whether response information fed back by the video playing server based on the message information is acquired or not, and acquires a judgment result;
and the video acquisition equipment executes corresponding communication operation based on the judgment result.
3. The optimization method according to claim 2, wherein the video capture device performs corresponding communication operations based on the determination result, including:
if the judgment result is that response information fed back by the playing server based on the message information is obtained, continuing to send the message information;
if the judgment result is that the response information fed back by the playing server based on the message information is not obtained, judging whether the abnormal time of not obtaining the response information reaches a preset abnormal time threshold value;
if the abnormal time reaches the preset abnormal time threshold, disconnecting the video playing server, reestablishing the connection with the video playing server, and continuing to send the message information after reestablishing the connection.
4. The optimization method according to claim 1, further comprising:
acquiring original video information and original audio information in real time through the video acquisition equipment;
generating, by the video capture device, a plurality of information blocks based on the original video information and original audio information;
storing the plurality of information blocks according to a preset sequence and a preset number through the video acquisition equipment;
the acquiring of the first video information from the video capture device includes:
and uploading an information block corresponding to the current time as first video information to the video playing server through the video acquisition equipment.
5. The optimization method according to claim 4, wherein the obtaining of the original video information and the original audio information by the video capture device in real time comprises:
acquiring initial configuration parameters of the video acquisition equipment;
obtaining the optimization operation of the user on the initial configuration parameters, and obtaining the optimized optimal configuration parameters;
and acquiring original video information and original audio information in real time based on the optimal configuration parameters.
6. The optimization method according to claim 4, wherein the processing the first video information to obtain a first video file comprises:
and caching the information block and generating the first video file based on the information block.
7. The optimization method according to any one of claims 1 to 4, further comprising:
under the condition that the video playing request is not acquired, judging whether the waiting time for not receiving the video playing request reaches preset idle time or not;
and if the waiting time reaches the preset idle time, deleting the currently cached video file.
CN201910008297.9A 2019-01-04 2019-01-04 Optimization method of live video Active CN109819278B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910008297.9A CN109819278B (en) 2019-01-04 2019-01-04 Optimization method of live video

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910008297.9A CN109819278B (en) 2019-01-04 2019-01-04 Optimization method of live video

Publications (2)

Publication Number Publication Date
CN109819278A CN109819278A (en) 2019-05-28
CN109819278B true CN109819278B (en) 2021-11-23

Family

ID=66604023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910008297.9A Active CN109819278B (en) 2019-01-04 2019-01-04 Optimization method of live video

Country Status (1)

Country Link
CN (1) CN109819278B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115705371A (en) * 2021-08-17 2023-02-17 鸿富锦精密工业(深圳)有限公司 Image marking and evidence storing method, system, terminal equipment and storage medium
CN113891044B (en) * 2021-09-29 2023-03-24 天翼物联科技有限公司 Video live broadcast method and device, computer equipment and computer readable storage medium
CN115243059A (en) * 2022-05-31 2022-10-25 广州播丫科技有限公司 Direct broadcast machine for realizing slow direct broadcast through monitoring camera and working method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657440A (en) * 2016-01-05 2016-06-08 福建星网智慧科技股份有限公司 Video broadcast method and system
CN105991414A (en) * 2015-02-15 2016-10-05 深圳市棱镜锐视科技有限公司 Method and system for video surveillance live broadcasting through intelligent terminal
CN108259975A (en) * 2018-02-01 2018-07-06 广州市百果园信息技术有限公司 Video broadcasting method, storage medium and terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101595884B1 (en) * 2009-07-16 2016-02-22 한화테크윈 주식회사 Monitoring camera method for controlling the same
CN107911706A (en) * 2017-12-18 2018-04-13 青岛国信发展(集团)有限责任公司 The audio/video player system and method for multi-brand compatibility

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105991414A (en) * 2015-02-15 2016-10-05 深圳市棱镜锐视科技有限公司 Method and system for video surveillance live broadcasting through intelligent terminal
CN105657440A (en) * 2016-01-05 2016-06-08 福建星网智慧科技股份有限公司 Video broadcast method and system
CN108259975A (en) * 2018-02-01 2018-07-06 广州市百果园信息技术有限公司 Video broadcasting method, storage medium and terminal

Also Published As

Publication number Publication date
CN109819278A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN108289187B (en) Method and system for accessing live webcast to video conference
EP3713224B1 (en) Live data processing method and system, and server
CN109819278B (en) Optimization method of live video
CN112738140B (en) Video stream transmission method, device, storage medium and equipment based on WebRTC
CN104883618B (en) Programme televised live tries method, apparatus and system
CN107172443A (en) Net cast methods, devices and systems
CN108881931B (en) Data buffering method and network equipment
US20200245020A1 (en) Method, system for processing a live-broadcasting data, and server thereof
WO2015120766A1 (en) Video optimisation system and method
WO2013017165A1 (en) Shaping media traffic based on manifest file in http adaptive streaming
CN104683734A (en) Video surveillance content adaptation method, system, central server and device
CN106412498B (en) monitoring data acquisition method and cloud terminal
CN103796045A (en) IPTV system, mobile terminal, and live broadcasting watching reminding realizing methods by IPTV system and mobile terminal
CN105959732A (en) Method and device for pushing television program
CN108924485A (en) Client live video stream interruption processing method and system, monitoring system
WO2017071428A1 (en) Fast forward/rewind processing method and terminal
CN118337764A (en) Video stream processing method and device, nonvolatile storage medium and electronic equipment
CN104639904A (en) Monitoring video code sending management system
CN109218645A (en) A kind of multi-medium data recording method and device
US10250402B2 (en) Communication method and storage medium storing communication program
CN113852866B (en) Media stream processing method, device and system
CN108076381B (en) Video display method, video forwarding equipment and system
KR101970200B1 (en) Method and system for multiple social network service live broadcasting at the same time based on image record apparatus
CN106358008B (en) Method for avoiding repeated call access and conference television terminal equipment
CN114286039A (en) Audio and video call method and system

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
TR01 Transfer of patent right

Effective date of registration: 20211221

Address after: 611732 No. 2, pengwen Road, China Sichuan cuisine Industrial Park, Pidu, Chengdu, Sichuan

Patentee after: CHENGDU IDEAL TECHNOLOGY DEVELOPMENT CO.,LTD.

Address before: 611730 room 401-506, unit 1, building 1, Hongji Yaju, No. 131, Chuangye commune, Jingrong Town, Pidu District, Chengdu, Sichuan

Patentee before: CHENGDU SUIANBAO NETWORK TECHNOLOGY CO.,LTD.

TR01 Transfer of patent right