CN114760528A - Method, system, device, computer equipment and medium for video data transmission - Google Patents

Method, system, device, computer equipment and medium for video data transmission Download PDF

Info

Publication number
CN114760528A
CN114760528A CN202210409605.0A CN202210409605A CN114760528A CN 114760528 A CN114760528 A CN 114760528A CN 202210409605 A CN202210409605 A CN 202210409605A CN 114760528 A CN114760528 A CN 114760528A
Authority
CN
China
Prior art keywords
video
video stream
server
network
speed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210409605.0A
Other languages
Chinese (zh)
Inventor
鲍琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Cubesili Information Technology Co Ltd
Original Assignee
Guangzhou Cubesili Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Cubesili Information Technology Co Ltd filed Critical Guangzhou Cubesili Information Technology Co Ltd
Priority to CN202210409605.0A priority Critical patent/CN114760528A/en
Publication of CN114760528A publication Critical patent/CN114760528A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/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/440218Processing 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 transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4
    • 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/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44209Monitoring of downstream path of the transmission network originating from a server, e.g. bandwidth variations of a wireless network
    • 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/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/462Content or additional data management, e.g. creating a master electronic program guide from data received from the Internet and a Head-end, controlling the complexity of a video stream by scaling the resolution or bit-rate based on the client capabilities
    • H04N21/4621Controlling the complexity of the content stream or additional data, e.g. lowering the resolution or bit-rate of the video stream for a mobile client with a small screen

Abstract

The application relates to the technical field of network live broadcast, and provides a method, a system, a device, computer equipment and a storage medium for video data transmission, wherein the method comprises the following steps: the method comprises the steps that a video initiating end collects video data and encodes the video data into a first video stream and a second video stream; sending the first video stream and the second video stream to a server; a video receiving end detects a network downlink speed, and if the network downlink speed is greater than or equal to a first preset threshold value, the first video stream is obtained from the server; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; according to the method and the device, the video starting end encodes the same video data into the first video stream with high code rate and the second video stream with low code rate, and the video receiving end obtains the video stream with corresponding code rate by detecting the network downlink speed, so that the video blocking during downlink weak network is avoided.

Description

