CN111726657A - Live video playing processing method and device and server - Google Patents

Live video playing processing method and device and server Download PDF

Info

Publication number
CN111726657A
CN111726657A CN201910204010.XA CN201910204010A CN111726657A CN 111726657 A CN111726657 A CN 111726657A CN 201910204010 A CN201910204010 A CN 201910204010A CN 111726657 A CN111726657 A CN 111726657A
Authority
CN
China
Prior art keywords
frame
live video
video
gops
live
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910204010.XA
Other languages
Chinese (zh)
Inventor
张志新
文启源
杨磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo 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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201910204010.XA priority Critical patent/CN111726657A/en
Publication of CN111726657A publication Critical patent/CN111726657A/en
Pending legal-status Critical Current

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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • 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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • H04N21/23106Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving caching operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • H04N21/23113Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving housekeeping operations for stored content, e.g. prioritizing content for deletion because of storage space restrictions
    • 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/27Server based end-user applications
    • H04N21/274Storing end-user multimedia data in response to end-user request, e.g. network recorder
    • H04N21/2743Video hosting of uploaded data from client
    • 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/438Interfacing the downstream path of the transmission network originating from a server, e.g. retrieving MPEG packets from an IP network
    • H04N21/4383Accessing a communication channel
    • H04N21/4384Accessing a communication channel involving operations to reduce the access time, e.g. fast-tuning for reducing channel switching latency

Abstract

The invention discloses a method, a device and a server for playing and processing live video, wherein the method comprises the following steps: receiving a playing request of a live video stream sent by a watching end; judging whether a video frame to be transmitted currently of a live video stream is a key frame; if yes, taking the key frame as a first screen frame, and sending the live video stream to a watching end; if not, extracting the video frames of the n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as a first screen frame, and sending the live video stream to a watching end. According to the mode, the GOPs are cached, the video frames when the watching end is switched in are non-key frames, the live broadcast video stream is sent to the watching end by taking the frame 1 of the cached GOPs as the first screen frame, so that the watching end plays the historical video frames of the live broadcast video firstly and then plays the real-time live broadcast frames, the problem that the first screen loading time is long due to the fact that the video frames when the watching end is switched in are non-key frames can be avoided, the first screen loading of the live broadcast video is optimized, and the user experience is improved.

Description

