WO2021012180A1 - Transmission control method and device for code streams, and computer readable storage medium - Google Patents

Transmission control method and device for code streams, and computer readable storage medium Download PDF

Info

Publication number
WO2021012180A1
WO2021012180A1 PCT/CN2019/097265 CN2019097265W WO2021012180A1 WO 2021012180 A1 WO2021012180 A1 WO 2021012180A1 CN 2019097265 W CN2019097265 W CN 2019097265W WO 2021012180 A1 WO2021012180 A1 WO 2021012180A1
Authority
WO
WIPO (PCT)
Prior art keywords
code stream
stream
code
frame rate
main
Prior art date
Application number
PCT/CN2019/097265
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 深圳市大疆创新科技有限公司
Priority to PCT/CN2019/097265 priority Critical patent/WO2021012180A1/en
Priority to CN201980008497.2A priority patent/CN111602389B/en
Publication of WO2021012180A1 publication Critical patent/WO2021012180A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/587Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal sub-sampling or interpolation, e.g. decimation or subsequent interpolation of pictures in a video sequence
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/21805Source of audio or video content, e.g. local disk arrays enabling multiple viewpoints, e.g. using a plurality of cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234381Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the temporal resolution, e.g. decreasing the frame rate by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
    • 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/6587Control parameters, e.g. trick play commands, viewpoint selection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/268Signal distribution or switching