Method, system, device, computer equipment and medium for video data transmission
Technical Field
The embodiment of the application relates to the technical field of network live broadcast, in particular to a method, a system, a device, computer equipment and a storage medium for video data transmission.
Background
With the development of video transmission technology, business forms based on the video transmission technology have been integrated into people's work and life, for example, the video transmission technology is used in scenes such as live broadcast, video chat and video conference which are hot today. In the video transmission process, an initiator encodes video data into a video stream and uploads the video stream to a server, and a receiver downloads the video stream from the server and decodes the video stream, so the quality of uplink and downlink network quality directly influences the video transmission quality. For example, in a situation where the network speed is limited, the video frames are frequently jammed when the receiving party watches the video, which seriously affects the viewing experience of the viewer.
At present, in order to avoid the video picture from being blocked, a receiving party discards part of encoded frames in a video stream when downloading the video stream, so that the fluency of the video is improved. However, by dropping part of the encoded frames in the video stream, the video sharpness is reduced, resulting in a poor user experience.
Disclosure of Invention
The embodiment of the application provides a method, a system, a device, computer equipment and a storage medium for video data transmission, which can avoid video blockage and improve video definition, and the technical scheme is as follows:
In a first aspect, an embodiment of the present application provides a method for video data transmission, including:
the method comprises the steps that a video initiating end collects video data and encodes the video data into a first video stream and a second video stream; sending the first video stream and the second video stream to a server; wherein the coding rate of the first video stream is greater than the coding rate of the second video stream;
a video receiving end detects a network downlink speed, and if the network downlink speed is greater than or equal to a first preset threshold value, the first video stream is obtained from the server; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; and the network downlink speed is the network speed of the video receiving end receiving data from the server.
In a second aspect, an embodiment of the present application provides a live broadcast system for video data transmission, including: the system comprises a main broadcasting end, a spectator end and a server;
the anchor terminal collects video data and encodes the video data into a first video stream and a second video stream; sending the first video stream and the second video stream to the server; wherein the coding rate of the first video stream is greater than the coding rate of the second video stream;
The audience terminal detects the network downlink speed, and if the network downlink speed is greater than or equal to a first preset threshold value, the first video stream is obtained from the server; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; and the network downlink speed is the network speed of the audience terminal for receiving data from the server.
In a third aspect, an embodiment of the present application provides an apparatus for video data transmission, including:
the video encoding module is used for acquiring video data by a video initiating end and encoding the video data into a first video stream and a second video stream; sending the first video stream and the second video stream to a server; wherein the coding rate of the first video stream is greater than the coding rate of the second video stream;
the video stream acquisition module is used for detecting the network downlink speed by a video receiving end, and acquiring the first video stream from the server if the network downlink speed is greater than or equal to a first preset threshold value; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; and the network downlink speed is the network speed of the video receiving end receiving data from the server.
In a fourth aspect, embodiments of the present application provide a computer device, a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method according to the first aspect.
In a fifth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the method according to the first aspect.
The method comprises the steps that video data are collected through a video starting end and are coded into a first video stream and a second video stream; sending the first video stream and the second video stream to a server; wherein the coding rate of the first video stream is greater than the coding rate of the second video stream; a video receiving end detects a network downlink speed, and if the network downlink speed is greater than or equal to a first preset threshold value, the first video stream is obtained from the server; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; and the network downlink speed is the network speed of the video receiving end receiving data from the server. According to the method and the device, the video starting end encodes the same video data into the first video stream with high code rate and the second video stream with low code rate, and the video receiving end obtains the video stream with corresponding code rate by detecting the downlink speed of the network, so that the video blocking during downlink weak network is avoided, and the video definition is improved.
For a better understanding and implementation, the technical solutions of the present application are described in detail below with reference to the accompanying drawings.
Drawings
Fig. 1 is a schematic application scenario diagram of a method for transmitting video data according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for transmitting video data according to an embodiment of the present disclosure;
fig. 2A is a schematic diagram of video data transmission according to an embodiment of the present application;
FIG. 3 is a schematic flowchart of steps S11-S15 in a method for video data transmission according to an embodiment of the present application;
FIG. 4 is a schematic flowchart of steps S16-S18 in a method for video data transmission according to an embodiment of the present application;
FIG. 5 is a schematic flowchart of steps S25-S27 in a method for video data transmission according to an embodiment of the present application;
FIG. 6 is a schematic flowchart of steps S30-S32 in a method for video data transmission according to an embodiment of the present application;
FIG. 7 is a schematic flowchart illustrating steps S33-S35 in a method for video data transmission according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a live broadcast system for video data transmission according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an apparatus for video data transmission according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if/if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The method and the device can be applied to scenes such as video chat, video conference, live broadcast and wheat connection, and the like, and the live broadcast and wheat connection is taken as an example for explanation below.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of a method for transmitting video data according to an embodiment of the present application, where the application scenario includes an anchor client 101, a server 102, and a viewer client 103 according to an embodiment of the present application, and the anchor client 101 and the viewer client 103 interact with each other through the server 102.
The proposed clients of the embodiment of the present application include the anchor client 101 and the viewer client 103.
It is noted that there are many understandings of the concept of "client" in the prior art, such as: it may be understood as an application program installed in a computer device, or may be understood as a hardware device corresponding to a server.
In the embodiments of the present application, the term "client" refers to a hardware device corresponding to a server, and more specifically, refers to a computer device, such as: smart phones, smart interactive tablets, personal computers, and the like.
When the client is a mobile device such as a smart phone and an intelligent interactive tablet, a user can install a matched mobile application program on the client and can also access a Web application program on the client.
When the client is a non-mobile device such as a Personal Computer (PC), the user can install a matching PC application on the client, and can also access a Web application on the client.
The mobile terminal application refers to an application program that can be installed in the mobile device, the PC terminal application refers to an application program that can be installed in the non-mobile device, and the Web terminal application refers to an application program that needs to be accessed through a browser.
Specifically, the Web applications may be divided into a mobile version and a PC version according to the difference of the client types, and the page layout modes of the two versions and the available server support may be different.
In the embodiment of the application, the types of live application programs provided to the user are mobile end live application programs, PC end live application programs and Web end live application programs. The user can autonomously select the mode of participating in the live webcast according to different types of the client adopted by the user.
The present application can divide the clients into the anchor client 101 and the viewer client 103 according to the user identity of the client. It should be noted that the viewer client 103 and the anchor client 101 are only divided according to the user identity, and in practical applications, the functions of the viewer client 103 and the anchor client 101 may be executed by the same client at different times. Therefore, the same client may serve as the viewer client 103 when watching the live network broadcast, and may serve as the anchor client 101 when publishing the live video.
The anchor client 101 is one end that sends a webcast video, and is typically a client used by an anchor (i.e., a webcast anchor user) in webcast.
The viewer client 103 refers to an end that receives and views webcast video, and is typically a client employed by a viewer viewing video in webcast (i.e., a live viewer user).
The hardware at which the anchor client 101 and viewer client 103 are directed is essentially a computer device, and in particular, as shown in fig. 1, it may be a type of computer device such as a smart phone, smart interactive tablet, and personal computer. Both the anchor client 101 and the viewer client 103 may access the internet via well-known network access to establish a data communication link with the server 102.
Server 102, acting as a business server, may be responsible for further connecting with related live streaming servers, small video servers, and other servers providing related support, etc., to form a logically associated server cluster for serving related terminal devices, such as anchor client 101 and viewer client 103 shown in fig. 1.
In the embodiment of the present application, the anchor client 101 and the audience client 103 may join in the same live broadcast room (i.e., a live broadcast channel), where the live broadcast room is a chat room implemented by means of an internet technology, and generally has an audio/video broadcast control function. The anchor user is live in the live room through the anchor client 101, and the audience of the audience client 103 can log in the server 102 to enter the live room to watch the live.
In the live broadcast room, interaction between the anchor and the audience can be realized through known online interaction modes such as voice, video, characters and the like, generally, the anchor user performs programs for the audience in the form of audio and video streams, and economic transaction behaviors can also be generated in the interaction process. Of course, the application form of the live broadcast room is not limited to online entertainment, and can also be popularized to other relevant scenes, such as: user pairing interaction scenarios, video conference scenarios, product recommendation sale scenarios, and any other scenario requiring similar interaction.
Specifically, the viewer watches live broadcast as follows: the viewer can click to access a live application (e.g., YY) installed on the viewer client 103 and choose to enter any one of the live rooms, and the viewer client 103 is triggered to load a live room interface for the viewer, wherein the live room interface includes a plurality of interactive components, and the viewer can watch live in the live room by loading the interactive components and perform various online interactions.
Currently, a main broadcast client acquires video data of a main broadcast, and sends the video data of the main broadcast to a server, and a spectator client acquires the video data of the main broadcast from the server, so that a spectator user can watch live broadcast of the main broadcast through the spectator client.
In the live broadcast watching process, the anchor client serves as a video initiating end, and the audience client serves as a video receiving end. However, the video data of the anchor is sent to the server by the anchor client and the video data of the anchor is obtained from the server by the audience client, which both occupy the network speed, thereby causing the network speed to be limited, and causing the video picture to have a stuck problem.
The server can also establish a connection of the live session between at least two anchor broadcasters, and under a live broadcast scene, video pictures of the anchor broadcasters and at least one live anchor are presented in the live broadcast room, so that audiences can see live contents of the anchor broadcasters and at least one live anchor in one live broadcast room. Specifically, the anchor may designate to connect to the at least one friend anchor, and after the server receives the anchor confirmation information of the anchor client corresponding to the friend anchor, the server may establish a connection session connection between the anchor client corresponding to the anchor identifier and the anchor client corresponding to the friend anchor identifier.
In the live wheat-connecting broadcast process, the client of the main broadcast serves as a video initiating end, and the client of the main broadcast serves as a video receiving end. The method comprises the steps that a video initiating terminal collects video data of a main broadcast, acquires video data of a main broadcast of continuous wheat collected by a video receiving terminal, the main broadcast video data and the video data of the main broadcast of continuous wheat are combined into live video data and then sent to a server, so that the server distributes the live video data in a live broadcast room of the main broadcast for audiences who join the main broadcast live broadcast room to watch, the video initiating terminal also sends the main broadcast video data to the video receiving terminal, the video receiving terminal combines the video data of the main broadcast of continuous wheat and the video data of the main broadcast into the live video data and then sends the live video data to the server, so that the server distributes the live video data in the live broadcast room of the main broadcast of continuous wheat and the audiences who join the main broadcast room of continuous wheat and watch the live broadcast.
However, the video originating terminal sends live video data, the video data of the anchor and the obtained live video data of the anchor connected to the wheat collected by the video receiving terminal occupy the network speed, and the occupied network speed is higher and higher with the increase of the number of people of the anchor connected to the wheat, so that the network speed is limited, and the video picture is blocked.
Therefore, the embodiment of the application provides a method for transmitting video data, which takes a video initiating terminal and a video receiving terminal as execution subjects.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a method for transmitting video data according to a first embodiment of the present application, the method including the following steps:
s10: the method comprises the steps that a video initiating end collects video data and encodes the video data into a first video stream and a second video stream; sending the first video stream and the second video stream to a server; and the coding rate of the first video stream is greater than that of the second video stream.
The video session application is installed on the video initiating terminal and the video receiving terminal, and the video initiating terminal and the video receiving terminal can carry out video session in response to the operation of starting the video session by a user. The video session may include video chat, video conference, live broadcast and microphone connection, and the video session application may include an instant messaging application, a live broadcast video application, and the like.
In the embodiment of the present application, please refer to fig. 2A, a video initiating end may invoke a camera to collect video data, after the camera collects the video data, the video data may be sent to an encoder, and the encoder encodes the video data with two different encoding parameters to obtain a first video stream and a second video stream. The encoding parameters include video resolution, frame rate and encoding rate, the video resolution of the first video stream is higher than the video resolution of the second video stream, the frame rate of the first video stream is higher than the frame rate of the second video stream, and the encoding rate of the first video stream is higher than the encoding rate of the second video stream. The coding rate is the number of data bits transmitted per unit time during data transmission. Under the condition that the video resolution and the frame rate are fixed, the coding code rate and the definition are in a direct proportion relation, and the larger the coding code rate is, the clearer the image is; the smaller the coding rate, the less clear the image.
Optionally, the encoder may include two modes, namely a hard coding mode and a soft coding mode, and the video data is encoded by using the hard coding mode, for example, the first video stream is obtained by encoding by using a dedicated DSP, FPGA, ASIC chip, and the like; the video data is encoded using a soft coding scheme, for example, using software program x264 to obtain a second video stream.
S20: a video receiving end detects a network downlink speed, and if the network downlink speed is greater than or equal to a first preset threshold value, the first video stream is obtained from the server; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; and the network downlink speed is the network speed of the video receiving end receiving data from the server.
In this embodiment of the present application, the first preset threshold may be calculated according to a video resolution and a frame rate of a video stream in a current video session. A video receiving end monitors the network downlink speed in real time through a background, if the network downlink speed is greater than or equal to a first preset threshold value, the network downlink speed can meet the requirement of all transmission of video stream data, and the first video stream with high code rate is obtained from the server so as to ensure the high definition requirement of video transmission; if the network downlink speed is less than a first preset threshold value, namely the number of effective pixels of a video picture in the transmitted video stream is reduced under the network downlink speed, the second video stream with low code rate is obtained from the server, the smoothness requirement of video transmission is guaranteed, and a user is prevented from perceiving that a video session is blocked.
The method comprises the steps that video data are collected through a video starting end and are encoded into a first video stream and a second video stream; sending the first video stream and the second video stream to a server; wherein the coding rate of the first video stream is greater than the coding rate of the second video stream; a video receiving end detects a network downlink speed, and if the network downlink speed is greater than or equal to a first preset threshold value, the first video stream is obtained from the server; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; and the network downlink speed is the network speed of the video receiving end receiving data from the server. According to the method and the device, the video starting end encodes the same video data into the first video stream with high code rate and the second video stream with low code rate, and the video receiving end obtains the video stream with corresponding code rate by detecting the network downlink speed, so that the video blocking during downlink weak network is avoided.
In an alternative embodiment, referring to fig. 3, the step S10 includes steps S11 to S15, which are as follows:
s11: the video initiating terminal detects the network uplink speed; the network uplink speed is the network speed of uploading data to the server by the video initiating terminal;
S12: if the network uplink speed is less than or equal to a second preset threshold, the video initiating end obtains a first coding rate corresponding to the currently detected network uplink speed according to a preset mapping relation between the network uplink speed and the coding rate;
s13: the video initiating end encodes the video data according to the first encoding code rate to obtain a first video stream;
s14: the video starting end encodes the video data according to a preset second encoding code rate to obtain a second video stream; wherein the second coding rate is less than the first coding rate;
s15: and the video initiating end sends the first video stream and the second video stream to a server.
In this embodiment of the application, when the video originating terminal uploads the video stream to the server, an uplink weak network condition may occur, which causes a video session to be blocked. Therefore, the video initiating terminal can monitor the network uplink speed in real time through the background in the video session process, and if the network uplink speed is less than or equal to the second preset threshold, the video initiating terminal obtains the first coding rate corresponding to the currently detected network uplink speed according to the preset mapping relation between the network uplink speed and the coding rate. Specifically, N groups of gears are preset, a network speed value meeting the requirement of each gear is set for each group of gears, and corresponding coding parameter values are obtained according to the currently detected network uplink speed and the corresponding gears in a matching mode. The encoding parameter values include encoding code rate, video resolution, frame rate and the like.
And coding the video data at the first coding rate to obtain a first video stream. And coding the video data at a preset second coding rate to obtain a second video stream. Wherein the second coding rate is less than the first coding rate. The video starting end sends the first video stream and the second video stream to the server, and the first video stream is obtained according to the encoding of the speed of the uplink network, so that the overload problem that the first video stream is transmitted to the server due to the fact that the uplink network is poor is avoided, and the video session blockage problem caused by the uplink weak network is avoided.
In an alternative embodiment, referring to fig. 4, the step S10 includes steps S16 to S18, which are as follows:
s16: the video starting end encodes the video data according to a preset third encoding code rate to obtain a first video stream;
s17: the video starting end encodes the video data according to a preset second encoding code rate to obtain a second video stream; wherein the second coding rate is less than the third coding rate;
s18: and the video initiating end sends the first video stream and the second video stream to a server.
In this embodiment of the present application, when a video session is started, the video originating end encodes the video data at two fixed coding rates to obtain a first video stream and a second video stream, for example, the coding rate of the first video stream is 1800k, and the coding rate of the second video stream is 400k, so as to improve video encoding efficiency.
In an optional embodiment, if the network downlink speed is lower than the first preset threshold in step S20, the step of obtaining the second video stream from the server includes steps S21 to S24, which are specifically as follows:
s21: if the network downlink speed is less than the first preset threshold, the video receiving end sends a video code rate adjusting instruction to the video initiating end; the video code rate adjusting instruction comprises the network downlink speed;
s22: the video starting end receives the video code rate adjusting instruction, acquires the network downlink speed and detects the network uplink speed;
s23: if the network uplink speed is less than or equal to a second preset threshold, the video initiating end obtains a fourth coding rate corresponding to the network uplink speed according to a preset mapping relation between the network uplink speed and the coding rate;
S24: and if the fourth coding code rate is greater than the network downlink speed, the video receiving end acquires the second video stream from the server.
In the embodiment of the application, when a video receiving end has a downlink weak network condition, the video receiving end sends a video code rate adjustment instruction to the video initiating end to indicate the video initiating end to detect the network uplink speed. And if the network uplink speed is low, namely the network uplink is weak, obtaining a fourth coding rate corresponding to the currently detected network uplink speed. And comparing the fourth coding rate with the network downlink speed, and if the fourth coding rate is higher than the network downlink speed, the video receiving end acquires the second video stream from the server, so that the uplink network condition is considered simultaneously when the downlink weak network exists, and video session pause caused by the uplink weak network is avoided.
In an alternative embodiment, referring to fig. 5, the method for transmitting video data includes steps S25 to S27, which are as follows:
s25: if the fourth coding rate is lower than the network downlink speed, the video initiating end codes the video data according to the fourth coding rate to obtain a third video stream;
S26: the video initiating terminal sends the third video stream to the server;
s27: and the video receiving end acquires the third video stream from the server.
In the embodiment of the application, when a video receiving end has a downlink weak network condition, the video receiving end sends a video code rate adjustment instruction to a video initiating end to instruct the video initiating end to detect the network uplink speed, and if the network uplink speed is low, namely the network uplink weak network, a fourth coding code rate corresponding to the currently detected network uplink speed is obtained. And comparing the fourth coding rate with the network downlink speed, and if the fourth coding rate is smaller than the network downlink speed, the video receiving end acquires a third video stream from a server, so that the third video stream with a higher coding rate relative to the second video stream is selected when the network is in a weak downlink state, and the video definition is improved while video session pause is avoided.
In an alternative embodiment, referring to fig. 6, the method for transmitting video data includes steps S30 to S32, which are as follows:
s30: after the step of acquiring the first video stream from the server by the video receiving end, if the network downlink speed is less than the first preset threshold, acquiring the second video stream from the server;
S31: the video receiving end respectively decodes the first video stream and the second video stream to obtain a first display time stamp of the first video stream and a second display time stamp of the second video stream;
s32: and if the difference value between the first display timestamp and the second display timestamp is smaller than a first preset threshold value, the video receiving end stops receiving the first video stream.
The display time stamp is a time stamp of a system reference time when the decoder decodes the video stream to display a video frame, and the system reference time is a time when the decoder starts to read the video stream data. In the embodiment of the present application, when the network uplink speed is good, the video receiving end acquires the first video stream from the server, and when the network downlink speed is poor, the video receiving end acquires the second video stream from the server. And a decoder at a video receiving end respectively decodes the first video stream and the second video stream to obtain a first display time stamp of the first video stream and a second display time stamp of the second video stream, and if the difference value between the first display time stamp and the second display time stamp is less than 200ms, the first video stream is stopped to be received, so that the picture switching is not obviously discontinuous when the first video stream is switched to the second video stream.
In an alternative embodiment, referring to fig. 7, the method for transmitting video data includes steps S33 to S35, which are as follows:
s33: if the difference value between the first display timestamp and the second display timestamp is larger than a first preset threshold value, the video receiving end acquires a first timestamp; the first timestamp is a timestamp when the video receiving end acquires the second video stream from the server;
s34: the video receiving end calculates the difference value between the first time stamp and the current time stamp;
s35: and if the difference value is larger than a second preset threshold value, the video receiving end stops receiving the first video stream.
In this embodiment of the application, if the difference between the first display timestamp and the second display timestamp is greater than 200ms, the receiving of the first video stream may be stopped by calculating a time length between a time when the second video stream starts to be received and a current time, and if the time length exceeds a preset time length, so that the timeout forced switching is started under the condition that the continuity of the picture when the first video stream is switched to the second video stream cannot be guaranteed, and an obvious sense of discontinuity during the picture switching is avoided.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a live broadcast system for video data transmission according to the present application. The live system 14 for video data transmission provided by the embodiment of the present application includes an anchor terminal 141, a viewer terminal 142, and a server 143;
The anchor terminal 141 collects video data and encodes the video data into a first video stream and a second video stream; sending the first video stream and the second video stream to the server 143; wherein the coding rate of the first video stream is greater than the coding rate of the second video stream;
the spectator end 142 detects a network downlink speed, and if the network downlink speed is greater than or equal to a first preset threshold value, the first video stream is acquired from the server 143; if the network downlink speed is less than the first preset threshold, acquiring the second video stream from the server 143; and the network downlink speed is the network speed at which the audience terminal receives data from the server.
In the live watching scene, the live broadcasting content of the main broadcasting can be played in the live broadcasting room. Therefore, the server will pull the video data corresponding to the anchor identification from the anchor terminal. After the server pulls the video data corresponding to the anchor identification from the anchor terminal, the server sends the video data to the client terminal added to the live broadcast room, and the client terminal added to the live broadcast room acquires the video data and outputs the video data in the live broadcast room.
Under the live broadcast scene of the live broadcast, the live broadcast content of each main broadcast can be played together in the live broadcast room. Therefore, the server will pull the video data corresponding to the anchor identification from each anchor terminal.
In an optional embodiment, after the server pulls the video data corresponding to the anchor identifier from each anchor terminal, the server performs mixed flow operation on the video data corresponding to the anchor identifier to obtain video stream data, and then sends the video stream data to the client terminal added to the live broadcasting room, and the client terminal added to the live broadcasting room obtains the video stream data and outputs the video stream data in the live broadcasting room.
In another optional embodiment, after the server pulls the video data corresponding to the anchor identifier from each anchor terminal, the server sends the video data corresponding to each anchor identifier to the anchor terminal. Optionally, the server may only issue video data corresponding to the anchor identifier of the other connected microphones to a certain anchor terminal, thereby reducing a certain traffic expense. And finally, the video stream data is issued to a viewer end added to the live broadcasting room through a server, and the video stream data is output in the live broadcasting room.
In other optional embodiments, after the server pulls the video data corresponding to the anchor identifier from each anchor terminal, the server sends the video data corresponding to each anchor identifier to the client (including the anchor terminal and the viewer terminal) added to the live broadcasting room, and after the client added to the live broadcasting room obtains the video data corresponding to each anchor identifier, the client performs mixed flow operation on the video data to obtain video stream data, and outputs the video stream data in the live broadcasting room.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an apparatus for transmitting video data according to the present application. The apparatus 4 for transmitting video data provided in the embodiment of the present application includes:
a video encoding module 41, configured to collect video data at a video initiating end, and encode the video data into a first video stream and a second video stream; sending the first video stream and the second video stream to a server; wherein the coding rate of the first video stream is greater than the coding rate of the second video stream;
a video stream obtaining module 42, configured to detect a network downlink speed at a video receiving end, and obtain the first video stream from the server if the network downlink speed is greater than or equal to a first preset threshold; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; and the network downlink speed is the network speed of the video receiving end receiving data from the server.
It should be noted that, when the apparatus for transmitting video data provided in the foregoing embodiment executes the method for transmitting video data, only the division of the above functional modules is taken as an example, and in practical applications, the above functions may be distributed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for video data transmission and the method for video data transmission provided in the foregoing embodiments belong to the same concept, and details of implementation processes thereof are referred to in the method embodiments and will not be described herein again.
Please refer to fig. 10, which is a schematic structural diagram of a computer device provided in the present application. As shown in fig. 10, the computer device 21 may include: a processor 210, a memory 211, and a computer program 212 stored in the memory 211 and operable on the processor 210, such as: a video data transmission program; the steps in the above embodiments are implemented when the processor 210 executes the computer program 212.
The processor 210 may include one or more processing cores, among other things. The processor 210 is connected to various parts in the computer device 21 by various interfaces and lines, executes various functions of the computer device 21 and processes data by executing or executing instructions, programs, code sets or instruction sets stored in the memory 211 and calling data in the memory 211, and optionally, the processor 210 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), Programmable Logic Array (PLA). The processor 210 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the touch display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 210, but may be implemented by a single chip.
The Memory 211 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 211 includes a non-transitory computer-readable medium. The memory 211 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 211 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch instructions, etc.), instructions for implementing the above-mentioned method embodiments, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 211 may optionally be at least one memory device located remotely from the processor 210.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are suitable for being loaded by a processor and executing the method steps of the foregoing embodiment, and a specific execution process may refer to specific descriptions of the foregoing embodiment, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the description of each embodiment has its own emphasis, and reference may be made to the related description of other embodiments for parts that are not described or recited in any embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described apparatus/terminal device embodiments are merely illustrative, and for example, a module or a unit may be divided into only one type of logic function, and another division manner may be provided in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium and used by a processor to implement the steps of the above-described embodiments of the method. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc.
The present invention is not limited to the above-described embodiments, and various modifications and variations of the present invention are intended to be included within the scope of the claims and the equivalent technology of the present invention if they do not depart from the spirit and scope of the present invention.