Live video playing processing method and device and server
Technical Field
The invention relates to the technical field of live broadcast, in particular to a method, a device and a server for playing and processing live broadcast video.
Background
The video is based on the principle of human visual persistence, and by playing a series of pictures, human eyes can generate motion feeling, and the video is transmitted only by video pictures, so that the video volume is very large, and the video is unacceptable for the existing network and storage. The video contains a large amount of repeated information, and the video data can be greatly reduced by encoding the video to compress the large amount of repeated information, so that the video can be more conveniently transmitted and stored.
In the existing compression standards, I-frames, P-frames, and B-frames are used to represent transmitted video pictures. The I frame, also called intra-frame coded frame, is an independent frame with all information, and can be independently decoded without referring to other pictures, and the first frame in the GOP is always an I frame (key frame). The P frame, also called an inter-frame predictive coding frame, needs to refer to the previous I frame for coding, which means that the difference between the current frame picture and the previous frame (the previous frame may be an I frame or a P frame), and when decoding, the picture buffered before needs to be superimposed on the difference defined by the current frame to generate the final picture. The B frame is also called bidirectional predictive coding frame, that is, the B frame records the difference between the current frame and the previous and subsequent frames, that is, to decode the B frame, not only the previous buffer picture but also the decoded picture are obtained, and the final picture is obtained by the superposition of the previous and subsequent pictures and the current frame data.
In the live video scene, after the watching end establishes a connection with the streaming server, the streaming server issues the video stream to the watching end in sequence, however, if the video frame to be issued when the watching end switches in is a B frame or a P frame, then the watching end needs to wait until the I frame is issued before decoding and playing the video, then the user starts the live video playing request, the watching end cannot normally play the video within a period of time and the first screen is blank, the live video can be normally played after waiting for a certain period of time, for the user, the live video can be watched after waiting for a period of time after the playing request is started, and the problem of overlong first screen loading time can cause user experience to be poor.
Disclosure of Invention
In view of the above, the present invention is proposed to provide a method, an apparatus and a server for playing and processing a live video, which overcome or at least partially solve the above problems.
According to an aspect of the present invention, a method for playing and processing a live video is provided, including:
receiving a playing request of a live video stream sent by a watching end;
judging whether a video frame to be transmitted currently of a live video stream is a key frame;
if yes, taking the key frame as a first screen frame, and sending the live video stream to a watching end;
if not, extracting the video frames of n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as a first screen frame, and sending the live video stream to a watching end, wherein n is greater than or equal to 1.
Optionally, the n GOPs stored in the buffer queue are n GOPs located before the GOP to which the current video frame to be delivered belongs.
Optionally, the method further comprises:
receiving a video frame of a live video stream uploaded by a main broadcasting end;
storing the uploaded video frames into a buffer queue;
and judging whether the quantity of the stored GOPs in the buffer queue is greater than or equal to n +1, and if so, deleting the GOP with the earliest time stamp in the buffer queue.
Optionally, the value of n is determined according to a preset caching strategy; the preset caching strategy is set according to the requirement of the playing fluency and/or the playing instantaneity of the service scene.
Optionally, the preset caching policy includes:
the higher the requirement on the playing fluency of the service scene is, the larger the value of the set n is; and the higher the real-time playing requirement of the service scene is, the smaller the value of the set n is.
According to another aspect of the present invention, there is provided a playback processing apparatus for live video, including:
the receiving module is suitable for receiving a playing request of a live video stream sent by a watching end;
the judging module is suitable for judging whether a video frame to be transmitted currently of the live video stream is a key frame;
the issuing module is suitable for issuing the live video stream to the watching end by taking the key frame as the first screen frame if the judging module judges that the video frame to be issued of the live video stream currently is the key frame;
the issuing module is further adapted to: if the judgment module judges that the video frame to be transmitted of the live video stream is not the key frame, extracting the video frames of n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as the first screen frame, and transmitting the live video stream to a watching end, wherein n is greater than or equal to 1.
Optionally, the n GOPs stored in the buffer queue are n GOPs located before the GOP to which the current video frame to be delivered belongs.
Optionally, the receiving module is further adapted to: receiving a video frame of a live video stream uploaded by a main broadcasting end, and storing the uploaded video frame into a cache queue;
the determination module is further adapted to: judging whether the number of stored GOPs in the buffer queue is greater than or equal to n + 1;
the apparatus further comprises: and the deleting module is suitable for deleting the GOP with the earliest time stamp in the cache queue if the judging module judges that the number of the stored GOPs in the cache queue is greater than or equal to n + 1.
Optionally, the value of n is determined according to a preset caching strategy; the preset caching strategy is set according to the requirement of the playing fluency and/or the playing instantaneity of the service scene.
Optionally, the preset caching policy includes:
the higher the requirement on the playing fluency of the service scene is, the larger the value of the set n is; and
the higher the real-time playing requirement of the service scene is, the smaller the value of n is set to be.
According to still another aspect of the present invention, there is provided a server including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the playing processing method of the live video.
According to another aspect of the present invention, a computer storage medium is provided, where at least one executable instruction is stored in the storage medium, and the executable instruction causes a processor to perform an operation corresponding to the above live video playing processing method.
The invention provides a corresponding live video playing processing method aiming at two conditions that whether a video frame is a key frame or not when a watching end is cut in, on one hand, a plurality of GOPs are cached, when the video frame is a non-key frame when the watching end is cut in, a1 st frame of the cached GOPs is used as a first screen frame to send a live video stream to the watching end, so that the watching end firstly plays a historical video picture of the live video and then plays a real-time live video, and the problem of long first screen waiting time caused by the fact that the video frame is a non-key frame when the watching end is cut in can be avoided; on the other hand, when the video frame cut by the watching end is a key frame, the live video stream is directly issued by taking the key frame as the first screen frame, and the watching end can normally play the video immediately. Through the two aspects, the user can initiate the live video playing request at any time, the watching end can normally play the video, the waiting time of first screen loading is reduced, the first screen loading of the live video is optimized, and the user experience is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flow chart illustrating a method for playing a live video according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for playing a live video according to another embodiment of the present invention;
fig. 3 is a functional block diagram showing a playback processing apparatus for live video according to still another embodiment of the present invention;
fig. 4 shows a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a flowchart illustrating a method for playing and processing live video according to an embodiment of the present invention, where the method is applied to a streaming server, but the present invention is not limited thereto, and as shown in fig. 1, the method includes:
step S101, receiving a playing request of a live video stream sent by a watching end.
In this embodiment, streaming is used for video data. The watching end can be a live broadcast application capable of providing live broadcast service, the watching end initiates a broadcast request of a live broadcast video stream to the stream server according to the operation of playing a live broadcast video executed by a user so as to establish connection with the stream server, and the stream server issues the live broadcast video stream after establishing connection with the watching end.
Step S102, judging whether a video frame to be transmitted currently of the live video stream is a key frame, if not, executing step S103; if yes, go to step S104.
When a play request of a live video stream sent by a watching end is received, whether a video frame to be currently transmitted in the live video stream uploaded by the live end is a key frame (I frame) or not is judged, namely whether the video frame to be transmitted when the watching end switches in is judged.
Step S103, extracting the video frames of n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as the first screen frame, and sending the live video stream to a watching end, wherein n is greater than or equal to 1.
If the video frame to be currently transmitted is not a key frame, if the live video stream is directly transmitted to the watching end by taking the video frame as the first screen frame according to the existing live video playing processing method, the watching end needs to wait for receiving the next key frame and then can normally play the video, and the watching end presents a black screen in the period, so that the user experience is not good.
Based on this, in this embodiment, n GOPs in the live video stream uploaded by the live end are cached, and when the watching end and the stream server are successfully connected, the stream server sequentially issues the n GOPs in the cache queue to the watching end, so that the watching end can play videos quickly. According to the coding rule, each GOP takes a key frame as an initial frame, then, the 1 st frame of the n GOPs is taken as a first screen frame to send the live video stream to a watching end in sequence, and the watching end can play the video normally.
The n videos in the buffer queue are specifically n GOPs located before the GOP to which the video frame to be delivered belongs, and then the n GOPs correspond to historical video pictures of the live video. The value of n may be set according to the requirements of the service scenario, which is not limited in the present invention.
Therefore, by adopting the mode, even if the video frame to be transmitted is a non-key video frame when the watching end is connected with the stream server, the watching end can firstly play the historical live video and then play the real-time live video by transmitting the live video stream by taking the 1 st video frame of the n cached GOPs as the first screen frame. That is to say, when a user initiates a request for playing a live video, if a video frame to be currently delivered is not a key frame, a historical video frame of the live video is played first, and after the historical video frame is played, a watching end also receives the key frame, and then a real-time live video frame can be played.
And step S104, taking the key frame as a first screen frame, and sending the live video stream to a watching end.
If the video frame to be sent is a key frame, the key frame is directly used as a first screen frame, the live video stream is sent to the watching end, in this case, the key frame is received by the watching end firstly, and the video can be played normally by decoding the received live video stream according to the key frame. That is, the user can watch the live video soon after initiating the request for playing the live video.
In short, with the method of this embodiment, the viewing end can get the key frame first when connecting with the streaming server at any time, whereas in the prior art, if the cut-in time is not appropriate, it needs to wait for a period of time before getting the key frame. Therefore, compared with the prior art, the method of the embodiment can reduce the waiting time of the first screen loading.
In summary, the mode provides a live video playing processing method for two situations of whether a video frame when a watching end is cut in is a key frame, on one hand, a plurality of GOPs are cached, when the video frame when the watching end is cut in is a non-key frame, the frame 1 of the cached GOPs is used as a first screen frame to send a live video stream to the watching end, so that the watching end firstly plays a historical video picture of the live video and then plays a real-time live video, and the problem of long first screen waiting time caused by the fact that the video frame when the watching end is cut in is a non-key frame can be avoided; on the other hand, when the video frame cut by the watching end is a key frame, the live video stream is directly issued by taking the key frame as the first screen frame, and the watching end can normally play the video immediately. Through the two aspects, the user can initiate the live video playing request at any time, the watching end can normally play the video, the waiting time of first screen loading is reduced, the first screen loading of the live video is optimized, and the user experience is improved.
Fig. 2 is a flowchart illustrating a method for playing a live video according to another embodiment of the present invention, where as shown in fig. 2, the method includes:
step S201, receiving a video frame of a live video stream uploaded by a host, and storing the uploaded video frame in a buffer queue.
In this embodiment, streaming is used for video data. The anchor terminal can refer to a live broadcast application capable of providing live broadcast service, a live broadcast entrance is provided in the live broadcast application for live broadcast of the anchor, and a live broadcast video watching entrance is also provided for a user to watch live broadcast video. If the user carries out live broadcasting through a live broadcasting entrance in the live broadcasting application, the live broadcasting application at the moment can be regarded as a live broadcasting end, and correspondingly, if the user watches live broadcasting videos through a watching entrance in the live broadcasting application, the live broadcasting application at the moment can be regarded as a watching end. Of course, the anchor terminal may also refer to a distribution server corresponding to the live application, and is used to upload the live video stream to the streaming server, which is not limited in the present invention.
After receiving the video frame of the live video stream uploaded by the main broadcasting end, the video frame is transmitted to the watching end which is playing the live video stream at present on one hand, and the video frame is cached in the cache queue on the other hand.
Step S202, judging whether the quantity of the stored GOPs in the buffer queue is larger than or equal to n +1, if so, deleting the GOP with the earliest time stamp in the buffer queue.
In this embodiment, instead of caching all the video frames uploaded by the anchor terminal, only part of the GOPs are cached, the anchor terminal uploads the video frames to the stream server according to the time stamp sequence of each video frame, and the stream server also caches each video frame in the cache queue according to the time stamp sequence of each video frame. In this step, when it is determined that the number of GOPs stored in the buffer queue is greater than or equal to n +1, the GOP with the earliest timestamp in the buffer queue is deleted, and thus, the number of complete GOPs stored in the buffer queue is always n. For example, a GOP in the buffer queue includes: GOP (1), GOP (2) … … GOP (n), and the first S video frames belonging to GOP (n +1), while the anchor continues to upload video frames, when all the remaining video frames of GOP (n +1) are input to the buffer queue, the GOPs in the buffer queue include: GOP (1), GOP (2) … … GOP (n), and GOP (n +1), at this time, when the number of GOPs in the buffer queue reaches n +1, the GOP1 is deleted, where GOP (1) is the earliest compared to other GOP timestamps in the buffer queue, and thus the buffer queue in this embodiment is a first-in first-out queue.
And if the stored GOPs in the buffer queue are judged not to be more than or equal to n +1, continuing to store the video frames of the live video stream uploaded by the main broadcasting end into the buffer queue.
Step S203, receiving a play request of the live video stream sent by the viewer.
The watching end can be a live broadcast application capable of providing live broadcast service, the watching end initiates a broadcast request of a live broadcast video stream to the stream server according to the operation of playing a live broadcast video executed by a user so as to establish connection with the stream server, and the stream server sends the live broadcast video stream to the watching end after establishing connection with the watching end.
Step S204, judging whether the video frame to be sent down currently of the live video stream is a key frame, if not, executing step S205; if yes, go to step S206.
When a play request of a live video stream sent by a watching end is received, whether a video frame to be currently transmitted in the live video stream uploaded by the live end is a key frame (I frame) or not is judged, namely whether the video frame to be transmitted when the watching end switches in is judged.
Step S205, extracting the video frames of n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as the first screen frame, and sending the live video stream to a watching end, wherein n is greater than or equal to 1.
If the video frame to be currently transmitted is not a key frame, if the live video stream is directly transmitted to the watching end by taking the video frame as the first screen frame according to the existing live video playing processing method, the watching end needs to wait for receiving the next key frame and then can normally play the video, and the watching end presents a black screen in the period, so that the user experience is not good.
Based on this, in this embodiment, n GOPs in the live video stream uploaded by the live end are cached, and when the watching end and the stream server are successfully connected, the stream server sequentially issues the n GOPs in the cache queue to the watching end, so that the watching end can play videos quickly. According to the coding rule, each GOP takes a key frame as an initial frame, then, the 1 st frame of the n GOPs is taken as a first screen frame to send the live video stream to a watching end in sequence, and the watching end can play the video normally.
The n GOPs stored in the buffer queue are n GOPs located before the GOP to which the video frame to be currently delivered belongs, and then the n GOPs correspond to historical video pictures of the live video. Therefore, by adopting the mode, even if the video frame to be transmitted is a non-key video frame when the watching end is connected with the stream server, the watching end can firstly play the historical live video and then play the real-time live video by transmitting the live video stream by taking the 1 st video frame of the n cached GOPs as the first screen frame. That is to say, when a user initiates a request for playing a live video, if a video frame to be currently delivered is not a key frame, a historical video frame of the live video is played first, and after the historical video frame is played, a watching end also receives the key frame, and then a real-time live video frame can be played.
In addition, n can be determined according to a preset caching strategy, and the preset caching strategy is set according to the playing fluency requirement and/or the playing real-time requirement of the service scene. Specifically, the preset caching policy includes: the higher the requirement on the smoothness of playing the service scene is, the larger the value of the setting n is, and the higher the requirement on the real-time performance of playing the service scene is, the smaller the value of the setting n is. For example, for some video frames uploaded by the b (business) side, if the real-time performance of live broadcasting is high, the value of n may be set to be small, and then the viewing side only plays a small section of historical video frame when switching in; for some video frames uploaded by a Client, if a live video is expected to be played smoothly, the value of n can be set to be larger, so that the time for playing a historical video picture is longer when a watching end is switched in, and meanwhile, the more video frames are sent by a streaming server, the more the live video is played smoothly.
It should be noted that the longer time is only relatively speaking, since it is not reasonable to play too many historical video frames in the live scene, a person skilled in the art can set the value of n according to actual situations, and since the time interval between video frames is also small, the time of actually playing the historical video frames is not very long.
And step S206, taking the key frame as a first screen frame, and sending the live video stream to a watching end.
If the video frame to be sent is a key frame, the key frame is directly used as a first screen frame, the live video stream is sent to the watching end, in this case, the key frame is received by the watching end firstly, and the video can be played normally by decoding the received live video stream according to the key frame. Equivalently, the user can watch the live video immediately after initiating the playing request of the live video.
In short, with the method of this embodiment, the viewing end can get the key frame first when connecting with the streaming server at any time, whereas in the prior art, if the cut-in time is not appropriate, it needs to wait for a period of time before getting the key frame. Therefore, compared with the prior art, the method of the embodiment can reduce the waiting time of the first screen loading.
In summary, the method provides a live video playing processing method for two situations of whether a video frame is a key frame or not when a watching end switches in, on one hand, a fixed number of GOPs uploaded by the live video playing end are cached, when the video frame is a non-key frame when the watching end switches in, a live video stream is issued to the watching end by taking the frame 1 of the cached GOPs as a first screen frame, so that the watching end firstly plays a historical video picture of the live video and then plays a real-time live video, and the problem of long first screen waiting time caused by the fact that the video frame is a non-key frame when the watching end switches in can be avoided; on the other hand, when the video frame cut by the watching end is a key frame, the live video stream is directly issued by taking the key frame as the first screen frame, and the watching end can normally play the video immediately. Through the two aspects, the user can initiate the live video playing request at any time, the watching end can normally play the video, the waiting time of first screen loading is reduced, the first screen loading of the live video is optimized, and the user experience is improved.
Fig. 3 is a functional block diagram of a live video playback processing apparatus according to still another embodiment of the present invention, and as shown in fig. 3, the apparatus includes:
a receiving module 31, adapted to receive a play request of a live video stream sent by a viewing end;
the judging module 32 is adapted to judge whether a video frame to be currently transmitted of the live video stream is a key frame;
the issuing module 33 is adapted to issue the live video stream to the watching end by taking the key frame as the first screen frame if the judging module judges that the video frame to be issued of the live video stream currently is the key frame;
the down-sending module 33 is further adapted to: if the judgment module judges that the video frame to be transmitted of the live video stream is not the key frame, extracting the video frames of n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as the first screen frame, and transmitting the live video stream to a watching end, wherein n is greater than or equal to 1.
Optionally, the n GOPs stored in the buffer queue are n GOPs located before the GOP to which the current video frame to be delivered belongs.
Optionally, the receiving module 31 is further adapted to: receiving a video frame of a live video stream uploaded by a main broadcasting end, and storing the uploaded video frame into a cache queue;
the determination module 32 is further adapted to: judging whether the number of stored GOPs in the buffer queue is greater than or equal to n + 1;
the apparatus further comprises: and the deleting module is suitable for deleting the GOP with the earliest time stamp in the cache queue if the judging module judges that the number of the stored GOPs in the cache queue is greater than or equal to n + 1.
Optionally, the value of n is determined according to a preset caching strategy; the preset caching strategy is set according to the requirement of the playing fluency and/or the playing instantaneity of the service scene.
Optionally, the preset caching policy includes: the higher the requirement on the playing fluency of the service scene is, the larger the value of the set n is; and the higher the real-time playing requirement of the service scene is, the smaller the value of the set n is.
The embodiment of the application provides a non-volatile computer storage medium, wherein at least one executable instruction is stored in the computer storage medium, and the computer executable instruction can execute the playing processing method of the live video in any method embodiment.
Fig. 4 is a schematic structural diagram of a server according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the server.
As shown in fig. 4, the server may include: a processor (processor)402, a Communications Interface 404, a memory 406, and a Communications bus 408.
Wherein:
the processor 402, communication interface 404, and memory 406 communicate with each other via a communication bus 408.
A communication interface 404 for communicating with network elements of other devices, such as clients or other servers.
The processor 402 is configured to execute the program 410, and may specifically execute relevant steps in the above-described live video playing processing method embodiment.
In particular, program 410 may include program code comprising computer operating instructions.
The processor 402 may be a central processing unit CPU, or an application specific Integrated circuit asic, or one or more Integrated circuits configured to implement an embodiment of the present invention. The server comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 406 for storing a program 410. Memory 406 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 410 may specifically be configured to cause the processor 402 to perform the following operations:
receiving a playing request of a live video stream sent by a watching end;
judging whether a video frame to be transmitted currently of a live video stream is a key frame;
if yes, taking the key frame as a first screen frame, and sending the live video stream to a watching end;
if not, extracting the video frames of n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as a first screen frame, and sending the live video stream to a watching end, wherein n is greater than or equal to 1.
In an optional manner, the n GOPs stored in the buffer queue are n GOPs located before the GOP to which the current video frame to be delivered belongs.
In an alternative approach, the program 410 may be further configured to cause the processor 402 to: receiving a video frame of a live video stream uploaded by a main broadcasting end; storing the uploaded video frames into a buffer queue; and judging whether the quantity of the stored GOPs in the buffer queue is greater than or equal to n +1, and if so, deleting the GOP with the earliest time stamp in the buffer queue.
In an optional manner, the value of n is determined according to a preset caching policy; the preset caching strategy is set according to the requirement of the playing fluency and/or the playing instantaneity of the service scene.
In an optional manner, the higher the requirement on the fluency of playing a service scene is, the larger the value of n is set; and the higher the real-time playing requirement of the service scene is, the smaller the value of the set n is.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in a live video playback processing apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses: A1. a method for playing and processing live video comprises the following steps:
receiving a playing request of a live video stream sent by a watching end;
judging whether a video frame to be transmitted currently of the live video stream is a key frame;
if yes, the key frame is taken as a first screen frame, and a live video stream is sent to the watching end;
if not, extracting the video frames of n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as a first screen frame, and sending the live video stream to the watching end, wherein n is greater than or equal to 1.
A2. The method according to a1, wherein the n GOPs stored in the buffer queue are n GOPs located before a GOP to which the current video frame to be delivered belongs.
A3. The method of a1, wherein the method further comprises:
receiving a video frame of a live video stream uploaded by a main broadcasting end;
storing the uploaded video frames into the buffer queue;
and judging whether the quantity of the stored GOPs in the cache queue is greater than or equal to n +1, and if so, deleting the GOP with the earliest time stamp in the cache queue.
A4. The method according to A1, wherein the value of n is determined according to a preset caching strategy; the preset caching strategy is set according to the requirement of the playing fluency and/or the playing instantaneity of the service scene.
A5. The method according to a4, wherein the preset caching policy includes:
the higher the requirement on the playing fluency of the service scene is, the larger the value of the set n is; and the higher the real-time playing requirement of the service scene is, the smaller the value of the set n is.
B6. A playback processing apparatus for live video, comprising:
the receiving module is suitable for receiving a playing request of a live video stream sent by a watching end;
the judging module is suitable for judging whether the video frame to be transmitted currently of the live video stream is a key frame;
the issuing module is suitable for issuing the live video stream to the watching end by taking the key frame as a first screen frame if the judging module judges that the video frame to be issued of the live video stream currently is the key frame;
the issuing module is further adapted to: if the judgment module judges that the video frame to be transmitted of the live video stream is not the key frame, extracting the video frames of n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as the first screen frame, and transmitting the live video stream to the watching end, wherein n is greater than or equal to 1.
B7. The apparatus according to B6, wherein the n GOPs stored in the buffer queue are n GOPs located before a GOP to which the current video frame to be delivered belongs.
B8. The apparatus of B6, wherein the receiving means is further adapted to: receiving a video frame of a live video stream uploaded by a main broadcasting end, and storing the uploaded video frame into the cache queue;
the determination module is further adapted to: judging whether the number of stored GOPs in the buffer queue is greater than or equal to n + 1;
the apparatus further comprises: and the deleting module is suitable for deleting the GOP with the earliest timestamp in the cache queue if the judging module judges that the number of the stored GOPs in the cache queue is greater than or equal to n + 1.
B9. The device according to B6, wherein the value of n is determined according to a preset caching policy; the preset caching strategy is set according to the requirement of the playing fluency and/or the playing instantaneity of the service scene.
B10. The apparatus of B9, wherein the preset caching policy includes:
the higher the requirement on the playing fluency of the service scene is, the larger the value of the set n is; and
the higher the real-time playing requirement of the service scene is, the smaller the value of n is set to be.
C11. A server, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the playing processing method of the live video in any one of A1-A5.
D12. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction causes a processor to execute an operation corresponding to the method for processing the playing of the live video in any one of a1-a 5.