Definitions

  • the present disclosure relates to the field of data transmission technology, and in particular to a transmission control method, device and computer-readable storage medium of a code stream.
  • a key frame is an image frame that does not refer to any frame for encoding, and its data size is larger than other reference frames. Transmission needs to take up more bandwidth or longer time. Therefore, in the prior art, when switching between multiple streams, to achieve a better display effect, it is necessary to buffer the key frames and buffer them for a period of time before displaying, which leads to a longer switching time; Switching speed, the size of the key frame will be limited, which will cause the switching screen to freeze or blur.
  • the present disclosure provides a stream transmission control method, device and computer-readable storage medium.
  • a transmission control method of a code stream includes:
  • At least two code streams are received, the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
  • main code stream switching signal indicates to switch the main code stream to the second code stream
  • the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
  • a transmission control method of a code stream includes:
  • the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
  • the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
  • a code stream receiving device includes a processor, a communication component, a memory, and a communication bus.
  • the memory stores executable instructions, and the processor is configured to perform the following steps:
  • At least two code streams are received, the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
  • main code stream switching signal indicates to switch the main code stream to the second code stream
  • the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
  • a code stream sending device includes a processor, a communication component, a memory, and a communication bus.
  • the memory stores executable instructions, and the processor is configured to perform the following steps:
  • the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
  • the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
  • a computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, it implements the above-mentioned code stream transmission control method.
  • the transmission frame rate of the original main stream is higher than the frame rate of the original background stream.
  • the transmission frame rate of the new main stream is higher than the transmission frame rate of the new background stream to continue the transmission of the at least two streams; that is, according to the main stream (original The transmission frame rate of the main code stream or the new main code stream) is greater than the transmission frame rate of the background code stream (the original background code stream or the new background code stream), which fully guarantees the transmission bandwidth of the main code stream and can avoid the background code stream ( The original background code stream or the new background code stream) occupies too much bandwidth and affects the transmission of the main code stream; and realizes the dynamic adjustment of the transmission frame rate of each stream according to the switching of the main code stream.
  • main stream and background stream are transmitted at different transmission frame rates at the same time, when the main stream is used as the stream to be played, it can be ensured that when the playback is switched, seamless switching to the playback location can be ensured.
  • Fig. 1 is a schematic diagram showing an implementation environment involved in the present disclosure according to an exemplary embodiment
  • Fig. 2 is a flow chart showing a method for transmission control of a code stream according to an exemplary embodiment
  • Fig. 3 is a schematic diagram of code stream transmission implemented according to the method of the present disclosure in a specific embodiment
  • Fig. 4 is a flowchart showing a method for transmission control of a code stream according to another exemplary embodiment
  • Fig. 5 is a flowchart showing a transmission control method of a code stream according to another exemplary embodiment
  • Fig. 6 is a flow chart showing a transmission control method of a code stream according to another exemplary embodiment
  • Fig. 7 is a hardware block diagram of a UAV according to an exemplary embodiment.
  • Fig. 1 is a schematic diagram showing an implementation environment involved in the present disclosure according to an exemplary embodiment.
  • the implementation environment includes: a sending end 100 and a receiving end 300.
  • the sending end 100 and the receiving end 300 establish a network connection in a wired or wireless manner. Therefore, based on the network connection between the two, the sending end 100 and the receiving end 300 interact, for example, the sending end 100 communicates to the receiving end. 300 transmits at least two code streams, and the sending end 100 adjusts the transmission frame rate of the image frames in the code stream according to the playback switching operation triggered by the receiving end 300.
  • the sending end 100 may be any device that can perform multi-channel code stream transmission, such as a drone, a notebook computer, a desktop computer, etc., that performs real-time image collection and transmission, which is not specifically limited here.
  • the receiving end can be any communication device that can receive the code stream, such as remote control with or without screen, VR/AR display device, TV, tablet computer, smart phone, notebook computer and other electronic devices.
  • Fig. 2 is a flow chart showing a method for controlling code stream transmission according to an exemplary embodiment.
  • the transmission control method of the code stream can be executed by the receiving end 300 in the implementation environment shown in FIG. 1.
  • the transmission control method of the code stream may include the following steps:
  • Step 310 At least two code streams are received.
  • the at least two code streams include a first code stream and a second code stream.
  • the first code stream is used as the original main code stream.
  • Other code streams are used as original background code streams, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any original background code stream.
  • the code stream is a video stream formed by sequentially arranging several image frames.
  • the code stream can also be an audio code stream.
  • the transmission frame rate is the number of image frames transmitted per second.
  • the transmission frame rate characterizes the data transmission speed in the code stream. It is worth mentioning that in step 310, the term “receiving at least two streams” refers to sequentially receiving the image frames in the at least two streams, and step 310 does not represent the completion of receiving each of the at least two streams. All image frames of the code stream, and the representative receiving end is in the process of receiving the image frames in each code stream.
  • the transmission frame rate of the main code stream is configured to be higher than the transmission frame rate of any background code stream.
  • the code stream to be played is used as the main code stream.
  • the other code streams except the played code stream in the received at least two code streams correspond to the background code stream, according to the main code stream.
  • the transmission frame rate is higher than the transmission frame rate of any background code stream for transmission, which can meet the playback requirements of the receiving end for the main code stream and avoid jams.
  • the background code stream is relative to the main code stream.
  • the corresponding background code stream changes accordingly.
  • at least two bit streams include A bit stream, B bit stream and C bit stream, where the main bit stream is A bit stream initially, then when A bit stream is used as the main bit stream, B bit stream The stream and C stream are the background stream; if the B stream is re-selected as the main stream, the A stream and the C stream will be used as the background stream while the B stream is used as the main stream.
  • the main stream can be selected based on user needs, or the main stream is set by default on the receiving end, or based on the processing set in the receiving end, for example, it is currently necessary to play the A stream .
  • the A stream is selected as the main stream (original main stream), so that the operation of the image frame in the A stream (such as encoding, transmission, decoding, buffering, etc.) by the sender or receiver All need to meet the playback of the A stream.
  • the main code stream before the main code stream switch is called the original main code stream, and the background code stream before the switch is called the original background code stream; the main code stream is switched The main stream after that is called the new main stream, and the background stream after switching is called the new background stream.
  • first code stream and the second code stream of the at least two code streams do not specifically refer to the specific code stream.
  • the first code stream generally refers to the original master before the main stream is selected.
  • the code stream of the code stream, and the second code stream generally refers to the code stream that is switched as the new main code stream when the main code stream is switched.
  • Step 330 Obtain the main code stream switching signal.
  • the main code stream switching signal indicates to switch the main code stream to the second code stream.
  • the data volume requirements of each stream at the receiving end may change, and the main stream needs to be switched; for example, the A Switch the code stream to play B code stream, then correspondingly, switch the main code stream to B code stream.
  • the main code stream switching signal is used to indicate the code stream to be switched to the main code stream.
  • the second code stream generally refers to the code stream which needs to be switched to the main code stream indicated by the main code stream switching signal. Therefore, the second code stream indicated by the main code stream switching signal is regarded as the new main code stream of the present disclosure.
  • the main stream switching signal may be generated according to a switching operation triggered in the receiving end, and the user triggers the switching operation in the receiving end to instruct the receiving end to switch the main stream to the second code. flow.
  • the receiving end is VR glasses and the user wants to switch the displayed code stream, he can trigger the switching operation by operating the corresponding control component of the VR glasses, thereby generating the main code stream switching signal.
  • the main stream switching signal may also be sent by an external device to the receiving end, or generated according to the main stream switching file configured in the receiving end, and the main stream switching file indicates During the transmission of at least two streams, each time segment is selected as the stream of the main stream.
  • the receiving end is a monitor screen
  • the monitor screen can receive a signal sent by an external device, or generate a main stream switching signal according to a configured main stream switching file.
  • the configured main stream switching file can generate the main stream switching signal according to the working status of the receiving end, such as working location, working time and other information.
  • the main stream switching signal can be automatically generated according to the pre-configured main stream switching file to automatically switch to the picture of camera B.
  • Step 330 Continue to receive at least two streams after the switch, where the second code stream is used as the new main code stream, and the other code streams in the at least two code streams except the second code stream are used as the new background code stream, after switching ,
  • the transmission frame rate of the new main stream is higher than the transmission frame rate of any new background stream.
  • the main code stream switching signal indicates the main code stream after switching. Since the transmission frame rate of the main code stream is configured to be higher than the transmission frame rate of any background code stream, after switching the main code stream, according to The selected stream as the new main stream, correspondingly adjust the transmission frame rate of each of the at least two streams, so that after switching, the transmission frame rate of the new main stream is higher than any new background code The transmission frame rate of the stream.
  • the receiving end after the receiving end obtains the main stream switching signal, the receiving end sends The end sends a frame rate adjustment signal, and the frame rate adjustment signal indicates that the main stream is switched to the second stream.
  • the frame rate adjustment signal is generated according to the main stream switching signal. Therefore, after receiving the frame rate adjustment signal, the transmitting end adjusts the transmission frame rate of each of the at least two streams according to the frame rate adjustment signal, and performs each code according to the adjusted transmission frame rate Stream transmission, where the sender adjusts the frame rate according to the transmission frame rate of the new main stream higher than the transmission frame rate of any new background stream.
  • the second stream is used as one stream in the original background stream, and the first stream is used as the original main stream.
  • the transmission frame rate of the original main stream is higher than that of the original background stream. Rate; after the main code stream is switched, the second code stream is used as the new main code stream, and the first code stream corresponds to the one code stream in the new background code stream; thus, it can be known that after the switch, in order to ensure the new main code stream
  • the transmission frame rate is higher than the transmission frame rate of the new main stream and guarantees the demand of the receiving end for the second code stream.
  • the transmission frame rate of the second code stream is increased, based on the transmission of the second code stream after the switch Frame rate, correspondingly adjust the frame rate of each stream as the new background stream.
  • the transmission frame rate of the background code stream (original background code stream or new background code stream) is preset.
  • a code stream is used as the background code stream (original background code stream or new background code stream)
  • the transmission of the stream is carried out according to the transmission frame rate set for the main stream.
  • the background code stream original background code stream or new background code stream
  • the transmission frame rate of each code stream is the same, so the transmission frame rate of the new background code stream after switching is the transmission frame rate of the second code stream before switching Frame rate.
  • the transmission frame rate of the main code stream (original main code stream or new main code stream) can also be preset.
  • a code stream is selected as the main code stream (original main code stream or new main code stream)
  • the transmission of the code stream as the main code stream is performed according to the set transmission frame rate.
  • the main stream original background code stream or new background code stream
  • the transmission frame rate of the main code stream is the same. Therefore, the transmission frame rate of the new main code stream after switching is the transmission frame rate of the original main code stream before switching. Frame rate.
  • the transmission frame rate as the main stream (original main stream or new main stream) and as the background code for each of the at least two streams at the same time.
  • the transmission frame rate of the stream original background code stream or new background code stream
  • the transmission frame rate of each code stream is adjusted according to the settings made.
  • the transmission frame rate of the new background code stream is a dynamic low frame rate adapted to the remaining bandwidth.
  • the remaining bandwidth is determined according to the transmission frame rate of the new main stream after switching. Specifically, the difference between the current bandwidth of the receiving end and the sending end and the occupied bandwidth of the new main stream when the transmission is performed according to the transmission frame rate of the new main stream after switching is the remaining bandwidth. Then dynamically determine the transmission frame rate for the new background stream according to the remaining bandwidth.
  • the at least two streams are performed according to the transmission frame rate of the original main stream higher than the frame rate of the original background stream
  • the transmission frame rate of the new main stream is higher than the transmission frame rate of the new background stream to continue the transmission of the at least two streams; on the one hand, according to the main stream
  • the transmission frame rate of (original main stream or new main stream) is greater than the transmission frame rate of background code stream (original background code stream or new background code stream), which fully guarantees the transmission bandwidth of the main stream to meet the requirements of the receiving end.
  • the data requirement of the main stream is to avoid the situation where the available bandwidth of the main stream is insufficient due to the excessive occupation of bandwidth by the background stream (original background stream or new background stream); on the other hand, according to the switch of the main stream
  • the transmission frame rate of each of the at least two streams is dynamically adjusted, so that the adjustment of the frame rate is adapted to the switching of the main stream.
  • the method further includes:
  • the receiving end buffers and plays the original main code stream according to the data of the received original main code stream, and only buffers the original background code stream, so that when the first code stream is used as the original main code stream, the receiving end Only the first stream is played at the end.
  • the receiving end since the code stream is transmitted after encoding, correspondingly, the receiving end performs corresponding decoding after receiving the data in the original main code stream and the original background code stream.
  • the original main stream is decoded and played, and the original background stream is decoded and buffered.
  • step 330 the method further includes:
  • the receiving end switches the playback according to the main stream switching signal, that is, stops playing the original first stream and switches to playing the second stream as the new main stream.
  • the second code stream as the new main code stream is decoded and played, and the new background code stream is decoded and buffered.
  • the step of playing the second code stream as the new main code stream includes:
  • the receiving end receives the playback switching instruction (equivalent to the main stream switching signal in this embodiment), it requests the sending end correspondingly to the playback switching instruction indicated by the playback switching instruction.
  • the data of the code stream that is, the buffering of the data in the code stream switched to is performed after the playback switching, which makes the playback switching time long and the playback switching response speed slow.
  • the receiving end After the playback switching operation is performed, the receiving end requests the image in the video stream from the sending end. Therefore, the sending end performs encoding and transmission of the image in the requested video stream according to the request of the receiving end. Since the first video frame in the video code stream is an I frame, and the I frame does not refer to any frame, it is obtained by the intra-frame coding method. The compression rate is low, the data volume is high, and the compression is difficult.
  • the streaming playback switching method in order to ensure that the receiving end responds to the playback switching, the size of the first video frame needs to be limited, that is, the first video frame is obtained by encoding after compression, and when the receiving end obtains the I frame according to the compressed encoding for playback and display, the displayed first video frame
  • the frame image freezes or is blurred.
  • the size of the first video frame is not limited, it will take a long time to transmit the I frame, resulting in a long transmission delay. Regardless of whether the first video frame is stuck or blurred or the transmission delay of the first video frame is large, the user experience is greatly reduced.
  • the image frames in each stream are transmitted according to the transmission frame rate that satisfies the receiving end to play each stream. .
  • the second cut is achieved during the playback switching, the transmission of the currently selected stream before the switching occupies too much bandwidth in the transmission channel, so that the available bandwidth for transmitting the currently selected stream is lost , It affects the playback of the currently selected stream, resulting in poor playback quality.
  • the transmission frame rate of the original main stream is higher than the transmission of any original background stream
  • the frame rate is transmitted to ensure the playback quality of the original main stream; and after the playback is switched according to the main stream switching signal, the frame rate is adjusted, and the transmission frame rate of the new background stream after adjustment is higher than any new background code
  • the transmission frame rate of the stream, and the transmission of each stream according to the adjusted transmission frame rate so as to realize the targeted transmission of each stream in combination with the stream that needs to be played in the receiving end.
  • the response speed of switching ensures the playback quality of the code stream.
  • Fig. 3 is a schematic diagram of code stream transmission according to the method of the present disclosure in an application scenario.
  • the receiving end receives two streams in parallel, namely, A stream and B stream.
  • the receiving end plays the A code stream, and correspondingly, during the playing of the A code stream, the A code stream is used as the original main code stream, and the B code stream is used as the original background code stream, and The transmission frame rate of code stream A is higher than that of code stream B.
  • the A bit stream is used as the new background bit stream
  • the B bit stream is used as the new main bit stream.
  • the A bit stream The transmission frame rate is lower than that of the B-channel stream.
  • the adjustment is to adjust the transmission frame rate of the A stream to the transmission frame rate of the B stream before the playback switch, and adjust the transmission frame rate of the B stream to the A code before the playback switch The transmission frame rate of the stream.
  • the first image frame transmitted in each bit stream is an I frame
  • the image frame transmitted thereafter is a P frame, thus greatly reducing the The bandwidth occupied during the transmission process.
  • encoding is performed again according to the intra-frame encoding method to obtain the I frame of the current image to be encoded And transmit; if there is no transmission error in the code stream, continue encoding according to the inter-frame encoding method to obtain the P frame of the current image to be encoded and transmit it.
  • the method further includes:
  • anomaly detection is performed on the received image frames.
  • the receiving end is concerned with whether the received image frame is accurate, that is, whether a data error occurs, and whether the receiving end misses the image frame, that is, whether the image frame is lost.
  • the abnormality detection performed is to detect whether the image frame received in the receiving end has data errors and whether the image frame loss occurs in the receiving end. Therefore, an abnormal image frame in the code stream is correspondingly determined according to the performed abnormality detection, and the abnormal image frame includes the image frame in which the data error occurs and the lost image frame.
  • the abnormality detection performed at the receiving end includes:
  • the check code carried by the received image frame it is checked whether the image frame is an image frame with data errors.
  • the image frame transmitted by the sending end to the receiving end includes the check code configured for the image frame, such as a CRC check code, so that after the image frame is received, the corresponding check algorithm is used, such as the CRC check
  • the CRC check algorithm of the code is checked to determine whether the check code obtained by the check algorithm is consistent with the check code carried in the received image frame to determine whether the received image frame has a data error. If they are consistent, there is no data error in the received image frame. On the contrary, if they are not consistent, the received image frame has a data error.
  • the abnormality detection performed on the receiving end further includes:
  • the frame sequence number carried by the received image frame determine whether the frame sequence numbers of the two adjacent received image frames in the same code stream are continuous, and the image frame corresponding to the frame sequence number between the frame sequence numbers that are judged to be discontinuous is confirmed as lost Image frame.
  • the sending end configures the frame sequence number for the sent image frame. Therefore, after receiving the image frame, the receiving end passes through the same code stream twice.
  • the continuity of the frame numbers of the received image frames is judged accordingly, that is, if the frame numbers of the image frames received two consecutive times are consecutive, there is no missing image frame in the image frames received twice. ; On the contrary, there are missing image frames, and the missing image frames are the image frames corresponding to the frame numbers between the discontinuous frame numbers.
  • the method further includes:
  • feedback information is sent to the sending end for the accurately received image frame, and the feedback information carries the frame number of the image frame.
  • the sending end can know in time which image frames sent are received and accurately received.
  • the code stream is transmitted to the receiving end after being encoded.
  • the original image in the code stream is encoded by the sending end according to the inter-frame encoding method or the intra-frame encoding method.
  • the inter-frame encoding method refers to the method of encoding image data using other frames as reference frames using the temporal correlation of image frames.
  • the intra-frame coding method refers to a method of encoding image data without referring to time-related lines for spatial prediction.
  • the first frame of each stream is an intra-encoded frame obtained by intra-encoding, such as H.263, H.264, H.265, MPEG4, etc.
  • the coding standard is an I frame obtained by intra-coding.
  • intra-frame coded frames since other frames are not referenced for coding, the receiving end can decode the intra-frame coded frames as long as they correctly receive it.
  • the image frame transmitted after the first frame in each stream can be an intra-frame coded frame, or an inter-frame coded frame obtained by inter-frame coding, such as H.263, H.264, H.265, P-frames and B-frames obtained by intra-frame coding in video coding standards such as MPEG4.
  • inter-frame coded frames since the predictive coding is performed with reference to the time correlation, that is, the coding depends on the reference frame, so even if the receiving end receives the inter-coded frame correctly, if the reference frame of the inter-coded frame is wrong, then The inter-coded frame cannot be decoded correctly.
  • the received image frame has a data error through anomaly detection. If the image frame with the data error is used as the reference frame of the subsequent image frame, the received image frame will not be correctly translated. Code, which causes the error caused by the image frame to be passed backward.
  • the code stream transmitted by the sending end to the receiving end includes the following image frames arranged in order: P0, P1, P2, P3, P4, P5, P6, ... Pn, where, in the sending end, the image The frame P5 is obtained by encoding the image frame P4 as the reference frame, and correspondingly, the image frames P6, P6, P6, ... Pn are obtained by encoding the previous image frame as the reference frame.
  • the receiving end finds that the image frame P4 is an abnormal image frame (that is, data error occurs or the image frame is lost) through anomaly detection, then, correspondingly, the image frame P4 cannot be correctly decoded at the receiving end.
  • the receiving end After confirming that the image frame P4 is an abnormal image frame, if it is not processed in time, it will directly affect the decoding of subsequent image frames. That is, if it is not processed, the receiving end cannot decode correctly after receiving the image frames P5, P6 and subsequent image frames, resulting in the error caused by the image frame P4 being transferred to the subsequent image frames , Resulting in wrong delivery.
  • the code stream is played in real time at the receiving end, if no countermeasures are taken for abnormal image frames to avoid the current abnormal image frame from affecting subsequent image frames, it will greatly affect the playback effect of the code stream.
  • the method further includes:
  • feedback information is sent to the sending end for the accurately received image frame, and the feedback information carries the frame number of the corresponding image frame.
  • the sending end detects the discontinuity of the frame sequence numbers in the two adjacent feedback information received, it is the initial data to be transmitted Determine the reference frame, and the determined reference frame is different from the abnormal image frame.
  • the transmitted image frame is obtained by encoding the initial data.
  • the sending end dynamically determines the reference frame corresponding to the initial data to be transmitted in the sending end according to the feedback information sent by the receiving end when it detects that the received image frame is a data error. Ensure that the determined reference frame is the image frame accurately received at the receiving end. So as to avoid wrong backward transmission.
  • the method includes:
  • a reference frame management queue is correspondingly configured at the receiving end for each bit stream received, and the reference frame management queue is used to store the accurately received image frame and the corresponding frame sequence number in the receiving end.
  • the method further includes:
  • the error-tolerant data sent again by the sending end for the abnormal image frame is the intra-frame coded frame corresponding to the abnormal image frame or the frame group including the intra-frame coded frame.
  • an abnormal image frame of an intra-coded frame or an intra-coded frame as a reference frame of the abnormal image frame can be decoded according to the re-received intra-coded frame correspondingly to avoid the error backward transfer.
  • the sending end periodically sends fault-tolerant data to the receiving end, so that no matter when an abnormal image frame appears in the receiving end, as long as the intra-frame coded frame corresponding to the abnormal image frame is received, it can be Decoding is performed according to the intra-coded frame received again for the abnormal image frame to obtain an accurate image frame.
  • Fig. 4 is a flow chart showing a method for transmission control of a code stream according to another exemplary embodiment.
  • the transmission control method of the code stream can be executed by the transmitting end 100 of the code stream, as shown in FIG. 4, including the following steps:
  • Step 410 Send at least two code streams, at least two code streams including a first code stream and a second code stream, where the first code stream is used as the original main code stream, and the at least two code streams except the first code stream Other code streams are used as original background code streams, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any original background code stream.
  • the original main stream is the stream selected for playback in the receiving end, so that after the receiving end receives the image frame of each of the at least two streams, the original main stream is The image frames of the code stream are played, and the image frames in the original background code stream are buffered.
  • the transmission is performed according to the image frame. Therefore, the sending of at least two code streams referred to in step 410 does not mean that the image frames in the at least two code streams have been sent, but it is known that the sending end is in the process of sending image frames.
  • Step 430 Obtain a frame rate adjustment signal, where the frame rate adjustment signal carries the code stream identifier of the second code stream.
  • the transmitting end can learn that the second code stream is switched to the main code stream according to the code stream identifier of the second code stream carried in the frame rate adjustment signal.
  • the frame rate adjustment signal sent by the receiving end according to the acquired main stream switching signal is received to obtain the frame rate adjustment signal.
  • the main stream switching signal is used to instruct to switch the main stream to the second code. flow.
  • the frame rate adjustment signal is correspondingly sent to the transmitting end, thereby correspondingly adjusting the transmission frame rate of each of the at least two code streams.
  • the frame rate adjustment signal may also be generated by an operation triggered on the transmitting end, that is, switching the main stream at the transmitting end.
  • Step 450 After adjusting the frame rate according to the frame rate adjustment signal, continue to send at least two streams according to the adjusted transmission frame rate, where the second stream is used as the new main stream, and the second stream is divided by the at least two streams. Other code streams outside the code stream are used as the new background code stream. After the frame rate is adjusted, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any new background code stream.
  • the transmission frame rate of the new background code stream is the transmission frame rate of the second code stream before switching, or is a dynamic low frame rate adapted to the remaining bandwidth.
  • the remaining bandwidth is based on the The transmission frame rate of the new main stream is determined.
  • the transmission frame rate of the new main stream is the transmission frame rate of the original main stream before switching.
  • the method further includes:
  • Step 510 Before sending the image frames of each code stream in the at least two code streams, obtain a reference frame determined for the original image to be encoded in the corresponding code stream.
  • Step 530 Encode the original image according to the reference frame to obtain an image frame of the original image.
  • the inter-frame coding method is used to code the original images in each bit stream.
  • step 510 includes:
  • the transmitting end configures a reference frame management queue corresponding to each code stream.
  • the reference frame management queue is used to store the image frames accurately received by the receiving end in the corresponding code stream, so as to ensure the reference frame used For the image frame accurately received in the receiving end, the steps of selecting the image frame from the image frame obtained by encoding in the corresponding code stream as the reference frame of the original image include:
  • the method further includes:
  • the feedback information sent by the receiving end is received.
  • the receiving end determines that the received image frame is accurate through anomaly detection, it sends feedback information for the accurately received image frame.
  • the feedback information is used to determine a reference frame for the original image to be encoded.
  • the sending end can determine which image frames are accurately received by the receiving end according to the received feedback information.
  • the feedback information carries the frame number of the corresponding image frame. Therefore, when the sending end receives the feedback information, the corresponding image frame corresponding to the frame sequence number is saved in the reference frame management queue of the corresponding code stream according to the carried frame sequence number.
  • the receiving end configures a reference frame management queue for each bit stream.
  • the image frame and the corresponding frame sequence number are saved to the corresponding code The flow's reference frame management queue.
  • the method further includes:
  • the image frame corresponding to the adjacent data of the original image is determined as the reference frame of the original image.
  • the encoding efficiency of using the image frame corresponding to the adjacent data of the original image to be encoded is higher.
  • the image frame corresponding to the adjacent data is not accurately received by the receiving end, it may cause the The image frame corresponding to the adjacent data can not be decoded correctly in the receiving end.
  • the reference frame for the original image to be encoded is determined according to the feedback information. Specifically, when the frame numbers carried in the detection feedback information are continuous, it means that there is no image frame with data errors or lost in the current receiving end, so that the adjacent data of the original image to be encoded corresponds to the image
  • the frame is determined as the reference frame of the original image, thereby improving the coding efficiency; and when the frame number carried in the feedback information is detected as discontinuous, it means that the image frames between the discontinuous frame numbers are abnormal image frames.
  • the image frame is selected from the reference frame management queue of the corresponding code stream as the reference frame of the original image to ensure that the reference frame used is the image frame accurately received at the receiving end.
  • the method further includes:
  • the original image of the first frame in each stream is encoded and transmitted according to the intra-frame encoding method.
  • the method further includes:
  • Step 610 Receive feedback information sent by the receiving end for the received image frame.
  • Step 630 Determine whether abnormal transmission occurs in the corresponding code stream through the feedback information.
  • the sender determines whether there is abnormal transmission in the corresponding code stream by detecting whether the frame sequence number carried in the feedback information received twice in the same code stream is adjacent, that is, if it is continuous, it means that there is no abnormal transmission; if it is not continuous, then Indicates abnormal transmission occurred.
  • the receiving end may also send feedback information for the abnormal image frame to the transmitting end after the abnormal image frame is determined by the abnormality detection.
  • the feedback information carries the frame number of the corresponding abnormal image frame
  • the abnormal image frame includes the image frame with data error and the image frame with loss. Therefore, after receiving the feedback information, the receiving end can determine that abnormal transmission has occurred in the corresponding code stream, and correspondingly determine the abnormal image frame according to the frame sequence number in the feedback information.
  • Step 650 If it is determined that abnormal transmission occurs in the corresponding code stream, the original image currently to be transmitted in the code stream is encoded and transmitted according to the intra-frame coding mode.
  • Step 670 If it is determined that no abnormal transmission occurs in the corresponding code stream, the original image currently to be transmitted is coded and transmitted according to the inter-frame coding mode.
  • the first frame of the original image in each stream is encoded and transmitted according to the intra-frame encoding method, such as an encoded I frame, and the subsequent original images in the stream are determined according to whether abnormal transmission occurs during transmission.
  • Coding mode that is, when abnormal transmission occurs, the intra-frame coding method is used for coding and transmission, such as encoding to obtain I frame and transmitting; when there is no abnormal transmission, the inter-frame coding method is used for encoding and transmitting, for example, encoding to obtain P frame And transfer.
  • a code stream receiving device includes a processor, a communication component, a memory, and a communication bus.
  • the memory stores executable instructions, and the processor is configured to perform the following steps:
  • the main code stream switching signal indicates to switch the main code stream to the second code stream.
  • the second stream is used as the new main stream, and at least two streams other than the second stream are used as the new background stream.
  • the new main stream The transmission frame rate of the code stream is higher than the transmission frame rate of any new background code stream.
  • the processor further executes the following steps:
  • the processor after the step of acquiring the main stream switching signal, the processor further executes the following steps:
  • the processor in the step of playing the second code stream as the new main code stream, is configured to perform the following steps:
  • the processor in the step of acquiring the main stream switching signal, is configured to perform the following steps:
  • the processor after the step of acquiring the main stream switching signal, the processor further executes the following steps:
  • the processor is configured to perform the following steps:
  • the transmission frame rate of the new background code stream after the switch is the transmission frame rate of the second code stream before the switch, or to adapt to the dynamic low frame rate of the remaining bandwidth, the remaining bandwidth is based on the new main stream after the switch.
  • the transmission frame rate of the stream is determined.
  • the transmission frame rate of the new main stream after switching is the transmission frame rate of the original main stream before switching.
  • the processor is further configured to perform the following steps:
  • anomaly detection is performed on the received image frames.
  • the processor after the step of performing abnormality detection on the received image frame, the processor further performs the following steps:
  • feedback information is sent to the sending end for the accurately received image frame, and the feedback information carries the frame number of the image frame.
  • the present disclosure provides a code stream sending device, which includes a processor, a communication component, a memory, and a communication bus.
  • the memory stores executable instructions, and the processor is configured to perform the following steps:
  • the frame rate adjustment signal is obtained, and the frame rate adjustment signal carries the code stream identifier of the second code stream.
  • the transmission frame rate of the new main code stream is higher than the transmission frame rate of any new background code stream after the frame rate is adjusted.
  • the processor in the step of obtaining the frame rate adjustment signal, is configured to perform the following steps:
  • the frame rate adjustment signal sent by the receiving end according to the acquired main code stream switching signal is received, and the main code stream switching signal is used to instruct to switch the main code stream to the second code stream.
  • the transmission frame rate of the new background code stream is the transmission frame rate of the second code stream before switching, or is a dynamic low frame rate adapted to the remaining bandwidth.
  • the remaining bandwidth is based on the The transmission frame rate of the new main stream is determined.
  • the transmission frame rate of the new main stream is the transmission frame rate of the original main stream before switching.
  • the processor is further configured to perform the following steps:
  • the original image is encoded according to the reference frame to obtain the image frame of the original image.
  • the processor in the step of obtaining the reference frame determined for the original image to be encoded in the corresponding bitstream, is configured to perform the following steps:
  • the processor is further configured to perform the following steps:
  • the feedback information sent by the receiving end is received.
  • the receiving end determines that the received image frame is accurate through anomaly detection, it sends feedback information for the accurately received image frame.
  • the feedback information is used to determine a reference frame for the original image to be encoded.
  • the processor is further configured to perform the following steps:
  • the original image of the first frame in each stream is encoded and transmitted according to the intra-frame encoding method.
  • the processor is further configured to perform the following steps:
  • the original image currently to be transmitted in the code stream is encoded and transmitted according to the intra-frame coding method
  • the original image currently to be transmitted is coded and transmitted according to the inter-frame coding mode.
  • a code stream transmission control device that should be configured as a receiving end, the device includes:
  • the first receiving module is configured to receive at least two code streams.
  • the at least two code streams include a first code stream and a second code stream.
  • the first code stream is used as the original main code stream.
  • Other code streams outside the code stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any original background code stream.
  • the main code stream signal acquisition module is configured to obtain the main code stream switching signal, and the main code stream switching signal indicates to switch the main code stream to the second code stream.
  • the second receiving module is configured to continue to receive at least two code streams after switching, where the second code stream is used as the new main code stream, and the other code streams except the second code stream among the at least two code streams are used as the new background code stream , After switching, the transmission frame rate of the new main stream is higher than the transmission frame rate of any new background stream.
  • the device further includes:
  • the play and storage module is configured to play the original main stream and buffer the original background stream.
  • the device further includes:
  • Switch the playback module configured to play the second code stream as the new main code stream, and buffer the new background code stream.
  • switching the playing module includes:
  • the buffer data acquisition unit is configured to acquire the buffer data buffered for the second code stream before switching.
  • the switching playing unit is configured to switch to playing the second code stream according to the buffered data.
  • the main stream signal acquisition module includes:
  • the main stream signal generating unit is configured to generate the main stream switching signal according to the triggered switching operation.
  • the device further includes:
  • the frame rate adjustment signal sending module is configured to send a frame rate adjustment signal to the sending end, and the frame rate adjustment signal indicates that the main stream is switched to the second stream.
  • the second receiving module includes:
  • the receiving unit is configured to receive at least two streams that the transmitter continues to transmit after adjusting the frame rate according to the frame rate adjustment signal, and the transmitter according to the transmission frame rate of the new main stream is higher than any transmission frame of the new background stream Adjust the frame rate.
  • the transmission frame rate of the new background code stream after the switch is the transmission frame rate of the second code stream before the switch, or to adapt to the dynamic low frame rate of the remaining bandwidth, the remaining bandwidth is based on the new main stream after the switch.
  • the transmission frame rate of the stream is determined.
  • the transmission frame rate of the new main stream after switching is the transmission frame rate of the original main stream before switching.
  • the device further includes:
  • the anomaly detection module is configured to perform anomaly detection on the received image frames for the image frames of each of the received at least two code streams.
  • the device further includes:
  • the feedback information sending module is configured to send feedback information for the accurately received image frame to the sending end when it is confirmed that the received image frame is accurate through anomaly detection, and the feedback information carries the frame number of the image frame.
  • modules can be implemented by hardware, software, or a combination of both.
  • these modules may be implemented as one or more hardware modules, such as one or more application specific integrated circuits.
  • these modules can be implemented as one or more computer programs executed on one or more processors.
  • a code stream transmission control device should be configured as a code stream transmitter, and the device includes:
  • the first sending module is configured to send at least two code streams.
  • the at least two code streams include a first code stream and a second code stream.
  • the first code stream is used as the original main code stream.
  • Other code streams outside the code stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any original background code stream.
  • the frame rate adjustment signal obtaining module is configured to obtain the frame rate adjustment signal, and the frame rate adjustment signal carries the code stream identifier of the second code stream.
  • the second sending module is configured to, after adjusting the frame rate according to the frame rate adjustment signal, continue to send at least two streams according to the adjusted transmission frame rate, where the second stream is used as the new main stream, and at least two streams The other code streams except the second code stream are used as the new background code stream. After the frame rate is adjusted, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any new background code stream.
  • the frame rate adjustment signal acquisition module includes:
  • the frame rate adjustment signal receiving unit is configured to receive the frame rate adjustment signal sent by the receiving end according to the acquired main stream switching signal, and the main stream switching signal is configured to instruct to switch the main stream to the second stream.
  • the transmission frame rate of the new background code stream is the transmission frame rate of the second code stream before switching, or is a dynamic low frame rate adapted to the remaining bandwidth.
  • the remaining bandwidth is based on the The transmission frame rate of the new main stream is determined.
  • the transmission frame rate of the new main stream is the transmission frame rate of the original main stream before switching.
  • the device further includes:
  • the reference frame obtaining module is configured to obtain the reference frame determined for the original image to be encoded in the corresponding code stream before sending the image frame of each code stream in the at least two code streams.
  • the encoding module is configured to encode the original image according to the reference frame to obtain the image frame of the original image.
  • the reference frame acquisition module includes:
  • the first reference frame acquisition unit is configured to select an image frame from the image frames obtained by encoding in the corresponding code stream as the reference frame of the original image.
  • the device further includes:
  • the feedback information receiving module is configured to receive the feedback information sent by the receiving end.
  • the receiving end determines that the received image frame is accurate through abnormal detection, it sends feedback information for the accurately received image frame.
  • the feedback information is configured as the original to be encoded
  • the image determines the reference frame.
  • the device further includes:
  • the first encoding transmission module is configured to encode and transmit the original image of the first frame in each code stream according to the intra-frame encoding method for at least two code streams.
  • the device further includes:
  • the information receiving module is configured to receive the feedback information sent by the receiving end for the received image frame
  • the abnormal transmission determination module is configured to determine whether abnormal transmission occurs in the corresponding code stream through feedback information
  • the second encoding transmission module is configured to, if the abnormal transmission determining module determines that abnormal transmission occurs in the corresponding code stream, the original image currently to be transmitted in the code stream is encoded and transmitted according to the intra-frame encoding method;
  • the third encoding transmission module is configured to encode and transmit the original image currently to be transmitted according to the inter-frame encoding method if the abnormal transmission determining module determines that no abnormal transmission occurs in the corresponding code stream.
  • modules can be implemented by hardware, software, or a combination of both.
  • these modules may be implemented as one or more hardware modules, such as one or more application specific integrated circuits.
  • these modules can be implemented as one or more computer programs executed on one or more processors.
  • Fig. 7 is a hardware block diagram of a UAV according to an exemplary embodiment, wherein the UAV 700 can be used as a code stream transmitter to correspondingly execute the code stream transmission control method of the present disclosure.
  • the drone 700 is only an example adapted to the present disclosure, and cannot be considered as providing any limitation of the scope of use of the present disclosure.
  • the unmanned aerial vehicle 700 cannot be considered to be dependent on or must have one or more components of the exemplary unmanned aerial vehicle 700 shown in FIG. 7.
  • the drone 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, an image acquisition component 708, a positioning component 710, a sensor component 714, and a communication component 716.
  • the processing component 702 generally controls the overall operations of the UAV 700, such as operations associated with code stream transmission, communication, data storage, and original image encoding.
  • the processing component 702 may include one or more processors 718 to execute instructions to complete all or part of the steps of the following method.
  • the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components.
  • the memory 704 is configured to store various types of data to support the operation of the drone 700. Examples of such data include instructions for any application or method configured to operate on drone 700.
  • the memory 704 can be implemented by any type of volatile or non-volatile storage devices or their combination, such as static random access memory (Static Random Access Memory, SRAM for short), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-only memory ( Read-Only Memory, ROM for short), magnetic memory, flash memory, disk, etc.
  • the memory 704 also stores one or more modules, and the one or more modules are configured to be executed by the one or more processors 718 to complete all or part of any of the foregoing method embodiments executed by the sending end step.
  • the power supply component 712 provides power for various components of the drone 700.
  • the power supply component 712 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the drone 700.
  • the power assembly 706 is configured to provide power for the flight of the drone 700.
  • the power assembly 706 may include a power motor that drives the rotor to rotate.
  • the image acquisition component 708 is configured for the UAV 700 to perform image or video acquisition, so as to encode a video stream.
  • the image acquisition component 708 may be at least one camera mounted on the drone 700.
  • the positioning component 710 is configured to obtain the position of the UAV 700 in real time.
  • the positioning component 710 may be a GPS positioning module, a low-orbit satellite module, or the like.
  • the sensor component 714 includes one or more sensors configured to provide the drone 700 with various aspects of status assessment.
  • the sensor component 714 can detect the take-off and stop status of the drone 700, the relative positioning of the components, and the sensor component 714 can also detect the position change of the drone 700 or a component of the drone 700 and the temperature of the drone 700 Variety.
  • the sensor component 714 may also include a magnetic sensor, a pressure sensor or a temperature sensor, an acceleration sensor, an angular velocity sensor, a distance sensor, etc.
  • the communication component 716 is configured to facilitate wired or wireless communication between the drone 700 and other devices.
  • the UAV 700 can be connected to a wireless network based on a communication standard, such as WiFi (WIreless-Fidelity, wireless fidelity).
  • the communication component 716 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 716 further includes a near field communication (Near Field Communication, NFC for short) module to facilitate short-range communication.
  • the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth technology and other technologies. .
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB Ultra Wideband
  • a computer-readable storage medium may be a temporary and non-transitory computer-readable storage medium including instructions.
  • the computer-readable storage medium stores a computer The program, when the computer program is executed by the processor, realizes the transmission control method of the code stream in any method embodiment executed by the receiving end.
  • a computer-readable storage medium may be a temporary and non-transitory computer-readable storage medium including instructions.
  • the computer-readable storage medium stores a computer The program, when the computer program is executed by the processor, realizes the transmission control method of the code stream in any method embodiment executed by the sending end.

Abstract

Disclosed are a transmission control method and device for code streams. The method comprises: receiving at least two code streams, the at least two code streams comprising a first code stream and a second code stream, wherein the first code stream serves as the original main code stream, the code streams other than the first code stream in the at least two code streams serve as original background code streams, and the transmission frame rate of the original main code stream is higher than that of any of the original background code streams; obtaining a main code stream switching signal, the main code stream switching signal indicates switching the main code stream to the second code stream; and continuing receiving the at least two code streams after the switching, wherein the second code stream serves as a new main code stream, the code streams other than the second code stream in the at least two code streams serve as new background code streams, and after the switching, the transmission frame rate of the new main code stream is higher than that of any of the new background code streams. The problem in the prior art of long playback switching response time can be effectively solved. (FIG. 2)