Claims (11)

1. A method of video data transmission, comprising the steps of:
the method comprises the steps that a video initiating end collects video data and encodes the video data into a first video stream and a second video stream; sending the first video stream and the second video stream to a server; wherein the coding rate of the first video stream is greater than the coding rate of the second video stream;
a video receiving end detects a network downlink speed, and if the network downlink speed is greater than or equal to a first preset threshold value, the first video stream is obtained from the server; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; and the network downlink speed is the network speed of the video receiving end receiving data from the server.
2. The method for video data transmission according to claim 1, wherein:
The video starting end collects video data and encodes the video data into a first video stream and a second video stream; the step of sending the first video stream and the second video stream to a server includes:
the video initiating terminal detects the network uplink speed; the network uplink speed is the network speed of uploading data to the server by the video initiating terminal;
if the network uplink speed is less than or equal to a second preset threshold, the video initiating end obtains a first coding rate corresponding to the network uplink speed according to a preset mapping relation between the network uplink speed and the coding rate;
the video starting end encodes the video data according to the first encoding code rate to obtain a first video stream;
the video starting end encodes the video data according to a preset second encoding code rate to obtain a second video stream; wherein the second coding rate is less than the first coding rate;
and the video initiating end sends the first video stream and the second video stream to a server.
3. The method for video data transmission according to claim 1, wherein:
the video starting end collects video data and encodes the video data into a first video stream and a second video stream; the step of sending the first video stream and the second video stream to a server includes:
The video starting end encodes the video data according to a preset third encoding code rate to obtain a first video stream;
the video starting end encodes the video data according to a preset second encoding code rate to obtain a second video stream; wherein the second coding rate is less than the third coding rate;
and the video initiating terminal sends the first video stream and the second video stream to a server.
4. A method of video data transmission according to claim 3, characterized in that:
if the network downlink speed is less than the first preset threshold, the step of obtaining the second video stream from the server includes:
if the network downlink speed is less than the first preset threshold, the video receiving end sends a video code rate adjusting instruction to the video initiating end; the video code rate adjusting instruction comprises the network downlink speed;
the video starting end receives the video code rate adjusting instruction, acquires the network downlink speed and detects the network uplink speed;
if the network uplink speed is less than or equal to a second preset threshold, the video initiating end obtains a fourth coding rate corresponding to the network uplink speed according to a preset mapping relation between the network uplink speed and the coding rate;
And if the fourth coding code rate is greater than the network downlink speed, the video receiving end acquires the second video stream from the server.
5. The method for video data transmission according to claim 4, further comprising the steps of:
if the fourth coding rate is less than or equal to the network downlink speed, the video initiating end codes the video data according to the fourth coding rate to obtain a third video stream;
the video initiating terminal sends the third video stream to the server;
and the video receiving end acquires the third video stream from the server.
6. The method for video data transmission according to any of claims 1 to 5, further comprising:
after the step of acquiring the first video stream from the server by the video receiving end, if the network downlink speed is less than the first preset threshold, acquiring the second video stream from the server;
the video receiving end respectively decodes the first video stream and the second video stream to obtain a first display time stamp of the first video stream and a second display time stamp of the second video stream;
And if the difference value between the first display timestamp and the second display timestamp is smaller than a first preset threshold value, the video receiving end stops receiving the first video stream.
7. The method for video data transmission according to claim 6, comprising:
if the difference value between the first display timestamp and the second display timestamp is larger than a first preset threshold value, the video receiving end acquires a first timestamp; the first timestamp is a timestamp when the video receiving end acquires the second video stream from the server;
the video receiving end calculates the difference value between the first time stamp and the current time stamp;
and if the difference value is larger than a second preset threshold value, the video receiving end stops receiving the first video stream.
8. A live system for video data transmission, comprising: the system comprises a main broadcasting end, a spectator end and a server;
the anchor terminal collects video data and encodes the video data into a first video stream and a second video stream; sending the first video stream and the second video stream to the server; wherein the coding rate of the first video stream is greater than the coding rate of the second video stream;
The audience terminal detects the network downlink speed, and if the network downlink speed is greater than or equal to a first preset threshold value, the first video stream is obtained from the server; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; and the network downlink speed is the network speed at which the audience terminal receives data from the server.
9. An apparatus for video data transmission, comprising:
the video encoding module is used for acquiring video data by a video initiating end and encoding the video data into a first video stream and a second video stream; sending the first video stream and the second video stream to a server; wherein the coding rate of the first video stream is greater than the coding rate of the second video stream;
the video stream acquisition module is used for detecting the network downlink speed by a video receiving end, and acquiring the first video stream from the server if the network downlink speed is greater than or equal to a first preset threshold value; if the network downlink speed is less than the first preset threshold value, acquiring the second video stream from the server; and the network downlink speed is the network speed of the video receiving end receiving data from the server.
10. A computer device, comprising: processor, memory and computer program stored in the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 7 are implemented when the processor executes the computer program.
11. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202210409605.0A 2022-04-19 2022-04-19 Method, system, device, computer equipment and medium for video data transmission Pending CN114760528A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210409605.0A CN114760528A (en) 2022-04-19 2022-04-19 Method, system, device, computer equipment and medium for video data transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210409605.0A CN114760528A (en) 2022-04-19 2022-04-19 Method, system, device, computer equipment and medium for video data transmission