Claims (10)

1. A method for playing and processing live video comprises the following steps:
receiving a playing request of a live video stream sent by a watching end;
judging whether a video frame to be transmitted currently of the live video stream is a key frame;
if yes, the key frame is taken as a first screen frame, and a live video stream is sent to the watching end;
if not, extracting the video frames of n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as a first screen frame, and sending the live video stream to the watching end, wherein n is greater than or equal to 1.
2. The method according to claim 1, wherein the n GOPs stored in the buffer queue are n GOPs before a GOP to which the current video frame to be delivered belongs.
3. The method of claim 1, wherein the method further comprises:
receiving a video frame of a live video stream uploaded by a main broadcasting end;
storing the uploaded video frames into the buffer queue;
and judging whether the quantity of the stored GOPs in the cache queue is greater than or equal to n +1, and if so, deleting the GOP with the earliest time stamp in the cache queue.
4. The method of claim 1, wherein the value of n is determined according to a preset caching policy; the preset caching strategy is set according to the requirement of the playing fluency and/or the playing instantaneity of the service scene.
5. The method of claim 4, wherein the preset caching policy comprises:
the higher the requirement on the playing fluency of the service scene is, the larger the value of the set n is; and the higher the real-time playing requirement of the service scene is, the smaller the value of the set n is.
6. A playback processing apparatus for live video, comprising:
the receiving module is suitable for receiving a playing request of a live video stream sent by a watching end;
the judging module is suitable for judging whether the video frame to be transmitted currently of the live video stream is a key frame;
the issuing module is suitable for issuing the live video stream to the watching end by taking the key frame as a first screen frame if the judging module judges that the video frame to be issued of the live video stream currently is the key frame;
the issuing module is further adapted to: if the judgment module judges that the video frame to be transmitted of the live video stream is not the key frame, extracting the video frames of n GOPs from the buffer queue, taking the 1 st frame of the n GOPs as the first screen frame, and transmitting the live video stream to the watching end, wherein n is greater than or equal to 1.
7. The apparatus according to claim 6, wherein the n GOPs stored in the buffer queue are n GOPs before a GOP to which the current video frame to be delivered belongs.
8. The apparatus of claim 6, wherein the receiving means is further adapted to: receiving a video frame of a live video stream uploaded by a main broadcasting end, and storing the uploaded video frame into the cache queue;
the determination module is further adapted to: judging whether the number of stored GOPs in the buffer queue is greater than or equal to n + 1;
the apparatus further comprises: and the deleting module is suitable for deleting the GOP with the earliest timestamp in the cache queue if the judging module judges that the number of the stored GOPs in the cache queue is greater than or equal to n + 1.
9. A server, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the playing processing method of the live video in any one of claims 1-5.
10. A computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the method for processing live video according to any one of claims 1-5.
CN201910204010.XA 2019-03-18 2019-03-18 Live video playing processing method and device and server Pending CN111726657A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910204010.XA CN111726657A (en) 2019-03-18 2019-03-18 Live video playing processing method and device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910204010.XA CN111726657A (en) 2019-03-18 2019-03-18 Live video playing processing method and device and server

