WO2015058590A1 - Control method, device and system for live broadcast of video, and storage medium - Google Patents

Control method, device and system for live broadcast of video, and storage medium Download PDF

Info

Publication number
WO2015058590A1
WO2015058590A1 PCT/CN2014/086055 CN2014086055W WO2015058590A1 WO 2015058590 A1 WO2015058590 A1 WO 2015058590A1 CN 2014086055 W CN2014086055 W CN 2014086055W WO 2015058590 A1 WO2015058590 A1 WO 2015058590A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
frame
key frame
key
frames
Prior art date
Application number
PCT/CN2014/086055
Other languages
French (fr)
Chinese (zh)
Inventor
胡兴华
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2015058590A1 publication Critical patent/WO2015058590A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/65Transmission of management data between client and server
    • H04N21/658Transmission by the client directed to the server
    • H04N21/6583Acknowledgement

Definitions

  • the invention relates to a video live broadcast control method, device and system and storage medium.
  • the patent application is filed on October 21, 2013, and the application number is 201310495767.1, the applicant is Tencent Technology (Shenzhen) Co., Ltd., and the invention name is "a video.”
  • the priority of the Chinese patent application of the method, the device and the system of the present disclosure is incorporated herein by reference.
  • the present invention relates to the field of computer technologies, and in particular, to a video live broadcast control method, device, system, and storage medium. Background technique
  • a frame is a single image of the smallest unit in a video or animation, equivalent to each shot on a film.
  • the key frame is a complete reservation of one frame.
  • the frame between two key frames is a non-key frame, which may be generally referred to as a transition frame or an intermediate frame.
  • the frame in which the prediction frame records the prediction information is also called a prediction frame, and the prediction information recorded according to the prediction frame may be in the decoding process.
  • the image is obtained by combining key frame decoding, and the transition frame generally refers to a P frame, a B frame, and the like.
  • a key frame generally refers to an I frame, which records information of an entire image. Therefore, a frame I picture takes a much larger space than a predicted frame P frame and a bidirectionally predicted frame B frame, especially when the video dynamic is not large.
  • the volume of an I picture will be more than 10 times the volume of a P picture or a B picture.
  • the number of normal P frames is the most, and the number is much larger than the other two frames.
  • the overall space occupied by the P frame is not the most, so excessive use of the I frame will reduce the compression efficiency, and the file will become larger or the resolution will decrease.
  • the key frame is used in the video position of the scene switching to maximize its value. If it is used in the video position of non-scene switching, it not only wastes space, but also affects the overall quality of the video. When using the specified bit rate, excessive use of I Frames can cause the overall quality of the video to drop.
  • the current live broadcast service provides video coding from the anchor device to the video server, and the video server distributes the video code to each user device.
  • the video encoding typically has a keyframe around 10 seconds.
  • the intermediate transition frame cannot be displayed, so it is necessary to wait until 10 seconds later to receive a complete key frame before the normal decoding occurs.
  • Picture In order to solve the problem that the picture cannot be displayed due to the loss of key frames, or the phenomenon of displaying the screen, the current solution to this problem is to increase the frequency of occurrence of key frames, for example: Adjusting to a key frame occurs in 2-3 seconds. Thus, when the key frame data is lost, the time of its impact is reduced from 10 seconds to 2-3 seconds.
  • the above scheme improves the frequency of occurrence of key frames (ie, shortening the spacing of key frames), which greatly increases the bit rate of the video, which imposes extremely high requirements on the bandwidth, even Causing network congestion.
  • the embodiment of the invention provides a video live broadcast control method, device, system and storage medium, which are used for eliminating the phenomenon that the picture cannot be displayed and the screen is caused by the loss of the key frame, and the data transmission amount is reduced, the bandwidth requirement is reduced, and the network is made. More fluid.
  • an embodiment of the present invention provides a video live broadcast control method, including:
  • the video server forwards the video frame of the autonomous device to the user equipment, where the video frame includes key frames and non-key frames;
  • the video server monitors whether a key frame loss occurs in the video frame
  • the notification message is sent to the anchor device, so that the anchor device sends a new key frame.
  • the embodiment of the present invention further provides a video live broadcast control method, including: receiving, by a user equipment, a video frame from an anchor device that is forwarded by a video server, where the video frame packet includes a key frame and a non-key frame;
  • the user equipment receives a new key frame from the anchor device forwarded by the video server when decoding the current video frame is unsuccessful, discarding the unsuccessfully decoded video frame, and receiving the new Non-keyframes of keyframes;
  • the embodiment of the present invention further provides a video live broadcast control method, including: the anchor device collects video data that needs to be broadcasted in real time into a video frame, and sends a video frame to the user equipment through the video server, where the video frame Contains keyframes and non-keyframes;
  • the anchor device sends a new key frame to the user equipment by using the video server.
  • the embodiment of the present invention further provides a video server, including:
  • a forwarding control unit configured to control a video frame of the future autonomous device to be forwarded to the user equipment, where the video frame includes a key frame and a non-key frame;
  • a frame loss monitoring unit configured to monitor whether a key frame is lost in the video frame
  • the information sending unit is configured to: if the frame loss monitoring unit detects that a key frame is lost, send the notification information to the anchor device, so that the anchor device sends a new key frame.
  • the embodiment of the present invention further provides a user equipment, including:
  • a video receiving unit configured to receive a video frame from the anchor device forwarded by the video server, where the video frame includes a key frame and a non-key frame; receive a video frame after the re-encoded key frame; and a frame determining unit, configured to determine Whether a new key frame from the anchor device forwarded by the video server is received when the current video frame decoding is unsuccessful;
  • a frame loss control unit configured to discard the unsuccessfully decoded video frame if a new key frame from the anchor device forwarded by the video server is received when the current video frame is unsuccessfully decoded;
  • the video a receiving unit, configured to receive a non-key frame of the new key frame;
  • a decoding unit configured to decode the received new key frame and its non-key frame
  • a display unit configured to display a video picture decoded by the decoding unit.
  • the embodiment of the present invention further provides an anchor device, including:
  • a data collection unit configured to collect video data that needs to be broadcasted at present
  • a coding unit configured to encode video data collected by the data collection unit into a video frame, where the video frame includes a key frame and a non-key frame;
  • a sending unit configured to send, by using a video server, a video frame obtained by encoding the coding unit to a user equipment;
  • An information receiving unit configured to receive notification information of a lost key frame;
  • the sending unit is further configured to: if the information receiving unit receives the notification information, send a new key frame to the user equipment by using the video server.
  • the embodiment of the present invention further provides a video live broadcast system, including: an anchor device, a user device, and a video server;
  • the anchor device is the anchor device of any one of the embodiments of the present invention
  • the video server is any one of the video servers provided by the embodiment of the present invention.
  • User equipment is the anchor device of any one of the embodiments of the present invention.
  • the embodiment of the present invention further provides a storage medium including computer executable instructions, where the computer executable instructions are executed by a computer processor to execute a video live broadcast control method, the method comprising:
  • the video server forwards the video frame of the autonomous device to the user equipment, where the video frame includes key frames and non-key frames;
  • the video server monitors whether a key frame loss occurs in the video frame
  • the notification message is sent to the anchor device, so that the anchor device sends a new key frame.
  • the embodiment of the present invention further provides a storage medium including computer executable instructions, where the computer executable instructions are executed by a computer processor to execute a video live broadcast control method, the method comprising:
  • the user equipment receives a video frame from the anchor device forwarded by the video server, the video frame packet containing key frames and non-key frames;
  • the user equipment receives a new key frame from the anchor device forwarded by the video server when decoding the current video frame is unsuccessful, discarding the unsuccessfully decoded video frame, and receiving the new Non-keyframes of keyframes;
  • the user equipment decodes the received new key frame and its non-key frame, and displays the decoded video picture.
  • the embodiment of the present invention further provides a storage medium including computer executable instructions, where the computer executable instructions are executed by a computer processor to perform a video live broadcast control method, the method comprising:
  • the anchor device collects the video data that needs to be broadcasted as a video frame, and sends a video frame to the user equipment through the video server, where the video frame includes a key frame and a non-key frame;
  • the anchor device If the anchor device receives the notification information, the anchor device transmits a new key frame to the video server.
  • the embodiment of the present invention has the following advantages:
  • the video server detects whether a key frame is lost, and then the video server notifies the anchor device that the key frame is lost, and the new key frame is sent by the anchor device, so that The anchor device uploads new key frames in time to eliminate the inability to display and bloom the screen caused by the loss of key frames. Since it is not necessary to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing bandwidth requirements and making the network more fluid.
  • FIG. 1 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a video server according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a video server according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a user equipment according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of an anchor device according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of an anchor device according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a video server according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a user equipment according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of an anchor device according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of a system according to an embodiment of the present invention.
  • FIG. 13 is a schematic flowchart of a method according to an embodiment of the present invention
  • FIG. 14 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • the video live broadcast control method provided by the embodiment of the present invention can be applied to a live video broadcast system.
  • the architecture of the system can be as shown in FIG. 12, including an anchor device, a video server, and a user equipment.
  • the anchor device is configured to provide a live video encoding to the video server, and the video server distributes the video encoding to one or more user equipments for live video broadcast.
  • the number of the anchor devices may be one or more, and multiple anchor devices may perform live video broadcast to the user equipment through the video server.
  • the embodiment of the present invention provides a video live broadcast control method, which is specifically implemented by a video server of a live video system. As shown in FIG. 1, the method includes:
  • the video server forwards the video frame of the autonomous device to the user equipment, where the video frame packet includes a key frame and a non-key frame;
  • the video server monitors whether a key frame loss occurs in the above video frame
  • the foregoing method further includes: if the video server receives the non-key frame associated with the lost key frame, discarding the above and losing Keyframes associated with non-keyframes.
  • the I frame with sequence numbers 1 and 2 above is the key frame, and the P frames with the sequence numbers 11-14 and 21-22 are non-key frames. If the I frame with sequence number 2 is lost, then the sequence number is 21 -22 P frames are discarded.
  • the re-encoded key frame may be a key frame encoded by the anchor device according to the current live data when the notification information is received, and the lost key frame is not re-encoded.
  • the notification information is sent to the anchor device, so that the anchor device sends a new key frame.
  • the new key frame may be re-encoded, or may be a new key frame that has been encoded but not sent, and can indicate that the anchor device starts the next new key frame and its non-key frame when it learns that the lost key frame is lost. Send it. For key frames that have been lost, there is no need to send their associated unsent non-critical frames.
  • the video server may send the notification information to the anchor device, so that the operation of the anchor device to send a new key frame may be implemented in multiple manners.
  • the following manner may be adopted.
  • the operation mode may be: if the video server detects that a key frame is lost, sending a notification message to the anchor device, so that the anchor device recodes the current video data into a key frame and a non-key frame, to the video.
  • the server sends.
  • the video server only needs to inform the anchor device that a key frame is lost, and it is not necessary to specifically inform which key frame is lost. After the anchor device receives this information, it is from the current live broadcast. The video data begins to be re-encoded and sent.
  • the operation mode of the other party may be: if the video server detects that a key frame is lost, sending a notification message to the anchor device to notify the anchor device of the missing key frame, so that the anchor device selects the loss from the cache. The next key frame and non-key frame of the key frame are sent to the video server.
  • the active video may be encoded in multiple frames, including multiple key frames and non-key frames in the sequence, and then encoded in the anchor device and then sequentially sent.
  • the video server specifically informs the anchor device which key frame is lost, and the anchor device searches the cache for the next key frame that has been encoded after the lost key frame, and if so, starts transmitting from the next key frame. Instead of sending non-key frames that are missing keyframes.
  • the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame.
  • the picture caused by the loss cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
  • the embodiment of the present invention further provides another video live broadcast control method, which is performed by a user equipment in a live video system, and includes the following:
  • the user equipment receives a video frame from the anchor device forwarded by the video server, the video frame packet containing key frames and non-key frames;
  • the user equipment receives a new key frame from the anchor device forwarded by the video server when decoding the current video frame is unsuccessful, discarding the unsuccessfully decoded video frame, and receiving the new Non-keyframes of keyframes;
  • the user equipment decodes the received new key frame and its non-key frame, and displays the decoded video picture.
  • the user equipment generally receives video frames including key frames and non-key frames in sequence, and decodes the key frames and their associated non-key frames, and performs video image display after decoding.
  • a key frame is lost, it is obvious that the user equipment cannot successfully decode even if it receives the non-key frame of the key frame. If a new key frame is received when the current video frame decoding is unsuccessful, it can be considered that there is a key frame loss. Phenomenon.
  • the two operations are not limited in sequence, preferably the receiving operation is performed first, and then the new key frame and its non-key After the frame can be successfully decoded, the unsuccessfully decoded video frame is further discarded, which ensures that the newly received video frame can be successfully decoded.
  • the operation performed after receiving the new key frame is preferably used in the following manner. As shown in FIG. 2, the method may include:
  • the user equipment receives a video frame from the anchor device forwarded by the video server, where the video frame includes a key frame and a non-key frame;
  • the user equipment determines the position of the re-encoded key frame in the video frame, and after the location Video frame data is discarded, and the video frame after the above-mentioned re-encoded key frame is received;
  • the re-encoded key frame that is, the new key frame re-transmitted by the anchor device after the occurrence of the key frame loss.
  • the new key frame is found in the video frame instead of the position corresponding to the lost key frame, which is actually the position of the lost key frame. Due to the loss of the original key frame, the non-key frame of the lost key frame can no longer be successfully decoded, so the video frame data after the above position can be discarded.
  • the video server forwards a new key frame to compensate for the lost key frame, and eliminates the phenomenon that the picture cannot be displayed and the screen is lost due to the loss of the key frame during the live broadcast of the video. Since there is no need to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
  • the embodiment of the present invention provides the following solution: Further, if the user equipment receives the forwarding by the video server Recoded keyframes from the anchor device, including:
  • the user equipment described above stops the decoding operation of all of the video frames after the re-encoded key frame is in the video frame.
  • the user equipment stores the received video frames, for example, in memory. Then, the required video frame is extracted from the memory for decoding operation. Therefore, received video frames and decoded video frames may be stored in different locations in the memory. After discarding a portion of the video frames based on the foregoing scheme, these video frames may still have been called for decoding, so it is preferable to further stop the current decoding operation on the video frames, and re-decode from the re-encoded key frames and their non-key frames.
  • the embodiment of the present invention further provides another video live broadcast control method, which is performed by an anchor device in a live video system, and the method includes the following:
  • the anchor device collects video data that needs to be broadcasted in real time into a video frame, and sends a video frame to the user equipment through the video server, where the video frame includes a key frame and a non-key frame;
  • the anchor device sends a new key frame to the user equipment by using the video server.
  • the method includes:
  • the anchor device collects video data that needs to be broadcasted as a video frame, and sends a video frame to the user equipment by using a video server, where the video frame includes a key frame and a non-key frame.
  • the anchor device If the anchor device receives the notification information, the notification information indicates the lost key frame; then, the anchor device re-encodes the key frame, and sends the re-encoded key frame to the user equipment by using the video server.
  • the anchor device may send another new key frame to the user equipment by using the video server.
  • Another mode of operation is: if the anchor device receives the notification information, the anchor device re-encodes the current video data into a key frame and a non-key frame, and sends the message to the user equipment through the video server.
  • a further mode of operation is: if the anchor device receives the notification information indicating the lost key frame, the anchor device selects the next key frame and the non-key frame of the lost key frame from the cache, and Sended to the user equipment by the video server.
  • the anchor device learns that a key frame is lost, and knows which key frame is lost. In the cache, it searches for the next key frame that has been encoded and not transmitted, and starts transmitting from the next key frame.
  • the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device re-encodes the key frame, so that the anchor device can upload a new key frame in time to eliminate the key frame loss.
  • the resulting picture cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
  • the notification information is not received, only 301 is needed. If the notification information is received, it may be determined that there is a key frame loss, because the lost key frame may have been completed.
  • Non-keyframe encoding, and non-keyframe recording is based on keyframe prediction information, so keyframe loss will cause the non-keyframe associated with it to lose meaning, in order to reduce the user equipment side (decoding end)
  • the present invention provides the following solutions:
  • the foregoing method further includes: the foregoing anchor device discards the already associated with the lost key frame, and the foregoing decoding method is provided.
  • Non-keyframes that are encoded and not sent to the video server above.
  • the embodiment of the present invention further provides a video server, as shown in FIG. 4, including:
  • a forwarding control unit 401 configured to control a video frame of the future autonomous device to be forwarded to the user equipment, where the video frame includes a key frame and a non-key frame;
  • the frame loss monitoring unit 402 is configured to monitor whether a key frame is lost in the video frame.
  • the information sending unit 403 is configured to: if the frame loss monitoring unit 402 detects that a key frame is lost, send the notification information to the anchor device, so that the anchor device sends a new key frame.
  • the information sending unit 403 is specifically configured to: if the frame loss monitoring unit detects that a key frame is lost, send the notification information to the anchor device, and notify the anchor device of the lost key frame, so that the anchor device sends the re-encoded Keyframe.
  • the re-encoded key frame may be a key frame encoded by the anchor device according to the current live data when the notification information is received, and the lost key frame is not re-encoded.
  • the information sending unit 403 is specifically configured to: if the frame loss monitoring unit detects that a key frame is lost, send the notification information to the anchor device, so that the anchor device recodes the current video data into a key frame. And non-key frames, sent to the video server.
  • the information sending unit 403 is specifically configured to: if the frame loss monitoring unit detects that a key frame is lost, send the notification information to the anchor device to notify the anchor device of the lost key frame, so that the The anchor device selects the next key frame and the non-key frame of the lost key frame from the cache and transmits to the video server.
  • the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame.
  • the picture caused by the loss cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
  • the video server of the present invention provides the following solution.
  • the video server further includes: a control frame dropping unit 501, if received, as shown in FIG.
  • the non-keyframe associated with the lost keyframe discards the non-keyframe associated with the missing keyframe as described above.
  • An embodiment of the present invention further provides a user equipment, as shown in FIG. 6, including:
  • a video receiving unit 601 configured to receive a video frame from an anchor device that is forwarded by a video server, where the video frame includes a key frame and a non-key frame;
  • a frame determining unit 602 configured to determine whether a new key frame from the anchor device forwarded by the video server is received when the current video frame is unsuccessfully decoded
  • a frame loss control unit 603 configured to discard the unsuccessfully decoded video frame if a new key frame from the anchor device forwarded by the video server is received when the current video frame is unsuccessfully decoded;
  • the video receiving unit 601 is further configured to receive the non-key frame of the new key frame, and the decoding unit 604 is configured to decode the received new key frame and its non-key frame;
  • the display unit 605 is configured to display the video picture decoded by the decoding unit 604.
  • the video receiving unit 601 is specifically configured to receive a video frame after the re-encoded key frame
  • the frame determining unit 602 is specifically configured to determine whether the video receiving unit 601 receives the re-encoded key frame from the anchor device forwarded by the video server;
  • the frame dropping control unit 603 is specifically configured to: if the frame determining unit 602 determines that the video receiving unit receives the re-encoded key frame from the anchor device forwarded by the video server, the user equipment determines the re-encoded key frame. Position in the video frame, and discard the video frame data after the above position;
  • the key frame of the re-encoded code is forwarded by the video server to compensate the lost key frame, and the picture cannot be displayed and the screen is lost due to the loss of the key frame during the live broadcast of the video. Since it is not necessary to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
  • the decoding unit 604 is further configured to: if the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, stop all the re-encoded key frames in the video frame The decoding operation of the video frame.
  • An embodiment of the present invention further provides an anchor device, as shown in FIG. 7, including:
  • a data collection unit 701 configured to collect video data that needs to be broadcasted at present;
  • the encoding unit 702 is configured to encode the video data collected by the data collection unit into a video frame, where the video frame includes a key frame and a non-key frame;
  • a sending unit 703 configured to send, by using a video server, the coding unit to send to the user equipment Video frame to;
  • the information receiving unit 704 is configured to receive notification information of a key frame loss.
  • the sending unit 703 is further configured to: if the information receiving unit 704 receives the notification information, send a new key frame to the user equipment by using the video server.
  • the coding unit 702 may be specifically configured to: if the foregoing anchor device receives the notification information, re-encode the key frame;
  • the sending unit 703 is specifically configured to send, by using the video server, the video frame encoded by the coding unit to the user equipment, and send the re-encoded key frame to the user equipment by using the video server;
  • the information receiving unit 704 is specifically configured to receive the notification information, where the notification information indicates the lost key frame.
  • the coding unit 702 is specifically configured to re-encode the current video data into a key frame and a non-key frame if the notification information is received;
  • the sending unit 703 is specifically configured to send the key frame and the non-key frame re-encoded by the coding unit to the user equipment by using the video server.
  • a further implementation manner is: the sending unit 703 is specifically configured to: if receiving the notification information indicating the lost key frame, select the next key frame and the non-key frame of the lost key frame from the cache, And sending to the user equipment through the video server.
  • the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame.
  • the picture caused by the loss cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
  • the foregoing anchor device further includes:
  • a frame loss unit 801 is configured to discard non-key frames that have been encoded and are not sent to the video server associated with the lost key frame.
  • the embodiment of the present invention further provides another video server, as shown in FIG. 9, comprising: a receiver 901, a transmitter 902, a processor 903, and a memory 904;
  • the processor 903 is configured to control the video server to forward the video frame of the autonomous device to the user equipment, where the video frame includes a key frame and a non-key frame; monitoring whether the key frame is lost in the video frame; If the frame is lost, the control sends a notification message to the anchor device to enable the anchor device to send a new key frame.
  • the notification information is sent to the anchor device, and the key frame lost by the anchor device is notified, so that the anchor device sends the re-encoded key frame.
  • the re-encoded key frame may be a key frame encoded by the anchor device according to the current live data when the notification information is received, and the lost key frame is not re-encoded.
  • the notification information is sent to the anchor device, so that the anchor device re-encodes the current video data into a key frame and a non-key frame, and sends the message to the video server.
  • the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame.
  • the picture caused by the loss cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
  • the embodiment of the present invention provides the following solution: Further, the processor 903 is further configured to receive and lose key frames if The associated non-keyframes discard the non-keyframes associated with the missing keyframes described above.
  • An embodiment of the present invention further provides another user equipment, as shown in FIG. 10, including: a receiver 1001, a transmitter 1002, a processor 1003, and a memory 1004.
  • the processor 1003 is configured to control, by the user equipment, the video frame from the anchor device that is forwarded by the video server, where the video frame includes a key frame and a non-key frame; if the video frame is unsuccessfully decoded, the a new key frame forwarded by the video server from the anchor device, discarding the unsuccessfully decoded video frame, and receiving the non-key frame of the new key frame; decoding the received new key frame and Non-keyframe, and display the decoded video picture.
  • the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, determining a position of the re-encoded key frame in the video frame, and setting the video frame data after the location Discarding, and receiving the video frame after the above-mentioned re-encoded key frame; decoding the received video frame, and controlling display of the decoded video picture.
  • the key frame of the re-encoded code is forwarded by the video server to compensate the lost key frame, and the picture cannot be displayed and the screen is lost due to the loss of the key frame during the live broadcast of the video. Since it is not necessary to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
  • the embodiment of the present invention provides the following solutions: Further, the processor 1003 is further configured to: if the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, stop all the re-encoded key frames in the video frame The decoding operation of the video frame.
  • the embodiment of the present invention further provides another anchor device, as shown in FIG. 11, comprising: a receiver 1101, a transmitter 1102, a processor 1103, and a memory 1104;
  • the processor 1103 is configured to control, to collect, video data that is currently required to be broadcasted into a video frame, and send a video frame to the user equipment by using the video server, where the video frame includes a key frame and a non-key a frame; if the anchor device receives the notification information, the anchor device sends a new key frame to the user equipment through the video server.
  • the anchor device receives the notification information, the notification information indicates the lost key frame; then, the anchor device re-encodes the key frame, and sends the re-encoded key frame to the user equipment through the video server.
  • the anchor device re-encodes the current video data into a key frame and a non-key frame, and sends the message to the user equipment by using the video server.
  • the anchor device selects the next key frame and the non-key frame of the lost key frame from the cache, and passes the The video server sends to the user equipment.
  • the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame.
  • the picture caused by the loss cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
  • the processor 1103 is further configured to discard a non-key frame that has been encoded and is not sent to the video server that is associated with the lost key frame.
  • the embodiment of the present invention further provides a video live broadcast system, as shown in FIG. 12, including: an anchor device 1201, a user device 1202, and a video server 1203;
  • the anchor device 1201 is an anchor device according to any one of the embodiments of the present invention.
  • the video server 1203 is a video server according to any one of the embodiments of the present invention. User equipment.
  • the embodiment of the invention is a compensation scheme based on uplink key frame data in the live broadcast process of the anchor device.
  • the video server finds that the uplink key frame data is lost during the live broadcast of the anchor device, the information is fed back to the client of the anchor device, and the anchor device notifies the client encoding module to stop encoding the non-key frame, and restarts encoding a key frame or the next one.
  • the client of the user equipment can decode and display the normal video picture after receiving the complete key frame. Referring to FIG. 13 , the specific process of a preferred example is as follows:
  • the anchor device collects live data, encodes the video frame and sends it to the video server, and the video server forwards the video frame to the user equipment.
  • the video frame contains key frames as well as non-critical frames.
  • the video server finds that the broadcast device's live uplink key frame data is lost, and the information is sent back to the client of the anchor device to indicate which key frame the lost key frame is.
  • the client of the anchor device notifies the client encoding module to stop the encoding of the non-keyframe and restarts encoding a key frame.
  • the client of the anchor device discards all non-keyframe data associated with the lost keyframe that has not been uploaded.
  • the client of the anchor device uploads the instant recoded key frame data to the video server, and sends the re-encoded key frame data to the user equipment through the video server.
  • the client of the user equipment stops decoding and discards all video frames (since the previously correctly decoded data has been displayed, the subsequent data should start with the re-encoded key frame, so all video frames can be discarded) until the steps are received.
  • the key frame of 1 305 is then re-decoded to display the normal video picture.
  • the anchor device when the anchor device loses packets in the uplink, it can restore the normal video frame in a short time, and there is no long-term pause. Since only the key frame data is lost, the key frame is encoded immediately, and the code rate does not rise and the network is congested.
  • the embodiment of the present invention further provides a storage medium including computer executable instructions for executing a video live broadcast control method when executed by a computer processor, the method comprising:
  • the video server forwards the video frame of the autonomous device to the user equipment, where the video frame includes key frames and non-key frames;
  • the video server monitors whether a key frame loss occurs in the video frame; If the video server detects that a key frame is lost, the notification message is sent to the anchor device, so that the anchor device sends a new key frame.
  • the embodiment of the present invention further provides a storage medium including computer executable instructions for executing a video live broadcast control method when executed by a computer processor, the method comprising:
  • the user equipment receives a video frame from the anchor device forwarded by the video server, the video frame packet containing key frames and non-key frames;
  • the user equipment receives a new key frame from the anchor device forwarded by the video server when decoding the current video frame is unsuccessful, discarding the unsuccessfully decoded video frame, and receiving the new Non-keyframes of keyframes;
  • the user equipment decodes the received new key frame and its non-key frame, and displays the decoded video picture.
  • the embodiment of the present invention further provides a storage medium including computer executable instructions for executing a video live broadcast control method when executed by a computer processor, the method comprising:
  • the anchor device collects video data that needs to be broadcasted in real time into a video frame, and sends a video frame to the user equipment through the video server, where the video frame includes a key frame and a non-key frame;
  • the anchor device If the anchor device receives the notification information, the anchor device transmits a new key frame to the video server.
  • the video live broadcast control method performed by the storage medium of each computer executable instruction can further perform the video live broadcast control method provided by the embodiment of the present invention.
  • the embodiment of the present invention further provides a terminal device.
  • a terminal device As shown in FIG. 14 , for the convenience of description, only parts related to the embodiment of the present invention are shown. For details that are not disclosed, refer to the method part of the embodiment of the present invention.
  • the terminal may be any mobile device, a tablet computer, a PDA (Personal Data Center), a POS (Point of Sa les, a sales terminal), an in-vehicle computer, or the like, and the terminal is a mobile phone. example:
  • FIG. 14 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present invention.
  • the mobile phone includes: a radio frequency (RF) circuit 1410, a memory 1420, The input unit 1430, the display unit 1440, the sensor 1450, the audio circuit 1460, the wireless fidelity (WiFi) module 1470, the processor 1480, and the power supply 1490 and the like.
  • RF radio frequency
  • the structure of the handset shown in FIG. 14 does not constitute a limitation to the handset, and may include more or less components than those illustrated, or some components may be combined, or different components may be arranged.
  • the RF circuit 1410 can be used for receiving and transmitting signals during and after receiving or transmitting information, and in particular, after receiving the downlink information of the base station, it is processed by the processor 1480; in addition, the uplink data is designed to be sent to the base station.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • LNA Low Noise Amplifier
  • RF circuitry 140 can also communicate with the network and other devices via wireless communication.
  • the above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), and code division multiple access ( Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA) > Long Term Evolution (LTE), e-mail, Short Messaging Service (SMS), etc.
  • GSM Global System of Mobile communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Messaging Service
  • the memory 1420 can be used to store software programs and modules, and the processor 1480 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 1420.
  • the memory 1420 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of the mobile phone (such as audio data, phone book, etc.).
  • memory 1420 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state memory device.
  • the input unit 1430 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the handset 1400.
  • the input unit 1430 may include a touch panel 1431 and other input devices 1432.
  • the touch panel 1431 also referred to as a touch screen, can collect touch operations on or near the user (such as a user using a finger, a stylus, etc. or any suitable object or
  • the attachment is operated on the touch panel 1431 or in the vicinity of the touch panel 1431, and the corresponding connecting device is driven according to a preset program.
  • the touch panel 1431 may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information
  • the processor 1480 is provided and can receive commands from the processor 1480 and execute them.
  • the touch panel 1431 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 1430 may also include other input devices 1432.
  • the other input device 1432 may include, but is not limited to, one or more of a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, a joystick, and the like.
  • function keys such as a volume control button, a switch button, etc.
  • a trackball such as a mouse, a joystick, and the like.
  • the display unit 1440 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone.
  • the display unit 1440 may include a display panel 1441.
  • the display panel 1441 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch panel 1431 may cover the display panel 1441. When the touch panel 1431 detects a touch operation thereon or nearby, the touch panel 1431 transmits to the processor 1480 to determine the type of the touch event, and then the processor 1480 according to the touch event. The type provides a corresponding visual output on display panel 1441.
  • the touch panel 1431 and the display panel 1441 are used as two independent components to implement the input and input functions of the mobile phone in FIG. 14, in some embodiments, the touch panel 1431 and the display panel 1441 may be integrated. Realize the input and output of the phone
  • the handset 1400 can also include at least one type of sensor 1450, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1441 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1441 and/or when the mobile phone moves to the ear. Or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
  • An audio circuit 1460, a speaker 1461, and a microphone 1462 can provide an audio interface between the user and the handset.
  • the audio circuit 1460 can transmit the converted electrical data of the received audio data to the speaker 1461 and convert it into a sound signal output by the speaker 1461.
  • the microphone 1462 converts the collected sound signal into an electrical signal, and the audio circuit 1460 After receiving, it is converted into audio data, and then processed by the audio data output processor 1480, transmitted to the other mobile phone via the RF circuit 1410, or outputted to the memory 1420 for further processing.
  • WiFi is a short-range wireless transmission technology.
  • the mobile phone can help users to send and receive emails, browse web pages and access streaming media through the WiFi module 1470. It provides users with wireless broadband Internet access.
  • FIG. 14 shows the WiFi module 1470, it can be understood that it does not belong to the essential configuration of the mobile phone 1400, and may be omitted as needed within the scope of not changing the essence of the invention.
  • the processor 1480 is the control center of the handset, which connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 1420, and by invoking data stored in the memory 1420, The phone's various functions and processing data, so that the overall monitoring of the phone.
  • the processor 1480 may include one or more processing units.
  • the processor 1480 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 1480.
  • the handset 1400 also includes a power source 1490 (such as a battery) for powering various components.
  • a power source 1490 such as a battery
  • the power source can be logically coupled to the processor 1480 through a power management system to perform functions such as managing charging, discharging, and power management through the power management system.
  • the mobile phone 1400 may further include a camera, a Bluetooth module, and the like, and details are not described herein.
  • the processor 1480 included in the terminal further has the following functions: if used as a user equipment, the processor 1480 is configured to control the user equipment to receive a video frame from the anchor device forwarded by the video server, where The video frame includes a key frame and a non-key frame; if the user equipment receives a new key frame forwarded by the video server from the anchor device when the current video frame is unsuccessfully decoded, the unsuccessfully decoded Video frame is discarded, and the non-key frame of the new key frame is received; the user equipment decodes the received new key frame and its non-key Frame, and display the decoded video picture.
  • the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, determining the position of the re-encoded key frame in the video frame, and setting the video frame after the location
  • the data is discarded, and the video frame after the above-mentioned re-encoded key frame is received; the received video frame is decoded, and the decoded video picture is displayed.
  • the video server forwards a new key frame to compensate for the lost key frame, and eliminates the phenomenon that the picture cannot be displayed and the screen is lost due to the loss of the key frame during the live broadcast of the video. Since there is no need to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
  • the embodiment of the present invention provides the following solution:
  • the processor 1480 is further configured to: if the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, stop all videos after the re-encoded key frame is located in the video frame. The decoding operation of the frame.
  • the master device if used as an anchor device, the processor 1480 is configured to control the video data currently required to be broadcasted into a video frame, and send a video frame to the user equipment through the video server, where the video frame includes a key frame and a non- a key frame; if the anchor device receives the notification information, the anchor device sends a new key frame to the user equipment through the video server.
  • the anchor device receives the notification information, the notification information indicates the lost key frame; then, the anchor device re-encodes the key frame, and sends the re-encoded key frame to the user equipment through the video server.
  • the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame.
  • the picture caused by the loss cannot be displayed and the screen is displayed. Since it is not necessary to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing the bandwidth requirement and making the network more smooth.
  • the notification information if the notification information is received, it may be determined that there is a case where the key frame is lost, since the encoding of the non-key frame related to the lost key frame may have been completed, and the non-key frame is recorded with the key frame.
  • the processor 1480 is further configured to discard non-key frames that have been encoded and are not sent to the video server that are associated with the lost key frame.
  • the terminal device can function as both the anchor device and the user device, and thus the terminal device can also have all the functions of the above processor.
  • each unit included is only divided according to functional logic, but is not limited to the foregoing division, as long as the corresponding function can be implemented;
  • the specific names of the functional units are also only for the purpose of distinguishing between the two, and are not intended to limit the scope of the present invention.
  • the storage medium may be a read only memory, a magnetic disk or an optical disk or the like.

Abstract

Disclosed are a control method, device and system of the live broadcast of a video, and a storage medium. The method comprises: a video server forwarding a video frame from a main broadcast device to a user equipment; the video server monitoring whether a key frame loss occurs in the video frame; and if it is monitored that a key frame loss occurs, the video server sending notification information to the main broadcast device, so that the main broadcast device sends a new key frame. The video server detects whether a key frame loss occurs, then the video server notifies the main broadcast device of the lost key frame, and the main broadcast device sends a new key frame, so that the main broadcast device can upload the new key frame in time, thereby eliminating the phenomena that pictures cannot be displayed and a screen is blurred due to the fact that a key frame is lost. Since it is not necessary to increase the frequency of the occurrence of the key frame, the data transmission amount can be reduced, so that bandwidth requirements are reduced and a network is made to be more smooth.

Description

说 明 书 一种视频直播控制方法、 设备及系统和存储介质 本专利申请要求于 2013年 10月 21 日提交的、 申请号为 201310495767.1、 申请人为腾讯科技(深圳)有限公司、 发明名称为 "一种视频直播控制方法、 设备及系统" 的中国专利申请的优先权, 该申请的全文以引用的方式并入本申 请中。  The invention relates to a video live broadcast control method, device and system and storage medium. The patent application is filed on October 21, 2013, and the application number is 201310495767.1, the applicant is Tencent Technology (Shenzhen) Co., Ltd., and the invention name is "a video." The priority of the Chinese patent application of the method, the device and the system of the present disclosure is incorporated herein by reference.
技术领域 本发明实施例涉及计算机技术领域, 特别涉及一种视频直播控制方法、 设 备及系统和存储介质。 背景技术 The present invention relates to the field of computer technologies, and in particular, to a video live broadcast control method, device, system, and storage medium. Background technique
帧就是视频或动画中最小单位的单幅影像画面, 相当于电影胶片上的每一 格镜头。  A frame is a single image of the smallest unit in a video or animation, equivalent to each shot on a film.
关键帧是一帧画面的完整保留, 在解码时只需要本帧数据就可以完成一幅 画面的显示, 一般可以指 I 帧。 两个关键帧之间的帧为非关键帧, 一般可以称 为过渡帧或者中间帧, 过渡帧记录的是预测信息的帧也称为预测帧, 依据预测 帧记录的预测信息可以在解码过程中结合关键帧解码得到图像,过渡帧一般指 P 帧、 B帧等。  The key frame is a complete reservation of one frame. When decoding, only the frame data is needed to complete the display of one picture, which can generally refer to I frame. The frame between two key frames is a non-key frame, which may be generally referred to as a transition frame or an intermediate frame. The frame in which the prediction frame records the prediction information is also called a prediction frame, and the prediction information recorded according to the prediction frame may be in the decoding process. The image is obtained by combining key frame decoding, and the transition frame generally refers to a P frame, a B frame, and the like.
关键帧一般来说是指 I帧,其记录了整张图像的信息,因此一帧 I图像相比 预测帧 P帧和双向预测帧 B帧占用空间要大很多, 特别是视频动态不大的情况 下, 一张 I图像的体积会是一张 P图像或 B图像的体积的 10倍以上。 在所有的 视频帧中, 一般 P帧的数量是最多的, 且数量远比其它两种帧的数量多。 但 P 帧整体占用的空间并不是最多的, 所以过多的使用 I帧会降低压缩效率,文件将 变大或清晰度下降。 关键帧用在场景切换的视频位置才使它的价值最大化, 若 用在非场景切换的视频位置,不仅浪费空间,还对视频的整体质量有影响, 在指 定码率时, 过多使用 I帧会导致视频整体质量下降。  A key frame generally refers to an I frame, which records information of an entire image. Therefore, a frame I picture takes a much larger space than a predicted frame P frame and a bidirectionally predicted frame B frame, especially when the video dynamic is not large. Next, the volume of an I picture will be more than 10 times the volume of a P picture or a B picture. In all video frames, the number of normal P frames is the most, and the number is much larger than the other two frames. However, the overall space occupied by the P frame is not the most, so excessive use of the I frame will reduce the compression efficiency, and the file will become larger or the resolution will decrease. The key frame is used in the video position of the scene switching to maximize its value. If it is used in the video position of non-scene switching, it not only wastes space, but also affects the overall quality of the video. When using the specified bit rate, excessive use of I Frames can cause the overall quality of the video to drop.
目前的直播业务由主播设备向视频服务器提供视频编码, 再由视频服务器 将视频编码分发给各个用户设备。 该视频编码一般 10秒左右出现一个关键帧。 在从主播设备至视频服务器的视频编码传播过程中,一旦关键帧的数据丢失了, 中间的过渡帧则也无法显示, 因此需要等到 1 0秒以后接收到一个完整的关键帧 后才能正常解码出现画面。 为了解决关键帧丢失导致的画面无法显示, 或者显 示花屏的现象, 目前针对这一问题的解决方案是: 提高关键帧出现的频率, 例 如: 调整为 2-3秒出现一个关键帧。 这样当出现关键帧数据丢失后, 其影响的 时间由 1 0秒降 <为 2-3秒。 The current live broadcast service provides video coding from the anchor device to the video server, and the video server distributes the video code to each user device. The video encoding typically has a keyframe around 10 seconds. During the video encoding propagation from the anchor device to the video server, once the key frame data is lost, the intermediate transition frame cannot be displayed, so it is necessary to wait until 10 seconds later to receive a complete key frame before the normal decoding occurs. Picture. In order to solve the problem that the picture cannot be displayed due to the loss of key frames, or the phenomenon of displaying the screen, the current solution to this problem is to increase the frequency of occurrence of key frames, for example: Adjusting to a key frame occurs in 2-3 seconds. Thus, when the key frame data is lost, the time of its impact is reduced from 10 seconds to 2-3 seconds.
基于前述介绍, 由于关键帧数据量大, 以上方案提高关键帧出现的频率(即 将关键帧的间距调短), 会大大增大视频的码率, 这样就会对带宽提出极高的要 求, 甚至造成网络拥堵。 发明内容  Based on the foregoing, due to the large amount of key frame data, the above scheme improves the frequency of occurrence of key frames (ie, shortening the spacing of key frames), which greatly increases the bit rate of the video, which imposes extremely high requirements on the bandwidth, even Causing network congestion. Summary of the invention
本发明实施例提供了一种视频直播控制方法、 设备及系统和存储介质, 用 于消除关键帧丢失导致的画面无法显示和花屏现象, 并且, 降低数据传输量, 减少对带宽的要求, 使网络更加流畅。  The embodiment of the invention provides a video live broadcast control method, device, system and storage medium, which are used for eliminating the phenomenon that the picture cannot be displayed and the screen is caused by the loss of the key frame, and the data transmission amount is reduced, the bandwidth requirement is reduced, and the network is made. More fluid.
第一方面, 本发明实施例提供了一种视频直播控制方法, 包括:  In a first aspect, an embodiment of the present invention provides a video live broadcast control method, including:
视频服务器将来自主播设备的视频帧转发给用户设备, 所述视频帧包含有 关键帧和非关键帧;  The video server forwards the video frame of the autonomous device to the user equipment, where the video frame includes key frames and non-key frames;
视频服务器监测所述视频帧中是否出现关键帧丢失;  The video server monitors whether a key frame loss occurs in the video frame;
视频服务器若监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备发送新的关键帧。  If the video server detects that a key frame is lost, the notification message is sent to the anchor device, so that the anchor device sends a new key frame.
第二方面, 本发明实施例还提供了一种视频直播控制方法, 包括: 用户设备接收由视频服务器转发的来自主播设备的视频帧 , 所述视频帧包 含有关键帧和非关键帧;  In a second aspect, the embodiment of the present invention further provides a video live broadcast control method, including: receiving, by a user equipment, a video frame from an anchor device that is forwarded by a video server, where the video frame packet includes a key frame and a non-key frame;
若所述用户设备在对当前视频帧解码未成功时接收到由所述视频服务器转 发的来自主播设备的新的关键帧, 则将所述未成功解码的视频帧丢弃, 并接收 所述新的关键帧的非关键帧;  If the user equipment receives a new key frame from the anchor device forwarded by the video server when decoding the current video frame is unsuccessful, discarding the unsuccessfully decoded video frame, and receiving the new Non-keyframes of keyframes;
所述用户设备解码接收到的所述新的关键帧及其非关键帧, 并显示解码得 到的视频画面。 第三方面, 本发明实施例还提供了一种视频直播控制方法, 包括: 主播设备釆集当前需要直播的视频数据编码为视频帧, 并通过视频服务器 向用户设备发送视频帧 , 所述视频帧包含有关键帧和非关键帧; The user equipment decodes the received new key frame and its non-key frame, and displays the decoded video picture. In a third aspect, the embodiment of the present invention further provides a video live broadcast control method, including: the anchor device collects video data that needs to be broadcasted in real time into a video frame, and sends a video frame to the user equipment through the video server, where the video frame Contains keyframes and non-keyframes;
若所述主播设备接收到告知信息, 则所述主播设备通过所述视频服务器向 用户设备发送新的关键帧。  And if the anchor device receives the notification information, the anchor device sends a new key frame to the user equipment by using the video server.
第四方面, 本发明实施例又提供了一种视频服务器, 包括:  In a fourth aspect, the embodiment of the present invention further provides a video server, including:
转发控制单元, 用于控制将来自主播设备的视频帧转发给用户设备, 所述 视频帧包含有关键帧和非关键帧;  a forwarding control unit, configured to control a video frame of the future autonomous device to be forwarded to the user equipment, where the video frame includes a key frame and a non-key frame;
丢帧监测单元, 用于监测所述视频帧中是否出现关键帧丢失;  a frame loss monitoring unit, configured to monitor whether a key frame is lost in the video frame;
信息发送单元, 用于若所述丢帧监测单元监测到出现关键帧丢失, 则向所 述主播设备发送告知信息 , 以使所述主播设备发送新的关键帧。  The information sending unit is configured to: if the frame loss monitoring unit detects that a key frame is lost, send the notification information to the anchor device, so that the anchor device sends a new key frame.
第五方面, 本发明实施例又提供了一种用户设备, 包括:  In a fifth aspect, the embodiment of the present invention further provides a user equipment, including:
视频接收单元, 用于接收由视频服务器转发的来自主播设备的视频帧, 所 述视频帧包含有关键帧和非关键帧; 接收重新编码的关键帧之后的视频帧; 帧确定单元 , 用于确定是否在对当前视频帧解码未成功时接收到由所述视 频服务器转发的来自主播设备的新的关键帧;  a video receiving unit, configured to receive a video frame from the anchor device forwarded by the video server, where the video frame includes a key frame and a non-key frame; receive a video frame after the re-encoded key frame; and a frame determining unit, configured to determine Whether a new key frame from the anchor device forwarded by the video server is received when the current video frame decoding is unsuccessful;
丢帧控制单元, 用于若在对当前视频帧解码未成功时接收到由所述视频服 务器转发的来自主播设备的新的关键帧, 则将所述未成功解码的视频帧丢弃; 所述视频接收单元, 还用于接收所述新的关键帧的非关键帧;  a frame loss control unit, configured to discard the unsuccessfully decoded video frame if a new key frame from the anchor device forwarded by the video server is received when the current video frame is unsuccessfully decoded; the video a receiving unit, configured to receive a non-key frame of the new key frame;
解码单元, 用于解码接收到的所述新的关键帧及其非关键帧;  a decoding unit, configured to decode the received new key frame and its non-key frame;
显示单元, 用于显示所述解码单元解码得到的视频画面。  a display unit, configured to display a video picture decoded by the decoding unit.
第六方面, 本发明实施例又提供了一种主播设备, 包括:  In a sixth aspect, the embodiment of the present invention further provides an anchor device, including:
数据釆集单元, 用于釆集当前需要直播的视频数据;  a data collection unit, configured to collect video data that needs to be broadcasted at present;
编码单元, 用于将所述数据釆集单元釆集的视频数据编码为视频帧, 所述 视频帧包含有关键帧和非关键帧;  a coding unit, configured to encode video data collected by the data collection unit into a video frame, where the video frame includes a key frame and a non-key frame;
发送单元, 用于通过视频服务器向用户设备发送所述编码单元编码得到的 视频帧;  a sending unit, configured to send, by using a video server, a video frame obtained by encoding the coding unit to a user equipment;
信息接收单元, 用于接收关键帧丢失的告知信息; 所述发送单元, 还用于若所述信息接收单元接收到所述告知信息, 则通过 所述视频服务器向用户设备发送新的关键帧。 An information receiving unit, configured to receive notification information of a lost key frame; The sending unit is further configured to: if the information receiving unit receives the notification information, send a new key frame to the user equipment by using the video server.
第七方面, 本发明实施例又提供了一种视频直播系统, 包括: 主播设备、 用户设备以及视频服务器;  In a seventh aspect, the embodiment of the present invention further provides a video live broadcast system, including: an anchor device, a user device, and a video server;
所述主播设备为本发明实施例提供的任意一项的主播设备, 所述视频服务 器为本发明实施例提供的任意一项的视频服务器, 所述用户设备为本发明实施 例提供的任意一项的用户设备。  The anchor device is the anchor device of any one of the embodiments of the present invention, and the video server is any one of the video servers provided by the embodiment of the present invention. User equipment.
第七方面, 本发明实施例又提供了一种包含计算机可执行指令的存储介质 , 所述计算机可执行指令在由计算机处理器执行时用于执行一种视频直播控制 方法, 该方法包括:  In a seventh aspect, the embodiment of the present invention further provides a storage medium including computer executable instructions, where the computer executable instructions are executed by a computer processor to execute a video live broadcast control method, the method comprising:
视频服务器将来自主播设备的视频帧转发给用户设备, 所述视频帧包含有 关键帧和非关键帧;  The video server forwards the video frame of the autonomous device to the user equipment, where the video frame includes key frames and non-key frames;
视频服务器监测所述视频帧中是否出现关键帧丢失;  The video server monitors whether a key frame loss occurs in the video frame;
视频服务器若监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备发送新的关键帧。  If the video server detects that a key frame is lost, the notification message is sent to the anchor device, so that the anchor device sends a new key frame.
第八方面 , 本发明实施例又提供了一种包含计算机可执行指令的存储介质 , 所述计算机可执行指令在由计算机处理器执行时用于执行一种视频直播控制 方法, 该方法包括:  In an eighth aspect, the embodiment of the present invention further provides a storage medium including computer executable instructions, where the computer executable instructions are executed by a computer processor to execute a video live broadcast control method, the method comprising:
用户设备接收由视频服务器转发的来自主播设备的视频帧 , 所述视频帧包 含有关键帧和非关键帧;  The user equipment receives a video frame from the anchor device forwarded by the video server, the video frame packet containing key frames and non-key frames;
若所述用户设备在对当前视频帧解码未成功时接收到由所述视频服务器 转发的来自主播设备的新的关键帧, 则将所述未成功解码的视频帧丢弃, 并接 收所述新的关键帧的非关键帧;  If the user equipment receives a new key frame from the anchor device forwarded by the video server when decoding the current video frame is unsuccessful, discarding the unsuccessfully decoded video frame, and receiving the new Non-keyframes of keyframes;
所述用户设备解码接收到的所述新的关键帧及其非关键帧, 并显示解码得 到的视频画面。  The user equipment decodes the received new key frame and its non-key frame, and displays the decoded video picture.
第九方面, 本发明实施例又提供了一种包含计算机可执行指令的存储介质, 所述计算机可执行指令在由计算机处理器执行时用于执行一种视频直播控制 方法, 该方法包括: 主播设备釆集当前需要直播的视频数据编码为视频帧, 并通过视频服务器 向用户设备发送视频帧 , 所述视频帧包含有关键帧和非关键帧; In a ninth aspect, the embodiment of the present invention further provides a storage medium including computer executable instructions, where the computer executable instructions are executed by a computer processor to perform a video live broadcast control method, the method comprising: The anchor device collects the video data that needs to be broadcasted as a video frame, and sends a video frame to the user equipment through the video server, where the video frame includes a key frame and a non-key frame;
若所述主播设备接收到告知信息, 则所述主播设备将新的关键帧向所述视 频服务器发送。  If the anchor device receives the notification information, the anchor device transmits a new key frame to the video server.
从以上技术方案可以看出, 本发明实施例具有以下优点: 由视频服务器检 测是否出现了关键帧丢失, 再由视频服务器告知主播设备丢失了关键帧, 由主 播设备发送新的关键帧, 可以使主播设备及时上传新的关键帧, 消除关键帧丢 失导致的画面无法显示和花屏现象。 由于不必提高关键帧出现的频率, 因此可 以降低数据传输量, 从而减少对带宽的要求, 使网络更加流畅。 附图说明  As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages: The video server detects whether a key frame is lost, and then the video server notifies the anchor device that the key frame is lost, and the new key frame is sent by the anchor device, so that The anchor device uploads new key frames in time to eliminate the inability to display and bloom the screen caused by the loss of key frames. Since it is not necessary to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing bandwidth requirements and making the network more fluid. DRAWINGS
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中所 需要使用的附图作简要介绍, 显而易见地, 下面描述中的附图仅仅是本发明的 一些实施例, 对于本领域的普通技术人员来讲, 在不付出创造性劳动性的前提 下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following drawings will be briefly described in the description of the embodiments, and it is obvious that the drawings in the following description are only some embodiments of the present invention, Those skilled in the art can also obtain other drawings based on these drawings without paying creative labor.
图 1为本发明实施例方法流程示意图;  1 is a schematic flowchart of a method according to an embodiment of the present invention;
图 2为本发明实施例方法流程示意图;  2 is a schematic flowchart of a method according to an embodiment of the present invention;
图 3为本发明实施例方法流程示意图;  3 is a schematic flowchart of a method according to an embodiment of the present invention;
图 4为本发明实施例视频服务器结构示意图;  4 is a schematic structural diagram of a video server according to an embodiment of the present invention;
图 5为本发明实施例视频服务器结构示意图;  FIG. 5 is a schematic structural diagram of a video server according to an embodiment of the present invention;
图 6为本发明实施例用户设备结构示意图;  6 is a schematic structural diagram of a user equipment according to an embodiment of the present invention;
图 7为本发明实施例主播设备结构示意图;  7 is a schematic structural diagram of an anchor device according to an embodiment of the present invention;
图 8为本发明实施例主播设备结构示意图;  8 is a schematic structural diagram of an anchor device according to an embodiment of the present invention;
图 9为本发明实施例视频服务器结构示意图;  9 is a schematic structural diagram of a video server according to an embodiment of the present invention;
图 10为本发明实施例用户设备结构示意图;  FIG. 10 is a schematic structural diagram of a user equipment according to an embodiment of the present invention;
图 11为本发明实施例主播设备结构示意图;  11 is a schematic structural diagram of an anchor device according to an embodiment of the present invention;
图 12为本发明实施例系统结构示意图;  12 is a schematic structural diagram of a system according to an embodiment of the present invention;
图 1 3为本发明实施例方法流程示意图; 图 14为本发明实施例终端结构示意图。 FIG. 13 is a schematic flowchart of a method according to an embodiment of the present invention; FIG. 14 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
具体实施方式 detailed description
为了使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发 明作进一步地详细描述, 显然, 所描述的实施例仅仅是本发明一部份实施例, 而不是全部的实施例。 基于本发明中的实施例 , 本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其它实施例, 都属于本发明保护的范围。  The present invention will be further described in detail with reference to the accompanying drawings, in which FIG. . All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例所提供的视频直播控制方法可适用于视频直播系统, 该系统 的架构可参见图 12所示, 包括主播设备、 视频服务器和用户设备。 其中, 主播 设备用于提供直播的视频编码给视频服务器, 由视频服务器将视频编码分发给 一个或多个用户设备, 进行视频直播。 主播设备的数量可以为一个或多个, 多 个主播设备均可通过视频服务器向用户设备进行视频直播。  The video live broadcast control method provided by the embodiment of the present invention can be applied to a live video broadcast system. The architecture of the system can be as shown in FIG. 12, including an anchor device, a video server, and a user equipment. The anchor device is configured to provide a live video encoding to the video server, and the video server distributes the video encoding to one or more user equipments for live video broadcast. The number of the anchor devices may be one or more, and multiple anchor devices may perform live video broadcast to the user equipment through the video server.
本发明实施例提供了一种视频直播控制方法, 该方法具体由视频直播系统 的视频服务器来执行, 如图 1所示, 该方法包括:  The embodiment of the present invention provides a video live broadcast control method, which is specifically implemented by a video server of a live video system. As shown in FIG. 1, the method includes:
101: 视频服务器将来自主播设备的视频帧转发给用户设备, 上述视频帧包 含有关键帧和非关键帧;  101: The video server forwards the video frame of the autonomous device to the user equipment, where the video frame packet includes a key frame and a non-key frame;
102: 视频服务器监测上述视频帧中是否出现关键帧丢失;  102: The video server monitors whether a key frame loss occurs in the above video frame;
进一步地, 由于与关键帧相关联的非关键帧记录的是以关键帧为参照的预 测信息, 因此如果出现了关键帧丢失, 那么与之相关联的非关键帧则会失去意 义, 为减少不必要的数据传输, 以及可能导致的视频显示错误, 本发明实施例 提供了如下解决方案: 上述方法还包括: 若视频服务器接收到与丢失的关键帧 相关联的非关键帧 , 则丢弃上述与丢失的关键帧相关联的非关键帧。  Further, since the non-key frame associated with the key frame records the prediction information with reference to the key frame, if a key frame loss occurs, the non-key frame associated with it loses meaning, in order to reduce The necessary data transmission, and the video display error that may be caused by the embodiment of the present invention provide the following solutions: The foregoing method further includes: if the video server receives the non-key frame associated with the lost key frame, discarding the above and losing Keyframes associated with non-keyframes.
假定接收到的帧如下表 1所示:  Assume that the received frame is as shown in Table 1:
表 1  Table 1
帧序号 帧类型  Frame number frame type
1 I  1 I
11 P  11 P
12 P 13 P 12 P 13 P
14 P  14 P
2 I  2 I
21 P  21 P
22 P 以上表 1中序号为 1和 2的 I帧为关键帧, 序号为 11-14以及 21-22的 P 帧为非关键帧, 假定序号为 2的 I帧丢失, 那么需要将序号为 21-22的 P帧丢 弃。  22 P The I frame with sequence numbers 1 and 2 above is the key frame, and the P frames with the sequence numbers 11-14 and 21-22 are non-key frames. If the I frame with sequence number 2 is lost, then the sequence number is 21 -22 P frames are discarded.
103: 视频服务器若监测到出现关键帧丢失, 则向上述主播设备发送告知信 息,告知上述主播设备丢失的关键帧,使上述主播设备发送重新编码的关键帧。  103: If the video server detects that a key frame is lost, sending a notification message to the anchor device to notify the anchor device of the missing key frame, so that the anchor device sends the re-encoded key frame.
上述重新编码的关键帧可以为收到告知信息时, 主播设备依据当前直播数 据编码的关键帧, 而并不需对丢失的关键帧进行重新编码。  The re-encoded key frame may be a key frame encoded by the anchor device according to the current live data when the notification information is received, and the lost key frame is not re-encoded.
实际操作中, 视频服务器若监测到出现关键帧丢失, 则向所述主播设备发 送告知信息, 以使所述主播设备发送新的关键帧即可。  In actual operation, if the video server detects that a key frame is lost, the notification information is sent to the anchor device, so that the anchor device sends a new key frame.
该新的关键帧可以是重新编码的, 也可以是已编码但未发送的一个新的关 键帧, 能够指示主播设备在获知已发关键帧丢失时, 启动下一个新关键帧及其 非关键帧发送即可。 对于已丢失的关键帧, 无需再发送其关联的未发送的非关 键帧。  The new key frame may be re-encoded, or may be a new key frame that has been encoded but not sent, and can indicate that the anchor device starts the next new key frame and its non-key frame when it learns that the lost key frame is lost. Send it. For key frames that have been lost, there is no need to send their associated unsent non-critical frames.
视频服务器向所述主播设备发送告知信息 , 以使所述主播设备发送新的关 键帧即可的操作可以有多种实现方式,除上述实施例步骤 103的实现方式之外, 还可以有如下方式:  The video server may send the notification information to the anchor device, so that the operation of the anchor device to send a new key frame may be implemented in multiple manners. In addition to the implementation manner of step 103 in the foregoing embodiment, the following manner may be adopted. :
种操作方式可以是, 视频服务器若监测到出现关键帧丢失, 则向所述主 播设备发送告知信息, 以使所述主播设备将当前视频数据重新编码为关键帧和 非关键帧, 向所述视频服务器发送。  The operation mode may be: if the video server detects that a key frame is lost, sending a notification message to the anchor device, so that the anchor device recodes the current video data into a key frame and a non-key frame, to the video. The server sends.
该操作方式中, 视频服务器仅需告知主播设备出现了关键帧丢失的情况, 而无需具体告知哪个关键帧丢失。 主播设备在接收到此信息后, 即从当前直播 的视频数据开始进行重新编码和发送。 In this mode of operation, the video server only needs to inform the anchor device that a key frame is lost, and it is not necessary to specifically inform which key frame is lost. After the anchor device receives this information, it is from the current live broadcast. The video data begins to be re-encoded and sent.
另一方操作方式可以是, 视频服务器若监测到出现关键帧丢失, 则向所述 主播设备发送告知信息, 以告知所述主播设备丢失的关键帧, 使所述主播设备 从緩存中选择所述丢失的关键帧的下一个关键帧和非关键帧, 向所述视频服务 器发送。  The operation mode of the other party may be: if the video server detects that a key frame is lost, sending a notification message to the anchor device to notify the anchor device of the missing key frame, so that the anchor device selects the loss from the cache. The next key frame and non-key frame of the key frame are sent to the video server.
该操作方式中, 主播设备中可能对直播视频进行了多帧的编码, 包括顺序 的多个关键帧及其非关键帧, 编码后緩存在主播设备中, 再顺序发送。 此时, 视频服务器具体告知主播设备哪个关键帧丢失, 则主播设备在緩存中查找该丢 失的关键帧之后是否已有编码的下一个关键帧, 若有, 从该下一个关键帧开始 进行发送, 而放弃发送丢失关键帧的非关键帧。  In the operation mode, the active video may be encoded in multiple frames, including multiple key frames and non-key frames in the sequence, and then encoded in the anchor device and then sequentially sent. At this time, the video server specifically informs the anchor device which key frame is lost, and the anchor device searches the cache for the next key frame that has been encoded after the lost key frame, and if so, starts transmitting from the next key frame. Instead of sending non-key frames that are missing keyframes.
以上实施例, 由视频服务器检测是否出现了关键帧丢失, 再由视频服务器 告知主播设备丢失的关键帧, 由主播设备发送新的关键帧, 可以使主播设备及 时上传新的关键帧, 消除关键帧丢失导致的画面无法显示和花屏现象。 由于不 必提高关键帧出现的频率,因此可以降低数据传输量,从而减少对带宽的要求, 使网络更加流畅。  In the above embodiment, the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame. The picture caused by the loss cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
本发明实施例还提供了另一种视频直播控制方法, 该方法由视频直播系统 中的用户设备来执行, 包括如下:  The embodiment of the present invention further provides another video live broadcast control method, which is performed by a user equipment in a live video system, and includes the following:
用户设备接收由视频服务器转发的来自主播设备的视频帧 , 所述视频帧包 含有关键帧和非关键帧;  The user equipment receives a video frame from the anchor device forwarded by the video server, the video frame packet containing key frames and non-key frames;
若所述用户设备在对当前视频帧解码未成功时接收到由所述视频服务器 转发的来自主播设备的新的关键帧, 则将所述未成功解码的视频帧丢弃, 并接 收所述新的关键帧的非关键帧;  If the user equipment receives a new key frame from the anchor device forwarded by the video server when decoding the current video frame is unsuccessful, discarding the unsuccessfully decoded video frame, and receiving the new Non-keyframes of keyframes;
所述用户设备解码接收到的所述新的关键帧及其非关键帧, 并显示解码得 到的视频画面。  The user equipment decodes the received new key frame and its non-key frame, and displays the decoded video picture.
本实施例中,用户设备通常是按顺序接收包括关键帧和非关键帧的视频帧, 并对关键帧及其关联的非关键帧进行解码, 解码后进行视频画面的显示。 当某 个关键帧丢失时, 显然, 用户设备即使接收到该关键帧的非关键帧也无法成功 解码。 若当前视频帧解码未成功时接收到新的关键帧, 可视为存在关键帧丢失 现象。 对未成功解码的视频帧的丢弃操作, 以及接受新的关键帧的非关键帧的 操作, 这两个操作先后顺序不限, 优选是先执行接收操作, 进而在新的关键帧 及其非关键帧能够成功解码后, 再进一步丢弃未成功解码的视频帧, 这样可以 确保新接收的视频帧可成功解码。 In this embodiment, the user equipment generally receives video frames including key frames and non-key frames in sequence, and decodes the key frames and their associated non-key frames, and performs video image display after decoding. When a key frame is lost, it is obvious that the user equipment cannot successfully decode even if it receives the non-key frame of the key frame. If a new key frame is received when the current video frame decoding is unsuccessful, it can be considered that there is a key frame loss. Phenomenon. For the discarding operation of the unsuccessfully decoded video frame, and the operation of accepting the non-keyframe of the new key frame, the two operations are not limited in sequence, preferably the receiving operation is performed first, and then the new key frame and its non-key After the frame can be successfully decoded, the unsuccessfully decoded video frame is further discarded, which ensures that the newly received video frame can be successfully decoded.
在接收到新的关键帧后所执行的操作优选釆用如下方式, 如图 2所示, 该 方法可以包括:  The operation performed after receiving the new key frame is preferably used in the following manner. As shown in FIG. 2, the method may include:
201: 用户设备接收由视频服务器转发的来自主播设备的视频帧, 上述视频 帧包含有关键帧和非关键帧;  201: The user equipment receives a video frame from the anchor device forwarded by the video server, where the video frame includes a key frame and a non-key frame;
202: 若上述用户设备接收到由上述视频良务器转发的来自主播设备的重新 编码的关键帧, 则, 上述用户设备确定上述重新编码的关键帧在视频帧中的位 置, 并将上述位置后的视频帧数据丢弃, 并接收上述重新编码的关键帧之后的 视频帧;  202: If the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, the user equipment determines the position of the re-encoded key frame in the video frame, and after the location Video frame data is discarded, and the video frame after the above-mentioned re-encoded key frame is received;
在上述操作中, 重新编码的关键帧, 即在出现关键帧丢失后, 主播设备重 新发送的新的关键帧。 用户设备在接收到此新的关键帧时, 在视频帧中找到该 新关键帧代替丢失的关键帧所对应的位置, 实际上即丢失的关键帧的位置。 由 于原有关键帧的丢失,使得丢失关键帧的非关键帧不再能够被成功解码,所以, 上述位置后的视频帧数据可以被丢弃。  In the above operation, the re-encoded key frame, that is, the new key frame re-transmitted by the anchor device after the occurrence of the key frame loss. When the user equipment receives this new key frame, the new key frame is found in the video frame instead of the position corresponding to the lost key frame, which is actually the position of the lost key frame. Due to the loss of the original key frame, the non-key frame of the lost key frame can no longer be successfully decoded, so the video frame data after the above position can be discarded.
203: 解码接收到的视频帧, 并显示解码得到的视频画面。  203: Decode the received video frame and display the decoded video picture.
以上实施例, 由视频服务器转发新的关键帧对丢失的关键帧进行补偿, 消 除在视频直播过程中关键帧丢失导致的画面无法显示和花屏现象。 由于不必提 高关键帧出现的频率, 因此可以降低数据传输量, 从而减少对带宽的要求, 使 网络更加流畅。  In the above embodiment, the video server forwards a new key frame to compensate for the lost key frame, and eliminates the phenomenon that the picture cannot be displayed and the screen is lost due to the loss of the key frame during the live broadcast of the video. Since there is no need to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
以上实施例中, 若没有收到新的关键帧, 则只需要执行 201和 203两个步 骤, 如果收到了新的关键帧, 则可以确定存在关键帧丢失的情况, 由于可能已 经收到了与该丢失的关键帧相关的非关键帧, 并且非关键帧记录的是以关键帧 为参照的预测信息, 因此关键帧丢失会导致与之相关联的非关键帧失去意义, 为了减少不必要的解码操作, 以及可能导致的视频显示错误, 本发明实施例提 供了如下解决方案: 进一步地, 若上述用户设备接收到由上述视频服务器转发 的来自主播设备的重新编码的关键帧, 还包括: In the above embodiment, if no new key frame is received, only two steps 201 and 203 are performed. If a new key frame is received, it may be determined that there is a key frame loss, since the Missing keyframe-related non-keyframes, and non-keyframes record prediction information that is referenced to keyframes, so keyframe loss can cause non-keyframes associated with it to lose meaning, in order to reduce unnecessary decoding operations. And the video display error that may be caused, the embodiment of the present invention provides the following solution: Further, if the user equipment receives the forwarding by the video server Recoded keyframes from the anchor device, including:
上述用户设备停止上述重新编码的关键帧在视频帧中的位置之后的所有视 频帧的解码操作。  The user equipment described above stops the decoding operation of all of the video frames after the re-encoded key frame is in the video frame.
通常情况下,用户设备将接收到的视频帧进行存储,例如可存储在内存中。 进而再从内存中提取出所需的视频帧进行解码操作。 因此, 接收到的视频帧和 解码的视频帧可能存储在内存的不同位置。 基于前述方案丢弃了部分视频帧之 后, 这些视频帧仍有可能已被调用进行解码, 所以优选是进一步停止当前对视 频帧的解码操作, 从重新编码的关键帧及其非关键帧开始重新解码。  Typically, the user equipment stores the received video frames, for example, in memory. Then, the required video frame is extracted from the memory for decoding operation. Therefore, received video frames and decoded video frames may be stored in different locations in the memory. After discarding a portion of the video frames based on the foregoing scheme, these video frames may still have been called for decoding, so it is preferable to further stop the current decoding operation on the video frames, and re-decode from the re-encoded key frames and their non-key frames.
本发明实施例还提供了另一种视频直播控制方法, 该方法由视频直播系统 中的主播设备来执行, 该方法包括如下:  The embodiment of the present invention further provides another video live broadcast control method, which is performed by an anchor device in a live video system, and the method includes the following:
主播设备釆集当前需要直播的视频数据编码为视频帧, 并通过视频服务器 向用户设备发送视频帧 , 所述视频帧包含有关键帧和非关键帧;  The anchor device collects video data that needs to be broadcasted in real time into a video frame, and sends a video frame to the user equipment through the video server, where the video frame includes a key frame and a non-key frame;
若所述主播设备接收到告知信息, 则所述主播设备通过所述视频服务器向 用户设备发送新的关键帧。  And if the anchor device receives the notification information, the anchor device sends a new key frame to the user equipment by using the video server.
如前所述,主播设备接收告知信息,并发送新的关键帧的操作有多种方式。 其中, 如图 3所示, 该方法包括:  As mentioned earlier, there are many ways in which an anchor device can receive notification information and send new key frames. Wherein, as shown in FIG. 3, the method includes:
301: 主播设备釆集当前需要直播的视频数据编码为视频帧, 并通过视频服 务器向用户设备发送视频帧, 上述视频帧包含有关键帧和非关键帧;  301: The anchor device collects video data that needs to be broadcasted as a video frame, and sends a video frame to the user equipment by using a video server, where the video frame includes a key frame and a non-key frame.
302:若上述主播设备接收到告知信息,上述告知信息指示了丢失的关键帧; 则, 上述主播设备重新编码关键帧, 并通过上述视频服务器向用户设备发送重 新编码的关键帧。  302: If the anchor device receives the notification information, the notification information indicates the lost key frame; then, the anchor device re-encodes the key frame, and sends the re-encoded key frame to the user equipment by using the video server.
当然, 若所述主播设备接收到告知信息, 则所述主播设备通过所述视频服 务器向用户设备发送新的关键帧的操作还可以有其他方式:  Of course, if the anchor device receives the notification information, the anchor device may send another new key frame to the user equipment by using the video server.
另一种操作方式为: 若所述主播设备接收到告知信息, 则所述主播设备将 当前视频数据重新编码为关键帧和非关键帧, 并通过所述视频服务器向用户设 备发送。  Another mode of operation is: if the anchor device receives the notification information, the anchor device re-encodes the current video data into a key frame and a non-key frame, and sends the message to the user equipment through the video server.
该操作方式中, 主播设备获知出现了关键帧丢失, 则启动将当前直播视频 进行重新编码再发送。 再一种操作方式为: 若所述主播设备接收到指示丢失的关键帧的告知信息 , 则, 所述主播设备从緩存中选择所述丢失的关键帧的下一个关键帧和非关键帧, 并通过所述视频服务器向用户设备发送。 In this operation mode, when the anchor device learns that a key frame is lost, the current live video is re-encoded and then sent. A further mode of operation is: if the anchor device receives the notification information indicating the lost key frame, the anchor device selects the next key frame and the non-key frame of the lost key frame from the cache, and Sended to the user equipment by the video server.
该操作方式中, 主播设备获知出现了关键帧丢失, 且获知具体哪个关键帧 丢失, 则在緩存中查找是否存在已编码未发送的下一个关键帧, 从下一个关键 帧开始进行发送。  In this mode of operation, the anchor device learns that a key frame is lost, and knows which key frame is lost. In the cache, it searches for the next key frame that has been encoded and not transmitted, and starts transmitting from the next key frame.
以上实施例, 由视频服务器检测是否出现了关键帧丢失, 再由视频服务器 告知主播设备丢失的关键帧, 由主播设备重新编码关键帧, 可以使主播设备及 时上传新的关键帧, 消除关键帧丢失导致的画面无法显示和花屏现象。 由于不 必提高关键帧出现的频率,因此可以降低数据传输量,从而减少对带宽的要求, 使网络更加流畅。  In the above embodiment, the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device re-encodes the key frame, so that the anchor device can upload a new key frame in time to eliminate the key frame loss. The resulting picture cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
以上实施例中, 若没有收到告知信息, 则只需要执行 301就可以了, 如果 收到了告知信息, 则可以确定存在关键帧丢失的情况, 由于可能已经完成了与 该丢失的关键帧相关的非关键帧的编码 , 并且非关键帧记录的是以关键帧为参 照的预测信息, 因此关键帧丢失会导致与之相关联的非关键帧失去意义, 为了 减少在用户设备侧 (解码端) 不必要的解码操作、 不必要的数据传输, 以及可 能导致的视频显示错误, 本发明实施例提供了如下解决方案: 进一步地, 上述 方法, 还包括: 上述主播设备丢弃与丢失的关键帧关联的已经编码且未发送给 上述视频服务器的非关键帧。  In the above embodiment, if the notification information is not received, only 301 is needed. If the notification information is received, it may be determined that there is a key frame loss, because the lost key frame may have been completed. Non-keyframe encoding, and non-keyframe recording is based on keyframe prediction information, so keyframe loss will cause the non-keyframe associated with it to lose meaning, in order to reduce the user equipment side (decoding end) The present invention provides the following solutions: The foregoing method further includes: the foregoing anchor device discards the already associated with the lost key frame, and the foregoing decoding method is provided. Non-keyframes that are encoded and not sent to the video server above.
本发明实施例还提供了一种视频服务器, 如图 4所示, 包括:  The embodiment of the present invention further provides a video server, as shown in FIG. 4, including:
转发控制单元 401 ,用于控制将来自主播设备的视频帧转发给用户设备,上 述视频帧包含有关键帧和非关键帧;  a forwarding control unit 401, configured to control a video frame of the future autonomous device to be forwarded to the user equipment, where the video frame includes a key frame and a non-key frame;
丢帧监测单元 402 , 用于监测上述视频帧中是否出现关键帧丢失;  The frame loss monitoring unit 402 is configured to monitor whether a key frame is lost in the video frame.
信息发送单元 403 , 用于若上述丢帧监测单元 402监测到出现关键帧丢失, 则向上述主播设备发送告知信息 , 以使所述主播设备发送新的关键帧。  The information sending unit 403 is configured to: if the frame loss monitoring unit 402 detects that a key frame is lost, send the notification information to the anchor device, so that the anchor device sends a new key frame.
所述信息发送单元 403具体可用于若所述丢帧监测单元监测到出现关键帧 丢失, 则向所述主播设备发送告知信息, 告知上述主播设备丢失的关键帧, 使 上述主播设备发送重新编码的关键帧。 上述重新编码的关键帧可以为收到告知信息时, 主播设备依据当前直播数 据编码的关键帧, 而并不需对丢失的关键帧进行重新编码。 The information sending unit 403 is specifically configured to: if the frame loss monitoring unit detects that a key frame is lost, send the notification information to the anchor device, and notify the anchor device of the lost key frame, so that the anchor device sends the re-encoded Keyframe. The re-encoded key frame may be a key frame encoded by the anchor device according to the current live data when the notification information is received, and the lost key frame is not re-encoded.
或者, 所述信息发送单元 403具体可用于若所述丢帧监测单元监测到出现 关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备将当前视频 数据重新编码为关键帧和非关键帧, 向所述视频服务器发送。  Or the information sending unit 403 is specifically configured to: if the frame loss monitoring unit detects that a key frame is lost, send the notification information to the anchor device, so that the anchor device recodes the current video data into a key frame. And non-key frames, sent to the video server.
再或者, 所述信息发送单元 403具体可用于若所述丢帧监测单元监测到出 现关键帧丢失, 则向所述主播设备发送告知信息, 以告知所述主播设备丢失的 关键帧, 使所述主播设备从緩存中选择所述丢失的关键帧的下一个关键帧和非 关键帧, 向所述视频服务器发送。  Or the information sending unit 403 is specifically configured to: if the frame loss monitoring unit detects that a key frame is lost, send the notification information to the anchor device to notify the anchor device of the lost key frame, so that the The anchor device selects the next key frame and the non-key frame of the lost key frame from the cache and transmits to the video server.
以上实施例, 由视频服务器检测是否出现了关键帧丢失, 再由视频服务器 告知主播设备丢失的关键帧, 由主播设备发送新的关键帧, 可以使主播设备及 时上传新的关键帧, 消除关键帧丢失导致的画面无法显示和花屏现象。 由于不 必提高关键帧出现的频率,因此可以降低数据传输量,从而减少对带宽的要求, 使网络更加流畅。  In the above embodiment, the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame. The picture caused by the loss cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
进一步地, 由于与关键帧相关联的非关键帧记录的是以关键帧为参照的预 测信息, 因此如果出现了关键帧丢失, 那么与之相关联的非关键帧则会失去意 义, 为减少不必要的数据传输, 以及可能导致的视频显示错误, 本发明实施例 提供了如下解决方案: 进一步地, 如图 5所示, 上述视频服务器, 还包括: 控制丢帧单元 501 ,用于若接收到与丢失的关键帧相关联的非关键帧,则丢 弃上述与丢失的关键帧相关联的非关键帧。  Further, since the non-key frame associated with the key frame records the prediction information with reference to the key frame, if a key frame loss occurs, the non-key frame associated with it loses meaning, in order to reduce The video server of the present invention provides the following solution. The video server further includes: a control frame dropping unit 501, if received, as shown in FIG. The non-keyframe associated with the lost keyframe discards the non-keyframe associated with the missing keyframe as described above.
本发明实施例还提供了一种用户设备, 如图 6所示, 包括:  An embodiment of the present invention further provides a user equipment, as shown in FIG. 6, including:
视频接收单元 601 , 用于接收由视频服务器转发的来自主播设备的视频帧, 上述视频帧包含有关键帧和非关键帧;  a video receiving unit 601, configured to receive a video frame from an anchor device that is forwarded by a video server, where the video frame includes a key frame and a non-key frame;
帧确定单元 602, 用于确定是否在对当前视频帧解码未成功时接收到由所 述视频服务器转发的来自主播设备的新的关键帧;  a frame determining unit 602, configured to determine whether a new key frame from the anchor device forwarded by the video server is received when the current video frame is unsuccessfully decoded;
丢帧控制单元 603 , 用于若在对当前视频帧解码未成功时接收到由所述视 频服务器转发的来自主播设备的新的关键帧 , 则将所述未成功解码的视频帧丢 弃; 所述视频接收单元 601 , 还用于接收所述新的关键帧的非关键帧; 解码单 元 604 , 用于解码接收到的所述新的关键帧及其非关键帧; a frame loss control unit 603, configured to discard the unsuccessfully decoded video frame if a new key frame from the anchor device forwarded by the video server is received when the current video frame is unsuccessfully decoded; The video receiving unit 601 is further configured to receive the non-key frame of the new key frame, and the decoding unit 604 is configured to decode the received new key frame and its non-key frame;
显示单元 605 , 用于显示上述解码单元 604解码得到的视频画面。  The display unit 605 is configured to display the video picture decoded by the decoding unit 604.
具体的, 该所述视频接收单元 601 , 具体用于接收重新编码的关键帧之后 的视频帧;  Specifically, the video receiving unit 601 is specifically configured to receive a video frame after the re-encoded key frame;
帧确定单元 602 ,具体用于确定上述视频接收单元 601是否接收到由上述视 频服务器转发的来自主播设备的重新编码的关键帧;  The frame determining unit 602 is specifically configured to determine whether the video receiving unit 601 receives the re-encoded key frame from the anchor device forwarded by the video server;
丢帧控制单元 603,具体用于若上述帧确定单元 602确定上述视频接收单元 接收到由上述视频服务器转发的来自主播设备的重新编码的关键帧, 则, 上述 用户设备确定上述重新编码的关键帧在视频帧中的位置, 并将上述位置后的视 频帧数据丢弃;  The frame dropping control unit 603 is specifically configured to: if the frame determining unit 602 determines that the video receiving unit receives the re-encoded key frame from the anchor device forwarded by the video server, the user equipment determines the re-encoded key frame. Position in the video frame, and discard the video frame data after the above position;
以上实施例, 由视频服务器转发重现编码的关键帧对丢失的关键帧进行补 偿, 消除在视频直播过程中关键帧丢失导致的画面无法显示和花屏现象。 由于 不必提高关键帧出现的频率, 因此可以降低数据传输量, 从而减少对带宽的要 求, 使网络更加流畅。  In the above embodiment, the key frame of the re-encoded code is forwarded by the video server to compensate the lost key frame, and the picture cannot be displayed and the screen is lost due to the loss of the key frame during the live broadcast of the video. Since it is not necessary to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
以上实施例中, 如果收到了重新编码的关键帧, 则可以确定存在关键帧丢 失的情况, 由于可能已经收到了与该丢失的关键帧相关的非关键帧, 并且非关 键帧记录的是以关键帧为参照的预测信息, 因此关键帧丢失会导致与之相关联 的非关键帧失去意义, 为了减少不必要的解码操作, 以及可能导致的视频显示 错误, 本发明实施例提供了如下解决方案: 进一步地, 上述解码单元 604 , 还用 于若上述用户设备接收到由上述视频服务器转发的来自主播设备的重新编码的 关键帧, 则停止上述重新编码的关键帧在视频帧中的位置之后的所有视频帧的 解码操作。  In the above embodiment, if the re-encoded key frame is received, it may be determined that there is a key frame loss condition, since the non-key frame associated with the lost key frame may have been received, and the non-key frame record is the key The frame is the referenced prediction information, so the key frame loss may cause the non-key frame associated with it to be meaningless. In order to reduce the unnecessary decoding operation and the video display error that may be caused, the embodiment of the present invention provides the following solutions: Further, the decoding unit 604 is further configured to: if the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, stop all the re-encoded key frames in the video frame The decoding operation of the video frame.
本发明实施例还提供了一种主播设备, 如图 7所示, 包括:  An embodiment of the present invention further provides an anchor device, as shown in FIG. 7, including:
数据釆集单元 701 , 用于釆集当前需要直播的视频数据;  a data collection unit 701, configured to collect video data that needs to be broadcasted at present;
编码单元 702 , 用于将上述数据釆集单元釆集的视频数据编码为视频帧, 上述视频帧包含有关键帧和非关键帧;  The encoding unit 702 is configured to encode the video data collected by the data collection unit into a video frame, where the video frame includes a key frame and a non-key frame;
发送单元 703 , 用于通过视频服务器向用户设备发送所述编码单元编码得 到的视频帧; a sending unit 703, configured to send, by using a video server, the coding unit to send to the user equipment Video frame to;
信息接收单元 704, 用于接收关键帧丢失的告知信息;  The information receiving unit 704 is configured to receive notification information of a key frame loss.
所述发送单元 703 , 还用于若所述信息接收单元 704接收到所述告知信息 , 则通过所述视频服务器向用户设备发送新的关键帧。  The sending unit 703 is further configured to: if the information receiving unit 704 receives the notification information, send a new key frame to the user equipment by using the video server.
各单元的具体实现方式有多种:  There are several specific implementations of each unit:
一种实现方式为: 所述编码单元 702,可具体用于若上述主播设备接收到告 知信息, 则, 重新编码关键帧;  An implementation manner is: the coding unit 702 may be specifically configured to: if the foregoing anchor device receives the notification information, re-encode the key frame;
发送单元 703 ,具体用于通过视频服务器向用户设备发送上述编码单元编码 得到的视频帧, 通过上述视频服务器向用户设备发送重新编码的关键帧;  The sending unit 703 is specifically configured to send, by using the video server, the video frame encoded by the coding unit to the user equipment, and send the re-encoded key frame to the user equipment by using the video server;
信息接收单元 704 ,具体用于接收告知信息,上述告知信息指示了丢失的关 键帧。  The information receiving unit 704 is specifically configured to receive the notification information, where the notification information indicates the lost key frame.
另一种实现方式为: 所述编码单元 702, 具体用于若接收到告知信息, 则 将当前视频数据重新编码为关键帧和非关键帧;  Another implementation manner is: the coding unit 702 is specifically configured to re-encode the current video data into a key frame and a non-key frame if the notification information is received;
所述发送单元 703 , 具体用于通过所述视频服务器将所述编码单元重新编 码的关键帧和非关键帧向用户设备发送。  The sending unit 703 is specifically configured to send the key frame and the non-key frame re-encoded by the coding unit to the user equipment by using the video server.
再一种实现方式为: 所述发送单元 703 , 具体用于若接收到指示丢失的关 键帧的告知信息, 则, 从緩存中选择所述丢失的关键帧的下一个关键帧和非关 键帧, 并通过所述视频服务器向用户设备发送。  A further implementation manner is: the sending unit 703 is specifically configured to: if receiving the notification information indicating the lost key frame, select the next key frame and the non-key frame of the lost key frame from the cache, And sending to the user equipment through the video server.
以上实施例, 由视频服务器检测是否出现了关键帧丢失, 再由视频服务器 告知主播设备丢失的关键帧, 由主播设备发送新的关键帧, 可以使主播设备及 时上传新的关键帧, 消除关键帧丢失导致的画面无法显示和花屏现象。 由于不 必提高关键帧出现的频率,因此可以降低数据传输量,从而减少对带宽的要求, 使网络更加流畅。  In the above embodiment, the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame. The picture caused by the loss cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
以上实施例中,如果收到了告知信息,则可以确定存在关键帧丢失的情况, 由于可能已经完成了与该丢失的关键帧相关的非关键帧的编码, 并且非关键帧 记录的是以关键帧为参照的预测信息, 因此关键帧丢失会导致与之相关联的非 关键帧失去意义, 为了减少在用户设备侧 (解码端) 不必要的解码操作、 不必 要的数据传输, 以及可能导致的视频显示错误, 本发明实施例提供了如下解决 方案: 进一步地, 如图 8所示, 上述主播设备, 还包括: In the above embodiment, if the notification information is received, it may be determined that there is a case where the key frame is lost, since the encoding of the non-key frame related to the lost key frame may have been completed, and the non-key frame is recorded with the key frame. For the reference information, the loss of key frames will cause the non-key frames associated with them to lose meaning, in order to reduce unnecessary decoding operations, unnecessary data transmission, and possible video on the user equipment side (decoding side). The display of the error is provided by the embodiment of the present invention. Solution: Further, as shown in FIG. 8, the foregoing anchor device further includes:
丢帧单元 801 ,用于丢弃与丢失的关键帧关联的已经编码且未发送给上述视 频服务器的非关键帧。  A frame loss unit 801 is configured to discard non-key frames that have been encoded and are not sent to the video server associated with the lost key frame.
本发明实施例还提供了另一种视频服务器,如图 9所示,包括:接收器 901、 发射器 902、 处理器 903以及存储器 904;  The embodiment of the present invention further provides another video server, as shown in FIG. 9, comprising: a receiver 901, a transmitter 902, a processor 903, and a memory 904;
其中处理器 903 ,用于控制视频服务器将来自主播设备的视频帧转发给用户 设备, 上述视频帧包含有关键帧和非关键帧; 监测上述视频帧中是否出现关键 帧丢失; 若监测到出现关键帧丢失, 则控制向上述主播设备发送告知信息, 以 使所述主播设备发送新的关键帧。  The processor 903 is configured to control the video server to forward the video frame of the autonomous device to the user equipment, where the video frame includes a key frame and a non-key frame; monitoring whether the key frame is lost in the video frame; If the frame is lost, the control sends a notification message to the anchor device to enable the anchor device to send a new key frame.
具体可以是若监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 告知上述主播设备丢失的关键帧 , 使上述主播设备发送重新编码的关键帧。  Specifically, if the key frame loss is detected, the notification information is sent to the anchor device, and the key frame lost by the anchor device is notified, so that the anchor device sends the re-encoded key frame.
上述重新编码的关键帧可以为收到告知信息时, 主播设备依据当前直播数 据编码的关键帧, 而并不需对丢失的关键帧进行重新编码。  The re-encoded key frame may be a key frame encoded by the anchor device according to the current live data when the notification information is received, and the lost key frame is not re-encoded.
或者,具体是若监测到出现关键帧丢失,则向所述主播设备发送告知信息, 以使所述主播设备将当前视频数据重新编码为关键帧和非关键帧, 向所述视频 服务器发送。  Or, specifically, if a key frame loss is detected, the notification information is sent to the anchor device, so that the anchor device re-encodes the current video data into a key frame and a non-key frame, and sends the message to the video server.
再或者, 若监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 以 告知所述主播设备丢失的关键帧 , 使所述主播设备从緩存中选择所述丢失的关 键帧的下一个关键帧和非关键帧, 向所述视频服务器发送。  Or, if a key frame loss is detected, sending a notification message to the anchor device to notify the anchor device of the missing key frame, so that the anchor device selects the next one of the lost key frames from the cache. Key frames and non-key frames are sent to the video server.
以上实施例, 由视频服务器检测是否出现了关键帧丢失, 再由视频服务器 告知主播设备丢失的关键帧, 由主播设备发送新的关键帧, 可以使主播设备及 时上传新的关键帧, 消除关键帧丢失导致的画面无法显示和花屏现象。 由于不 必提高关键帧出现的频率,因此可以降低数据传输量,从而减少对带宽的要求, 使网络更加流畅。  In the above embodiment, the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame. The picture caused by the loss cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
进一步地, 由于与关键帧相关联的非关键帧记录的是以关键帧为参照的预 测信息, 因此如果出现了关键帧丢失, 那么与之相关联的非关键帧则会失去意 义, 为减少不必要的数据传输, 以及可能导致的视频显示错误, 本发明实施例 提供了如下解决方案: 进一步地, 处理器 903 , 还用于若接收到与丢失的关键帧 相关联的非关键帧, 则丢弃上述与丢失的关键帧相关联的非关键帧。 本发明实施例还提供了另一种用户设备,如图 10所示,包括:接收器 1001、 发射器 1002、 处理器 1003以及存储器 1004 ; Further, since the non-key frame associated with the key frame records the prediction information with reference to the key frame, if a key frame loss occurs, the non-key frame associated with it loses meaning, in order to reduce The necessary data transmission, and the video display error that may be caused, the embodiment of the present invention provides the following solution: Further, the processor 903 is further configured to receive and lose key frames if The associated non-keyframes discard the non-keyframes associated with the missing keyframes described above. An embodiment of the present invention further provides another user equipment, as shown in FIG. 10, including: a receiver 1001, a transmitter 1002, a processor 1003, and a memory 1004.
其中处理器 1003 ,用于控制用户设备接收由视频服务器转发的来自主播设 备的视频帧, 上述视频帧包含有关键帧和非关键帧; 若在对当前视频帧解码未 成功时接收到由所述视频服务器转发的来自主播设备的新的关键帧 , 则将所述 未成功解码的视频帧丢弃, 并接收所述新的关键帧的非关键帧; 解码接收到的 所述新的关键帧及其非关键帧, 并显示解码得到的视频画面。  The processor 1003 is configured to control, by the user equipment, the video frame from the anchor device that is forwarded by the video server, where the video frame includes a key frame and a non-key frame; if the video frame is unsuccessfully decoded, the a new key frame forwarded by the video server from the anchor device, discarding the unsuccessfully decoded video frame, and receiving the non-key frame of the new key frame; decoding the received new key frame and Non-keyframe, and display the decoded video picture.
具体可以是若上述用户设备接收到由上述视频服务器转发的来自主播设 备的重新编码的关键帧, 则, 确定上述重新编码的关键帧在视频帧中的位置, 并将上述位置后的视频帧数据丢弃, 并接收上述重新编码的关键帧之后的视频 帧; 解码接收到的视频帧, 并控制显示解码得到的视频画面。  Specifically, if the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, determining a position of the re-encoded key frame in the video frame, and setting the video frame data after the location Discarding, and receiving the video frame after the above-mentioned re-encoded key frame; decoding the received video frame, and controlling display of the decoded video picture.
以上实施例, 由视频服务器转发重现编码的关键帧对丢失的关键帧进行补 偿, 消除在视频直播过程中关键帧丢失导致的画面无法显示和花屏现象。 由于 不必提高关键帧出现的频率, 因此可以降低数据传输量, 从而减少对带宽的要 求, 使网络更加流畅。  In the above embodiment, the key frame of the re-encoded code is forwarded by the video server to compensate the lost key frame, and the picture cannot be displayed and the screen is lost due to the loss of the key frame during the live broadcast of the video. Since it is not necessary to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
以上实施例中, 如果收到了重新编码的关键帧, 则可以确定存在关键帧丢 失的情况, 由于可能已经收到了与该丢失的关键帧相关的非关键帧, 并且非关 键帧记录的是以关键帧为参照的预测信息, 因此关键帧丢失会导致与之相关联 的非关键帧失去意义, 为了减少不必要的解码操作, 以及可能导致的视频显示 错误, 本发明实施例提供了如下解决方案: 进一步地, 上述处理器 1003 , 还用 于若上述用户设备接收到由上述视频服务器转发的来自主播设备的重新编码的 关键帧, 则停止上述重新编码的关键帧在视频帧中的位置之后的所有视频帧的 解码操作。  In the above embodiment, if the re-encoded key frame is received, it may be determined that there is a key frame loss condition, since the non-key frame associated with the lost key frame may have been received, and the non-key frame record is the key The frame is the referenced prediction information, so the key frame loss may cause the non-key frame associated with it to be meaningless. In order to reduce the unnecessary decoding operation and the video display error that may be caused, the embodiment of the present invention provides the following solutions: Further, the processor 1003 is further configured to: if the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, stop all the re-encoded key frames in the video frame The decoding operation of the video frame.
本发明实施例还提供了另一种主播设备,如图 11所示,包括:接收器 1101、 发射器 1102、 处理器 1103以及存储器 1104 ;  The embodiment of the present invention further provides another anchor device, as shown in FIG. 11, comprising: a receiver 1101, a transmitter 1102, a processor 1103, and a memory 1104;
其中处理器 1103 , 用于控制釆集当前需要直播的视频数据编码为视频帧, 并通过视频服务器向用户设备发送视频帧, 上述视频帧包含有关键帧和非关键 帧; 若所述主播设备接收到告知信息, 则所述主播设备通过所述视频服务器向 用户设备发送新的关键帧。 The processor 1103 is configured to control, to collect, video data that is currently required to be broadcasted into a video frame, and send a video frame to the user equipment by using the video server, where the video frame includes a key frame and a non-key a frame; if the anchor device receives the notification information, the anchor device sends a new key frame to the user equipment through the video server.
具体是, 若上述主播设备接收到告知信息, 上述告知信息指示了丢失的关 键帧; 则, 上述主播设备重新编码关键帧, 并通过上述视频服务器向用户设备 发送重新编码的关键帧。  Specifically, if the anchor device receives the notification information, the notification information indicates the lost key frame; then, the anchor device re-encodes the key frame, and sends the re-encoded key frame to the user equipment through the video server.
或者, 可以是若所述主播设备接收到告知信息, 则所述主播设备将当前视 频数据重新编码为关键帧和非关键帧, 并通过所述视频服务器向用户设备发送。  Alternatively, if the anchor device receives the notification information, the anchor device re-encodes the current video data into a key frame and a non-key frame, and sends the message to the user equipment by using the video server.
再或者,可以是若所述主播设备接收到指示丢失的关键帧的告知信息,则, 所述主播设备从緩存中选择所述丢失的关键帧的下一个关键帧和非关键帧, 并 通过所述视频服务器向用户设备发送。  Or, if the anchor device receives the notification information indicating the lost key frame, the anchor device selects the next key frame and the non-key frame of the lost key frame from the cache, and passes the The video server sends to the user equipment.
以上实施例, 由视频服务器检测是否出现了关键帧丢失, 再由视频服务器 告知主播设备丢失的关键帧, 由主播设备发送新的关键帧, 可以使主播设备及 时上传新的关键帧, 消除关键帧丢失导致的画面无法显示和花屏现象。 由于不 必提高关键帧出现的频率,因此可以降低数据传输量,从而减少对带宽的要求, 使网络更加流畅。  In the above embodiment, the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame. The picture caused by the loss cannot be displayed and the screen is displayed. Since the frequency of key frames does not have to be increased, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
以上实施例中,如果收到了告知信息,则可以确定存在关键帧丢失的情况, 由于可能已经完成了与该丢失的关键帧相关的非关键帧的编码, 并且非关键帧 记录的是以关键帧为参照的预测信息, 因此关键帧丢失会导致与之相关联的非 关键帧失去意义, 为了减少在用户设备侧 (解码端) 不必要的解码操作、 不必 要的数据传输, 以及可能导致的视频显示错误, 本发明实施例提供了如下解决 方案: 进一步地, 上述处理器 1103 , 还用于丢弃与丢失的关键帧关联的已经编 码且未发送给上述视频服务器的非关键帧。  In the above embodiment, if the notification information is received, it may be determined that there is a case where the key frame is lost, since the encoding of the non-key frame related to the lost key frame may have been completed, and the non-key frame is recorded with the key frame. For the reference information, the loss of key frames will cause the non-key frames associated with them to lose meaning, in order to reduce unnecessary decoding operations, unnecessary data transmission, and possible video on the user equipment side (decoding side). In the embodiment of the present invention, the following solutions are provided: Further, the processor 1103 is further configured to discard a non-key frame that has been encoded and is not sent to the video server that is associated with the lost key frame.
本发明实施例还提供了一种视频直播系统, 如图 12所示, 包括: 主播设备 1201、 用户设备 1202以及视频服务器 1203;  The embodiment of the present invention further provides a video live broadcast system, as shown in FIG. 12, including: an anchor device 1201, a user device 1202, and a video server 1203;
上述主播设备 1201为本发明实施例提供的任意一项的主播设备,上述视频 服务器 1203为本发明实施例提供的任意一项的视频服务器,上述用户设备 1202 为本发明实施例提供的任意一项的用户设备。  The anchor device 1201 is an anchor device according to any one of the embodiments of the present invention. The video server 1203 is a video server according to any one of the embodiments of the present invention. User equipment.
本发明实施例是根据主播设备直播过程中上行关键帧数据进行的补偿方案。 当视频服务器发现主播设备直播过程中上行关键帧数据丢失时, 将该信息反馈 给主播设备的客户端, 主播设备通知客户端编码模块停止非关键帧的编码, 重 新开始编码一个关键帧或下一个关键帧的发送, 用户设备的客户端收到这个完 整的关键帧后, 就能解码显示正常的视频画面。 请参阅图 1 3所示, 一个优选实 例的具体流程如下: The embodiment of the invention is a compensation scheme based on uplink key frame data in the live broadcast process of the anchor device. When the video server finds that the uplink key frame data is lost during the live broadcast of the anchor device, the information is fed back to the client of the anchor device, and the anchor device notifies the client encoding module to stop encoding the non-key frame, and restarts encoding a key frame or the next one. After the key frame is sent, the client of the user equipment can decode and display the normal video picture after receiving the complete key frame. Referring to FIG. 13 , the specific process of a preferred example is as follows:
1 301: 主播设备釆集直播数据, 编码得到视频帧并发送给视频服务器, 视 频服务器转发视频帧给用户设备。 本步骤中, 视频帧包含有关键帧以及非关键 帧。  1 301: The anchor device collects live data, encodes the video frame and sends it to the video server, and the video server forwards the video frame to the user equipment. In this step, the video frame contains key frames as well as non-critical frames.
1 302: 视频服务器发现主播设备直播上行关键帧数据丢失, 将告知信息反 馈给主播设备的客户端, 告知丢失的关键帧是哪一个关键帧。  1 302: The video server finds that the broadcast device's live uplink key frame data is lost, and the information is sent back to the client of the anchor device to indicate which key frame the lost key frame is.
1 303: 主播设备的客户端通知客户端编码模块停止非关键帧的编码, 重新 开始编码一个关键帧。  1 303: The client of the anchor device notifies the client encoding module to stop the encoding of the non-keyframe and restarts encoding a key frame.
1 304: 主播设备的客户端将还未上传的与丢失的关键帧相关联的非关键帧 数据全部丢弃。  1 304: The client of the anchor device discards all non-keyframe data associated with the lost keyframe that has not been uploaded.
1 305 : 主播设备的客户端上传即时重新编码的关键帧数据给视频服务器, 并通过视频服务器将重新编码的关键帧数据发送给用户设备。  1 305: The client of the anchor device uploads the instant recoded key frame data to the video server, and sends the re-encoded key frame data to the user equipment through the video server.
1 306 : 用户设备的客户端停止解码, 丢弃所有视频帧 (由于之前正确解码 的数据已经显示, 后续数据应以重现编码的关键帧为起点, 因此可以丢弃所有 视频帧),直到接收到步骤 1 305的关键帧,然后重新解码显示正常的视频画面。  1 306: The client of the user equipment stops decoding and discards all video frames (since the previously correctly decoded data has been displayed, the subsequent data should start with the re-encoded key frame, so all video frames can be discarded) until the steps are received. The key frame of 1 305 is then re-decoded to display the normal video picture.
以上实施例中, 主播设备上行瞬间丢包时, 能让用户在艮短的时间恢复正 常的视频画面,不会出现长时间的花屏停顿现象。由于只有关键帧数据丢失时, 才即时编码关键帧, 不会出现码率上升而导致网络拥塞。  In the above embodiment, when the anchor device loses packets in the uplink, it can restore the normal video frame in a short time, and there is no long-term pause. Since only the key frame data is lost, the key frame is encoded immediately, and the code rate does not rise and the network is congested.
本发明实施例还提供了一种包含计算机可执行指令的存储介质, 所述计算 机可执行指令在由计算机处理器执行时用于执行一种视频直播控制方法, 该方 法包括:  The embodiment of the present invention further provides a storage medium including computer executable instructions for executing a video live broadcast control method when executed by a computer processor, the method comprising:
视频服务器将来自主播设备的视频帧转发给用户设备, 所述视频帧包含有 关键帧和非关键帧;  The video server forwards the video frame of the autonomous device to the user equipment, where the video frame includes key frames and non-key frames;
视频服务器监测所述视频帧中是否出现关键帧丢失; 视频服务器若监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备发送新的关键帧。 The video server monitors whether a key frame loss occurs in the video frame; If the video server detects that a key frame is lost, the notification message is sent to the anchor device, so that the anchor device sends a new key frame.
本发明实施例还提供了一种包含计算机可执行指令的存储介质, 所述计算 机可执行指令在由计算机处理器执行时用于执行一种视频直播控制方法, 该方 法包括:  The embodiment of the present invention further provides a storage medium including computer executable instructions for executing a video live broadcast control method when executed by a computer processor, the method comprising:
用户设备接收由视频服务器转发的来自主播设备的视频帧 , 所述视频帧包 含有关键帧和非关键帧;  The user equipment receives a video frame from the anchor device forwarded by the video server, the video frame packet containing key frames and non-key frames;
若所述用户设备在对当前视频帧解码未成功时接收到由所述视频服务器 转发的来自主播设备的新的关键帧, 则将所述未成功解码的视频帧丢弃, 并接 收所述新的关键帧的非关键帧;  If the user equipment receives a new key frame from the anchor device forwarded by the video server when decoding the current video frame is unsuccessful, discarding the unsuccessfully decoded video frame, and receiving the new Non-keyframes of keyframes;
所述用户设备解码接收到的所述新的关键帧及其非关键帧, 并显示解码得 到的视频画面。  The user equipment decodes the received new key frame and its non-key frame, and displays the decoded video picture.
本发明实施例还提供了一种包含计算机可执行指令的存储介质, 所述计算 机可执行指令在由计算机处理器执行时用于执行一种视频直播控制方法, 该方 法包括:  The embodiment of the present invention further provides a storage medium including computer executable instructions for executing a video live broadcast control method when executed by a computer processor, the method comprising:
主播设备釆集当前需要直播的视频数据编码为视频帧, 并通过视频服务器 向用户设备发送视频帧 , 所述视频帧包含有关键帧和非关键帧;  The anchor device collects video data that needs to be broadcasted in real time into a video frame, and sends a video frame to the user equipment through the video server, where the video frame includes a key frame and a non-key frame;
若所述主播设备接收到告知信息, 则所述主播设备将新的关键帧向所述视 频服务器发送。  If the anchor device receives the notification information, the anchor device transmits a new key frame to the video server.
上述各计算机可执行指令的存储介质所执行的视频直播控制方法均可进一 步执行本发明实施例提供的视频直播控制方法。  The video live broadcast control method performed by the storage medium of each computer executable instruction can further perform the video live broadcast control method provided by the embodiment of the present invention.
本发明实施例还提供了一种终端设备, 如图 14所示, 为了便于说明, 仅示 出了与本发明实施例相关的部分, 具体技术细节未揭示的, 请参照本发明实施 例方法部分。 该终端可以为包括手机、 平板电脑、 PDA ( Persona l Dig i ta l As s i s tant , 个人数字助理)、 POS ( Point of Sa les , 销售终端)、 车载电脑等 任意终端设备, 以终端为手机为例:  The embodiment of the present invention further provides a terminal device. As shown in FIG. 14 , for the convenience of description, only parts related to the embodiment of the present invention are shown. For details that are not disclosed, refer to the method part of the embodiment of the present invention. . The terminal may be any mobile device, a tablet computer, a PDA (Personal Data Center), a POS (Point of Sa les, a sales terminal), an in-vehicle computer, or the like, and the terminal is a mobile phone. example:
图 14示出的是与本发明实施例提供的终端相关的手机的部分结构的框图。 参考图 14 , 手机包括: 射频(Radio Frequency, RF )电路 1410、 存储器 1420、 输入单元 1430、显示单元 1440、传感器 1450、音频电路 1460、无线保真(wireless fidelity, WiFi )模块 1470、 处理器 1480、 以及电源 1490等部件。 本领域技 术人员可以理解, 图 14中示出的手机结构并不构成对手机的限定, 可以包括比 图示更多或更少的部件, 或者组合某些部件, 或者不同的部件布置。 FIG. 14 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present invention. Referring to FIG. 14, the mobile phone includes: a radio frequency (RF) circuit 1410, a memory 1420, The input unit 1430, the display unit 1440, the sensor 1450, the audio circuit 1460, the wireless fidelity (WiFi) module 1470, the processor 1480, and the power supply 1490 and the like. It will be understood by those skilled in the art that the structure of the handset shown in FIG. 14 does not constitute a limitation to the handset, and may include more or less components than those illustrated, or some components may be combined, or different components may be arranged.
下面结合图 14对手机的各个构成部件进行具体的介绍:  The following describes the components of the mobile phone in detail with reference to FIG. 14:
RF电路 1410可用于收发信息或通话过程中, 信号的接收和发送, 特别地, 将基站的下行信息接收后, 给处理器 1480处理; 另外, 将设计上行的数据发送 给基站。 通常, RF电路包括但不限于天线、 至少一个放大器、 收发信机、 耦合 器、 低噪声放大器(Low Noise Amplifier, LNA )、 双工器等。 此外, RF 电路 140还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通 信标准或协议, 包括但不限于全球移动通讯系统 ( Global System of Mobile communication, GSM )、 通用分组无线月良务 ( General Packet Radio Service, GPRS)、 码分多址 ( Code Division Multiple Access, CDMA )、 宽带码分多址 (Wideband Code Division Multiple Access, WCDMA )> 长期演进 ( Long Term Evolution, LTE )、 电子邮件、 短消息月良务(Short Messaging Service, SMS ) 等。  The RF circuit 1410 can be used for receiving and transmitting signals during and after receiving or transmitting information, and in particular, after receiving the downlink information of the base station, it is processed by the processor 1480; in addition, the uplink data is designed to be sent to the base station. Generally, RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 140 can also communicate with the network and other devices via wireless communication. The above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), and code division multiple access ( Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA) > Long Term Evolution (LTE), e-mail, Short Messaging Service (SMS), etc.
存储器 1420可用于存储软件程序以及模块, 处理器 1480通过运行存储在 存储器 1420的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。 存储器 1420可主要包括存储程序区和存储数据区, 其中, 存储程序区可存储操 作系统、至少一个功能所需的应用程序(比如声音播放功能、 图像播放功能等) 等; 存储数据区可存储根据手机的使用所创建的数据(比如音频数据、 电话本 等)等。 此外, 存储器 1420可以包括高速随机存取存储器, 还可以包括非易失 性存储器, 例如至少一个磁盘存储器件、 闪存器件、 或其他易失性固态存储器 件。  The memory 1420 can be used to store software programs and modules, and the processor 1480 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 1420. The memory 1420 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of the mobile phone (such as audio data, phone book, etc.). In addition, memory 1420 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state memory device.
输入单元 1430可用于接收输入的数字或字符信息, 以及产生与手机 1400 的用户设置以及功能控制有关的键信号输入。 具体地, 输入单元 1430可包括触 控面板 1431 以及其他输入设备 1432。 触控面板 1431, 也称为触摸屏, 可收集 用户在其上或附近的触摸操作 (比如用户使用手指、 触笔等任何适合的物体或 附件在触控面板 1431上或在触控面板 1431附近的操作 ),并根据预先设定的程 式驱动相应的连接装置。 可选的, 触控面板 1431可包括触摸检测装置和触摸控 制器两个部分。 其中, 触摸检测装置检测用户的触摸方位, 并检测触摸操作带 来的信号, 将信号传送给触摸控制器; 触摸控制器从触摸检测装置上接收触摸 信息, 并将它转换成触点坐标, 再送给处理器 1480, 并能接收处理器 1480发来 的命令并加以执行。 此外, 可以釆用电阻式、 电容式、 红外线以及表面声波等 多种类型实现触控面板 1431。 除了触控面板 1431 , 输入单元 1430还可以包括 其他输入设备 1432。 具体地, 其他输入设备 1432可以包括但不限于物理键盘、 功能键(比如音量控制按键、 开关按键等)、 轨迹球、 鼠标、 操作杆等中的一种 或多种。 The input unit 1430 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the handset 1400. Specifically, the input unit 1430 may include a touch panel 1431 and other input devices 1432. The touch panel 1431, also referred to as a touch screen, can collect touch operations on or near the user (such as a user using a finger, a stylus, etc. or any suitable object or The attachment is operated on the touch panel 1431 or in the vicinity of the touch panel 1431, and the corresponding connecting device is driven according to a preset program. Optionally, the touch panel 1431 may include two parts: a touch detection device and a touch controller. Wherein, the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information The processor 1480 is provided and can receive commands from the processor 1480 and execute them. In addition, the touch panel 1431 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1431, the input unit 1430 may also include other input devices 1432. Specifically, the other input device 1432 may include, but is not limited to, one or more of a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, a joystick, and the like.
显示单元 1440可用于显示由用户输入的信息或提供给用户的信息以及手机 的各种菜单。 显示单元 1440可包括显示面板 1441 , 可选的, 可以釆用液晶显示 器 ( Liquid Crys ta l Di splay, LCD )、有机发光二极管 ( Organic Light-Emi t t ing Diode, OLED )等形式来配置显示面板 1441。 进一步的, 触控面板 1431可覆盖 显示面板 1441 , 当触控面板 1431检测到在其上或附近的触摸操作后,传送给处 理器 1480以确定触摸事件的类型, 随后处理器 1480根据触摸事件的类型在显 示面板 1441上提供相应的视觉输出。 虽然在图 14中, 触控面板 1431与显示面 板 1441是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施 例中, 可以将触控面板 1431与显示面板 1441集成而实现手机的输入和输出功 The display unit 1440 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone. The display unit 1440 may include a display panel 1441. Alternatively, the display panel 1441 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. . Further, the touch panel 1431 may cover the display panel 1441. When the touch panel 1431 detects a touch operation thereon or nearby, the touch panel 1431 transmits to the processor 1480 to determine the type of the touch event, and then the processor 1480 according to the touch event. The type provides a corresponding visual output on display panel 1441. Although the touch panel 1431 and the display panel 1441 are used as two independent components to implement the input and input functions of the mobile phone in FIG. 14, in some embodiments, the touch panel 1431 and the display panel 1441 may be integrated. Realize the input and output of the phone
•6匕 •6匕
3匕。 3匕.
手机 1400还可包括至少一种传感器 1450, 比如光传感器、运动传感器以及 其他传感器。 具体地, 光传感器可包括环境光传感器及接近传感器, 其中, 环 境光传感器可根据环境光线的明暗来调节显示面板 1441的亮度,接近传感器可 在手机移动到耳边时,关闭显示面板 1441和 /或背光。作为运动传感器的一种, 加速计传感器可检测各个方向上(一般为三轴)加速度的大小, 静止时可检测 出重力的大小及方向, 可用于识别手机姿态的应用 (比如横竖屏切换、 相关游 戏、 磁力计姿态校准)、 振动识别相关功能(比如计步器、 敲击)等; 至于手机 还可配置的陀螺仪、 气压计、 湿度计、 温度计、 红外线传感器等其他传感器, 音频电路 1460、 扬声器 1461 , 传声器 1462可提供用户与手机之间的音频 接口。 音频电路 1460 可将接收到的音频数据转换后的电信号, 传输到扬声器 1461 , 由扬声器 1461转换为声音信号输出; 另一方面, 传声器 1462将收集的 声音信号转换为电信号, 由音频电路 1460接收后转换为音频数据, 再将音频数 据输出处理器 1480处理后, 经 RF电路 1410以发送给比如另一手机, 或者将音 频数据输出至存储器 1420以便进一步处理。 The handset 1400 can also include at least one type of sensor 1450, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1441 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1441 and/or when the mobile phone moves to the ear. Or backlight. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as well as other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. An audio circuit 1460, a speaker 1461, and a microphone 1462 can provide an audio interface between the user and the handset. The audio circuit 1460 can transmit the converted electrical data of the received audio data to the speaker 1461 and convert it into a sound signal output by the speaker 1461. On the other hand, the microphone 1462 converts the collected sound signal into an electrical signal, and the audio circuit 1460 After receiving, it is converted into audio data, and then processed by the audio data output processor 1480, transmitted to the other mobile phone via the RF circuit 1410, or outputted to the memory 1420 for further processing.
WiFi属于短距离无线传输技术, 手机通过 WiFi模块 1470可以帮助用户收 发电子邮件、 浏览网页和访问流式媒体等, 它为用户提供了无线的宽带互联网 访问。 虽然图 14示出了 WiFi模块 1470, 但是可以理解的是, 其并不属于手机 1400的必须构成, 完全可以根据需要在不改变发明的本质的范围内而省略。  WiFi is a short-range wireless transmission technology. The mobile phone can help users to send and receive emails, browse web pages and access streaming media through the WiFi module 1470. It provides users with wireless broadband Internet access. Although FIG. 14 shows the WiFi module 1470, it can be understood that it does not belong to the essential configuration of the mobile phone 1400, and may be omitted as needed within the scope of not changing the essence of the invention.
处理器 1480是手机的控制中心, 利用各种接口和线路连接整个手机的各个 部分, 通过运行或执行存储在存储器 1420 内的软件程序和 /或模块, 以及调用 存储在存储器 1420内的数据, 执行手机的各种功能和处理数据, 从而对手机进 行整体监控。 可选的, 处理器 1480可包括一个或多个处理单元; 优选的, 处理 器 1480可集成应用处理器和调制解调处理器, 其中, 应用处理器主要处理操作 系统、 用户界面和应用程序等, 调制解调处理器主要处理无线通信。 可以理解 的是, 上述调制解调处理器也可以不集成到处理器 1480中。  The processor 1480 is the control center of the handset, which connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 1420, and by invoking data stored in the memory 1420, The phone's various functions and processing data, so that the overall monitoring of the phone. Optionally, the processor 1480 may include one or more processing units. Preferably, the processor 1480 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like. The modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 1480.
手机 1400还包括给各个部件供电的电源 1490 (比如电池), 优选的, 电源 可以通过电源管理系统与处理器 1480逻辑相连,从而通过电源管理系统实现管 理充电、 放电、 以及功耗管理等功能。  The handset 1400 also includes a power source 1490 (such as a battery) for powering various components. Preferably, the power source can be logically coupled to the processor 1480 through a power management system to perform functions such as managing charging, discharging, and power management through the power management system.
尽管未示出, 手机 1400还可以包括摄像头、 蓝牙模块等, 在此不再赘述。 在本发明实施例中, 该终端所包括的处理器 1480还具有以下功能: 若作为用户设备使用, 则处理器 1480, 用于控制用户设备接收由视频服务 器转发的来自主播设备的视频帧, 上述视频帧包含有关键帧和非关键帧; 若所 述用户设备在对当前视频帧解码未成功时接收到由所述视频服务器转发的来 自主播设备的新的关键帧, 则将所述未成功解码的视频帧丢弃, 并接收所述新 的关键帧的非关键帧; 所述用户设备解码接收到的所述新的关键帧及其非关键 帧, 并显示解码得到的视频画面。 Although not shown, the mobile phone 1400 may further include a camera, a Bluetooth module, and the like, and details are not described herein. In the embodiment of the present invention, the processor 1480 included in the terminal further has the following functions: if used as a user equipment, the processor 1480 is configured to control the user equipment to receive a video frame from the anchor device forwarded by the video server, where The video frame includes a key frame and a non-key frame; if the user equipment receives a new key frame forwarded by the video server from the anchor device when the current video frame is unsuccessfully decoded, the unsuccessfully decoded Video frame is discarded, and the non-key frame of the new key frame is received; the user equipment decodes the received new key frame and its non-key Frame, and display the decoded video picture.
具体地, 例如若上述用户设备接收到由上述视频服务器转发的来自主播设 备的重新编码的关键帧, 则, 确定上述重新编码的关键帧在视频帧中的位置, 并将上述位置后的视频帧数据丢弃, 并接收上述重新编码的关键帧之后的视频 帧; 解码接收到的视频帧, 并控制显示解码得到的视频画面。  Specifically, for example, if the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, determining the position of the re-encoded key frame in the video frame, and setting the video frame after the location The data is discarded, and the video frame after the above-mentioned re-encoded key frame is received; the received video frame is decoded, and the decoded video picture is displayed.
以上实施例, 由视频服务器转发新的关键帧对丢失的关键帧进行补偿, 消 除在视频直播过程中关键帧丢失导致的画面无法显示和花屏现象。 由于不必提 高关键帧出现的频率, 因此可以降低数据传输量, 从而减少对带宽的要求, 使 网络更加流畅。  In the above embodiment, the video server forwards a new key frame to compensate for the lost key frame, and eliminates the phenomenon that the picture cannot be displayed and the screen is lost due to the loss of the key frame during the live broadcast of the video. Since there is no need to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing the bandwidth requirements and making the network more fluid.
以上实施例中, 如果收到了新的关键帧, 则可以确定存在关键帧丢失的情 况, 由于可能已经收到了与该丢失的关键帧相关的非关键帧, 并且非关键帧记 录的是以关键帧为参照的预测信息 , 因此关键帧丢失会导致与之相关联的非关 键帧失去意义, 为了减少不必要的解码操作, 以及可能导致的视频显示错误, 本发明实施例提供了如下解决方案: 进一步地, 上述处理器 1480 , 还用于若上 述用户设备接收到由上述视频服务器转发的来自主播设备的重新编码的关键帧 , 则停止上述重新编码的关键帧在视频帧中的位置之后的所有视频帧的解码操作。  In the above embodiment, if a new key frame is received, it may be determined that there is a loss of the key frame, since the non-key frame related to the lost key frame may have been received, and the non-key frame records the key frame. For the referenced prediction information, therefore, the loss of the key frame may cause the non-key frame associated with it to be meaningless. In order to reduce the unnecessary decoding operation and the video display error that may be caused, the embodiment of the present invention provides the following solution: The processor 1480 is further configured to: if the user equipment receives the re-encoded key frame from the anchor device forwarded by the video server, stop all videos after the re-encoded key frame is located in the video frame. The decoding operation of the frame.
主播设备, 若作为主播设备使用则, 处理器 1480 , 用于控制釆集当前需要 直播的视频数据编码为视频帧, 并通过视频服务器向用户设备发送视频帧, 上 述视频帧包含有关键帧和非关键帧; 若所述主播设备接收到告知信息, 则所述 主播设备通过所述视频服务器向用户设备发送新的关键帧。  The master device, if used as an anchor device, the processor 1480 is configured to control the video data currently required to be broadcasted into a video frame, and send a video frame to the user equipment through the video server, where the video frame includes a key frame and a non- a key frame; if the anchor device receives the notification information, the anchor device sends a new key frame to the user equipment through the video server.
例如具体是若上述主播设备接收到告知信息, 上述告知信息指示了丢失的 关键帧; 则, 上述主播设备重新编码关键帧, 并通过上述视频服务器向用户设 备发送重新编码的关键帧。  For example, if the anchor device receives the notification information, the notification information indicates the lost key frame; then, the anchor device re-encodes the key frame, and sends the re-encoded key frame to the user equipment through the video server.
以上实施例, 由视频服务器检测是否出现了关键帧丢失, 再由视频服务器 告知主播设备丢失的关键帧, 由主播设备发送新的关键帧, 可以使主播设备及 时上传新的关键帧, 消除关键帧丢失导致的画面无法显示和花屏现象。 由于不 必提高关键帧出现的频率,因此可以降低数据传输量,从而减少对带宽的要求, 使网络更加流畅。 以上实施例中,如果收到了告知信息,则可以确定存在关键帧丢失的情况, 由于可能已经完成了与该丢失的关键帧相关的非关键帧的编码, 并且非关键帧 记录的是以关键帧为参照的预测信息, 因此关键帧丢失会导致与之相关联的非 关键帧失去意义, 为了减少在用户设备侧 (解码端) 不必要的解码操作、 不必 要的数据传输, 以及可能导致的视频显示错误, 本发明实施例提供了如下解决 方案: 进一步地, 上述处理器 1480 , 还用于丢弃与丢失的关键帧关联的已经编 码且未发送给上述视频服务器的非关键帧。 In the above embodiment, the video server detects whether a key frame is lost, and then the video server notifies the anchor device of the lost key frame, and the anchor device sends a new key frame, so that the anchor device can upload a new key frame in time, and eliminate the key frame. The picture caused by the loss cannot be displayed and the screen is displayed. Since it is not necessary to increase the frequency of occurrence of key frames, the amount of data transmission can be reduced, thereby reducing the bandwidth requirement and making the network more smooth. In the above embodiment, if the notification information is received, it may be determined that there is a case where the key frame is lost, since the encoding of the non-key frame related to the lost key frame may have been completed, and the non-key frame is recorded with the key frame. For the reference information, the loss of key frames will cause the non-key frames associated with them to lose meaning, in order to reduce unnecessary decoding operations, unnecessary data transmission, and possible video on the user equipment side (decoding side). In the embodiment of the present invention, the following solutions are provided: Further, the processor 1480 is further configured to discard non-key frames that have been encoded and are not sent to the video server that are associated with the lost key frame.
可以理解的是终端设备是可以兼具作为主播设备和用户设备能力的, 因此 终端设备也可以具有以上处理器的所有功能。  It can be understood that the terminal device can function as both the anchor device and the user device, and thus the terminal device can also have all the functions of the above processor.
值得注意的是, 上述用户设备、 主播设备和视频服务器实施例中, 所包括 的各个单元只是按照功能逻辑进行划分的, 但并不局限于上述的划分, 只要能 够实现相应的功能即可; 另外, 各功能单元的具体名称也只是为了便于相互区 分, 并不用于限制本发明的保护范围。  It should be noted that, in the foregoing embodiment of the user equipment, the anchor device, and the video server, each unit included is only divided according to functional logic, but is not limited to the foregoing division, as long as the corresponding function can be implemented; The specific names of the functional units are also only for the purpose of distinguishing between the two, and are not intended to limit the scope of the present invention.
另外, 本领域普通技术人员可以理解实现上述各方法实施例中的全部或部 分步骤是可以通过程序来指令相关的硬件完成, 相应的程序可以存储于一种计 算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。  In addition, those skilled in the art may understand that all or part of the steps in implementing the above method embodiments may be performed by a program to instruct related hardware, and the corresponding program may be stored in a computer readable storage medium, as mentioned above. The storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
以上仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此, 任何熟悉本技术领域的技术人员在本发明实施例揭露的技术范围内, 可轻易想 到的变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范 围应该以权利要求的保护范围为准。  The above is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the embodiments of the present invention. All should be covered by the scope of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

权 利 要 求 书 claims
1、 一种视频直播控制方法, 其特征在于, 包括: 1. A video live broadcast control method, characterized by including:
视频服务器将来自主播设备的视频帧转发给用户设备, 所述视频帧包含有 关键帧和非关键帧; The video server forwards video frames from the host device to the user device, where the video frames include key frames and non-key frames;
视频服务器监测所述视频帧中是否出现关键帧丢失; The video server monitors whether key frames are lost in the video frames;
视频服务器若监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备发送新的关键帧。 If the video server detects that key frames are lost, it sends notification information to the host device so that the host device sends new key frames.
2、 根据权利要求 1 所述的方法, 其特征在于, 视频服务器若监测到出现 关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备发送新的关 键帧包括: 2. The method according to claim 1, characterized in that, if the video server detects that a key frame is lost, it sends notification information to the anchor device, so that the anchor device sends a new key frame, including:
视频服务器若监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 告知所述主播设备丢失的关键帧, 使所述主播设备发送重新编码的关键帧。 If the video server detects that key frames are lost, it sends notification information to the host device to inform the host device of the lost key frames, so that the host device sends re-encoded key frames.
3、 根据权利要求 1 所述的方法, 其特征在于, 视频服务器若监测到出现 关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备发送新的关 键帧包括: 3. The method according to claim 1, characterized in that, if the video server detects that a key frame is lost, the video server sends notification information to the anchor device, so that the anchor device sends a new key frame, including:
视频服务器若监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备将当前视频数据重新编码为关键帧和非关键帧, 向所述视频 服务器发送。 If the video server detects that key frames are lost, it will send notification information to the host device, so that the host device will re-encode the current video data into key frames and non-key frames and send them to the video server.
4、 根据权利要求 1 所述的方法, 其特征在于, 视频服务器若监测到出现 关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备发送新的关 键帧包括: 4. The method according to claim 1, characterized in that, if the video server detects that a key frame is lost, it sends notification information to the anchor device, so that the anchor device sends a new key frame, including:
视频服务器若监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 以告知所述主播设备丢失的关键帧, 使所述主播设备从緩存中选择所述丢失的 关键帧的下一个关键帧和非关键帧, 向所述视频服务器发送。 If the video server detects that a key frame is lost, it sends notification information to the host device to inform the host device of the lost key frame, so that the host device selects the next key of the lost key frame from the cache. frames and non-key frames, sent to the video server.
5、 根据权利要求 1-4任一所述方法, 其特征在于, 还包括: 5. The method according to any one of claims 1-4, characterized in that, further comprising:
若所述视频服务器接收到与丢失的关键帧相关联的非关键帧, 则丢弃所述 与丢失的关键帧相关联的非关键帧。 If the video server receives non-key frames associated with the lost key frames, then discards the non-key frames associated with the lost key frames.
6、 一种视频直播控制方法, 其特征在于, 包括: 6. A video live broadcast control method, characterized by including:
用户设备接收由视频服务器转发的来自主播设备的视频帧, 所述视频帧包 含有关键帧和非关键帧; The user equipment receives video frames from the host equipment forwarded by the video server, and the video frame packets Contains key frames and non-key frames;
若所述用户设备在对当前视频帧解码未成功时接收到由所述视频服务器 转发的来自主播设备的新的关键帧, 则将所述未成功解码的视频帧丢弃, 并接 收所述新的关键帧的非关键帧; If the user equipment receives a new key frame from the host device forwarded by the video server when the current video frame is unsuccessfully decoded, the unsuccessfully decoded video frame is discarded and the new key frame is received. non-keyframes of keyframes;
所述用户设备解码接收到的所述新的关键帧及其非关键帧, 并显示解码得 到的视频画面。 The user equipment decodes the received new key frame and its non-key frame, and displays the decoded video picture.
7、 根据权利要求 6所述的方法, 其特征在于, 若所述用户设备在对当前 视频帧解码未成功时接收到由所述视频服务器转发的来自主播设备的新的关 键帧, 则, 所述用户设备将所述未成功解码的视频帧丢弃, 并接收所述新的关 键帧的非关键帧包括: 7. The method according to claim 6, characterized in that if the user equipment receives a new key frame from the host device forwarded by the video server when decoding the current video frame fails, then, The user equipment discards the unsuccessfully decoded video frames and receives the new non-key frames of the key frames including:
若所述用户设备接收到由所述视频服务器转发的来自主播设备的重新编 码的关键帧,则,所述用户设备确定所述重新编码的关键帧在视频帧中的位置, 并将所述位置后的视频帧数据丢弃, 并接收所述重新编码的关键帧之后的视频 帧。 If the user equipment receives the re-encoded key frame from the host device forwarded by the video server, the user equipment determines the position of the re-encoded key frame in the video frame, and sets the position to The video frame data after the key frame is discarded, and the video frame after the re-encoded key frame is received.
8、 根据权利要求 7所述方法, 其特征在于, 若所述用户设备接收到由所 述视频服务器转发的来自主播设备的重新编码的关键帧, 还包括: 8. The method according to claim 7, characterized in that, if the user equipment receives the re-encoded key frame from the host device forwarded by the video server, it further includes:
所述用户设备停止所述重新编码的关键帧在视频帧中的位置之后的所有 视频帧的解码操作。 The user equipment stops the decoding operation of all video frames after the position of the re-encoded key frame in the video frame.
9、 一种视频直播控制方法, 其特征在于, 包括: 9. A video live broadcast control method, characterized by including:
主播设备釆集当前需要直播的视频数据编码为视频帧, 并通过视频服务器 向用户设备发送视频帧 , 所述视频帧包含有关键帧和非关键帧; The anchor device collects and encodes the video data that currently needs to be broadcast into video frames, and sends the video frames to the user device through the video server. The video frames include key frames and non-key frames;
若所述主播设备接收到告知信息, 则所述主播设备通过所述视频服务器向 用户设备发送新的关键帧。 If the host device receives the notification information, the host device sends a new key frame to the user device through the video server.
10、 根据权利要求 9所述的方法, 其特征在于, 若所述主播设备接收到告 知信息, 则所述主播设备通过所述视频服务器向用户设备发送新的关键帧包括: 若所述主播设备接收到告知信息,所述告知信息指示了丢失的关键帧;贝' J , 所述主播设备重新编码关键帧, 并通过所述视频服务器向用户设备发送重新编 码的关键帧。 10. The method according to claim 9, characterized in that, if the anchor device receives the notification information, sending the new key frame to the user device through the video server includes: if the anchor device After receiving the notification information indicating the lost key frame, the host device re-encodes the key frame and sends the re-encoded key frame to the user device through the video server.
11、 根据权利要求 9所述的方法, 其特征在于, 若所述主播设备接收到告 知信息, 则所述主播设备通过所述视频服务器向用户设备发送新的关键帧包括: 若所述主播设备接收到告知信息, 则所述主播设备将当前视频数据重新编 码为关键帧和非关键帧, 并通过所述视频服务器向用户设备发送。 11. The method according to claim 9, characterized in that, if the anchor device receives the notification information, sending the new key frame to the user device through the video server includes: if the anchor device After receiving the notification information, the host device re-encodes the current video data into key frames and non-key frames, and sends them to the user device through the video server.
12、 根据权利要求 9所述的方法, 其特征在于, 若所述主播设备接收到告 知信息, 则所述主播设备通过所述视频服务器向用户设备发送新的关键帧包括: 若所述主播设备接收到指示丢失的关键帧的告知信息, 则, 所述主播设备 从緩存中选择所述丢失的关键帧的下一个关键帧和非关键帧, 并通过所述视频 服务器向用户设备发送。 12. The method according to claim 9, characterized in that, if the anchor device receives the notification information, sending the new key frame to the user device through the video server includes: if the anchor device Upon receiving notification information indicating a lost key frame, the host device selects the next key frame and non-key frame of the lost key frame from the cache, and sends them to the user device through the video server.
13、 根据权利要求 9-12任一所述方法, 其特征在于, 还包括: 13. The method according to any one of claims 9-12, further comprising:
所述主播设备丢弃与丢失的关键帧关联的已经编码且未发送给所述视频 服务器的非关键帧。 The host device discards non-key frames associated with the missing key frames that have been encoded and not sent to the video server.
14、 一种视频服务器, 其特征在于, 包括: 14. A video server, characterized by including:
转发控制单元, 用于控制将来自主播设备的视频帧转发给用户设备, 所述 视频帧包含有关键帧和非关键帧; A forwarding control unit, used to control the forwarding of video frames from the host device to the user device, where the video frames include key frames and non-key frames;
丢帧监测单元, 用于监测所述视频帧中是否出现关键帧丢失; A frame loss monitoring unit, used to monitor whether key frames are lost in the video frames;
信息发送单元, 用于若所述丢帧监测单元监测到出现关键帧丢失, 则向所 述主播设备发送告知信息 , 以使所述主播设备发送新的关键帧。 The information sending unit is configured to send notification information to the host device if the frame loss monitoring unit detects that a key frame is lost, so that the host device sends a new key frame.
15、 根据权利要求 14所述的视频服务器, 其特征在于: 15. The video server according to claim 14, characterized in that:
所述信息发送单元具体用于若所述丢帧监测单元监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 告知所述主播设备丢失的关键帧, 使所述主 播设备发送重新编码的关键帧。 The information sending unit is specifically configured to send notification information to the anchor device if the frame loss monitoring unit detects that a key frame is lost, informing the anchor device of the lost key frame, and causing the anchor device to send a re-encoding keyframes.
16、 根据权利要求 14所述的视频服务器, 其特征在于: 16. The video server according to claim 14, characterized in that:
所述信息发送单元具体用于若所述丢帧监测单元监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备将当前视频数据重新编码 为关键帧和非关键帧, 向所述视频服务器发送。 The information sending unit is specifically configured to send notification information to the host device if the frame loss monitoring unit detects that a key frame is lost, so that the host device re-encodes the current video data into key frames and non-key frames. Frames are sent to the video server.
17、 根据权利要求 14所述的视频服务器, 其特征在于: 17. The video server according to claim 14, characterized in that:
所述信息发送单元具体用于若所述丢帧监测单元监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 以告知所述主播设备丢失的关键帧, 使所述 主播设备从緩存中选择所述丢失的关键帧的下一个关键帧和非关键帧, 向所述 视频服务器发送。 The information sending unit is specifically configured to: if the frame loss monitoring unit detects that a key frame is lost, Then send notification information to the host device to inform the host device of the lost key frame, so that the host device selects the next key frame and non-key frame of the lost key frame from the cache, and sends the video to the video Sent by the server.
18、 根据权利要求 14-17任一所述的视频服务器, 其特征在于, 还包括: 控制丢帧单元, 用于若接收到与丢失的关键帧相关联的非关键帧, 则丢弃 所述与丢失的关键帧相关联的非关键帧。 18. The video server according to any one of claims 14 to 17, further comprising: a frame dropping control unit configured to discard the non-key frame associated with the lost key frame if a non-key frame associated with the lost key frame is received. The missing keyframe is associated with a non-keyframe.
19、 一种用户设备, 其特征在于, 包括: 19. A user equipment, characterized by: including:
视频接收单元, 用于接收由视频服务器转发的来自主播设备的视频帧, 所 述视频帧包含有关键帧和非关键帧; A video receiving unit, configured to receive video frames from the host device forwarded by the video server, where the video frames include key frames and non-key frames;
帧确定单元 , 用于确定是否在对当前视频帧解码未成功时接收到由所述视 频服务器转发的来自主播设备的新的关键帧; A frame determination unit, used to determine whether a new key frame from the host device forwarded by the video server is received when decoding the current video frame is unsuccessful;
丢帧控制单元, 用于若在对当前视频帧解码未成功时接收到由所述视频服 务器转发的来自主播设备的新的关键帧, 则将所述未成功解码的视频帧丢弃; 所述视频接收单元, 还用于接收所述新的关键帧的非关键帧; A frame loss control unit, configured to discard the unsuccessfully decoded video frame if a new key frame from the host device forwarded by the video server is received when the current video frame is unsuccessfully decoded; the video The receiving unit is also configured to receive non-key frames of the new key frame;
解码单元, 用于解码接收到的所述新的关键帧及其非关键帧; A decoding unit, configured to decode the received new key frame and its non-key frame;
显示单元, 用于显示所述解码单元解码得到的视频画面。 A display unit is used to display the video picture decoded by the decoding unit.
20、 根据权利要求 19所述的用户设备, 其特征在于: 20. The user equipment according to claim 19, characterized in that:
所述视频接收单元, 具体用于接收重新编码的关键帧之后的视频帧; 所述帧确定单元, 具体用于确定所述视频接收单元是否接收到由所述视频 服务器转发的来自主播设备的重新编码的关键帧; The video receiving unit is specifically configured to receive the video frame after the re-encoded key frame; the frame determining unit is specifically configured to determine whether the video receiving unit has received the re-coded key frame from the host device forwarded by the video server. encoded keyframes;
所述丢帧控制单元, 具体用于若所述帧确定单元确定所述视频接收单元接 收到由所述视频服务器转发的来自主播设备的重新编码的关键帧, 则, 所述用 户设备确定所述重新编码的关键帧在视频帧中的位置, 并将所述位置后的视频 帧数据丢弃。 The frame loss control unit is specifically configured to: if the frame determination unit determines that the video receiving unit receives the re-encoded key frame from the host device forwarded by the video server, then, the user equipment determines that the The position of the re-encoded key frame in the video frame is determined, and the video frame data after the position is discarded.
21、 根据权利要求 20所述的用户设备, 其特征在于, 21. The user equipment according to claim 20, characterized in that,
所述解码单元 , 还用于若所述用户设备接收到由所述视频服务器转发的来 自主播设备的重新编码的关键帧, 则停止所述重新编码的关键帧在视频帧中的 位置之后的所有视频帧的解码操作。 The decoding unit is also configured to, if the user equipment receives the re-encoded key frame from the host device forwarded by the video server, stop all the re-encoded key frames after the position in the video frame. Decoding operation of video frames.
22、 一种主播设备, 其特征在于, 包括: 22. An anchor device, characterized by including:
数据釆集单元, 用于釆集当前需要直播的视频数据; The data collection unit is used to collect the video data that currently needs to be broadcast live;
编码单元, 用于将所述数据釆集单元釆集的视频数据编码为视频帧, 所述 视频帧包含有关键帧和非关键帧; An encoding unit, used to encode the video data collected by the data collection unit into video frames, where the video frames include key frames and non-key frames;
发送单元, 用于通过视频服务器向用户设备发送所述编码单元编码得到的 视频帧; A sending unit, configured to send the video frame encoded by the encoding unit to the user equipment through the video server;
信息接收单元, 用于接收关键帧丢失的告知信息; Information receiving unit, used to receive notification information of key frame loss;
所述发送单元, 还用于若所述信息接收单元接收到所述告知信息, 则通过 所述视频服务器向用户设备发送新的关键帧。 The sending unit is also configured to send a new key frame to the user equipment through the video server if the information receiving unit receives the notification information.
23、 根据权利要求 22所述的主播设备, 其特征在于: 23. The anchor device according to claim 22, characterized in that:
所述编码单元, 具体用于若所述主播设备接收到告知信息, 则, 重新编码 关键帧; The encoding unit is specifically used to re-encode the key frame if the anchor device receives the notification information;
所述发送单元, 具体用于通过视频服务器向用户设备发送所述编码单元编 码得到的视频帧, 通过所述视频服务器向用户设备发送重新编码的关键帧; 所述信息接收单元, 具体用于接收告知信息, 所述告知信息指示了丢失的 关键帧。 The sending unit is specifically configured to send the video frames encoded by the encoding unit to the user equipment through the video server, and send the re-encoded key frames to the user equipment through the video server; the information receiving unit is specifically used to receive Notification information indicating the lost key frame.
24、 根据权利要求 22所述的主播设备, 其特征在于: 24. The anchor device according to claim 22, characterized in that:
所述编码单元, 具体用于若接收到告知信息, 则将当前视频数据重新编码 为关键帧和非关键帧; The encoding unit is specifically used to re-encode the current video data into key frames and non-key frames if notification information is received;
所述发送单元, 具体用于通过所述视频服务器将所述编码单元重新编码的 关键帧和非关键帧向用户设备发送。 The sending unit is specifically configured to send the key frames and non-key frames re-encoded by the encoding unit to the user equipment through the video server.
25、 根据权利要求 22所述的主播设备, 其特征在于: 25. The anchor device according to claim 22, characterized in that:
所述发送单元, 具体用于若接收到指示丢失的关键帧的告知信息, 则, 从 緩存中选择所述丢失的关键帧的下一个关键帧和非关键帧, 并通过所述视频服 务器向用户设备发送。 The sending unit is specifically configured to, if notification information indicating a lost key frame is received, select the next key frame and non-key frame of the lost key frame from the cache, and send the message to the user through the video server device sends.
26、 根据权利要求 22-25任一所述的主播设备, 其特征在于, 还包括: 丢帧单元, 用于丢弃与丢失的关键帧关联的已经编码且未发送给所述视频 服务器的非关键帧。 26. The anchor device according to any one of claims 22 to 25, further comprising: a frame dropping unit, configured to discard non-key frames associated with the lost key frames that have been encoded and not sent to the video server. frame.
27、 一种视频直播系统, 包括: 主播设备、 用户设备以及视频服务器, 其 特征在于, 27. A video live broadcast system, including: anchor equipment, user equipment and video server, characterized by:
所述主播设备为权利要求 22-26任一所述的主播设备, 所述视频服务器为 权利要求 14-18任一所述的视频服务器, 所述用户设备为权利要求 19-21任一 所述的用户设备。 The anchor device is the anchor device described in any one of claims 22-26, the video server is the video server described in any one of claims 14-18, and the user equipment is the video server described in any one of claims 19-21. user equipment.
28、 一种包含计算机可执行指令的存储介质, 所述计算机可执行指令在由 计算机处理器执行时用于执行一种视频直播控制方法, 其特征在于, 该方法包 括: 28. A storage medium containing computer-executable instructions, which when executed by a computer processor are used to execute a video live broadcast control method, characterized in that the method includes:
视频服务器将来自主播设备的视频帧转发给用户设备, 所述视频帧包含有 关键帧和非关键帧; The video server forwards video frames from the host device to the user device, where the video frames include key frames and non-key frames;
视频服务器监测所述视频帧中是否出现关键帧丢失; The video server monitors whether key frames are lost in the video frames;
视频服务器若监测到出现关键帧丢失, 则向所述主播设备发送告知信息, 以使所述主播设备发送新的关键帧。 If the video server detects that key frames are lost, it sends notification information to the host device so that the host device sends new key frames.
29、 一种包含计算机可执行指令的存储介质, 所述计算机可执行指令在由计 算机处理器执行时用于执行一种视频直播控制方法, 其特征在于, 该方法包括: 用户设备接收由视频服务器转发的来自主播设备的视频帧 , 所述视频帧包 含有关键帧和非关键帧; 29. A storage medium containing computer-executable instructions. The computer-executable instructions, when executed by a computer processor, are used to perform a video live broadcast control method. The method is characterized in that the method includes: The user equipment receives a video message sent by a video server. Forwarded video frames from the host device, the video frames include key frames and non-key frames;
若所述用户设备在对当前视频帧解码未成功时接收到由所述视频服务器 转发的来自主播设备的新的关键帧, 则将所述未成功解码的视频帧丢弃, 并接 收所述新的关键帧的非关键帧; If the user equipment receives a new key frame from the host device forwarded by the video server when the current video frame is unsuccessfully decoded, the unsuccessfully decoded video frame is discarded and the new key frame is received. non-keyframes of keyframes;
所述用户设备解码接收到的所述新的关键帧及其非关键帧, 并显示解码得 到的视频画面。 The user equipment decodes the received new key frame and its non-key frame, and displays the decoded video picture.
30、 一种包含计算机可执行指令的存储介质, 所述计算机可执行指令在由计 算机处理器执行时用于执行一种视频直播控制方法, 其特征在于, 该方法包括: 主播设备釆集当前需要直播的视频数据编码为视频帧, 并通过视频服务器 向用户设备发送视频帧 , 所述视频帧包含有关键帧和非关键帧; 30. A storage medium containing computer-executable instructions. The computer-executable instructions, when executed by a computer processor, are used to execute a video live broadcast control method, characterized in that the method includes: The host device collects current needs The live video data is encoded into video frames, and the video frames are sent to the user device through the video server, where the video frames include key frames and non-key frames;
若所述主播设备接收到告知信息, 则所述主播设备将新的关键帧向所述视 频服务器发送。 If the host device receives the notification information, the host device sends a new key frame to the video server.
PCT/CN2014/086055 2013-10-21 2014-09-05 Control method, device and system for live broadcast of video, and storage medium WO2015058590A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310495767.1A CN103533387B (en) 2013-10-21 2013-10-21 A kind of live video control, equipment and system
CN201310495767.1 2013-10-21

Publications (1)

Publication Number Publication Date
WO2015058590A1 true WO2015058590A1 (en) 2015-04-30

Family

ID=49934996

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/086055 WO2015058590A1 (en) 2013-10-21 2014-09-05 Control method, device and system for live broadcast of video, and storage medium

Country Status (2)

Country Link
CN (1) CN103533387B (en)
WO (1) WO2015058590A1 (en)

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533387B (en) * 2013-10-21 2016-08-17 腾讯科技(深圳)有限公司 A kind of live video control, equipment and system
WO2015196457A1 (en) * 2014-06-27 2015-12-30 北京新媒传信科技有限公司 Method for routing key frame and media server
CN104363519B (en) * 2014-11-21 2017-12-15 广州华多网络科技有限公司 It is a kind of based on online live method for information display, relevant apparatus and system
CN104703053A (en) * 2015-03-11 2015-06-10 青岛海尔智能家电科技有限公司 Packet loss processing method, device and system of video transmission process
CN107231328B (en) * 2016-03-23 2020-08-28 福建星网锐捷通讯股份有限公司 Real-time video transmission method, device, equipment and system
CN106302054A (en) * 2016-09-14 2017-01-04 芜湖扬展新材料科技服务有限公司 A kind of Smart Home Data acquisition and issuance processing system
CN106488273B (en) * 2016-10-10 2019-09-10 广州酷狗计算机科技有限公司 A kind of method and apparatus for transmitting live video
CN106792263A (en) * 2016-12-09 2017-05-31 东方网力科技股份有限公司 A kind of method of transmitting video data, apparatus and system
CN108234420B (en) * 2016-12-21 2021-03-19 北京酷我科技有限公司 System and method for solving video head loss of streaming media
CN106604064A (en) * 2016-12-30 2017-04-26 北京奇艺世纪科技有限公司 Rapid broadcasting method and device
CN108306923A (en) * 2017-08-21 2018-07-20 北京潘达互娱科技有限公司 A kind of live video method for uploading, device, electronic equipment and storage medium
CN110149491B (en) * 2018-02-11 2021-09-28 腾讯科技(深圳)有限公司 Video encoding method, video decoding method, terminal and storage medium
CN110392269B (en) * 2018-04-17 2021-11-30 腾讯科技(深圳)有限公司 Media data processing method and device and media data playing method and device
CN112492118B (en) * 2018-06-21 2023-11-17 深圳市道通智能航空技术股份有限公司 Data transmission control method, information sending end, information receiving end and aircraft image transmission system
CN110392284B (en) * 2019-07-29 2022-02-01 腾讯科技(深圳)有限公司 Video encoding method, video data processing method, video encoding apparatus, video data processing apparatus, computer device, and storage medium
CN110602507A (en) * 2019-08-19 2019-12-20 西安万像电子科技有限公司 Frame loss processing method, device and system
CN110519598A (en) * 2019-08-23 2019-11-29 香港乐蜜有限公司 Video encoding/decoding method, device and equipment
CN113132807B (en) * 2019-12-30 2023-04-07 成都鼎桥通信技术有限公司 Video-based key frame request method, device, equipment and storage medium
CN111212286B (en) * 2020-01-14 2022-02-01 四川大学 Distributed multi-view video transmission method and system based on layer repair
CN112333461A (en) * 2020-11-04 2021-02-05 北京金山云网络技术有限公司 Method and device for starting live video
CN113824985B (en) * 2021-09-18 2023-08-22 北京百度网讯科技有限公司 Live streaming method, apparatus, device, storage medium and computer program product
CN116112127A (en) * 2021-11-09 2023-05-12 哈尔滨海能达科技有限公司 Data transmission method, related equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753275A (en) * 2008-12-15 2010-06-23 华为技术有限公司 Method, device and system for retransmission of video messages
CN101883240A (en) * 2010-06-09 2010-11-10 广东威创视讯科技股份有限公司 Video conference system based on MCU (Microprogrammed Control Unit) and video transmission lost packet processing method thereof
CN103354615A (en) * 2013-06-24 2013-10-16 西安交通大学 Signal intensity based live video data transmission error control method
CN103533387A (en) * 2013-10-21 2014-01-22 腾讯科技(深圳)有限公司 Live video control method, equipment and system

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3757857B2 (en) * 2001-12-12 2006-03-22 ソニー株式会社 Data communication system, data transmission apparatus, data reception apparatus and method, and computer program
US9077991B2 (en) * 2002-12-10 2015-07-07 Sony Computer Entertainment America Llc System and method for utilizing forward error correction with video compression
CN1697354B (en) * 2005-06-17 2010-05-05 顾红波 Method for reliable transmitting data through multicast and unicast protocol, and host of receiving data
CN101197642A (en) * 2006-12-04 2008-06-11 中兴通讯股份有限公司 Solving method for packet loss of IPTV
WO2008088305A2 (en) * 2006-12-20 2008-07-24 Thomson Research Funding Corporation Video data loss recovery using low bit rate stream in an iptv system
KR20100103547A (en) * 2007-12-05 2010-09-27 온라이브, 인크. System and method for compressing video based on detected data rate of a communication channel
US8693553B2 (en) * 2007-12-28 2014-04-08 Nokia Corporation Methods, apparatuses, and computer program products for adaptive synchronized decoding of digital video
CN101945427B (en) * 2009-07-03 2012-11-14 深圳市融创天下科技股份有限公司 Efficient streaming media transmission method
CN102118619B (en) * 2009-12-31 2012-08-29 华为技术有限公司 Video signal compensating method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753275A (en) * 2008-12-15 2010-06-23 华为技术有限公司 Method, device and system for retransmission of video messages
CN101883240A (en) * 2010-06-09 2010-11-10 广东威创视讯科技股份有限公司 Video conference system based on MCU (Microprogrammed Control Unit) and video transmission lost packet processing method thereof
CN103354615A (en) * 2013-06-24 2013-10-16 西安交通大学 Signal intensity based live video data transmission error control method
CN103533387A (en) * 2013-10-21 2014-01-22 腾讯科技(深圳)有限公司 Live video control method, equipment and system

Also Published As

Publication number Publication date
CN103533387A (en) 2014-01-22
CN103533387B (en) 2016-08-17

Similar Documents

Publication Publication Date Title
WO2015058590A1 (en) Control method, device and system for live broadcast of video, and storage medium
US11144171B2 (en) Reduced latency server-mediated audio-video communication
CN108737908B (en) Media playing method, device and storage medium
WO2017076143A1 (en) Method, apparatus, and system for switching video live stream to video-on-demand data
US9832621B2 (en) Method, terminal, server, and system for audio signal transmission
US9924205B2 (en) Video remote-commentary synchronization method and system, and terminal device
WO2017008627A1 (en) Multimedia live broadcast method, apparatus and system
WO2015058656A1 (en) Live broadcast control method and main broadcast device
WO2018059352A1 (en) Remote control method and apparatus for live video stream
US11202066B2 (en) Video data encoding and decoding method, device, and system, and storage medium
CN111866433B (en) Video source switching method, video source playing method, video source switching device, video source playing device, video source equipment and storage medium
US11297328B2 (en) Video coding method, device, device and storage medium
WO2015131768A1 (en) Video processing method, apparatus and system
WO2016023358A1 (en) Method and apparatus for adjusting image quality of video according to network environment
JP2021505081A (en) Video transmission methods, video transmission equipment, and video transmission systems, as well as computer-readable storage media
WO2023060988A1 (en) Reestablishment method in communication abnormality, terminal device, and storage medium
WO2019076250A1 (en) Push message management method and related products
CN109194979B (en) Audio and video processing method and device, mobile terminal and readable storage medium
CN109729438B (en) Method and device for sending video packet and method and device for receiving video packet
JP5488694B2 (en) Remote mobile communication system, server device, and remote mobile communication system control method
JP5407479B2 (en) Image transmission system, image transmission apparatus, client terminal, image transmission method, and image transmission program
CN117955920A (en) Data transmission method, device, equipment and storage medium
KR20220103880A (en) Audio playback method, device and storage medium
CN117857836A (en) Video complement method, system, device and storage medium
CN113497911A (en) Video communication method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14856423

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS EPO FORM 1205A DATED 07-09-16)

122 Ep: pct application non-entry in european phase

Ref document number: 14856423

Country of ref document: EP

Kind code of ref document: A1