Publications (1)

Publication Number Publication Date
CN114760528A true CN114760528A (en) 2022-07-15

Family

ID=82332049

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210409605.0A Pending CN114760528A (en) 2022-04-19 2022-04-19 Method, system, device, computer equipment and medium for video data transmission

Country Status (1)

Country Link
CN (1) CN114760528A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878808A (en) * 2017-03-17 2017-06-20 福建中金在线信息科技有限公司 A kind of video broadcasting method and device
CN108012159A (en) * 2017-12-05 2018-05-08 广州华多网络科技有限公司 live video push control method, device and corresponding terminal
CN108024126A (en) * 2017-11-28 2018-05-11 北京潘达互娱科技有限公司 Network direct broadcasting video regulation method, device, electronic equipment and storage medium
CN109068157A (en) * 2018-08-21 2018-12-21 北京潘达互娱科技有限公司 Method of adjustment, device and the server of plug-flow parameter in a kind of live streaming
CN111083536A (en) * 2019-12-31 2020-04-28 广州酷狗计算机科技有限公司 Method and device for adjusting video code rate
CN111405312A (en) * 2020-04-26 2020-07-10 广州酷狗计算机科技有限公司 Live broadcast stream pushing method, device, terminal, server and storage medium
CN111669619A (en) * 2020-06-04 2020-09-15 北京奇艺世纪科技有限公司 Video stream data switching method, device, terminal and readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878808A (en) * 2017-03-17 2017-06-20 福建中金在线信息科技有限公司 A kind of video broadcasting method and device
CN108024126A (en) * 2017-11-28 2018-05-11 北京潘达互娱科技有限公司 Network direct broadcasting video regulation method, device, electronic equipment and storage medium
CN108012159A (en) * 2017-12-05 2018-05-08 广州华多网络科技有限公司 live video push control method, device and corresponding terminal
CN109068157A (en) * 2018-08-21 2018-12-21 北京潘达互娱科技有限公司 Method of adjustment, device and the server of plug-flow parameter in a kind of live streaming
CN111083536A (en) * 2019-12-31 2020-04-28 广州酷狗计算机科技有限公司 Method and device for adjusting video code rate
CN111405312A (en) * 2020-04-26 2020-07-10 广州酷狗计算机科技有限公司 Live broadcast stream pushing method, device, terminal, server and storage medium
CN111669619A (en) * 2020-06-04 2020-09-15 北京奇艺世纪科技有限公司 Video stream data switching method, device, terminal and readable storage medium