Publications (1)

Publication Number Publication Date
CN111726657A true CN111726657A (en) 2020-09-29

Family

ID=72562309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910204010.XA Pending CN111726657A (en) 2019-03-18 2019-03-18 Live video playing processing method and device and server

Country Status (1)

Country Link
CN (1) CN111726657A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112333461A (en) * 2020-11-04 2021-02-05 北京金山云网络技术有限公司 Method and device for starting live video
CN112954389A (en) * 2021-03-11 2021-06-11 山东云缦智能科技有限公司 Method for quickly changing channel
CN113905196A (en) * 2021-08-30 2022-01-07 浙江大华技术股份有限公司 Video frame management method, video recorder and computer readable storage medium
CN114760522A (en) * 2020-12-29 2022-07-15 阿里巴巴集团控股有限公司 Data processing method, device and equipment
WO2023284428A1 (en) * 2021-07-14 2023-01-19 腾讯科技(深圳)有限公司 Live video playback method and apparatus, electronic device, storage medium, and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070195892A1 (en) * 2006-02-17 2007-08-23 Kwang-Pyo Choi Data receiving device and method for shortening channel switching time in digital multimedia broadcasting system
CN101316357A (en) * 2008-06-30 2008-12-03 华为技术有限公司 Channel switching method, terminal and medium service apparatus
CN106713941A (en) * 2017-01-04 2017-05-24 北京百度网讯科技有限公司 Audio and video live broadcast implementation method and server
CN106998485A (en) * 2016-01-25 2017-08-01 百度在线网络技术(北京)有限公司 Net cast method and device
CN107483976A (en) * 2017-09-26 2017-12-15 武汉斗鱼网络科技有限公司 Live management-control method, device and electronic equipment
CN107801049A (en) * 2016-09-05 2018-03-13 杭州海康威视数字技术股份有限公司 A kind of real-time video transmission, player method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070195892A1 (en) * 2006-02-17 2007-08-23 Kwang-Pyo Choi Data receiving device and method for shortening channel switching time in digital multimedia broadcasting system
CN101316357A (en) * 2008-06-30 2008-12-03 华为技术有限公司 Channel switching method, terminal and medium service apparatus
CN106998485A (en) * 2016-01-25 2017-08-01 百度在线网络技术(北京)有限公司 Net cast method and device
CN107801049A (en) * 2016-09-05 2018-03-13 杭州海康威视数字技术股份有限公司 A kind of real-time video transmission, player method and device
CN106713941A (en) * 2017-01-04 2017-05-24 北京百度网讯科技有限公司 Audio and video live broadcast implementation method and server
CN107483976A (en) * 2017-09-26 2017-12-15 武汉斗鱼网络科技有限公司 Live management-control method, device and electronic equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112333461A (en) * 2020-11-04 2021-02-05 北京金山云网络技术有限公司 Method and device for starting live video
CN114760522A (en) * 2020-12-29 2022-07-15 阿里巴巴集团控股有限公司 Data processing method, device and equipment
CN112954389A (en) * 2021-03-11 2021-06-11 山东云缦智能科技有限公司 Method for quickly changing channel
WO2023284428A1 (en) * 2021-07-14 2023-01-19 腾讯科技(深圳)有限公司 Live video playback method and apparatus, electronic device, storage medium, and program product
CN113905196A (en) * 2021-08-30 2022-01-07 浙江大华技术股份有限公司 Video frame management method, video recorder and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN111726657A (en) Live video playing processing method and device and server
CA2965484C (en) Adaptive bitrate streaming latency reduction
WO2016131223A1 (en) Frame loss method for video frame and video sending apparatus
CN110784740A (en) Video processing method, device, server and readable storage medium
CN107566918B (en) A kind of low delay under video distribution scene takes the neutrel extraction of root
CN106998485B (en) Video live broadcasting method and device
CN111447455A (en) Live video stream playback processing method and device and computing equipment
WO2018076998A1 (en) Method and device for generating playback video file
US11128897B2 (en) Method for initiating a transmission of a streaming content delivered to a client device and access point for implementing this method
CN110519640B (en) Video processing method, encoder, CDN server, decoder, device, and medium
CN113141522B (en) Resource transmission method, device, computer equipment and storage medium
CN110582012B (en) Video switching method, video processing device and storage medium
CN109348279A (en) A kind of plug-flow method, apparatus, equipment and storage medium
CN107801049B (en) Real-time video transmission and playing method and device
CN111726641A (en) Live video playing processing method and device and server
CN112423140A (en) Video playing method and device, electronic equipment and storage medium
CN111010603A (en) Video caching and forwarding processing method and device
CN114501052B (en) Live broadcast data processing method, cloud platform, computer equipment and storage medium
WO2017071428A1 (en) Fast forward/rewind processing method and terminal
CN112291591A (en) Video data playback method, electronic equipment and storage medium
US9467691B2 (en) Video system for displaying image data, method and computer program
CN110798700B (en) Video processing method, video processing device, storage medium and electronic equipment
CN114051150A (en) Live broadcast method and device, electronic equipment and computer readable storage medium
CN114079796A (en) Channel switching method, device and system
EP3210383A1 (en) Adaptive bitrate streaming latency reduction

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