Description

码流的传输控制方法、设备及计算机可读存储介质Transmission control method, equipment and computer readable storage medium of code stream 技术领域Technical field
本公开涉及数据传输技术领域,特别涉及一种码流的传输控制方法、设备及计算机可读存储介质。The present disclosure relates to the field of data transmission technology, and in particular to a transmission control method, device and computer-readable storage medium of a code stream.
背景技术Background technique
随着通信技术的发展,越来越多的场景开始使用到多路码流传输。例如,在一些比赛直播中,经常会在比赛现场设置多个摄像机来实现不同角度对比赛现场的直播,而相应的在直播接收处(如主持人屏幕、电视、网络视频端等)通常只有一块屏幕,因此若需要观看不同的摄像机的直播画面,就需要切换多个摄像机所传输的多路码流进行。With the development of communication technology, more and more scenarios have begun to use multi-channel code stream transmission. For example, in some live broadcasts of matches, multiple cameras are often set up at the match site to achieve live broadcasts of the match site from different angles, and the corresponding live broadcast receiver (such as the host’s screen, TV, network video terminal, etc.) usually has only one Therefore, if you need to watch the live images of different cameras, you need to switch the multiple streams transmitted by multiple cameras.
码流的传输中存在图像编解码的过程,而在图像编解码中,关键帧是不参考任何帧进行编码的图像帧,其数据大小比其他参考帧要大,从而导致码流对关键帧的传输需要占用更大的带宽或者更长的时间。因此,现有技术中在对多路码流进行切换时,要达到较好的显示效果,就需要对关键帧进行缓存,缓存一段时间再显示,从而导致切换时间较长;要达到较快的切换速度,关键帧的大小就会被限制,从而导致切换画面卡顿或模糊。There is an image encoding and decoding process in the transmission of the code stream. In the image encoding and decoding, a key frame is an image frame that does not refer to any frame for encoding, and its data size is larger than other reference frames. Transmission needs to take up more bandwidth or longer time. Therefore, in the prior art, when switching between multiple streams, to achieve a better display effect, it is necessary to buffer the key frames and buffer them for a period of time before displaying, which leads to a longer switching time; Switching speed, the size of the key frame will be limited, which will cause the switching screen to freeze or blur.
因此,在多路码流进行切换时,保证画面的显示效果的同时来减少切换时间和占用带宽,是亟待解决的问题。Therefore, when switching between multiple streams, it is a problem to be solved urgently to ensure the display effect of the picture while reducing the switching time and occupying bandwidth.
发明内容Summary of the invention
为了解决相关技术中所存在在进行多路码流切换时,切换时间长或者画面显示效果差的问题,本公开提供了一种码流的传输控制方法、设备及计算机可读存储介质。In order to solve the problems of long switching time or poor screen display effect when switching multiple streams in related technologies, the present disclosure provides a stream transmission control method, device and computer-readable storage medium.
第一方面,一种码流的传输控制方法,所述方法包括:In a first aspect, a transmission control method of a code stream, the method includes:
接收至少两路码流,所述至少两路码流包括第一码流和第二码流,其中所述第一码流作为原始主码流,所述至少两路码流中除第一码流外的其他码流作为原始背景码流,所述原始主码流的传输帧率高于任一路所述原始背景码流的传输帧率;At least two code streams are received, the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
获取主码流切换信号,所述主码流切换信号指示将主码流切换为所述第二码流;Acquiring a main code stream switching signal, where the main code stream switching signal indicates to switch the main code stream to the second code stream;
继续接收切换后的所述至少两路码流,其中所述第二码流作为新主码流,所述至少两路码流中除第二码流外的其它码流作为新背景码流,进行切换后,所述新主码流的传输帧率高于任一路所述新背景码流的传输帧率。Continue to receive the at least two code streams after switching, wherein the second code stream is used as the new main code stream, and the other code streams except the second code stream among the at least two code streams are used as the new background code stream, After the switching, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
第二方面,一种码流的传输控制方法,所述方法包括:In a second aspect, a transmission control method of a code stream, the method includes:
发送至少两路码流,所述至少两路码流包括第一码流和第二码流,其中所述第一码流作为原始主码流,所述至少两路码流中除第一码流外的其他码流作为原始背景码流,所述原始主码流的传输帧率高于任一路所述原始背景码流的传输帧率;Send at least two code streams, the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
获取帧率调整信号,所述帧率调整信号携带所述第二码流的码流标识;Acquiring a frame rate adjustment signal, where the frame rate adjustment signal carries the code stream identifier of the second code stream;
在根据所述帧率调整信号进行帧率调整后,按照调整后的传输帧率继续发送所述至少两路码流,其中所述第二码流作为新主码流,所述至少两路码流中除第二码流外的其它码流作为新背景码流,帧率调整后,所述新主码流的传输帧率高于任一路所述新背景码流的传输帧率。After adjusting the frame rate according to the frame rate adjustment signal, continue to send the at least two code streams according to the adjusted transmission frame rate, wherein the second code stream is used as the new main code stream, and the at least two code streams are Other code streams in the stream except the second code stream are used as the new background code stream. After the frame rate is adjusted, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
第三方面,一种码流的接收设备,包括处理器、通信组件、存储器和通信总线,所述存储器上存储有可执行指令,所述处理器被配置为执行以下步骤:In a third aspect, a code stream receiving device includes a processor, a communication component, a memory, and a communication bus. The memory stores executable instructions, and the processor is configured to perform the following steps:
接收至少两路码流,所述至少两路码流包括第一码流和第二码流,其中所述第一码流作为原始主码流,所述至少两路码流中除第一码流外的其他码流作为原始背景码流,所述原始主码流的传输帧率高于任一路所述原始背景码流的传输帧率;At least two code streams are received, the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
获取主码流切换信号,所述主码流切换信号指示将主码流切换为所述第二码流;Acquiring a main code stream switching signal, where the main code stream switching signal indicates to switch the main code stream to the second code stream;
继续接收切换后的所述至少两路码流,其中所述第二码流作为新主码流,所述至少两路码流中除第二码流外的其它码流作为新背景码流,进行切换后,所述新主码流的传输帧率高于任一路所述新背景码流的传输帧率。Continue to receive the at least two code streams after switching, wherein the second code stream is used as the new main code stream, and the other code streams except the second code stream among the at least two code streams are used as the new background code stream, After the switching, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
第四方面,一种码流的发送设备,包括处理器、通信组件、存储器和通信总线,所述存储器上存储有可执行指令,所述处理器被配置为执行以下步骤:In a fourth aspect, a code stream sending device includes a processor, a communication component, a memory, and a communication bus. The memory stores executable instructions, and the processor is configured to perform the following steps:
发送至少两路码流,所述至少两路码流包括第一码流和第二码流,其中所述第一码流作为原始主码流,所述至少两路码流中除第一码流外的其他码流作为原始背景码流,所述原始主码流的传输帧率高于任一路所述原始背景码流的传输帧率;Send at least two code streams, the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
获取帧率调整信号,所述帧率调整信号携带所述第二码流的码流标识;Acquiring a frame rate adjustment signal, where the frame rate adjustment signal carries the code stream identifier of the second code stream;
在根据所述帧率调整信号进行帧率调整后,按照调整后的传输帧率继续发送所述至少两路码流,其中所述第二码流作为新主码流,所述至少两路码流中除第二码流外的其它码流作为新背景码流,帧率调整后,所述新主码流的传输帧率高于任一路所述新背景码流的传输帧率。After adjusting the frame rate according to the frame rate adjustment signal, continue to send the at least two code streams according to the adjusted transmission frame rate, wherein the second code stream is used as the new main code stream, and the at least two code streams are Other code streams in the stream except the second code stream are used as the new background code stream. After the frame rate is adjusted, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
第五方面,一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述码流的传输控制方法。In a fifth aspect, a computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, it implements the above-mentioned code stream transmission control method.
本公开的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
通过本公开的技术方案,在至少两路码流的传输过程中,主码流切换前,按照原始主码流的传输帧率高于原始背景码流的帧率进行该至少两路码流的传输;在获取到主码流切换信号后,按照新主码流的传输帧率高于新背景码流的传输帧率继续进行该至少两路码流的传输;即,按照主码流(原始主码流或新主码流)的传输帧率大于背景码流(原始背景码流或新背景码流)的传输帧率,充分保证了主码流的传输带宽,可以避免因背景码流(原始背景码流或新背景码流)过多地占用带宽而影响主码流传输;而且实现了根据主码流的切换动态进行各路码流的传输帧率的调整。According to the technical solution of the present disclosure, during the transmission of at least two streams, before the main stream is switched, the transmission frame rate of the original main stream is higher than the frame rate of the original background stream. Transmission; after the main stream switching signal is obtained, the transmission frame rate of the new main stream is higher than the transmission frame rate of the new background stream to continue the transmission of the at least two streams; that is, according to the main stream (original The transmission frame rate of the main code stream or the new main code stream) is greater than the transmission frame rate of the background code stream (the original background code stream or the new background code stream), which fully guarantees the transmission bandwidth of the main code stream and can avoid the background code stream ( The original background code stream or the new background code stream) occupies too much bandwidth and affects the transmission of the main code stream; and realizes the dynamic adjustment of the transmission frame rate of each stream according to the switching of the main code stream.
进一步的,由于同时按照不同的传输帧率进行主码流和背景码流的传输,从而,在将主码流作为播放的码流时,可以保证在进行播放切换时,无缝切换至播放所切换至的主码 流,提高了切换响应速度,而且保证了播放切换过程中的播放效果。Furthermore, since the main stream and background stream are transmitted at different transmission frame rates at the same time, when the main stream is used as the stream to be played, it can be ensured that when the playback is switched, seamless switching to the playback location can be ensured. The main stream switched to improves the switching response speed and ensures the playback effect during the playback switching process.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本公开。It should be understood that the above general description and the following detailed description are only exemplary and cannot limit the present disclosure.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并于说明书一起用于解释本发明的原理。The drawings herein are incorporated into the specification and constitute a part of the specification, show embodiments in accordance with the present invention, and are used together with the specification to explain the principle of the present invention.
图1是根据一示例性实施例示出本公开所涉及的实施环境的示意图;Fig. 1 is a schematic diagram showing an implementation environment involved in the present disclosure according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种码流的传输控制方法的流程图;Fig. 2 is a flow chart showing a method for transmission control of a code stream according to an exemplary embodiment;
图3是在一具体实施例中根据本公开的方法所实现码流的传输示意图;Fig. 3 is a schematic diagram of code stream transmission implemented according to the method of the present disclosure in a specific embodiment;
图4是根据另一示例性实施例示出的一种码流的传输控制方法的流程图;Fig. 4 is a flowchart showing a method for transmission control of a code stream according to another exemplary embodiment;
图5是根据另一示例性实施例示出的码流的传输控制方法的流程图;Fig. 5 is a flowchart showing a transmission control method of a code stream according to another exemplary embodiment;
图6是根据另一示例性实施例示出的码流的传输控制方法的流程图;Fig. 6 is a flow chart showing a transmission control method of a code stream according to another exemplary embodiment;
图7是根据一示例性实施例示出的一种无人机的硬件框图。Fig. 7 is a hardware block diagram of a UAV according to an exemplary embodiment.
通过上述附图,已示出本发明明确的实施例,后文中将有更详细的描述,这些附图和文字描述并不是为了通过任何方式限制本发明构思的范围,而是通过参考特定实施例为本领域技术人员说明本发明的概念。Through the above drawings, the specific embodiments of the present invention have been shown, and there will be more detailed descriptions in the following. These drawings and text descriptions are not intended to limit the scope of the concept of the present invention in any way, but by referring to specific embodiments. The concept of the present invention is explained for those skilled in the art.
具体实施方式Detailed ways
这里将详细地对示例性实施例执行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。Here, an exemplary embodiment will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present invention. Rather, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
图1是根据一示例性实施例示出的本公开所涉及的实施环境的示意图。该实施环境包括:发送端100和接收端300。Fig. 1 is a schematic diagram showing an implementation environment involved in the present disclosure according to an exemplary embodiment. The implementation environment includes: a sending end 100 and a receiving end 300.
其中发送端100和接收端300之间通过有线或者无线的方式建立网络连接,从而,基于二者的网络连接,发送端100与接收端300进行交互,所进行的交互例如发送端100向接收端300传输至少两路码流、发送端100根据接收端300中所触发进行的播放切换操作调整码流中图像帧的传输帧率等。The sending end 100 and the receiving end 300 establish a network connection in a wired or wireless manner. Therefore, based on the network connection between the two, the sending end 100 and the receiving end 300 interact, for example, the sending end 100 communicates to the receiving end. 300 transmits at least two code streams, and the sending end 100 adjusts the transmission frame rate of the image frames in the code stream according to the playback switching operation triggered by the receiving end 300.
发送端100可以是任意可以进行多路码流传输的设备,例如进行实时图像采集和传输的无人机、笔记本电脑、台式电脑等,在此不进行具体限定。接收端可以是任意可以进行码流接收的通信设备,例如带屏或不带屏的遥控器、VR/AR显示设备、电视机、平板电脑、智能手机、笔记本电脑等电子设备。The sending end 100 may be any device that can perform multi-channel code stream transmission, such as a drone, a notebook computer, a desktop computer, etc., that performs real-time image collection and transmission, which is not specifically limited here. The receiving end can be any communication device that can receive the code stream, such as remote control with or without screen, VR/AR display device, TV, tablet computer, smart phone, notebook computer and other electronic devices.
图2是根据一示例性实施例示出的一种码流的传输控制方法的流程图。该码流的传输控制方法可以由图1所示实施环境的接收端300执行。如图2所示,该码流的传输控制方 法,可以包括以下步骤:Fig. 2 is a flow chart showing a method for controlling code stream transmission according to an exemplary embodiment. The transmission control method of the code stream can be executed by the receiving end 300 in the implementation environment shown in FIG. 1. As shown in Figure 2, the transmission control method of the code stream may include the following steps:
步骤310,接收至少两路码流,至少两路码流包括第一码流和第二码流,其中第一码流作为原始主码流,至少两路码流中除第一码流外的其他码流作为原始背景码流,原始主码流的传输帧率高于任一路原始背景码流的传输帧率。Step 310: At least two code streams are received. The at least two code streams include a first code stream and a second code stream. The first code stream is used as the original main code stream. Other code streams are used as original background code streams, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any original background code stream.
在一具体应用场景中,码流是由若干图像帧顺序排列形成的视频流。在其他应用场景中,码流还可以是音频码流。In a specific application scenario, the code stream is a video stream formed by sequentially arranging several image frames. In other application scenarios, the code stream can also be an audio code stream.
传输帧率是每秒所传输图像帧的帧数。传输帧率表征了码流中的数据传输速度。值得一提的是,在步骤310中,所指的接收至少两路码流是指分别顺序接收至少两路码流中的图像帧,步骤310并不代表完成接收该至少两路码流中各路码流的全部图像帧,而代表接收端处于接收各路码流中图像帧的过程中。The transmission frame rate is the number of image frames transmitted per second. The transmission frame rate characterizes the data transmission speed in the code stream. It is worth mentioning that in step 310, the term “receiving at least two streams” refers to sequentially receiving the image frames in the at least two streams, and step 310 does not represent the completion of receiving each of the at least two streams. All image frames of the code stream, and the representative receiving end is in the process of receiving the image frames in each code stream.
对于接收端所接收的至少两路码流,其中一路码流作为主码流,将该至少两路码流中除该码流外的其它码流作为相对于该主码流的背景码流。在本公开的技术方案中,将主码流的传输帧率配置为高于任一路背景码流的传输帧率。在一具体实施例中,将进行播放的码流作为主码流,对应的,所接收至少两路码流中除所播放码流外的其它码流对应作为背景码流,按照主码流的传输帧率高于任一路背景码流的传输帧率进行传输,从而可以满足接收端对于主码流的播放要求,避免出现卡顿的情况。For the at least two code streams received by the receiving end, one of the code streams is used as the main code stream, and the other code streams among the at least two code streams are taken as the background code stream relative to the main code stream. In the technical solution of the present disclosure, the transmission frame rate of the main code stream is configured to be higher than the transmission frame rate of any background code stream. In a specific embodiment, the code stream to be played is used as the main code stream. Correspondingly, the other code streams except the played code stream in the received at least two code streams correspond to the background code stream, according to the main code stream. The transmission frame rate is higher than the transmission frame rate of any background code stream for transmission, which can meet the playback requirements of the receiving end for the main code stream and avoid jams.
值得一提的是,背景码流是相对于主码流而言的,当主码流变化时,则对应的背景码流对应发生变化。例如至少两路码流包括A路码流、B路码流和C路码流,其中初始作为主码流为A路码流,则在A路码流作为主码流期间,B路码流和C路码流为背景码流;若重新选定B路码流作为主码流,则在B路码流作为主码流期间,A路码流和C路码流作为背景码流。It is worth mentioning that the background code stream is relative to the main code stream. When the main code stream changes, the corresponding background code stream changes accordingly. For example, at least two bit streams include A bit stream, B bit stream and C bit stream, where the main bit stream is A bit stream initially, then when A bit stream is used as the main bit stream, B bit stream The stream and C stream are the background stream; if the B stream is re-selected as the main stream, the A stream and the C stream will be used as the background stream while the B stream is used as the main stream.
对于主码流,可以是基于用户需求进行主码流的选定、或者接收端默认设定主码流,或者基于接收端中设定的处理过程进行选定,例如当前需要播放A路码流,则将A路码流选定为主码流(原始主码流),从而,不管是发送端还是接收端对A路码流中图像帧的操作(例如编码、传输、解码、缓存等)均需要满足A路码流的播放。For the main stream, the main stream can be selected based on user needs, or the main stream is set by default on the receiving end, or based on the processing set in the receiving end, for example, it is currently necessary to play the A stream , The A stream is selected as the main stream (original main stream), so that the operation of the image frame in the A stream (such as encoding, transmission, decoding, buffering, etc.) by the sender or receiver All need to meet the playback of the A stream.
在本公开的技术方案中,为描述方便和避免混淆,将主码流切换之前的主码流称为原始主码流,切换之前的背景码流称为原始背景码流;将主码流切换之后的主码流称为新主码流,切换之后的背景码流称为新背景码流。In the technical solution of the present disclosure, in order to facilitate description and avoid confusion, the main code stream before the main code stream switch is called the original main code stream, and the background code stream before the switch is called the original background code stream; the main code stream is switched The main stream after that is called the new main stream, and the background stream after switching is called the new background stream.
值得一提的是,至少两路码流中的第一码流和第二码流并不特指具体的码流,该第一码流泛指在进行主码流之前被选定作为原始主码流的码流,而第二码流泛指在进行主码流切换所被切换作为新主码流的码流。It is worth mentioning that the first code stream and the second code stream of the at least two code streams do not specifically refer to the specific code stream. The first code stream generally refers to the original master before the main stream is selected. The code stream of the code stream, and the second code stream generally refers to the code stream that is switched as the new main code stream when the main code stream is switched.
步骤330,获取主码流切换信号,主码流切换信号指示将主码流切换为第二码流。Step 330: Obtain the main code stream switching signal. The main code stream switching signal indicates to switch the main code stream to the second code stream.
基于用户需求,或者接收端中对所接收各路码流的处理过程,接收端对于各路码流的数据量要求可能会发生变化,从而需要进行主码流的切换;例如将所播放的A路码流切换为播放B路码流,那么对应的,将主码流切换为B路码流。Based on user requirements, or the processing process of each stream received at the receiving end, the data volume requirements of each stream at the receiving end may change, and the main stream needs to be switched; for example, the A Switch the code stream to play B code stream, then correspondingly, switch the main code stream to B code stream.
主码流切换信号即用于指示所要切换为主码流的码流,在本公开的技术方案中,用第二码流泛指主码流切换信号所指示需要切换为主码流的码流,从而,主码流切换信号所指示的第二码流即被作为本公开的新主码流。The main code stream switching signal is used to indicate the code stream to be switched to the main code stream. In the technical solution of the present disclosure, the second code stream generally refers to the code stream which needs to be switched to the main code stream indicated by the main code stream switching signal. Therefore, the second code stream indicated by the main code stream switching signal is regarded as the new main code stream of the present disclosure.
在一具体实施例中,该主码流切换信号可以是根据在接收端中触发的切换操作生成的,用户通过在接收端中触发切换操作从而向接收端指示将主码流切换为第二码流。例如,当接收端为VR眼镜,用户想要切换显示的码流时,可以通过对VR眼镜的相应控制部件进行操作来触发切换操作,从而生成主码流切换信号。In a specific embodiment, the main stream switching signal may be generated according to a switching operation triggered in the receiving end, and the user triggers the switching operation in the receiving end to instruct the receiving end to switch the main stream to the second code. flow. For example, when the receiving end is VR glasses and the user wants to switch the displayed code stream, he can trigger the switching operation by operating the corresponding control component of the VR glasses, thereby generating the main code stream switching signal.
在另一具体实施例中,该主码流切换信号还可以是外部设备发送至接收端,或者根据在接收端中所配置主码流切换文件生成的,该主码流切换文件指示了在该至少两路码流的传输过程中各个时间段所选定作为主码流的码流。例如,当接收端为监视显示屏时,监视显示屏可以接收外部设备发送的信号,或者依据配置的主码流切换文件,来生成主码流切换信号。配置的主码流切换文件可以根据接收端的工作状态,如工作位置、工作时间等信息,来生成主码流切换信号。例如,当监视显示屏显示摄像机A的画面到预定时间后,可以依据预先配置的主码流切换文件,自动生成主码流切换信号,从而自动切换至摄像机B的画面。In another specific embodiment, the main stream switching signal may also be sent by an external device to the receiving end, or generated according to the main stream switching file configured in the receiving end, and the main stream switching file indicates During the transmission of at least two streams, each time segment is selected as the stream of the main stream. For example, when the receiving end is a monitor screen, the monitor screen can receive a signal sent by an external device, or generate a main stream switching signal according to a configured main stream switching file. The configured main stream switching file can generate the main stream switching signal according to the working status of the receiving end, such as working location, working time and other information. For example, when the monitor screen displays the picture of camera A for a predetermined period of time, the main stream switching signal can be automatically generated according to the pre-configured main stream switching file to automatically switch to the picture of camera B.
步骤330,继续接收切换后的至少两路码流,其中第二码流作为新主码流,至少两路码流中除第二码流外的其它码流作为新背景码流,进行切换后,新主码流的传输帧率高于任一路新背景码流的传输帧率。Step 330: Continue to receive at least two streams after the switch, where the second code stream is used as the new main code stream, and the other code streams in the at least two code streams except the second code stream are used as the new background code stream, after switching , The transmission frame rate of the new main stream is higher than the transmission frame rate of any new background stream.
如上所描述,主码流切换信号指示了切换后的主码流,由于配置主码流的传输帧率高于任一路背景码流的传输帧率,从而,在切换了主码流后,根据所选定作为新主码流的码流,对应调整该至少两路码流中各路码流的传输帧率,使得进行切换后,新主码流的传输帧率高于任一路新背景码流的传输帧率。As described above, the main code stream switching signal indicates the main code stream after switching. Since the transmission frame rate of the main code stream is configured to be higher than the transmission frame rate of any background code stream, after switching the main code stream, according to The selected stream as the new main stream, correspondingly adjust the transmission frame rate of each of the at least two streams, so that after switching, the transmission frame rate of the new main stream is higher than any new background code The transmission frame rate of the stream.
在一具体实施例中,为保证进行切换后,新主码流的传输帧率高于任一路新背景码流的传输帧率,在接收端获取到主码流切换信号之后,接收端向发送端发送帧率调整信号,帧率调整信号指示了将主码流切换为第二码流。可以理解的是,该帧率调整信号是根据主码流切换信号生成的。从而,发送端在接收到帧率调整信号之后,根据该帧率调整信号对该至少两路码流中各路码流的传输帧率进行调整,并按照调整后的传输帧率进行各路码流的传输,其中发送端按照新主码流的传输帧率高于任一路新背景码流的传输帧率进行帧率调整。In a specific embodiment, to ensure that after switching, the transmission frame rate of the new main stream is higher than the transmission frame rate of any new background stream, after the receiving end obtains the main stream switching signal, the receiving end sends The end sends a frame rate adjustment signal, and the frame rate adjustment signal indicates that the main stream is switched to the second stream. It can be understood that the frame rate adjustment signal is generated according to the main stream switching signal. Therefore, after receiving the frame rate adjustment signal, the transmitting end adjusts the transmission frame rate of each of the at least two streams according to the frame rate adjustment signal, and performs each code according to the adjusted transmission frame rate Stream transmission, where the sender adjusts the frame rate according to the transmission frame rate of the new main stream higher than the transmission frame rate of any new background stream.
在进行主码流切换之前,第二码流作为原始背景码流中的一路码流,第一码流作为原始主码流,原始主码流的传输帧率高于原始背景码流的传输帧率;在进行主码流切换之后,第二码流作为新主码流,第一码流对应作为新背景码流中的一路码流;从而可以知道,进行切换后,为保证新主码流的传输帧率高于新主码流的传输帧率且保证接收端对于第二码流的需求,切换后,增大第二码流的传输帧率,从而基于切换后第二码流的传输帧率,对应调整作为新背景码流的各路码流的帧率。Before switching the main stream, the second stream is used as one stream in the original background stream, and the first stream is used as the original main stream. The transmission frame rate of the original main stream is higher than that of the original background stream. Rate; after the main code stream is switched, the second code stream is used as the new main code stream, and the first code stream corresponds to the one code stream in the new background code stream; thus, it can be known that after the switch, in order to ensure the new main code stream The transmission frame rate is higher than the transmission frame rate of the new main stream and guarantees the demand of the receiving end for the second code stream. After switching, the transmission frame rate of the second code stream is increased, based on the transmission of the second code stream after the switch Frame rate, correspondingly adjust the frame rate of each stream as the new background stream.
在一实施例中,预先设定背景码流(原始背景码流或新背景码流)的传输帧率,当一码流被作为背景码流(原始背景码流或新背景码流)后,按照为主码流所设定的传输帧率进行该路码流的传输。换言之,作为背景码流(原始背景码流或新背景码流)中各路码流的传输帧率相同,从而进行切换后新背景码流的传输帧率为进行切换前第二码流的传输帧率。在具体实施例中,还可以为每一路码流分别设定作为背景码流(原始背景码流或新背景码流)的传输帧率。In one embodiment, the transmission frame rate of the background code stream (original background code stream or new background code stream) is preset. When a code stream is used as the background code stream (original background code stream or new background code stream), The transmission of the stream is carried out according to the transmission frame rate set for the main stream. In other words, as the background code stream (original background code stream or new background code stream), the transmission frame rate of each code stream is the same, so the transmission frame rate of the new background code stream after switching is the transmission frame rate of the second code stream before switching Frame rate. In a specific embodiment, it is also possible to set the transmission frame rate as the background code stream (original background code stream or new background code stream) for each bit stream.
在一实施例中,还可以预先设定主码流(原始主码流或新主码流)的传输帧率,当一路码流被选定作为主码流(原始主码流或新主码流)后,按照所设定的传输帧率进行该作为主码流的码流的传输。换言之,作为主码流(原始背景码流或新背景码流)时主码流的传输帧率相同,从而,进行切换后新主码流的传输帧率为进行切换前原始主码流的传输帧率。In an embodiment, the transmission frame rate of the main code stream (original main code stream or new main code stream) can also be preset. When a code stream is selected as the main code stream (original main code stream or new main code stream) After that, the transmission of the code stream as the main code stream is performed according to the set transmission frame rate. In other words, as the main stream (original background code stream or new background code stream), the transmission frame rate of the main code stream is the same. Therefore, the transmission frame rate of the new main code stream after switching is the transmission frame rate of the original main code stream before switching. Frame rate.
在另一实施例中,还可以同时为该至少两路码流中的每一路码流分别设定作为主码流(原始主码流或新主码流)的传输帧率,以及作为背景码流(原始背景码流或新背景码流)的传输帧率,从而在进行主码流切换之后,对应按照所进行的设定调整各路码流的传输帧率。In another embodiment, it is also possible to set the transmission frame rate as the main stream (original main stream or new main stream) and as the background code for each of the at least two streams at the same time. The transmission frame rate of the stream (original background code stream or new background code stream), so that after the main code stream is switched, the transmission frame rate of each code stream is adjusted according to the settings made.
在另一实施例中,新背景码流的传输帧率为适应于剩余带宽的动态低帧率。该剩余带宽是根据切换后新主码流的传输帧率来确定的。具体的,接收端和发送端的当前带宽与按照切换后新主码流的传输帧率进行传输时新主码流做占用带宽之差即为剩余带宽。然后按照剩余带宽来动态为新背景码流确定传输帧率。In another embodiment, the transmission frame rate of the new background code stream is a dynamic low frame rate adapted to the remaining bandwidth. The remaining bandwidth is determined according to the transmission frame rate of the new main stream after switching. Specifically, the difference between the current bandwidth of the receiving end and the sending end and the occupied bandwidth of the new main stream when the transmission is performed according to the transmission frame rate of the new main stream after switching is the remaining bandwidth. Then dynamically determine the transmission frame rate for the new background stream according to the remaining bandwidth.
在本公开的技术方案中,在至少两路码流的传输过程中,主码流切换前,按照原始主码流的传输帧率高于原始背景码流的帧率进行该至少两路码流的传输;在获取到主码流切换信号后,按照新主码流的传输帧率高于新背景码流的传输帧率继续进行该至少两路码流的传输;一方面,按照主码流(原始主码流或新主码流)的传输帧率大于背景码流(原始背景码流或新背景码流)的传输帧率,充分保证了主码流的传输带宽,以满足接收端对于主码流的数据需求,避免发生因背景码流(原始背景码流或新背景码流)过多地占用带宽而造成主码流可用带宽不足的情况;另一方面,根据主码流的切换动态地进行调整该至少两路码流中各路码流的传输帧率,使得帧率的调整适应于主码流的切换。In the technical solution of the present disclosure, during the transmission of at least two streams, before the main stream is switched, the at least two streams are performed according to the transmission frame rate of the original main stream higher than the frame rate of the original background stream After obtaining the main stream switching signal, the transmission frame rate of the new main stream is higher than the transmission frame rate of the new background stream to continue the transmission of the at least two streams; on the one hand, according to the main stream The transmission frame rate of (original main stream or new main stream) is greater than the transmission frame rate of background code stream (original background code stream or new background code stream), which fully guarantees the transmission bandwidth of the main stream to meet the requirements of the receiving end. The data requirement of the main stream is to avoid the situation where the available bandwidth of the main stream is insufficient due to the excessive occupation of bandwidth by the background stream (original background stream or new background stream); on the other hand, according to the switch of the main stream The transmission frame rate of each of the at least two streams is dynamically adjusted, so that the adjustment of the frame rate is adapted to the switching of the main stream.
在一实施例中,步骤310之后,该方法还包括:In an embodiment, after step 310, the method further includes:
对原始主码流进行播放,并对原始背景码流进行缓存。Play the original main stream and cache the original background stream.
也即是说,接收端根据所接收原始主码流的数据进行原始主码流的缓存播放,而仅对原始背景码流进行缓存,从而使得在第一码流作为原始主码流期间,接收端仅播放第一码流。In other words, the receiving end buffers and plays the original main code stream according to the data of the received original main code stream, and only buffers the original background code stream, so that when the first code stream is used as the original main code stream, the receiving end Only the first stream is played at the end.
在具体实施例中,由于是在编码之后进行码流的传输,对应的,接收端在接收到原始主码流和原始背景码流中的数据之后,对应进行译码。换言之,对原始主码流进行译码播 放,并对原始背景码流进行译码缓存。In a specific embodiment, since the code stream is transmitted after encoding, correspondingly, the receiving end performs corresponding decoding after receiving the data in the original main code stream and the original background code stream. In other words, the original main stream is decoded and played, and the original background stream is decoded and buffered.
进一步的,在步骤330之后,该方法还包括:Further, after step 330, the method further includes:
对作为新主码流的第二码流进行播放,并对新背景码流进行缓存。Play the second code stream as the new main code stream, and buffer the new background code stream.
换言之,在接收端中,接收端根据主码流切换信号进行播放切换,即停止对原第一码流的播放而切换为播放作为新主码流的第二码流。In other words, in the receiving end, the receiving end switches the playback according to the main stream switching signal, that is, stops playing the original first stream and switches to playing the second stream as the new main stream.
如上所描述,对应于编码之后进行码流传输的场景,对作为新主码流的第二码流进行译码播放,而对新背景码流进行译码缓存。As described above, corresponding to the scene of code stream transmission after encoding, the second code stream as the new main code stream is decoded and played, and the new background code stream is decoded and buffered.
在一具体实施例中,对作为新主码流的第二码流进行播放的步骤包括:In a specific embodiment, the step of playing the second code stream as the new main code stream includes:
获取在进行切换前为第二码流缓存的缓存数据。Obtain the buffered data buffered for the second code stream before switching.
根据缓存数据切换至播放第二码流。Switch to play the second stream according to the buffered data.
由于在原始主码流的播放期间,为作为原始背景码流进行了数据缓存,其中包括该期间作为原始背景码流的第二码流,从而在进行主码流切换之后,可以无需进行缓冲即可无缝切换至播放第二码流。Because during the playback of the original main stream, data is buffered for the original background stream, including the second stream as the original background stream during this period, so after the main stream is switched, no buffering is needed. Can seamlessly switch to play the second stream.
现有技术的码流播放切换中,在接收端接收到播放切换指令(相当于本实施例中的主码流切换信号)之后,才对应地向发送端请求该播放切换指令所指示需要播放的码流的数据,即在播放切换之后才进行所切换至码流中数据的缓存,从而使得播放切换时间长,播放切换响应速度慢。In the stream playback switching of the prior art, after the receiving end receives the playback switching instruction (equivalent to the main stream switching signal in this embodiment), it requests the sending end correspondingly to the playback switching instruction indicated by the playback switching instruction. The data of the code stream, that is, the buffering of the data in the code stream switched to is performed after the playback switching, which makes the playback switching time long and the playback switching response speed slow.
在进行播放切换操作之后接收端才向发送端请求该路视频码流中的图像,从而,发送端根据接收端的请求进行所请求视频码流中图像的编码传输。由于视频码流中的首视频帧为I帧,而I帧不参考任何帧,是采用帧内编码方式获得,压缩率较低,数据量较高,压缩难度大,若按照现有技术的码流播放切换方法,为保证接收端对于播放切换的响应,需要限制首视频帧的大小,即压缩后编码获得I帧,而接收端在根据压缩后编码获得I帧进行播放显示时,所显示首帧图像卡顿或者模糊。而如果不限制首视频帧的大小,则传输该I帧所花费的时间长,造成传输时延大。而不管是首视频帧卡顿模糊或者首视频帧的传输时延大,均极大降低了用户体验。After the playback switching operation is performed, the receiving end requests the image in the video stream from the sending end. Therefore, the sending end performs encoding and transmission of the image in the requested video stream according to the request of the receiving end. Since the first video frame in the video code stream is an I frame, and the I frame does not refer to any frame, it is obtained by the intra-frame coding method. The compression rate is low, the data volume is high, and the compression is difficult. The streaming playback switching method, in order to ensure that the receiving end responds to the playback switching, the size of the first video frame needs to be limited, that is, the first video frame is obtained by encoding after compression, and when the receiving end obtains the I frame according to the compressed encoding for playback and display, the displayed first video frame The frame image freezes or is blurred. However, if the size of the first video frame is not limited, it will take a long time to transmit the I frame, resulting in a long transmission delay. Regardless of whether the first video frame is stuck or blurred or the transmission delay of the first video frame is large, the user experience is greatly reduced.
采用本实施例的技术方案,可以有效避免这些问题。由于在进行播放切换之前,即接收端获取到主码流切换信号之前,对原始主码流进行缓存播放,并对原始背景码流中的数据进行缓存,从而,在接收端获取到主码流切换信号之后,可以直接根据所缓存的数据无缝切换至播放作为新主码流的第二码流,播放切换响应速度快,而且不存在首帧卡顿模糊的情况,保证了播放效果。With the technical solution of this embodiment, these problems can be effectively avoided. Because before the playback switching, that is, before the receiving end obtains the main stream switching signal, the original main stream is buffered and played, and the data in the original background stream is buffered, so that the main stream is obtained at the receiving end After the signal is switched, it can be seamlessly switched to play the second stream as the new main stream directly according to the buffered data. The playback switching response speed is fast, and there is no blurring of the first frame, ensuring the playback effect.
在现有技术中,为了提高码流播放切换的响应时间,对于所传输的至少两路码流,均按照满足接收端播放各路码流的传输帧率进行各路码流中图像帧的传输。虽然在播放切换时实现了秒切,但是由于在切换之前传输非当前所选定进行播放码流占用传输信道中过多的带宽,使得传输当前所选定进行播放的码流的可用带宽受到损失,影响了当前所选定码 流的播放,造成播放质量差。In the prior art, in order to improve the response time of stream playback switching, for at least two streams to be transmitted, the image frames in each stream are transmitted according to the transmission frame rate that satisfies the receiving end to play each stream. . Although the second cut is achieved during the playback switching, the transmission of the currently selected stream before the switching occupies too much bandwidth in the transmission channel, so that the available bandwidth for transmitting the currently selected stream is lost , It affects the playback of the currently selected stream, resulting in poor playback quality.
在本公开所进行的至少两路码流的传输中,结合接收端中所选定需要进行播放的原始主码流,按照原始主码流的传输帧率高于任一路原始背景码流的传输帧率进行传输,保证了原始主码流的播放质量;而在根据主码流切换信号进行播放切换后,进行帧率调整,调整后新背景码流的传输帧率高于任一路新背景码流的传输帧率,并按照调整后的传输帧率进行各路码流的传输,从而实现了结合接收端中所需要播放的码流来针对性地进行各路码流的传输,在保证播放切换的响应速度的同时保证了码流的播放质量。In the transmission of at least two streams performed by the present disclosure, combined with the original main stream selected in the receiving end to be played, the transmission frame rate of the original main stream is higher than the transmission of any original background stream The frame rate is transmitted to ensure the playback quality of the original main stream; and after the playback is switched according to the main stream switching signal, the frame rate is adjusted, and the transmission frame rate of the new background stream after adjustment is higher than any new background code The transmission frame rate of the stream, and the transmission of each stream according to the adjusted transmission frame rate, so as to realize the targeted transmission of each stream in combination with the stream that needs to be played in the receiving end. The response speed of switching ensures the playback quality of the code stream.
图3是在一应用场景中根据本公开的方法所进行码流的传输示意图。在图4中,接收端并行接收两路码流,即A路码流和B路码流。其中,在进行码流播放切换之前,接收端中播放A路码流,对应的在播放A路码流期间,A路码流作为原始主码流,B路码流作为原始背景码流,且A路码流的传输帧率高于B路码流的传输帧率。而在进行播放切换后,A路码流被作为新背景码流,B路码流被作为新主码流,在根据播放切换进行两路码流传输帧率的调整后,A路码流的传输帧率低于B路码流的传输帧率。在图3中,所进行的调整即将A路码流的传输帧率调整为播放切换前B路码流的传输帧率,而将B路码流的传输帧率调整为播放切换前A路码流的传输帧率。Fig. 3 is a schematic diagram of code stream transmission according to the method of the present disclosure in an application scenario. In Figure 4, the receiving end receives two streams in parallel, namely, A stream and B stream. Among them, before the code stream playback switch, the receiving end plays the A code stream, and correspondingly, during the playing of the A code stream, the A code stream is used as the original main code stream, and the B code stream is used as the original background code stream, and The transmission frame rate of code stream A is higher than that of code stream B. After the playback switch is performed, the A bit stream is used as the new background bit stream, and the B bit stream is used as the new main bit stream. After the transmission frame rate of the two bit streams is adjusted according to the playback switch, the A bit stream The transmission frame rate is lower than that of the B-channel stream. In Figure 3, the adjustment is to adjust the transmission frame rate of the A stream to the transmission frame rate of the B stream before the playback switch, and adjust the transmission frame rate of the B stream to the A code before the playback switch The transmission frame rate of the stream.
如图3所示,在A路码流和B路码流中,各码流中传输的首图像帧均为I帧,而其后传输的图像帧为P帧,从而大幅降低了在码流的传输过程中所占用的带宽。在一具体实施例中,为了避免传输中异常的图像帧影响其后所传输图像帧的译码,在码流中出现传输错误时再次按照帧内编码方式进行编码获得当前待编码图像的I帧并传输;若码流中未出现传输错误则继续按照帧间编码方式进行编码获得当前待编码图像的P帧并传输。As shown in Figure 3, in the A bit stream and the B bit stream, the first image frame transmitted in each bit stream is an I frame, and the image frame transmitted thereafter is a P frame, thus greatly reducing the The bandwidth occupied during the transmission process. In a specific embodiment, in order to prevent abnormal image frames during transmission from affecting the decoding of subsequently transmitted image frames, when a transmission error occurs in the code stream, encoding is performed again according to the intra-frame encoding method to obtain the I frame of the current image to be encoded And transmit; if there is no transmission error in the code stream, continue encoding according to the inter-frame encoding method to obtain the P frame of the current image to be encoded and transmit it.
在一实施例中,该方法还包括:In an embodiment, the method further includes:
对于接收到至少两路码流中各路码流的图像帧,对所接收到的图像帧进行异常检测。For the received image frames of each of the at least two code streams, anomaly detection is performed on the received image frames.
为了保证码流传输的准确性,对于接收端而言,所关注的是所接收的图像帧是否准确,即是否发生数据错误,和接收端是否漏接收到图像帧,即是否发生图像帧丢失。In order to ensure the accuracy of bit stream transmission, the receiving end is concerned with whether the received image frame is accurate, that is, whether a data error occurs, and whether the receiving end misses the image frame, that is, whether the image frame is lost.
所进行的异常检测,即是检测接收端中所接收的图像帧是否发生数据错误和检测接收端中是否发生图像帧丢失的情况。从而,根据所进行的异常检测对应确定码流中异常的图像帧,该异常的图像帧包括发生数据错误的图像帧和被丢失的图像帧。The abnormality detection performed is to detect whether the image frame received in the receiving end has data errors and whether the image frame loss occurs in the receiving end. Therefore, an abnormal image frame in the code stream is correspondingly determined according to the performed abnormality detection, and the abnormal image frame includes the image frame in which the data error occurs and the lost image frame.
在一具体实施例中,接收端中所进行的异常检测包括:In a specific embodiment, the abnormality detection performed at the receiving end includes:
根据所接收图像帧所携带的校验码校验图像帧是否为发生数据错误的图像帧。According to the check code carried by the received image frame, it is checked whether the image frame is an image frame with data errors.
发送端向接收端所传输的图像帧中包括为该图像帧所配置的校验码,例如CRC校验码,从而,在接收到图像帧后,按照对应的校验算法,例如对于CRC校验码的CRC校验算法,进行校验,判断通过检验算法所得到的校验码是否与所接收到图像帧中携带的校验码一致来对应判断所接收到的图像帧是否发生数据错误,如果一致,则所接收到的图像帧未发生数据错误,反之,如果不一致,则所接收到的图像帧发生数据错误。The image frame transmitted by the sending end to the receiving end includes the check code configured for the image frame, such as a CRC check code, so that after the image frame is received, the corresponding check algorithm is used, such as the CRC check The CRC check algorithm of the code is checked to determine whether the check code obtained by the check algorithm is consistent with the check code carried in the received image frame to determine whether the received image frame has a data error. If they are consistent, there is no data error in the received image frame. On the contrary, if they are not consistent, the received image frame has a data error.
在另一具体实施例中,接收端中所进行的异常检测还包括:In another specific embodiment, the abnormality detection performed on the receiving end further includes:
根据所接收图像帧携带的帧序号,判断同一码流中相邻两次所接收到图像帧的帧序号是否连续,将判断为不连续的帧序号之间的帧序号所对应图像帧确认为丢失的图像帧。According to the frame sequence number carried by the received image frame, determine whether the frame sequence numbers of the two adjacent received image frames in the same code stream are continuous, and the image frame corresponding to the frame sequence number between the frame sequence numbers that are judged to be discontinuous is confirmed as lost Image frame.
对于是否发生图像帧丢失的情况,在本实施例中,发送端为所发送的图像帧对应配置了帧序号,从而,接收端在接收到图像帧后,通过同一码流中相邻两次所接收到图像帧的帧序号的连续性来对应进行判断,即如果相邻两次所接收到图像帧的帧序号连续,则在该相邻两次所接收到图像帧中不存在丢失的图像帧;反之,则存在丢失的图像帧,所丢失的图像帧即为不连续的帧序号之间帧序号所对应的图像帧。Regarding whether the image frame is lost, in this embodiment, the sending end configures the frame sequence number for the sent image frame. Therefore, after receiving the image frame, the receiving end passes through the same code stream twice. The continuity of the frame numbers of the received image frames is judged accordingly, that is, if the frame numbers of the image frames received two consecutive times are consecutive, there is no missing image frame in the image frames received twice. ; On the contrary, there are missing image frames, and the missing image frames are the image frames corresponding to the frame numbers between the discontinuous frame numbers.
在一实施例中,对所接收到的图像帧进行异常检测之后,该方法还包括:In an embodiment, after performing abnormality detection on the received image frame, the method further includes:
在通过异常检测确认所接收到图像帧准确时,为所准确接收的图像帧向发送端发送反馈信息,反馈信息携带图像帧的帧序号。When it is confirmed that the received image frame is accurate through anomaly detection, feedback information is sent to the sending end for the accurately received image frame, and the feedback information carries the frame number of the image frame.
通过该反馈信息,发送端可以及时获知所发送的哪些图像帧被接收准确接收。Through the feedback information, the sending end can know in time which image frames sent are received and accurately received.
在一应用场景中,码流是在经过编码之后传输到接收端的。发送端对码流中的原始图像所进行的编码是按照帧间编码方式或者帧内编码方式进行编码。In an application scenario, the code stream is transmitted to the receiving end after being encoded. The original image in the code stream is encoded by the sending end according to the inter-frame encoding method or the intra-frame encoding method.
帧间编码方式是指利用图像帧在时间上的相关性,以其他帧作为参考帧对图像数据进行编码的方式。The inter-frame encoding method refers to the method of encoding image data using other frames as reference frames using the temporal correlation of image frames.
而帧内编码方式是指不参考时间相关行进行空域预测,对图像数据进行编码的方式。The intra-frame coding method refers to a method of encoding image data without referring to time-related lines for spatial prediction.
对于发送端向接收端所传输的码流,每一路码流的首帧为通过帧内编码方式所获得的帧内编码帧,例如通过H.263、H.264、H.265、MPEG4等视频编码标准进行帧内编码所获得的I帧。对于帧内编码帧,由于不参考其他帧进行编码,从而接收端只要正确接收到帧内编码帧,即可对应进行译码。For the stream transmitted from the sender to the receiver, the first frame of each stream is an intra-encoded frame obtained by intra-encoding, such as H.263, H.264, H.265, MPEG4, etc. The coding standard is an I frame obtained by intra-coding. For intra-frame coded frames, since other frames are not referenced for coding, the receiving end can decode the intra-frame coded frames as long as they correctly receive it.
每一路码流中首帧之后所传输的图像帧可以是帧内编码帧,也可以是通过帧间编码方式所获得的帧间编码帧,例如通过H.263、H.264、H.265、MPEG4等视频编码标准进行帧内编码所获得的P帧和B帧。对于帧间编码帧,由于参考了时间相关性进行预测编码,即依赖参考帧进行编码,从而,接收端即使正确接收到该帧间编码帧,如果该帧间编码帧的参考帧发生错误,则不能对该帧间编码帧进行正确译码。The image frame transmitted after the first frame in each stream can be an intra-frame coded frame, or an inter-frame coded frame obtained by inter-frame coding, such as H.263, H.264, H.265, P-frames and B-frames obtained by intra-frame coding in video coding standards such as MPEG4. For inter-frame coded frames, since the predictive coding is performed with reference to the time correlation, that is, the coding depends on the reference frame, so even if the receiving end receives the inter-coded frame correctly, if the reference frame of the inter-coded frame is wrong, then The inter-coded frame cannot be decoded correctly.
在接收端通过异常检测检测确定所接收到的图像帧发生数据错误,若该发生数据错误的图像帧作为其后图像帧的参考帧,则会导致所接收到其后的图像帧不能被正确译码,从而导致将该图像帧所引起的错误向后传递。At the receiving end, it is determined that the received image frame has a data error through anomaly detection. If the image frame with the data error is used as the reference frame of the subsequent image frame, the received image frame will not be correctly translated. Code, which causes the error caused by the image frame to be passed backward.
举例来说,发送端向接收端所传输码流中包括如下按照先后顺序排列的图像帧:P0、P1、P2、P3、P4、P5、P6、……Pn,其中,在发送端中,图像帧P5是以图像帧P4作为参考帧进行编码得到的,对应的,图像帧P6、P6、P6、……Pn对应地是以前一图像帧作为参考帧进行编码得到的。现接收端通过异常检测发现图像帧P4为异常的图像帧(即发 生数据错误或者该图像帧丢失),那么,对应的,在接收端中,图像帧P4不能被正确译码。For example, the code stream transmitted by the sending end to the receiving end includes the following image frames arranged in order: P0, P1, P2, P3, P4, P5, P6, ... Pn, where, in the sending end, the image The frame P5 is obtained by encoding the image frame P4 as the reference frame, and correspondingly, the image frames P6, P6, P6, ... Pn are obtained by encoding the previous image frame as the reference frame. Now the receiving end finds that the image frame P4 is an abnormal image frame (that is, data error occurs or the image frame is lost) through anomaly detection, then, correspondingly, the image frame P4 cannot be correctly decoded at the receiving end.
在确认图像帧P4为异常的图像帧后,如果不进行及时处理,会直接影响其后图像帧的译码。即如果不进行处理,那么接收端在接收到图像帧P5、P6以及后续的图像帧后,也对应的不能进行正确进行译码,从而导致由图像帧P4所引起的错误传递到后续的图像帧,造成错误的传递。After confirming that the image frame P4 is an abnormal image frame, if it is not processed in time, it will directly affect the decoding of subsequent image frames. That is, if it is not processed, the receiving end cannot decode correctly after receiving the image frames P5, P6 and subsequent image frames, resulting in the error caused by the image frame P4 being transferred to the subsequent image frames , Resulting in wrong delivery.
如果接收端中实时进行码流的播放,如果不对异常的图像帧采取应对措施,以避免当前异常的图像帧影响到其后图像帧,那么会极大影响码流的播放效果。If the code stream is played in real time at the receiving end, if no countermeasures are taken for abnormal image frames to avoid the current abnormal image frame from affecting subsequent image frames, it will greatly affect the playback effect of the code stream.
从而,在一实施例中,为了避免发生错误的传递,该方法还包括:Therefore, in an embodiment, in order to avoid erroneous transmission, the method further includes:
在检测到所接收到图像帧被准确接收时,为所准确接收的图像帧向发送端发送反馈信息,反馈信息携带所对应图像帧的帧序号。When it is detected that the received image frame is accurately received, feedback information is sent to the sending end for the accurately received image frame, and the feedback information carries the frame number of the corresponding image frame.
接收发送端根据反馈信息为待编码的初始数据所确定参考帧进行编码而传输的图像帧,发送端在检测到相邻两次所接收反馈信息中帧序号不连续时,为待传输的初始数据确定参考帧,所确定的参考帧区别于异常的图像帧。The image frame transmitted by the receiving and sending end for encoding the reference frame determined for the initial data to be encoded according to the feedback information. When the sending end detects the discontinuity of the frame sequence numbers in the two adjacent feedback information received, it is the initial data to be transmitted Determine the reference frame, and the determined reference frame is different from the abnormal image frame.
在发送端,所传输的图像帧即是将初始数据进行编码所得到。At the sending end, the transmitted image frame is obtained by encoding the initial data.
在本实施例的技术方案中,发送端根据接收端在检测所接收到图像帧为发生数据错误时所发送的反馈信息,来对应的为发送端中待传输的初始数据动态确定参考帧,以保证所确定的参考帧为接收端中所准确接收到的图像帧。从而避免发生错误的向后传递。In the technical solution of this embodiment, the sending end dynamically determines the reference frame corresponding to the initial data to be transmitted in the sending end according to the feedback information sent by the receiving end when it detects that the received image frame is a data error. Ensure that the determined reference frame is the image frame accurately received at the receiving end. So as to avoid wrong backward transmission.
在一实施例中,为所准确接收的图像帧向发送端发送反馈信息的步骤之后,该方法包括:In an embodiment, after the step of sending feedback information to the sending end for the accurately received image frame, the method includes:
将所准确接收的图像帧和所对应的帧序号保存至接收端对应码流的参考帧管理队列中。Save the accurately received image frame and the corresponding frame sequence number in the reference frame management queue of the corresponding code stream at the receiving end.
在该实施例中,在接收端为所接收的每一路码流对应配置了参考帧管理队列,该参考帧管理队列用于存储接收端中所准确接收到的图像帧和所对应的帧序号。In this embodiment, a reference frame management queue is correspondingly configured at the receiving end for each bit stream received, and the reference frame management queue is used to store the accurately received image frame and the corresponding frame sequence number in the receiving end.
在另一实施例中,为避免发生错误的传递,该方法还包括:In another embodiment, to avoid erroneous delivery, the method further includes:
接收发送端为异常的图像帧所再次发送的容错数据,容错数据为异常的图像帧所对应帧内编码帧或包括帧内编码帧在内的帧组。The error-tolerant data sent again by the sending end for the abnormal image frame is the intra-frame coded frame corresponding to the abnormal image frame or the frame group including the intra-frame coded frame.
通过容错数据中的帧内编码帧进行译码,获得准确的图像帧。By decoding the intra-coded frame in the error-tolerant data, an accurate image frame is obtained.
在本实施例中,不管该异常的图像帧是通过帧间编码的方式获得的帧内编码帧,还是以其他的帧内编码帧作为参考帧按照帧间编码方式所得到,只要再次接收到作为帧内编码帧的异常的图像帧或者是作为该异常的图像帧的参考帧的帧内编码帧,则可以对应地根据所重新接收到的帧内编码帧进行译码,以避免该错误向后传递。In this embodiment, regardless of whether the abnormal image frame is an intra-coded frame obtained by inter-coding, or other intra-coded frames are used as reference frames to be obtained by inter-coding, as long as it is received again as An abnormal image frame of an intra-coded frame or an intra-coded frame as a reference frame of the abnormal image frame can be decoded according to the re-received intra-coded frame correspondingly to avoid the error backward transfer.
在具体实施例中,发送端周期性地向接收端发送容错数据,从而,不管接收端中何时 出现异常的图像帧,只要接收到该异常的图像帧所对应的帧内编码帧,即可根据为该异常的图像帧所再次接收到的帧内编码帧进行译码,获得准确的图像帧。In a specific embodiment, the sending end periodically sends fault-tolerant data to the receiving end, so that no matter when an abnormal image frame appears in the receiving end, as long as the intra-frame coded frame corresponding to the abnormal image frame is received, it can be Decoding is performed according to the intra-coded frame received again for the abnormal image frame to obtain an accurate image frame.
图4是根据另一示例性实施例示出的一种码流的传输控制方法的流程图。该码流的传输控制方法可以由码流的发送端100执行,如图4所示,包括以下步骤:Fig. 4 is a flow chart showing a method for transmission control of a code stream according to another exemplary embodiment. The transmission control method of the code stream can be executed by the transmitting end 100 of the code stream, as shown in FIG. 4, including the following steps:
步骤410,发送至少两路码流,至少两路码流包括第一码流和第二码流,其中第一码流作为原始主码流,至少两路码流中除第一码流外的其他码流作为原始背景码流,原始主码流的传输帧率高于任一路原始背景码流的传输帧率。Step 410: Send at least two code streams, at least two code streams including a first code stream and a second code stream, where the first code stream is used as the original main code stream, and the at least two code streams except the first code stream Other code streams are used as original background code streams, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any original background code stream.
在一实施例中,该原始主码流为接收端中所选定进行播放的码流,从而,在接收端接收到该至少两路码流中各路码流的图像帧后,对原始主码流的图像帧进行播放,并对原始背景码流中的图像帧进行缓存。In an embodiment, the original main stream is the stream selected for playback in the receiving end, so that after the receiving end receives the image frame of each of the at least two streams, the original main stream is The image frames of the code stream are played, and the image frames in the original background code stream are buffered.
对应的,由于在各路码流的发送过程中,按照图像帧进行发送。因此,步骤410中所指的发送至少两路码流并不指发送完至少两路码流中的图像帧,而知发送端处于发送图像帧的过程中。Correspondingly, in the transmission process of each bit stream, the transmission is performed according to the image frame. Therefore, the sending of at least two code streams referred to in step 410 does not mean that the image frames in the at least two code streams have been sent, but it is known that the sending end is in the process of sending image frames.
步骤430,获取帧率调整信号,帧率调整信号携带第二码流的码流标识。Step 430: Obtain a frame rate adjustment signal, where the frame rate adjustment signal carries the code stream identifier of the second code stream.
从而,发送端根据帧率调整信号中所携带第二码流的码流标识即可获知第二码流被切换为主码流。Therefore, the transmitting end can learn that the second code stream is switched to the main code stream according to the code stream identifier of the second code stream carried in the frame rate adjustment signal.
在一实施例中,接收接收端根据所获取的主码流切换信号而发送的帧率调整信号,从而获得帧率调整信号,主码流切换信号用于指示将主码流切换为第二码流。换言之,在接收端获取到主码流切换信号之后,对应的向发送端发送帧率调整信号,从而对应地调整该至少两路码流中各路码流的传输帧率。In one embodiment, the frame rate adjustment signal sent by the receiving end according to the acquired main stream switching signal is received to obtain the frame rate adjustment signal. The main stream switching signal is used to instruct to switch the main stream to the second code. flow. In other words, after the receiving end obtains the main code stream switching signal, the frame rate adjustment signal is correspondingly sent to the transmitting end, thereby correspondingly adjusting the transmission frame rate of each of the at least two code streams.
在另一实施例中,该帧率调整信号还可以是对发送端触发的操作来生成的,即在发送端进行主码流的切换。In another embodiment, the frame rate adjustment signal may also be generated by an operation triggered on the transmitting end, that is, switching the main stream at the transmitting end.
步骤450,在根据帧率调整信号进行帧率调整后,按照调整后的传输帧率继续发送至少两路码流,其中第二码流作为新主码流,至少两路码流中除第二码流外的其它码流作为新背景码流,帧率调整后,新主码流的传输帧率高于任一路新背景码流的传输帧率。Step 450: After adjusting the frame rate according to the frame rate adjustment signal, continue to send at least two streams according to the adjusted transmission frame rate, where the second stream is used as the new main stream, and the second stream is divided by the at least two streams. Other code streams outside the code stream are used as the new background code stream. After the frame rate is adjusted, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any new background code stream.
在一实施例中,帧率调整后,新背景码流的传输帧率为进行切换前第二码流的传输帧率,或为适应于剩余带宽的动态低帧率,剩余带宽是根据切换后新主码流的传输帧率来确定的。In one embodiment, after the frame rate is adjusted, the transmission frame rate of the new background code stream is the transmission frame rate of the second code stream before switching, or is a dynamic low frame rate adapted to the remaining bandwidth. The remaining bandwidth is based on the The transmission frame rate of the new main stream is determined.
在一实施例中,帧率调整后,新主码流的传输帧率为进行切换前原始主码流的传输帧率。In one embodiment, after the frame rate is adjusted, the transmission frame rate of the new main stream is the transmission frame rate of the original main stream before switching.
在一实施例中,如图5所示,该方法还包括:In an embodiment, as shown in FIG. 5, the method further includes:
步骤510,在发送至少两路码流中各码流的图像帧之前,获取为对应码流中待编码的原始图像所确定的参考帧。Step 510: Before sending the image frames of each code stream in the at least two code streams, obtain a reference frame determined for the original image to be encoded in the corresponding code stream.
步骤530,根据参考帧对原始图像进行编码,获得原始图像的图像帧。Step 530: Encode the original image according to the reference frame to obtain an image frame of the original image.
在该实施例中,采用帧间编码方式来对各路码流中的原始图像进行编码。In this embodiment, the inter-frame coding method is used to code the original images in each bit stream.
在一实施例中,步骤510包括:In one embodiment, step 510 includes:
从对应码流中编码所获得图像帧中选取图像帧作为原始图像的参考帧。Select the image frame from the image frame obtained by encoding in the corresponding code stream as the reference frame of the original image.
在一具体实施例中,发送端为各码流对应配置了参考帧管理队列,参考帧管理队列用于存储对应码流中接收端所准确接收到的图像帧,从而为保证所使用的参考帧为接收端中所准确接收到的图像帧,从对应码流中编码所获得图像帧中选取图像帧作为原始图像的参考帧的步骤包括:In a specific embodiment, the transmitting end configures a reference frame management queue corresponding to each code stream. The reference frame management queue is used to store the image frames accurately received by the receiving end in the corresponding code stream, so as to ensure the reference frame used For the image frame accurately received in the receiving end, the steps of selecting the image frame from the image frame obtained by encoding in the corresponding code stream as the reference frame of the original image include:
从对应码流的参考帧管理队列中选取图像帧作为原始图像的参考帧。Select an image frame from the reference frame management queue of the corresponding code stream as the reference frame of the original image.
在一实施例中,该方法还包括:In an embodiment, the method further includes:
接收接收端发送的反馈信息,接收端在通过异常检测确定所接收到图像帧准确时,为准确接收到的图像帧发送反馈信息,反馈信息用于为待编码的原始图像确定参考帧。The feedback information sent by the receiving end is received. When the receiving end determines that the received image frame is accurate through anomaly detection, it sends feedback information for the accurately received image frame. The feedback information is used to determine a reference frame for the original image to be encoded.
从而,发送端可以根据所接收到的反馈信息来确定哪些图像帧被接收端准确接收到。在一具体实施例中,反馈信息中携带所对应图像帧的帧序号。从而,在发送端接收到反馈信息中,对应的根据所携带的帧序号将该帧序号所对应图像帧保存至对应码流的参考帧管理队列中。Therefore, the sending end can determine which image frames are accurately received by the receiving end according to the received feedback information. In a specific embodiment, the feedback information carries the frame number of the corresponding image frame. Therefore, when the sending end receives the feedback information, the corresponding image frame corresponding to the frame sequence number is saved in the reference frame management queue of the corresponding code stream according to the carried frame sequence number.
在一具体实施例中,接收端对应为每一路码流配置了参考帧管理队列,在接收端通过异常检测确定做接收到图像帧准确时,将该图像帧以及对应的帧序号保存至对应码流的参考帧管理队列中。In a specific embodiment, the receiving end configures a reference frame management queue for each bit stream. When the receiving end determines that the received image frame is accurate through abnormal detection, the image frame and the corresponding frame sequence number are saved to the corresponding code The flow's reference frame management queue.
在一实施例中,接收接收端发送的反馈信息的步骤之后,该方法还包括:In an embodiment, after the step of receiving the feedback information sent by the receiving end, the method further includes:
检测相邻两次所接收到对应码流中反馈信息所携带帧序号是否连续。Detect whether the frame sequence numbers carried in the feedback information in the corresponding code streams received twice adjacently are continuous.
若连续,则将原始图像的相邻数据所对应图像帧确定为原始图像的参考帧。If it is continuous, the image frame corresponding to the adjacent data of the original image is determined as the reference frame of the original image.
若不连续,则执行从对应码流的参考帧管理队列中选取图像帧作为原始图像的参考帧。If it is not continuous, then select the image frame from the reference frame management queue of the corresponding code stream as the reference frame of the original image.
对于编码而言,采用待编码的原始图像的相邻数据所对应图像帧进行编码的编码效率效率更高,但是如果该相邻数据所对应图像帧未被接收端准确接收,则可能导致以该相邻数据所对应图像帧作为参考帧进行编码获得的图像帧在接收端中不能被正确译码。For encoding, the encoding efficiency of using the image frame corresponding to the adjacent data of the original image to be encoded is higher. However, if the image frame corresponding to the adjacent data is not accurately received by the receiving end, it may cause the The image frame corresponding to the adjacent data can not be decoded correctly in the receiving end.
在本实施例的技术方案中即实现了根据反馈信息来为待编码的原始图像确定参考帧。具体而言,在检测反馈信息中所携带的帧序号连续时,即说明当前接收端中未出现发生数据错误或者被丢失的图像帧,从而将该待编码的原始图像的相邻数据所对应图像帧确定为该原始图像的参考帧,从而提高编码效率;而在检测反馈信息中所携带的帧序号不连续时,即说明该不连续的帧序号之间的图像帧为异常的图像帧,从而从对应码流的参考帧管理队列中选取图像帧作为原始图像的参考帧,以保证所使用的参考帧为接收端中所准确接收到 的图像帧。In the technical solution of this embodiment, it is realized that the reference frame for the original image to be encoded is determined according to the feedback information. Specifically, when the frame numbers carried in the detection feedback information are continuous, it means that there is no image frame with data errors or lost in the current receiving end, so that the adjacent data of the original image to be encoded corresponds to the image The frame is determined as the reference frame of the original image, thereby improving the coding efficiency; and when the frame number carried in the feedback information is detected as discontinuous, it means that the image frames between the discontinuous frame numbers are abnormal image frames. The image frame is selected from the reference frame management queue of the corresponding code stream as the reference frame of the original image to ensure that the reference frame used is the image frame accurately received at the receiving end.
在一实施例中,该方法还包括:In an embodiment, the method further includes:
对于至少两路码流,将各码流中的首帧原始图像按照帧内编码方式进行编码并传输。For at least two streams, the original image of the first frame in each stream is encoded and transmitted according to the intra-frame encoding method.
进一步的,在一实施例中,将各码流中的首帧原始图像按照帧内编码方式进行编码并传输之后,如图6所示,该方法还包括:Further, in an embodiment, after the original image of the first frame in each code stream is encoded and transmitted according to the intra-frame encoding method, as shown in FIG. 6, the method further includes:
步骤610,接收接收端为所接收到图像帧发送的反馈信息。Step 610: Receive feedback information sent by the receiving end for the received image frame.
步骤630,通过反馈信息确定对应码流中是否出现异常传输。Step 630: Determine whether abnormal transmission occurs in the corresponding code stream through the feedback information.
在一实施例中,如上所描述,在接收端通过异常检测确定所接收的图像帧准确的图像帧时,为该所准确接收到的图像帧向发送端发送反馈信息,其中该反馈信息携带该所准确接收到图像帧的帧序号。从而,发送端通过检测同一码流中相邻两次所接收到反馈信息携带的帧序号是否来确定对应码流中是否出现异常传输,即如果连续,说明未出现异常传输;如果不连续,则说明出现异常传输。In one embodiment, as described above, when the receiving end determines the correct image frame of the received image frame through anomaly detection, feedback information is sent to the transmitting end for the accurately received image frame, wherein the feedback information carries the The frame number of the accurately received image frame. Therefore, the sender determines whether there is abnormal transmission in the corresponding code stream by detecting whether the frame sequence number carried in the feedback information received twice in the same code stream is adjacent, that is, if it is continuous, it means that there is no abnormal transmission; if it is not continuous, then Indicates abnormal transmission occurred.
在另一实施例中,接收端还可以在通过异常检测确定异常的图像帧后,为异常的图像帧向发送端发送反馈信息,对应的,该反馈信息携带所对应异常的图像帧的帧序号,异常的图像帧包括发生数据错误的图像帧和发生丢失的图像帧。从而,接收端在接收到该反馈信息后,即可确定对应码流中出现了异常传输,且对应根据反馈信息中的帧序号确定异常的图像帧。In another embodiment, the receiving end may also send feedback information for the abnormal image frame to the transmitting end after the abnormal image frame is determined by the abnormality detection. Correspondingly, the feedback information carries the frame number of the corresponding abnormal image frame , The abnormal image frame includes the image frame with data error and the image frame with loss. Therefore, after receiving the feedback information, the receiving end can determine that abnormal transmission has occurred in the corresponding code stream, and correspondingly determine the abnormal image frame according to the frame sequence number in the feedback information.
步骤650,若确定对应码流中出现异常传输,则将码流中当前待传输的原始图像按照帧内编码方式进行编码并传输。Step 650: If it is determined that abnormal transmission occurs in the corresponding code stream, the original image currently to be transmitted in the code stream is encoded and transmitted according to the intra-frame coding mode.
步骤670,若确定对应码流中未出现异常传输,则按照帧间编码方式对当前待传输的原始图像进行编码并传输。Step 670: If it is determined that no abnormal transmission occurs in the corresponding code stream, the original image currently to be transmitted is coded and transmitted according to the inter-frame coding mode.
在本实施例中,各路码流中的首帧原始图像按照帧内编码方式进行编码并传输,例如编码的I帧,而码流中其后的原始图像根据传输中是否出现异常传输来确定编码方式,即在出现异常传输时,采用帧内编码方式进行编码并传输,例如编码获得I帧并传输;在未出现异常传输时,采用帧间编码方式进行编码并传输,例如编码获得P帧并传输。从而,一方面提高了发送端的编码效率,而且降低了异常的图像帧对其后传输图像帧的影响。In this embodiment, the first frame of the original image in each stream is encoded and transmitted according to the intra-frame encoding method, such as an encoded I frame, and the subsequent original images in the stream are determined according to whether abnormal transmission occurs during transmission. Coding mode, that is, when abnormal transmission occurs, the intra-frame coding method is used for coding and transmission, such as encoding to obtain I frame and transmitting; when there is no abnormal transmission, the inter-frame coding method is used for encoding and transmitting, for example, encoding to obtain P frame And transfer. Thus, on the one hand, the coding efficiency of the sending end is improved, and the influence of abnormal image frames on subsequent transmission of image frames is reduced.
下述为本公开设备实施例。对于本公开设备实施例中未披露的细节,请参照本公开码流的传输控制方法实施例。The following are embodiments of the disclosed device. For details that are not disclosed in the device embodiment of the present disclosure, please refer to the embodiment of the transmission control method of the code stream of the present disclosure.
一种码流的接收设备,包括处理器、通信组件、存储器和通信总线,存储器上存储有可执行指令,处理器被配置为执行以下步骤:A code stream receiving device includes a processor, a communication component, a memory, and a communication bus. The memory stores executable instructions, and the processor is configured to perform the following steps:
接收至少两路码流,至少两路码流包括第一码流和第二码流,其中第一码流作为原始主码流,至少两路码流中除第一码流外的其他码流作为原始背景码流,原始主码流的传输帧率高于任一路原始背景码流的传输帧率。Receive at least two code streams, at least two code streams including a first code stream and a second code stream, where the first code stream is used as the original main code stream, and at least two code streams other than the first code stream As the original background code stream, the transmission frame rate of the original main code stream is higher than the transmission frame rate of any original background code stream.
获取主码流切换信号,主码流切换信号指示将主码流切换为第二码流。Acquire the main code stream switching signal, the main code stream switching signal indicates to switch the main code stream to the second code stream.
继续接收切换后的至少两路码流,其中第二码流作为新主码流,至少两路码流中除第二码流外的其它码流作为新背景码流,进行切换后,新主码流的传输帧率高于任一路新背景码流的传输帧率。Continue to receive at least two streams after switching. The second stream is used as the new main stream, and at least two streams other than the second stream are used as the new background stream. After switching, the new main stream The transmission frame rate of the code stream is higher than the transmission frame rate of any new background code stream.
在一实施例中,接收至少两路码流的步骤之后,处理器还执行还以下步骤:In an embodiment, after the step of receiving at least two bit streams, the processor further executes the following steps:
对原始主码流进行播放,并对原始背景码流进行缓存。Play the original main stream and cache the original background stream.
在一实施例中,获取主码流切换信号步骤之后,处理器还执行以下步骤:In an embodiment, after the step of acquiring the main stream switching signal, the processor further executes the following steps:
对作为新主码流的第二码流进行播放,并对新背景码流进行缓存。Play the second code stream as the new main code stream, and buffer the new background code stream.
在一实施例中,在对作为新主码流的第二码流进行播放的步骤中,处理器被配置为执行以下步骤:In an embodiment, in the step of playing the second code stream as the new main code stream, the processor is configured to perform the following steps:
获取在进行切换前为第二码流缓存的缓存数据。Obtain the buffered data buffered for the second code stream before switching.
根据缓存数据切换至播放第二码流。Switch to play the second stream according to the buffered data.
在一实施例中,在获取主码流切换信号的步骤中,处理器被配置为执行以下步骤:In an embodiment, in the step of acquiring the main stream switching signal, the processor is configured to perform the following steps:
根据触发的切换操作生成主码流切换信号。Generate the main stream switching signal according to the triggered switching operation.
在一实施例中,在获取主码流切换信号步骤之后,处理器还执行以下步骤:In an embodiment, after the step of acquiring the main stream switching signal, the processor further executes the following steps:
向发送端发送帧率调整信号,帧率调整信号指示了将主码流切换为第二码流;Send a frame rate adjustment signal to the sending end, and the frame rate adjustment signal indicates to switch the main stream to the second stream;
在继续接收切换后的至少两路码流的步骤中,处理器被配置为执行以下步骤:In the step of continuing to receive at least two code streams after switching, the processor is configured to perform the following steps:
接收发送端根据帧率调整信号进行帧率调整后所继续传输的至少两路码流,发送端按照新主码流的传输帧率高于任一路新背景码流的传输帧率进行帧率调整。Receive at least two streams that continue to be transmitted after adjusting the frame rate according to the frame rate adjustment signal by the sender, and the sender adjusts the frame rate according to the transmission frame rate of the new main stream higher than the transmission frame rate of any new background stream .
在一实施例中,进行切换后新背景码流的传输帧率为进行切换前第二码流的传输帧率,或为适应于剩余带宽的动态低帧率,剩余带宽是根据切换后新主码流的传输帧率来确定的。In one embodiment, the transmission frame rate of the new background code stream after the switch is the transmission frame rate of the second code stream before the switch, or to adapt to the dynamic low frame rate of the remaining bandwidth, the remaining bandwidth is based on the new main stream after the switch. The transmission frame rate of the stream is determined.
在一实施例中,进行切换后新主码流的传输帧率为进行切换前原始主码流的传输帧率。In one embodiment, the transmission frame rate of the new main stream after switching is the transmission frame rate of the original main stream before switching.
在一实施例中,处理器还被配置为执行以下步骤:In an embodiment, the processor is further configured to perform the following steps:
对于接收到至少两路码流中各路码流的图像帧,对所接收到的图像帧进行异常检测。For the received image frames of each of the at least two code streams, anomaly detection is performed on the received image frames.
在一实施例中,在对所接收到的图像帧进行异常检测的步骤之后,处理器还执行以下步骤:In an embodiment, after the step of performing abnormality detection on the received image frame, the processor further performs the following steps:
在通过异常检测确认所接收到图像帧准确时,为所准确接收的图像帧向发送端发送反馈信息,反馈信息携带图像帧的帧序号。When it is confirmed that the received image frame is accurate through anomaly detection, feedback information is sent to the sending end for the accurately received image frame, and the feedback information carries the frame number of the image frame.
上述各实施例中码流的接收设备的处理器执行操作的具体方式已经在有关该码流的传输控制方法的实施例中执行了详细描述,此处将不做详细阐述说明。The specific operations performed by the processor of the receiving device of the code stream in the foregoing embodiments have been described in detail in the embodiment of the transmission control method for the code stream, and will not be elaborated here.
本公开提供了一种码流的发送设备,包括处理器、通信组件、存储器和通信总线,存储器上存储有可执行指令,处理器被配置为执行以下步骤:The present disclosure provides a code stream sending device, which includes a processor, a communication component, a memory, and a communication bus. The memory stores executable instructions, and the processor is configured to perform the following steps:
发送至少两路码流,至少两路码流包括第一码流和第二码流,其中第一码流作为原始主码流,至少两路码流中除第一码流外的其他码流作为原始背景码流,原始主码流的传输帧率高于任一路原始背景码流的传输帧率。Send at least two code streams, at least two code streams including a first code stream and a second code stream, where the first code stream is used as the original main code stream, and at least two code streams other than the first code stream As the original background code stream, the transmission frame rate of the original main code stream is higher than the transmission frame rate of any original background code stream.
获取帧率调整信号,帧率调整信号携带第二码流的码流标识。The frame rate adjustment signal is obtained, and the frame rate adjustment signal carries the code stream identifier of the second code stream.
在根据帧率调整信号进行帧率调整后,按照调整后的传输帧率继续发送至少两路码流,其中第二码流作为新主码流,至少两路码流中除第二码流外的其它码流作为新背景码流,帧率调整后,新主码流的传输帧率高于任一路新背景码流的传输帧率。After adjusting the frame rate according to the frame rate adjustment signal, continue to send at least two streams according to the adjusted transmission frame rate, where the second stream is used as the new main stream, and at least two streams except the second stream As the new background code stream, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any new background code stream after the frame rate is adjusted.
在一实施例中,在获取帧率调整信号的步骤中,处理器被配置为执行以下步骤:In an embodiment, in the step of obtaining the frame rate adjustment signal, the processor is configured to perform the following steps:
接收接收端根据所获取的主码流切换信号而发送的帧率调整信号,主码流切换信号用于指示将主码流切换为第二码流。The frame rate adjustment signal sent by the receiving end according to the acquired main code stream switching signal is received, and the main code stream switching signal is used to instruct to switch the main code stream to the second code stream.
在一实施例中,帧率调整后,新背景码流的传输帧率为进行切换前第二码流的传输帧率,或为适应于剩余带宽的动态低帧率,剩余带宽是根据切换后新主码流的传输帧率来确定的。In one embodiment, after the frame rate is adjusted, the transmission frame rate of the new background code stream is the transmission frame rate of the second code stream before switching, or is a dynamic low frame rate adapted to the remaining bandwidth. The remaining bandwidth is based on the The transmission frame rate of the new main stream is determined.
在一实施例中,帧率调整后,新主码流的传输帧率为进行切换前原始主码流的传输帧率。In one embodiment, after the frame rate is adjusted, the transmission frame rate of the new main stream is the transmission frame rate of the original main stream before switching.
在一实施例中,处理器还被配置为执行以下步骤:In an embodiment, the processor is further configured to perform the following steps:
在发送至少两路码流中各码流的图像帧之前,获取为对应码流中待编码的原始图像所确定的参考帧;Before sending the image frames of each code stream in at least two code streams, obtain the reference frame determined for the original image to be encoded in the corresponding code stream;
根据参考帧对原始图像进行编码,获得原始图像的图像帧。The original image is encoded according to the reference frame to obtain the image frame of the original image.
在一实施例中,在获取为对应码流中待编码的原始图像所确定的参考帧的步骤中,处理器被配置为执行以下步骤:In an embodiment, in the step of obtaining the reference frame determined for the original image to be encoded in the corresponding bitstream, the processor is configured to perform the following steps:
从对应码流中编码所获得图像帧中选取图像帧作为原始图像的参考帧。Select the image frame from the image frame obtained by encoding in the corresponding code stream as the reference frame of the original image.
在一实施例中,处理器还被配置为执行以下步骤:In an embodiment, the processor is further configured to perform the following steps:
接收接收端发送的反馈信息,接收端在通过异常检测确定所接收到图像帧准确时,为准确接收到的图像帧发送反馈信息,反馈信息用于为待编码的原始图像确定参考帧。The feedback information sent by the receiving end is received. When the receiving end determines that the received image frame is accurate through anomaly detection, it sends feedback information for the accurately received image frame. The feedback information is used to determine a reference frame for the original image to be encoded.
在一实施例中,处理器还被配置为执行以下步骤:In an embodiment, the processor is further configured to perform the following steps:
对于至少两路码流,将各码流中的首帧原始图像按照帧内编码方式进行编码并传输。For at least two streams, the original image of the first frame in each stream is encoded and transmitted according to the intra-frame encoding method.
在一实施例中,在将各码流中的首帧原始图像按照帧内编码方式进行编码并传输的步骤之后,处理器还被配置为执行以下步骤:In an embodiment, after the step of encoding and transmitting the first frame of the original image in each code stream according to the intra-frame encoding method, the processor is further configured to perform the following steps:
接收接收端为所接收到图像帧发送的反馈信息;Receiving the feedback information sent by the receiving end for the received image frame;
通过反馈信息确定对应码流中是否出现异常传输;Determine whether there is abnormal transmission in the corresponding code stream through the feedback information;
若确定对应码流中出现异常传输,则将码流中当前待传输的原始图像按照帧内编码方式进行编码并传输;If it is determined that abnormal transmission occurs in the corresponding code stream, the original image currently to be transmitted in the code stream is encoded and transmitted according to the intra-frame coding method;
若确定对应码流中未出现异常传输,则按照帧间编码方式对当前待传输的原始图像进行编码并传输。If it is determined that there is no abnormal transmission in the corresponding code stream, the original image currently to be transmitted is coded and transmitted according to the inter-frame coding mode.
上述各实施例中码流的发送设备的处理器执行操作的具体方式已经在有关该码流的传输控制方法的实施例中执行了详细描述,此处将不做详细阐述说明。The specific operations performed by the processor of the code stream sending device in the foregoing embodiments have been described in detail in the embodiment of the transmission control method for the code stream, which will not be elaborated here.
下述为本公开装置实施例,可以配置为执行本公开上述发送端100或接收端300执行的码流的传输控制方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开码流的传输控制方法实施例。The following are embodiments of the apparatus of the present disclosure, which can be configured to execute the above-mentioned embodiment of the transmission control method of the code stream executed by the sender 100 or the receiver 300 of the present disclosure. For details not disclosed in the embodiment of the device of the present disclosure, please refer to the embodiment of the transmission control method of the code stream of the present disclosure.
一种码流的传输控制装置,应配置为接收端,该装置包括:A code stream transmission control device that should be configured as a receiving end, the device includes:
第一接收模块,配置为接收至少两路码流,至少两路码流包括第一码流和第二码流,其中第一码流作为原始主码流,至少两路码流中除第一码流外的其他码流作为原始背景码流,原始主码流的传输帧率高于任一路原始背景码流的传输帧率。The first receiving module is configured to receive at least two code streams. The at least two code streams include a first code stream and a second code stream. The first code stream is used as the original main code stream. Other code streams outside the code stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any original background code stream.
主码流信号获取模块,配置为获取主码流切换信号,主码流切换信号指示将主码流切换为第二码流。The main code stream signal acquisition module is configured to obtain the main code stream switching signal, and the main code stream switching signal indicates to switch the main code stream to the second code stream.
第二接收模块,配置为继续接收切换后的至少两路码流,其中第二码流作为新主码流,至少两路码流中除第二码流外的其它码流作为新背景码流,进行切换后,新主码流的传输帧率高于任一路新背景码流的传输帧率。The second receiving module is configured to continue to receive at least two code streams after switching, where the second code stream is used as the new main code stream, and the other code streams except the second code stream among the at least two code streams are used as the new background code stream , After switching, the transmission frame rate of the new main stream is higher than the transmission frame rate of any new background stream.
在一实施例中,该装置还包括:In an embodiment, the device further includes:
播放和存储模块,配置为对原始主码流进行播放,并对原始背景码流进行缓存。The play and storage module is configured to play the original main stream and buffer the original background stream.
在一实施例中,该装置还包括:In an embodiment, the device further includes:
切换播放模块,配置为对作为新主码流的第二码流进行播放,并对新背景码流进行缓存。Switch the playback module, configured to play the second code stream as the new main code stream, and buffer the new background code stream.
在一实施例中,切换播放模块,包括:In an embodiment, switching the playing module includes:
缓存数据获取单元,配置为获取在进行切换前为第二码流缓存的缓存数据。The buffer data acquisition unit is configured to acquire the buffer data buffered for the second code stream before switching.
切换播放单元,配置为根据缓存数据切换至播放第二码流。The switching playing unit is configured to switch to playing the second code stream according to the buffered data.
在一实施例中,主码流信号获取模块,包括:In an embodiment, the main stream signal acquisition module includes:
主码流信号生成单元,配置为根据触发的切换操作生成主码流切换信号。The main stream signal generating unit is configured to generate the main stream switching signal according to the triggered switching operation.
在一实施例中,该装置还包括:In an embodiment, the device further includes:
帧率调整信号发送模块,配置为向发送端发送帧率调整信号,帧率调整信号指示了将主码流切换为第二码流。The frame rate adjustment signal sending module is configured to send a frame rate adjustment signal to the sending end, and the frame rate adjustment signal indicates that the main stream is switched to the second stream.
在该实施例中,第二接收模块,包括:In this embodiment, the second receiving module includes:
接收单元,配置为接收发送端根据帧率调整信号进行帧率调整后所继续传输的至少两路码流,发送端按照新主码流的传输帧率高于任一路新背景码流的传输帧率进行帧率调整。The receiving unit is configured to receive at least two streams that the transmitter continues to transmit after adjusting the frame rate according to the frame rate adjustment signal, and the transmitter according to the transmission frame rate of the new main stream is higher than any transmission frame of the new background stream Adjust the frame rate.
在一实施例中,进行切换后新背景码流的传输帧率为进行切换前第二码流的传输帧率,或为适应于剩余带宽的动态低帧率,剩余带宽是根据切换后新主码流的传输帧率来确定的。In one embodiment, the transmission frame rate of the new background code stream after the switch is the transmission frame rate of the second code stream before the switch, or to adapt to the dynamic low frame rate of the remaining bandwidth, the remaining bandwidth is based on the new main stream after the switch. The transmission frame rate of the stream is determined.
在一实施例中,进行切换后新主码流的传输帧率为进行切换前原始主码流的传输帧率。In one embodiment, the transmission frame rate of the new main stream after switching is the transmission frame rate of the original main stream before switching.
在一实施例中,该装置还包括:In an embodiment, the device further includes:
异常检测模块,配置为对于接收到至少两路码流中各路码流的图像帧,对所接收到的图像帧进行异常检测。The anomaly detection module is configured to perform anomaly detection on the received image frames for the image frames of each of the received at least two code streams.
在一实施例中,该装置还包括:In an embodiment, the device further includes:
反馈信息发送模块,配置为在通过异常检测确认所接收到图像帧准确时,为所准确接收的图像帧向发送端发送反馈信息,反馈信息携带图像帧的帧序号。The feedback information sending module is configured to send feedback information for the accurately received image frame to the sending end when it is confirmed that the received image frame is accurate through anomaly detection, and the feedback information carries the frame number of the image frame.
上述装置中各个模块/单元的功能和作用的实现过程具体详见上述码流的传输控制方法中对应步骤的实现过程,在此不再赘述。For the implementation process of the functions and roles of each module/unit in the above-mentioned device, refer to the implementation process of the corresponding steps in the above-mentioned code stream transmission control method for details, which will not be repeated here.
可以理解,这些模块可以通过硬件、软件、或二者结合来实现。当以硬件方式实现时,这些模块可以实施为一个或多个硬件模块,例如一个或多个专用集成电路。当以软件方式实现时,这些模块可以实施为在一个或多个处理器上执行的一个或多个计算机程序。It can be understood that these modules can be implemented by hardware, software, or a combination of both. When implemented in hardware, these modules may be implemented as one or more hardware modules, such as one or more application specific integrated circuits. When implemented in software, these modules can be implemented as one or more computer programs executed on one or more processors.
在另一实施例中,一种码流的传输控制装置,应配置为码流的发送端,该装置包括:In another embodiment, a code stream transmission control device should be configured as a code stream transmitter, and the device includes:
第一发送模块,配置为发送至少两路码流,至少两路码流包括第一码流和第二码流,其中第一码流作为原始主码流,至少两路码流中除第一码流外的其他码流作为原始背景码流,原始主码流的传输帧率高于任一路原始背景码流的传输帧率。The first sending module is configured to send at least two code streams. The at least two code streams include a first code stream and a second code stream. The first code stream is used as the original main code stream. Other code streams outside the code stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any original background code stream.
帧率调整信号获取模块,配置为获取帧率调整信号,帧率调整信号携带第二码流的码流标识。The frame rate adjustment signal obtaining module is configured to obtain the frame rate adjustment signal, and the frame rate adjustment signal carries the code stream identifier of the second code stream.
第二发送模块,配置为在根据帧率调整信号进行帧率调整后,按照调整后的传输帧率继续发送至少两路码流,其中第二码流作为新主码流,至少两路码流中除第二码流外的其它码流作为新背景码流,帧率调整后,新主码流的传输帧率高于任一路新背景码流的传输帧率。The second sending module is configured to, after adjusting the frame rate according to the frame rate adjustment signal, continue to send at least two streams according to the adjusted transmission frame rate, where the second stream is used as the new main stream, and at least two streams The other code streams except the second code stream are used as the new background code stream. After the frame rate is adjusted, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any new background code stream.
在一实施例中,帧率调整信号获取模块,包括:In an embodiment, the frame rate adjustment signal acquisition module includes:
帧率调整信号接收单元,配置为接收接收端根据所获取的主码流切换信号而发送的帧率调整信号,主码流切换信号配置为指示将主码流切换为第二码流。The frame rate adjustment signal receiving unit is configured to receive the frame rate adjustment signal sent by the receiving end according to the acquired main stream switching signal, and the main stream switching signal is configured to instruct to switch the main stream to the second stream.
在一实施例中,帧率调整后,新背景码流的传输帧率为进行切换前第二码流的传输帧率,或为适应于剩余带宽的动态低帧率,剩余带宽是根据切换后新主码流的传输帧率来确定的。In one embodiment, after the frame rate is adjusted, the transmission frame rate of the new background code stream is the transmission frame rate of the second code stream before switching, or is a dynamic low frame rate adapted to the remaining bandwidth. The remaining bandwidth is based on the The transmission frame rate of the new main stream is determined.
在一实施例中,帧率调整后,新主码流的传输帧率为进行切换前原始主码流的传输帧率。In one embodiment, after the frame rate is adjusted, the transmission frame rate of the new main stream is the transmission frame rate of the original main stream before switching.
在一实施例中,该装置还包括:In an embodiment, the device further includes:
参考帧获取模块,配置为在发送至少两路码流中各码流的图像帧之前,获取为对应码流中待编码的原始图像所确定的参考帧。The reference frame obtaining module is configured to obtain the reference frame determined for the original image to be encoded in the corresponding code stream before sending the image frame of each code stream in the at least two code streams.
编码模块,配置为根据参考帧对原始图像进行编码,获得原始图像的图像帧。The encoding module is configured to encode the original image according to the reference frame to obtain the image frame of the original image.
在一实施例中,参考帧获取模块,包括:In an embodiment, the reference frame acquisition module includes:
第一参考帧获取单元,配置为从对应码流中编码所获得图像帧中选取图像帧作为原始图像的参考帧。The first reference frame acquisition unit is configured to select an image frame from the image frames obtained by encoding in the corresponding code stream as the reference frame of the original image.
在一实施例中,该装置还包括:In an embodiment, the device further includes:
反馈信息接收模块,配置为接收接收端发送的反馈信息,接收端在通过异常检测确定 所接收到图像帧准确时,为准确接收到的图像帧发送反馈信息,反馈信息配置为为待编码的原始图像确定参考帧。The feedback information receiving module is configured to receive the feedback information sent by the receiving end. When the receiving end determines that the received image frame is accurate through abnormal detection, it sends feedback information for the accurately received image frame. The feedback information is configured as the original to be encoded The image determines the reference frame.
在一实施例中,该装置还包括:In an embodiment, the device further includes:
第一编码传输模块,配置为对于至少两路码流,将各码流中的首帧原始图像按照帧内编码方式进行编码并传输。The first encoding transmission module is configured to encode and transmit the original image of the first frame in each code stream according to the intra-frame encoding method for at least two code streams.
在一实施例中,该装置还包括:In an embodiment, the device further includes:
信息接收模块,配置为接收接收端为所接收到图像帧发送的反馈信息;The information receiving module is configured to receive the feedback information sent by the receiving end for the received image frame;
异常传输确定模块,配置为通过反馈信息确定对应码流中是否出现异常传输;The abnormal transmission determination module is configured to determine whether abnormal transmission occurs in the corresponding code stream through feedback information;
第二编码传输模块,配置为若异常传输确定模块确定对应码流中出现异常传输,则将码流中当前待传输的原始图像按照帧内编码方式进行编码并传输;The second encoding transmission module is configured to, if the abnormal transmission determining module determines that abnormal transmission occurs in the corresponding code stream, the original image currently to be transmitted in the code stream is encoded and transmitted according to the intra-frame encoding method;
第三编码传输模块,配置为若异常传输确定模块确定对应码流中未出现异常传输,则按照帧间编码方式对当前待传输的原始图像进行编码并传输。The third encoding transmission module is configured to encode and transmit the original image currently to be transmitted according to the inter-frame encoding method if the abnormal transmission determining module determines that no abnormal transmission occurs in the corresponding code stream.
上述装置中各个模块/单元的功能和作用的实现过程具体详见上述码流的传输控制方法中对应步骤的实现过程,在此不再赘述。For the implementation process of the functions and roles of each module/unit in the above-mentioned device, refer to the implementation process of the corresponding steps in the above-mentioned code stream transmission control method for details, which will not be repeated here.
可以理解,这些模块可以通过硬件、软件、或二者结合来实现。当以硬件方式实现时,这些模块可以实施为一个或多个硬件模块,例如一个或多个专用集成电路。当以软件方式实现时,这些模块可以实施为在一个或多个处理器上执行的一个或多个计算机程序。It can be understood that these modules can be implemented by hardware, software, or a combination of both. When implemented in hardware, these modules may be implemented as one or more hardware modules, such as one or more application specific integrated circuits. When implemented in software, these modules can be implemented as one or more computer programs executed on one or more processors.
图7是根据一示例性实施例示出的无人机的硬件框图,其中,该无人机700可以作为码流的发送端,对应执行本公开码流的传输控制方法。Fig. 7 is a hardware block diagram of a UAV according to an exemplary embodiment, wherein the UAV 700 can be used as a code stream transmitter to correspondingly execute the code stream transmission control method of the present disclosure.
需要说明的是,该无人机700只是一个适配于本公开的示例,不能认为是提供了本公开的使用范围的任何限制。该用无人机700也不能认为需要依赖于或者必须具有图7中示出的示例性的无人机700中的一个或多个组件。It should be noted that the drone 700 is only an example adapted to the present disclosure, and cannot be considered as providing any limitation of the scope of use of the present disclosure. The unmanned aerial vehicle 700 cannot be considered to be dependent on or must have one or more components of the exemplary unmanned aerial vehicle 700 shown in FIG. 7.
参照图7,无人机700可以包括以下一个或多个组件:处理组件702,存储器704,动力组件706,图像采集组件708,定位组件710,传感器组件714以及通信组件716。7, the drone 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, an image acquisition component 708, a positioning component 710, a sensor component 714, and a communication component 716.
处理组件702通常控制无人机700的整体操作,诸如与码流发送,通信,数据存储、原始图像编码等相关联的操作等。处理组件702可以包括一个或多个处理器718来执行指令,以完成下述的方法的全部或部分步骤。此外,处理组件702可以包括一个或多个模块,便于处理组件702和其他组件之间的交互。The processing component 702 generally controls the overall operations of the UAV 700, such as operations associated with code stream transmission, communication, data storage, and original image encoding. The processing component 702 may include one or more processors 718 to execute instructions to complete all or part of the steps of the following method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components.
存储器704被配置为存储各种类型的数据以支持在无人机700的操作。这些数据的示例包括配置为在无人机700上操作的任何应用程序或方法的指令。存储器704可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(Static Random Access Memory,简称SRAM),电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,简称EEPROM),可擦除可编程只读存储器(Erasable Programmable Read Only Memory,简称EPROM),可编程只读存储器(Programmable Red-Only Memory,简称PROM),只读存储器(Read-Only Memory,简称ROM),磁 存储器,快闪存储器,磁盘等。存储器704中还存储有一个或多个模块,该一个或多个模块被配置成由该一个或多个处理器718执行,以完成上述任一由发送端所执行的方法实施例的全部或者部分步骤。The memory 704 is configured to store various types of data to support the operation of the drone 700. Examples of such data include instructions for any application or method configured to operate on drone 700. The memory 704 can be implemented by any type of volatile or non-volatile storage devices or their combination, such as static random access memory (Static Random Access Memory, SRAM for short), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-only memory ( Read-Only Memory, ROM for short), magnetic memory, flash memory, disk, etc. The memory 704 also stores one or more modules, and the one or more modules are configured to be executed by the one or more processors 718 to complete all or part of any of the foregoing method embodiments executed by the sending end step.
电源组件712为无人机700的各种组件提供电力。电源组件712可以包括电源管理系统,一个或多个电源,及其他与为无人机700生成、管理和分配电力相关联的组件。The power supply component 712 provides power for various components of the drone 700. The power supply component 712 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the drone 700.
动力组件706配置为为无人机700的飞行提供动力。动力组件706可以包括驱动旋翼转动的动力电机。The power assembly 706 is configured to provide power for the flight of the drone 700. The power assembly 706 may include a power motor that drives the rotor to rotate.
图像采集组件708配置为无人机700进行图像或者视频采集,从而编码获得视频码流。图像采集组件708可以是搭载在无人机700上的至少一个摄像机。The image acquisition component 708 is configured for the UAV 700 to perform image or video acquisition, so as to encode a video stream. The image acquisition component 708 may be at least one camera mounted on the drone 700.
定位组件710配置为实时获取无人机700的位置,该定位组件710可以是GPS定位模块,低轨卫星模块等。The positioning component 710 is configured to obtain the position of the UAV 700 in real time. The positioning component 710 may be a GPS positioning module, a low-orbit satellite module, or the like.
传感器组件714包括一个或多个传感器,配置为为无人机700提供各个方面的状态评估。例如,传感器组件714可以检测到无人机700的起飞和停止状态,组件的相对定位,传感器组件714还可以检测无人机700或无人机700一个组件的位置改变以及无人机700的温度变化。在一些实施例中,该传感器组件714还可以包括磁传感器,压力传感器或温度传感器、加速度传感器、角速度传感器、距离传感器等。The sensor component 714 includes one or more sensors configured to provide the drone 700 with various aspects of status assessment. For example, the sensor component 714 can detect the take-off and stop status of the drone 700, the relative positioning of the components, and the sensor component 714 can also detect the position change of the drone 700 or a component of the drone 700 and the temperature of the drone 700 Variety. In some embodiments, the sensor component 714 may also include a magnetic sensor, a pressure sensor or a temperature sensor, an acceleration sensor, an angular velocity sensor, a distance sensor, etc.
通信组件716被配置为便于无人机700和其他设备之间有线或无线方式的通信。无人机700可以接入基于通信标准的无线网络,如WiFi(WIreless-Fidelity,无线保真)。在一个示例性实施例中,通信组件716经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件716还包括近场通信(Near Field Communication,简称NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(Radio Frequency Identification,简称RFID)技术,红外数据协会(Infrared Data Association,简称IrDA)技术,超宽带(Ultra Wideband,简称UWB)技术,蓝牙技术和其他技术来实现。The communication component 716 is configured to facilitate wired or wireless communication between the drone 700 and other devices. The UAV 700 can be connected to a wireless network based on a communication standard, such as WiFi (WIreless-Fidelity, wireless fidelity). In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a near field communication (Near Field Communication, NFC for short) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth technology and other technologies. .
在示例性实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质可以为包括指令的临时性和非临时性计算机可读存储介质,该计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现以上由接收端所执行任一方法实施例中码流的传输控制方法。In an exemplary embodiment, a computer-readable storage medium is also provided. The computer-readable storage medium may be a temporary and non-transitory computer-readable storage medium including instructions. The computer-readable storage medium stores a computer The program, when the computer program is executed by the processor, realizes the transmission control method of the code stream in any method embodiment executed by the receiving end.
在示例性实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质可以为包括指令的临时性和非临时性计算机可读存储介质,该计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现以上由发送端所执行任一方法实施例中码流的传输控制方法。In an exemplary embodiment, a computer-readable storage medium is also provided. The computer-readable storage medium may be a temporary and non-transitory computer-readable storage medium including instructions. The computer-readable storage medium stores a computer The program, when the computer program is executed by the processor, realizes the transmission control method of the code stream in any method embodiment executed by the sending end.
应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围执行各种修改和改变。本发明的范围仅由所附的权利要求来限制。It should be understood that the present invention is not limited to the precise structure that has been described above and shown in the drawings, and various modifications and changes can be performed without departing from its scope. The scope of the present invention is only limited by the appended claims.

Claims (40)

  1. 一种码流的传输控制方法,所述方法包括:A transmission control method of a code stream, the method comprising:
    接收至少两路码流,所述至少两路码流包括第一码流和第二码流,其中所述第一码流作为原始主码流,所述至少两路码流中除第一码流外的其他码流作为原始背景码流,所述原始主码流的传输帧率高于任一路所述原始背景码流的传输帧率;At least two code streams are received, the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
    获取主码流切换信号,所述主码流切换信号指示将主码流切换为所述第二码流;Acquiring a main code stream switching signal, where the main code stream switching signal indicates to switch the main code stream to the second code stream;
    继续接收切换后的所述至少两路码流,其中所述第二码流作为新主码流,所述至少两路码流中除第二码流外的其它码流作为新背景码流,进行切换后,所述新主码流的传输帧率高于任一路所述新背景码流的传输帧率。Continue to receive the at least two code streams after switching, wherein the second code stream is used as the new main code stream, and the other code streams except the second code stream among the at least two code streams are used as the new background code stream, After the switching, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
  2. 根据权利要求1所述的方法,其中,所述接收至少两路码流之后,所述方法还包括:The method according to claim 1, wherein after the receiving at least two code streams, the method further comprises:
    对所述原始主码流进行播放,并对所述原始背景码流进行缓存。Play the original main code stream, and buffer the original background code stream.
  3. 根据权利要求2所述的方法,其中,所述获取主码流切换信号之后,所述方法还包括:The method according to claim 2, wherein after said obtaining the main stream switching signal, the method further comprises:
    对作为新主码流的所述第二码流进行播放,并对所述新背景码流进行缓存。Playing the second code stream as the new main code stream, and buffering the new background code stream.
  4. 根据权利要求1所述的方法,其中,所述对作为新主码流的所述第二码流进行播放,包括:The method according to claim 1, wherein the playing the second code stream as the new main code stream comprises:
    获取在进行切换前为所述第二码流缓存的缓存数据;Acquiring the buffered data buffered for the second code stream before switching;
    根据所述缓存数据切换至播放所述第二码流。Switch to playing the second code stream according to the buffered data.
  5. 根据权利要求1所述的方法,其中,所述获取主码流切换信号,包括:The method according to claim 1, wherein said obtaining the main stream switching signal comprises:
    根据触发的切换操作生成所述主码流切换信号。The main stream switching signal is generated according to the triggered switching operation.
  6. 根据权利要求1所述的方法,其中,所述获取主码流切换信号之后,所述方法还包括:The method according to claim 1, wherein after said acquiring the main stream switching signal, the method further comprises:
    向发送端发送帧率调整信号,所述帧率调整信号指示了将主码流切换为所述第二码流;Sending a frame rate adjustment signal to the sending end, where the frame rate adjustment signal instructs to switch the main code stream to the second code stream;
    所述继续接收切换后的所述至少两路码流,包括:The continuing to receive the at least two code streams after the handover includes:
    接收所述发送端根据所述帧率调整信号进行帧率调整后所继续传输的所述至少两路码流,所述发送端按照所述新主码流的传输帧率高于任一路所述新背景码流的传输帧率进行所述帧率调整。Receiving the at least two streams that are continued to be transmitted after the transmitting end performs frame rate adjustment according to the frame rate adjustment signal, and the transmitting end according to the new main stream has a higher transmission frame rate than any one of the The frame rate adjustment is performed on the transmission frame rate of the new background code stream.
  7. 根据权利要求1所述的方法,其中,进行切换后所述新背景码流的传输帧率为进行切换前所述第二码流的传输帧率,或为适应于剩余带宽的动态低帧率,所述剩余带宽是根据切换后所述新主码流的传输帧率来确定的。The method according to claim 1, wherein the transmission frame rate of the new background code stream after switching is the transmission frame rate of the second code stream before switching, or is a dynamic low frame rate adapted to the remaining bandwidth The remaining bandwidth is determined according to the transmission frame rate of the new main stream after switching.
  8. 根据权利要求1所述的方法,其中,进行切换后所述新主码流的传输帧率为进行切换前所述原始主码流的传输帧率。The method according to claim 1, wherein the transmission frame rate of the new main stream after the switching is performed is the transmission frame rate of the original main stream before the switching.
  9. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    对于接收到所述至少两路码流中各路码流的图像帧,对所接收到的所述图像帧进行异常检测。For the received image frames of each of the at least two code streams, abnormality detection is performed on the received image frames.
  10. 根据权利要求9所述的方法,其中,所述对所接收到的所述图像帧进行异常检测之后,所述方法还包括:The method according to claim 9, wherein, after the abnormality detection is performed on the received image frame, the method further comprises:
    在通过所述异常检测确认所接收到图像帧准确时,为所准确接收的所述图像帧向发送端发送反馈信息,所述反馈信息携带所述图像帧的帧序号。When it is confirmed through the abnormality detection that the received image frame is accurate, feedback information is sent to the sending end for the accurately received image frame, and the feedback information carries the frame sequence number of the image frame.
  11. 一种码流的传输控制方法,所述方法包括:A transmission control method of a code stream, the method comprising:
    发送至少两路码流,所述至少两路码流包括第一码流和第二码流,其中所述第一码流作为原始主码流,所述至少两路码流中除第一码流外的其他码流作为原始背景码流,所述原始主码流的传输帧率高于任一路所述原始背景码流的传输帧率;Send at least two code streams, the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
    获取帧率调整信号,所述帧率调整信号携带所述第二码流的码流标识;Acquiring a frame rate adjustment signal, where the frame rate adjustment signal carries the code stream identifier of the second code stream;
    在根据所述帧率调整信号进行帧率调整后,按照调整后的传输帧率继续发送所述至少两路码流,其中所述第二码流作为新主码流,所述至少两路码流中除第二码流外的其它码流作为新背景码流,帧率调整后,所述新主码流的传输帧率高于任一路所述新背景码流的传输帧率。After adjusting the frame rate according to the frame rate adjustment signal, continue to send the at least two code streams according to the adjusted transmission frame rate, wherein the second code stream is used as the new main code stream, and the at least two code streams are Other code streams in the stream except the second code stream are used as the new background code stream. After the frame rate is adjusted, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
  12. 根据权利要求11所述的方法,其中,所述获取帧率调整信号,包括:The method according to claim 11, wherein said obtaining the frame rate adjustment signal comprises:
    接收接收端根据所获取的主码流切换信号而发送的帧率调整信号,所述主码流切换信号用于指示将主码流切换为所述第二码流。The frame rate adjustment signal sent by the receiving end according to the acquired main stream switching signal is received, where the main stream switching signal is used to instruct to switch the main stream to the second stream.
  13. 根据权利要求11所述的方法,其中,帧率调整后,所述新背景码流的传输帧率为进行切换前所述第二码流的传输帧率,或为适应于剩余带宽的动态低帧率,所述剩余带宽是根据切换后所述新主码流的传输帧率来确定的。The method according to claim 11, wherein after the frame rate is adjusted, the transmission frame rate of the new background code stream is the transmission frame rate of the second code stream before switching, or is adapted to the dynamic low of the remaining bandwidth Frame rate, the remaining bandwidth is determined according to the transmission frame rate of the new main stream after the switching.
  14. 根据权利要求11所述的方法,其中,帧率调整后,所述新主码流的传输帧率为进行切换前所述原始主码流的传输帧率。The method according to claim 11, wherein after the frame rate is adjusted, the transmission frame rate of the new main stream is the transmission frame rate of the original main stream before the switching.
  15. 根据权利要求11所述的方法,其中,所述方法还包括:The method according to claim 11, wherein the method further comprises:
    在发送所述至少两路码流中各码流的图像帧之前,获取为对应码流中待编码的原始图像所确定的参考帧;Before sending the image frame of each code stream in the at least two code streams, acquiring the reference frame determined for the original image to be encoded in the corresponding code stream;
    根据所述参考帧对所述原始图像进行编码,获得所述原始图像的图像帧。The original image is encoded according to the reference frame to obtain an image frame of the original image.
  16. 根据权利要求11所述的方法,其中,所述获取为对应码流中待编码的原始图像所确定的参考帧,包括:The method according to claim 11, wherein said obtaining the reference frame determined for the original image to be encoded in the corresponding bitstream comprises:
    从所述对应码流中编码所获得图像帧中选取图像帧作为所述原始图像的参考帧。Selecting an image frame from the image frames obtained by encoding in the corresponding code stream as the reference frame of the original image.
  17. 根据权利要求15所述的方法,其中,所述方法还包括:The method according to claim 15, wherein the method further comprises:
    接收所述接收端发送的反馈信息,所述接收端在通过异常检测确定所接收到图像帧准确时,为准确接收到的所述图像帧发送所述反馈信息,所述反馈信息用于为所述待编码的原始图像确定参考帧。Receiving the feedback information sent by the receiving end, when the receiving end determines that the received image frame is accurate through anomaly detection, it sends the feedback information for the accurately received image frame, and the feedback information is used for The original image to be encoded determines the reference frame.
  18. 根据权利要求15所述的方法,其中,所述方法还包括:The method according to claim 15, wherein the method further comprises:
    对于所述至少两路码流,将各码流中的首帧原始图像按照帧内编码方式进行编码并传输。For the at least two code streams, the original image of the first frame in each code stream is coded and transmitted in an intra-frame coding mode.
  19. 根据权利要求18所述的方法,其中,所述将各码流中的首帧原始图像按照帧内编码方式进行编码并传输之后,所述方法还包括:The method according to claim 18, wherein, after the original image of the first frame in each code stream is encoded and transmitted in an intra-frame coding manner, the method further comprises:
    接收所述接收端为所接收到图像帧发送的反馈信息;Receiving feedback information sent by the receiving end for the received image frame;
    通过所述反馈信息确定对应码流中是否出现异常传输;Determine whether abnormal transmission occurs in the corresponding code stream according to the feedback information;
    若确定对应码流中出现异常传输,则将所述码流中当前待传输的原始图像按照帧内编码方式进行编码并传输;If it is determined that abnormal transmission occurs in the corresponding code stream, the original image currently to be transmitted in the code stream is encoded and transmitted according to the intra-frame coding mode;
    若确定对应码流中未出现异常传输,则按照帧间编码方式对当前待传输的原始图像进行编码并传输。If it is determined that there is no abnormal transmission in the corresponding code stream, the original image currently to be transmitted is coded and transmitted according to the inter-frame coding mode.
  20. 一种码流的接收设备,包括处理器、通信组件、存储器和通信总线,所述存储器上存储有可执行指令,所述处理器被配置为执行以下步骤:A code stream receiving device includes a processor, a communication component, a memory, and a communication bus. The memory stores executable instructions, and the processor is configured to perform the following steps:
    接收至少两路码流,所述至少两路码流包括第一码流和第二码流,其中所述第一码流作为原始主码流,所述至少两路码流中除第一码流外的其他码流作为原始背景码流,所述原始主码流的传输帧率高于任一路所述原始背景码流的传输帧率;At least two code streams are received, the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
    获取主码流切换信号,所述主码流切换信号指示将主码流切换为所述第二码流;Acquiring a main code stream switching signal, where the main code stream switching signal indicates to switch the main code stream to the second code stream;
    继续接收切换后的所述至少两路码流,其中所述第二码流作为新主码流,所述至少两路码流中除第二码流外的其它码流作为新背景码流,进行切换后,所述新主码流的传输帧率高于任一路所述新背景码流的传输帧率。Continue to receive the at least two code streams after switching, wherein the second code stream is used as the new main code stream, and the other code streams except the second code stream among the at least two code streams are used as the new background code stream, After the switching, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
  21. 根据权利要求20所述的接收设备,其中,所述接收至少两路码流步骤之后,所述处理器还执行以下步骤:The receiving device according to claim 20, wherein after the step of receiving at least two code streams, the processor further executes the following steps:
    对所述原始主码流进行播放,并对所述原始背景码流进行缓存。Play the original main code stream, and buffer the original background code stream.
  22. 根据权利要求21所述的接收设备,其中,所述获取主码流切换信号步骤之后,所述处理器还执行以下步骤:The receiving device according to claim 21, wherein, after the step of acquiring the main stream switching signal, the processor further executes the following steps:
    对作为新主码流的所述第二码流进行播放,并对所述新背景码流进行缓存。Playing the second code stream as the new main code stream, and buffering the new background code stream.
  23. 根据权利要求22所述的接收设备,其中,在所述对作为新主码流的所述第二码流进行播放的步骤中,所述处理器被配置为执行以下步骤:The receiving device according to claim 22, wherein, in the step of playing the second code stream as the new main code stream, the processor is configured to perform the following steps:
    获取在进行切换前为所述第二码流缓存的缓存数据;Acquiring the buffered data buffered for the second code stream before switching;
    根据所述缓存数据切换至播放所述第二码流。Switch to playing the second code stream according to the buffered data.
  24. 根据权利要求20所述的接收设备,其中,在所述获取主码流切换信号的步骤中,所述处理器被配置为执行以下步骤:22. The receiving device according to claim 20, wherein, in the step of acquiring the main stream switching signal, the processor is configured to perform the following steps:
    根据触发的切换操作生成所述主码流切换信号。The main stream switching signal is generated according to the triggered switching operation.
  25. 根据权利要求20所述的接收设备,其中,在所述获取主码流切换信号步骤之后,所述处理器还执行以下步骤:The receiving device according to claim 20, wherein, after the step of obtaining the main stream switching signal, the processor further executes the following steps:
    向发送端发送帧率调整信号,所述帧率调整信号指示了将主码流切换为所述第二码流;Sending a frame rate adjustment signal to the sending end, where the frame rate adjustment signal instructs to switch the main code stream to the second code stream;
    在所述继续接收切换后的所述至少两路码流的步骤中,所述处理器被配置为执行以下步骤:In the step of continuing to receive the at least two code streams after switching, the processor is configured to perform the following steps:
    接收所述发送端根据所述帧率调整信号进行帧率调整后所继续传输的所述至少两路码流,所述发送端按照所述新主码流的传输帧率高于任一路所述新背景码流的传输帧率进行所述帧率调整。Receiving the at least two streams that are continued to be transmitted after the transmitting end performs frame rate adjustment according to the frame rate adjustment signal, and the transmitting end according to the new main stream has a higher transmission frame rate than any one of the The frame rate adjustment is performed on the transmission frame rate of the new background code stream.
  26. 根据权利要求20所述的接收设备,其中,进行切换后所述新背景码流的传输帧率为进行切换前所述第二码流的传输帧率,或为适应于剩余带宽的动态低帧率,所述剩余带宽是根据切换后所述新主码流的传输帧率来确定的。The receiving device according to claim 20, wherein the transmission frame rate of the new background code stream after the switching is the transmission frame rate of the second code stream before the switching, or is a dynamic low frame rate adapted to the remaining bandwidth The remaining bandwidth is determined according to the transmission frame rate of the new main stream after switching.
  27. 根据权利要求20所述的接收设备,其中,进行切换后所述新主码流的传输帧率为进行切换前所述原始主码流的传输帧率。22. The receiving device according to claim 20, wherein the transmission frame rate of the new main stream after the switching is performed is the transmission frame rate of the original main stream before the switching.
  28. 根据权利要求20所述的接收设备,其中,所述处理器还被配置为执行以下步骤:The receiving device of claim 20, wherein the processor is further configured to perform the following steps:
    对于接收到所述至少两路码流中各路码流的图像帧,对所接收到的所述图像帧进行异常检测。For the received image frames of each of the at least two code streams, abnormality detection is performed on the received image frames.
  29. 根据权利要求28所述的接收设备,其中,在所述对所接收到的所述图像帧进行异常检测的步骤之后,所述处理器还执行以下步骤:The receiving device according to claim 28, wherein, after the step of performing abnormality detection on the received image frame, the processor further performs the following steps:
    在通过所述异常检测确认所接收到图像帧准确时,为所准确接收的所述图像帧向发送端发送反馈信息,所述反馈信息携带所述图像帧的帧序号。When it is confirmed through the abnormality detection that the received image frame is accurate, feedback information is sent to the sending end for the accurately received image frame, and the feedback information carries the frame sequence number of the image frame.
  30. 一种码流的发送设备,包括处理器、通信组件、存储器和通信总线,所述存储器上存储有可执行指令,所述处理器被配置为执行以下步骤:A code stream sending device includes a processor, a communication component, a memory, and a communication bus. The memory stores executable instructions, and the processor is configured to execute the following steps:
    发送至少两路码流,所述至少两路码流包括第一码流和第二码流,其中所述第一码流作为原始主码流,所述至少两路码流中除第一码流外的其他码流作为原始背景码流,所述原始主码流的传输帧率高于任一路所述原始背景码流的传输帧率;Send at least two code streams, the at least two code streams include a first code stream and a second code stream, wherein the first code stream is used as the original main code stream, and the first code stream is excluded from the at least two code streams Other code streams outside the stream are used as the original background code stream, and the transmission frame rate of the original main code stream is higher than the transmission frame rate of any one of the original background code streams;
    获取帧率调整信号,所述帧率调整信号携带所述第二码流的码流标识;Acquiring a frame rate adjustment signal, where the frame rate adjustment signal carries the code stream identifier of the second code stream;
    在根据所述帧率调整信号进行帧率调整后,按照调整后的传输帧率继续发送所述至少两路码流,其中所述第二码流作为新主码流,所述至少两路码流中除第二码流外的其它码流作为新背景码流,帧率调整后,所述新主码流的传输帧率高于任一路所述新背景码流的传输帧率。After adjusting the frame rate according to the frame rate adjustment signal, continue to send the at least two code streams according to the adjusted transmission frame rate, wherein the second code stream is used as the new main code stream, and the at least two code streams are Other code streams in the stream except the second code stream are used as the new background code stream. After the frame rate is adjusted, the transmission frame rate of the new main code stream is higher than the transmission frame rate of any one of the new background code streams.
  31. 根据权利要求30所述的发送设备,其中,在所述获取帧率调整信号的步骤中,所述处理器被配置为执行以下步骤:The transmitting device according to claim 30, wherein, in the step of acquiring the frame rate adjustment signal, the processor is configured to perform the following steps:
    接收接收端根据所获取的主码流切换信号而发送的帧率调整信号,所述主码流切换信号用于指示将主码流切换为所述第二码流。The frame rate adjustment signal sent by the receiving end according to the acquired main stream switching signal is received, where the main stream switching signal is used to instruct to switch the main stream to the second stream.
  32. 根据权利要求30所述的发送设备,其中,帧率调整后,所述新背景码流的传输帧率为进行切换前所述第二码流的传输帧率,或为适应于剩余带宽的动态低帧率,所述剩余带宽是根据切换后所述新主码流的传输帧率来确定的。The sending device according to claim 30, wherein after the frame rate is adjusted, the transmission frame rate of the new background code stream is the transmission frame rate of the second code stream before switching, or is a dynamic response to the remaining bandwidth Low frame rate, the remaining bandwidth is determined according to the transmission frame rate of the new main stream after switching.
  33. 根据权利要求30所述的发送设备,其中,帧率调整后,所述新主码流的传输帧 率为进行切换前所述原始主码流的传输帧率。The sending device according to claim 30, wherein after the frame rate is adjusted, the transmission frame rate of the new main stream is the transmission frame rate of the original main stream before the switching.
  34. 根据权利要求30所述的发送设备,其中,所述处理器还被配置为执行以下步骤:The sending device of claim 30, wherein the processor is further configured to perform the following steps:
    在发送所述至少两路码流中各码流的图像帧之前,获取为对应码流中待编码的原始图像所确定的参考帧;Before sending the image frame of each code stream in the at least two code streams, acquiring the reference frame determined for the original image to be encoded in the corresponding code stream;
    根据所述参考帧对所述原始图像进行编码,获得所述原始图像的图像帧。The original image is encoded according to the reference frame to obtain an image frame of the original image.
  35. 根据权利要求30所述的发送设备,其中,在所述获取为对应码流中待编码的原始图像所确定的参考帧的步骤中,所述处理器被配置为执行以下步骤:The sending device according to claim 30, wherein, in the step of obtaining the reference frame determined for the original image to be encoded in the corresponding code stream, the processor is configured to perform the following steps:
    从所述对应码流中编码所获得图像帧中选取图像帧作为所述原始图像的参考帧。Selecting an image frame from the image frames obtained by encoding in the corresponding code stream as the reference frame of the original image.
  36. 根据权利要求34所述的发送设备,其中,所述处理器还被配置为执行以下步骤:The sending device of claim 34, wherein the processor is further configured to perform the following steps:
    接收所述接收端发送的反馈信息,所述接收端在通过异常检测确定所接收到图像帧准确时,为准确接收到的所述图像帧发送所述反馈信息,所述反馈信息用于为所述待编码的原始图像确定参考帧。Receiving the feedback information sent by the receiving end, when the receiving end determines that the received image frame is accurate through anomaly detection, it sends the feedback information for the accurately received image frame, and the feedback information is used for The original image to be encoded determines the reference frame.
  37. 根据权利要求34所述的发送设备,其中,所述处理器还被配置为执行以下步骤:The sending device of claim 34, wherein the processor is further configured to perform the following steps:
    对于所述至少两路码流,将各码流中的首帧原始图像按照帧内编码方式进行编码并传输。For the at least two code streams, the original image of the first frame in each code stream is coded and transmitted in an intra-frame coding mode.
  38. 根据权利要求37所述的发送设备,其中,在所述将各码流中的首帧原始图像按照帧内编码方式进行编码并传输的步骤之后,所述处理器还被配置为执行以下步骤:The sending device according to claim 37, wherein, after the step of encoding and transmitting the original image of the first frame in each code stream according to an intra-frame encoding method, the processor is further configured to perform the following steps:
    接收所述接收端为所接收到图像帧发送的反馈信息;Receiving feedback information sent by the receiving end for the received image frame;
    通过所述反馈信息确定对应码流中是否出现异常传输;Determine whether abnormal transmission occurs in the corresponding code stream according to the feedback information;
    若确定对应码流中出现异常传输,则将所述码流中当前待传输的原始图像按照帧内编码方式进行编码并传输;If it is determined that abnormal transmission occurs in the corresponding code stream, the original image currently to be transmitted in the code stream is encoded and transmitted according to the intra-frame coding mode;
    若确定对应码流中未出现异常传输,则按照帧间编码方式对当前待传输的原始图像进行编码并传输。If it is determined that there is no abnormal transmission in the corresponding code stream, the original image currently to be transmitted is coded and transmitted according to the inter-frame coding mode.
  39. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至10中任一项所述的方法。A computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
  40. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求11至19中任一项所述的方法。A computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 11 to 19 is realized.
PCT/CN2019/097265 2019-07-23 2019-07-23 Transmission control method and device for code streams, and computer readable storage medium WO2021012180A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/097265 WO2021012180A1 (en) 2019-07-23 2019-07-23 Transmission control method and device for code streams, and computer readable storage medium
CN201980008497.2A CN111602389B (en) 2019-07-23 2019-07-23 Code stream transmission control method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/097265 WO2021012180A1 (en) 2019-07-23 2019-07-23 Transmission control method and device for code streams, and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2021012180A1 true WO2021012180A1 (en) 2021-01-28

Family

ID=72190286

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/097265 WO2021012180A1 (en) 2019-07-23 2019-07-23 Transmission control method and device for code streams, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN111602389B (en)
WO (1) WO2021012180A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174965A (en) * 2022-06-30 2022-10-11 杭州海康威视数字技术股份有限公司 Video preview method and device, electronic equipment and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101917568A (en) * 2009-12-17 2010-12-15 新奥特(北京)视频技术有限公司 Streaming media technology-based network video player and playing system
CN202799004U (en) * 2012-06-04 2013-03-13 深圳市景阳科技股份有限公司 Video playback terminal and video playback system
CN103997680A (en) * 2014-06-06 2014-08-20 北京奇艺世纪科技有限公司 Switching method and device of video bitstream
CN104079869A (en) * 2013-03-29 2014-10-01 杭州海康威视数字技术股份有限公司 Method and client side for previewing multi-channel code streams
US20150227294A1 (en) * 2014-02-11 2015-08-13 Wowza Media Systems, LLC Server configuration interface including stream preview
CN106231225A (en) * 2016-09-14 2016-12-14 深圳市泛海三江科技发展有限公司 A kind of network hard disk video recorder data processing method and system
CN106937141A (en) * 2017-03-24 2017-07-07 北京奇艺世纪科技有限公司 A kind of bitstreams switching method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9570106B2 (en) * 2014-12-02 2017-02-14 Sony Corporation Sensor configuration switching for adaptation of video capturing frame rate
CN106572355A (en) * 2016-11-02 2017-04-19 乐视控股(北京)有限公司 Multi-channel video live streaming method and system
CN107666593B (en) * 2017-08-28 2020-04-21 中国电子科技集团公司第二十八研究所 Video real-time transmission method under fluctuating network environment
CN109195010B (en) * 2018-08-15 2021-08-06 咪咕视讯科技有限公司 Code rate adjusting method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101917568A (en) * 2009-12-17 2010-12-15 新奥特(北京)视频技术有限公司 Streaming media technology-based network video player and playing system
CN202799004U (en) * 2012-06-04 2013-03-13 深圳市景阳科技股份有限公司 Video playback terminal and video playback system
CN104079869A (en) * 2013-03-29 2014-10-01 杭州海康威视数字技术股份有限公司 Method and client side for previewing multi-channel code streams
US20150227294A1 (en) * 2014-02-11 2015-08-13 Wowza Media Systems, LLC Server configuration interface including stream preview
CN103997680A (en) * 2014-06-06 2014-08-20 北京奇艺世纪科技有限公司 Switching method and device of video bitstream
CN106231225A (en) * 2016-09-14 2016-12-14 深圳市泛海三江科技发展有限公司 A kind of network hard disk video recorder data processing method and system
CN106937141A (en) * 2017-03-24 2017-07-07 北京奇艺世纪科技有限公司 A kind of bitstreams switching method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174965A (en) * 2022-06-30 2022-10-11 杭州海康威视数字技术股份有限公司 Video preview method and device, electronic equipment and computer readable storage medium
CN115174965B (en) * 2022-06-30 2024-01-02 杭州海康威视数字技术股份有限公司 Video preview method, device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN111602389B (en) 2022-06-03
CN111602389A (en) 2020-08-28

Similar Documents

Publication Publication Date Title
US10009630B2 (en) System and method for encoding video content using virtual intra-frames
CN111052754B (en) Streaming frames of spatial elements to a client device
US9585062B2 (en) System and method for implementation of dynamic encoding rates for mobile devices
US10659815B2 (en) Method of dynamic adaptive streaming for 360-degree videos
US8934728B2 (en) Image display system, image composing and re-encoding apparatus, image display apparatus, method of displaying image, and computer-readable storage medium having stored therein image composing and re-encoding program
US20200259880A1 (en) Data processing method and apparatus
WO2017198223A1 (en) Video quality evaluation method, device and remote radio head
WO2020237466A1 (en) Video transmission method and apparatus, and aircraft, playback device, and storage medium
WO2013030166A2 (en) Method for transmitting video signals from an application on a server over an ip network to a client device
WO2021012180A1 (en) Transmission control method and device for code streams, and computer readable storage medium
JP2010213119A (en) Video transmission system, imaging apparatus and monitoring device
KR20090037741A (en) Remote surveillance system using a network camera
JP2010057084A (en) Video transmission apparatus, control method thereof, and program for executing the control method
US9118803B2 (en) Video conferencing system
CN107734278B (en) Video playback method and related device
US9363574B1 (en) Video throttling based on individual client delay
US9553906B2 (en) Method and system for synchronization of data streams
CN112470481B (en) Encoder and method for encoding tile-based immersive video
US9451288B2 (en) Inferred key frames for fast initiation of video coding sessions
KR100899666B1 (en) Dispersed multistreaming transmission apparatus
CN113508601A (en) Client and method for managing a streaming session of multimedia content at a client
US11973634B1 (en) Detecting hardware issue
US20240137606A1 (en) Electronic apparatus, server apparatus and control method thereof
JP2004140691A (en) Moving picture data communication system and moving picture data communication method
JP2022015118A (en) Wireless image transmission system, image display system and wireless image transmission method

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: 19938260

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19938260

Country of ref document: EP

Kind code of ref document: A1