Similar Documents

Publication Publication Date Title
US10728594B2 (en) Method and apparatus for transmitting data of mobile terminal
CN110557649B (en) Live broadcast interaction method, live broadcast system, electronic equipment and storage medium
CN107846633B (en) Live broadcast method and system
US9479737B2 (en) Systems and methods for event programming via a remote media player
US20110285863A1 (en) Live television broadcasting system for the internet
WO2020220902A1 (en) Method and apparatus for distributing transmission parameters of video resources
CN101848382A (en) Method and system for adjusting video streaming image resolution ratio and code stream
US9521366B2 (en) Method and apparatus for playing conference signal, video conference terminal, and mobile device
US8743172B2 (en) Image capturing for video conference system
AU2003258912B2 (en) Audio visual media encoding system
WO2013048618A1 (en) Systems and methods for synchronizing the presentation of a combined video program
CN112019927A (en) Video live broadcast method, microphone connecting equipment, RTC media server and main broadcast equipment
CN114546308A (en) Application interface screen projection method, device, equipment and storage medium
CN111131725A (en) System and method for monitoring multi-picture video signal
US20240004859A1 (en) Data handling method, system and computer program
JP2005198313A (en) Digital real-time interactive program system
CN113286190A (en) Cross-network and same-screen control method and device and cross-network and same-screen system
CN109729379B (en) Method, device, terminal and storage medium for realizing live video microphone connection
EP1698059B1 (en) Controlling return path in interactive television environment
US20130291011A1 (en) Transcoding server and method for overlaying image with additional information therein
EP3316546B1 (en) Multimedia information live method and system, collecting device and standardization server
CN113194276B (en) Method, system and storage medium for generating dynamic layout in video conference system
CN106412617A (en) Remote debugging control method and device
CN111385590A (en) Live broadcast data processing method and device and terminal
CN114760528A (en) Method, system, device, computer equipment and medium for video data transmission

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination