WO2021204141A1 - 视频直播控制、桥接、流控、播控方法及客户端 - Google Patents

视频直播控制、桥接、流控、播控方法及客户端 Download PDF

Info

Publication number
WO2021204141A1
WO2021204141A1 PCT/CN2021/085783 CN2021085783W WO2021204141A1 WO 2021204141 A1 WO2021204141 A1 WO 2021204141A1 CN 2021085783 W CN2021085783 W CN 2021085783W WO 2021204141 A1 WO2021204141 A1 WO 2021204141A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
live
broadcast
operating system
simulation
Prior art date
Application number
PCT/CN2021/085783
Other languages
English (en)
French (fr)
Inventor
王斐航
林忠涛
Original Assignee
广州华多网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州华多网络科技有限公司 filed Critical 广州华多网络科技有限公司
Publication of WO2021204141A1 publication Critical patent/WO2021204141A1/zh

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/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • 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/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • 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/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • 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 or rendering scenes according to encoded video stream scene graphs
    • 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/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4438Window management, e.g. event handling following interaction with the user interface

Definitions

  • the present invention relates to computer system communication technology, in particular to a video live broadcast control method and a corresponding client, and correspondingly relates to a video direct bridge method, a video live streaming control method, and a video live broadcast control method during the execution of the control method.
  • the developer will choose to let the anchor install a customized emulator on the PC, first establish an environment suitable for Android App running on the PC machine, and then use the emulator
  • the Android launch tool is installed inside, so that R&D only needs to develop the Android launch application to meet the needs of the PC and Android platforms.
  • the present invention provides a live video control method, a live video bridge bridging method, a live video streaming control method, and a live video broadcast control method for the first purpose of avoiding repeated development.
  • the second object of the present invention is to provide a client terminal, so as to realize hardware support for the first object and the method.
  • the present invention provides the following technical solutions:
  • the video live broadcast control method of the present invention includes the following steps:
  • the simulation program When the simulation program running in the current first operating system for simulating the operating environment of the second operating system starts the live program, the simulation program establishes the live program running in the operating environment and the live program running in the first operating system.
  • the communication channel of the flow control program
  • the broadcast start preview message is broadcast, and the simulation program notifies the flow control program of the start preview message to trigger it to enter the preview state, so that it opens a preview window to display the video stream it collects;
  • the live broadcast program After the live broadcast program starts the broadcast mode, it broadcasts the cloud address message it has acquired for receiving the video stream, and the simulation program notifies the cloud address message to the streaming control program to trigger it to enter the broadcast state and make it broadcast to the corresponding The cloud address to transmit the video stream.
  • the method further includes the following steps:
  • the simulation program When the live broadcast program is closed, the broadcast preview stop message, the simulation program notifies the stream control program of the preview stop message to trigger it to enter the stop broadcast state, and stop pushing the video stream to the cloud address.
  • the communication channel includes a first direct channel between a live program and a simulation program and a second direct channel between the simulation program and the flow control program.
  • the first direct channel is established as follows: the live program carries service components registered in the simulation running environment, and the simulation program carries broadcast receivers registered in the simulation running environment The simulation program transmits the messages generated by the flow control program to the live program through the service process constructed by the service component; the simulation program receives the messages broadcast by the live program through the broadcast receiver and transmits them Give the described flow control program.
  • the second direct channel is established as follows: the second direct channel is established between the simulation program and the flow control program by reading and writing sockets or files with each other.
  • the simulation program and the flow control program are suitable for running on the current first operating system
  • the live broadcast program is suitable for running on a second operating system that is different from the current operating system
  • the simulation program is suitable for Simulate the second operating system in the first operating system to create a corresponding simulated running environment for the live program.
  • the first operating system is any one of Windows or operating systems based on Linux and Unix
  • the second operating system is Android, IOS, Linux, Windows that are different from the first operating system. Any of the operating systems.
  • the application package name representing the main process of the live program and the service name representing its service process are passed to the flow control program for all
  • the flow control program identifies the main process and the service process of the live broadcast program to determine the identity of message delivery.
  • a tool container for controlling the video stream collected by the flow control program is opened.
  • the tool container includes at least one control that can affect the special effects of the preview video in the preview window.
  • the message generated from the control is transmitted to the live broadcast program through the communication channel.
  • the preview window is closed when the flow control program enters the stop state.
  • a method for bridging video live broadcast of the present invention includes the following steps:
  • the method further includes the following steps:
  • the communication channel includes a first direct channel between the simulation program and the live program implemented by the method, and a second direct channel between the simulation program and the flow control program.
  • the first direct channel is established as follows: the live program carries service components registered in the simulation running environment, and the simulation program carries broadcast receivers registered in the simulation running environment The simulation program transmits the messages generated by the flow control program to the live program through the service process constructed by the service component; the simulation program receives the messages broadcast by the live program through the broadcast receiver and transmits them Give the described flow control program.
  • the second direct channel is established as follows: the second direct channel is established between the simulation program and the flow control program by reading and writing sockets or files with each other.
  • the application package name representing the main process of the live program and the service name representing its service process are passed to the flow control program for all
  • the flow control program identifies the main process and the service process of the live broadcast program to determine the identity of message delivery.
  • a video live streaming method of the present invention includes the following steps:
  • a tool container for controlling the video stream when entering the preview state, is opened, and the tool container includes at least one control that can affect the special effect of the preview video in the preview window.
  • the preview window when entering the stop state, the preview window is closed.
  • the flow control program that implements this method and the simulation program realize communication by reading and writing sockets or files with each other, so as to realize the transmission of the message.
  • the flow control program that implements the method sends a notification message to the simulation program, so that the notification message is displayed in the simulation running environment created by the simulation program.
  • a method for controlling live video broadcasting of the present invention includes the following steps:
  • the bottom layer driver of the first operating system is triggered to stop collecting the video stream.
  • the first operating system runs a simulation program for creating the operating environment of the second operating system module, and the first operating system runs a first-level control program for capturing video from the underlying driver The action of streaming and the execution of the action of pushing the video stream.
  • the live broadcast program that implements the method sends a message in the broadcast mode of the broadcast mechanism of the second operating system to implement the trigger operation on the first operating system.
  • the live program that implements the method carries a service component for receiving messages generated in the first operating system, so as to display the messages generated in the first operation to the user.
  • the first operating system is any one of Windows or operating systems based on Linux and Unix
  • the second operating system is Android, IOS, Linux, and Linux, which are different from the first operating system. Any of the Windows operating systems.
  • a client of the present invention includes a central processing unit and a memory, and the central processing unit is used to call and run one or more computer programs stored in the memory to execute the various types of the first object of the present invention as described above. Provided method.
  • the video stream does not need to be transferred through the simulation program and the live program, which can greatly improve the push efficiency of the video stream.
  • the video stream is received by the cloud server and pushed to the terminal device of the user in the live broadcast room, the user can obtain high fidelity Video stream to obtain a clearer video viewing effect. Accordingly, developers do not need to adapt to the mechanism and development language of the first operating system to re-develop and maintain another version of the live program, which can greatly save program development consumption and development cost.
  • the simulation program implemented by the video live streaming bridge method of the present invention can not only simulate the operating environment of the second operating system in the first operating system, so as to ensure that the live program is called and run normally, but also, through the establishment of the live program and
  • the communication channel between flow control programs realizes the message bridging mechanism, which in fact creates the basic conditions for the separation of video streaming and live broadcast control.
  • the simulation program It can serve it and provide a docking channel between the flow control programs. Therefore, the bridging method is equivalent to providing applications of different operating systems running on the first operating system and enabling separate collection and push of video streams.
  • the service mechanism is convenient for Internet developers to adapt and call, and it is convenient to be compatible with the application programs of the second operating system developed by different developers.
  • the flow control program implemented by the video live streaming method of the present invention runs on the first operating system and is specifically responsible for the collection, push and preview of the video stream, and can be used for the second operation through the simulation program through the corresponding communication channel.
  • the live program developed by the system provides the service of pushing the video stream, which is convenient for the anchor users to watch and operate on the first operating system (usually a PC), which is more convenient to control and obtain better preview effects.
  • the live program implemented by the video live broadcast control method of the present invention can access the simulation program running on the first operating system of the present invention as long as the relevant response and message broadcasting is implemented according to the method, and run on the simulation program created by the simulation program.
  • the live program can also be developed lightly, and it does not necessarily need to provide a complete preview. , Capture and push video stream related functions.
  • developers often provide full-featured live broadcast programs.
  • the live broadcast programs developed for the second operating system can access the simulation programs as long as they comply with the specifications of this broadcast control method. , And it runs virtually in the first operating system, which realizes function expansion and facilitates the operation of anchor users.
  • FIG. 1 is a schematic flowchart of a typical embodiment of the video live broadcast control method of the present invention
  • FIG. 2 is a schematic flowchart of a typical embodiment of the video live streaming bridge method of the present invention
  • FIG. 3 is a schematic flowchart of a typical embodiment of a video live streaming method of the present invention.
  • FIG. 4 is a schematic flowchart of a typical embodiment of a method for controlling live video broadcasting according to the present invention.
  • client includes both wireless signal receiver devices, which only have wireless signal receiver devices without transmitting capabilities, and include A device for receiving and transmitting hardware, which has a device capable of receiving and transmitting hardware for two-way communication on a two-way communication link.
  • Such devices may include: cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service, personal communication) System), which can combine voice, data processing, fax and/or data communication capabilities; PDA (Personal Digital Assistant), which can include radio frequency receivers, pagers, Internet/Intranet access, web browsers, and notes Notebook, calendar, and/or GPS (Global Positioning System) receiver; conventional laptop and/or palmtop computer or other equipment, which has and/or includes a conventional laptop and/or radio frequency receiver Palm-size computer or other equipment.
  • cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays
  • PCS Personal Communications Service, personal communication) System
  • PDA Personal Digital Assistant
  • GPS Global Positioning System
  • the “client”, “terminal”, and “terminal device” used here may be portable, transportable, installed in vehicles (air, sea and/or land), or suitable and/or configured to be locally Operate, and/or in a distributed form, operate in any other location on the earth and/or space.
  • the “client”, “terminal”, and “terminal device” used here can also be communication terminals, internet terminals, music/video playback terminals, such as PDA, MID (Mobile Internet Device, mobile Internet device) and/or Mobile phones with music/video playback functions can also be devices such as smart TVs and set-top boxes.
  • the hardware referred to by the names "server”, “client”, “service node” and so on in the present invention is essentially a device with the equivalent capabilities of a personal computer, which is a central processing unit (including arithmetic unit and controller) , Memory, input equipment, output equipment and other necessary components disclosed by the von Neumann principle.
  • the computer program is stored in its memory.
  • the central processing unit transfers the program stored in the external memory into the memory to run and execute the program.
  • the command interacts with input and output devices to complete specific functions.
  • server referred to in the present invention can also be extended to the situation of server clusters in the same way.
  • the present invention is proposed for the application scenario of the host side of live video.
  • the host uses a personal computer installed with a first operating system, such as a Windows system, as a client, and runs the video according to the present invention on the desktop.
  • the live program in the operating system can use the live program as a controller to control the flow control program to collect and preview the video stream, and further can operate the live program to drive the flow control program to push the video stream to the cloud server, which is pushed by the server For users in the live broadcast room to watch.
  • the video stream referred to in the present invention unless otherwise selectively controlled by the host user, generally can include two types of stream data, video and audio, and these video streams may not be collected by the underlying driver of the client.
  • the original data means that the anchor user can edit and process the video and/or audio with the special effects tools provided by the flow control program, so that the flow control program will finally push the edited and processed video stream to The cloud server.
  • Both the first operating system and the second operating system involved in the present invention can be various currently known operating systems or unknown operating systems, including operating systems suitable for various mobile terminals and personal computers.
  • the first operating system and the second operating system are different operating systems, so the bridging is just achieved through the simulation program.
  • the first operating system of the present invention recommends using any one of Windows or Linux and Unix-based operating systems
  • the second operating system is Android, which is different from the first operating system.
  • Any one of IOS, Linux, Windows operating system can be set as the Windows operating system and the second operating system is the Android operating system.
  • the second operating system excludes other operating systems including IOS.
  • the method includes the following steps:
  • Step S11 when the simulation program running in the current first operating system for simulating the operating environment of the second operating system starts the live program, the simulation program establishes the live program running in the operating environment and runs in the first operation
  • the first operating system of the present invention runs, for example, the Windows operating system
  • the second operating system may be, for example, the Android operating system.
  • the flow control program and the simulation program are both developed by the Windows operating system.
  • the said flow control program is actually equivalent to opening a service, which can collect video streams and realize video preview in the desktop window of the first operating system, and can push the collected video streams to the cloud with a designated cloud address.
  • the cloud server can push the video stream to the relevant participating users in the live broadcast room controlled by the host user.
  • the anchor user will run the flow control program and the simulation program first, and when the developer develops, he can also integrate the simulation program and the flow control program into the same program, so that they can call each other associatively, simplifying the anchor user Start operation.
  • the flow control program When the flow control program is initially started, it is in a stopped state by default, so there is no need to open the preview window (which can also be opened) and the corresponding tool container, and it can run in the background.
  • the simulation program When the simulation program is started, it is responsible for creating the simulation running environment of the second operating system, which actually functions as the operating system virtual machine, and finally provides a second operating system operation interface, which is convenient for the anchor user to install and start it. , Close and uninstall related applications, including the live broadcast program.
  • the simulation program establishes the communication channel in accordance with the protocol mechanism preset by the developer during or after the start-up process.
  • the communication channel includes a first direct channel between a live program and a simulation program and a second direct channel between the simulation program and the flow control program.
  • the first direct channel is mainly to maintain the message transmission between the simulation program and the live program, including two-direction message transmission, that is, the message channel from the simulation program to the live program and the message channel from the live program to the simulation program.
  • the message channel through which the simulation program transmits messages to the live broadcast program is realized by using the service components carried by the live broadcast program.
  • the code related to the service component is embedded, and the service component has been declared in its Androidmanifest.xml configuration information file. Therefore, when the live broadcast program is running, it will be parsed and registered in the simulation running environment to construct A service process.
  • the simulation program implements binding with the service process and maintains communication with it to realize inter-process communication, and can send messages to the live program through the service process, usually by forwarding and transmitting the messages generated by the flow control program.
  • the message channel through which the live broadcast program transmits messages to the simulation program implements message broadcast by using the broadcast mechanism of the second operating system itself, such as the broadcast mechanism in Android, by the live broadcast program.
  • a broadcast receiver is pre-declared in its Androidmanifest.xml file.
  • This broadcast interface device can be used to filter and receive various messages broadcast by the live broadcast program.
  • the live program uses this mechanism to include the messages that need to be broadcast into the intent to achieve broadcast.
  • the simulation program filters and receives the messages broadcast by the live program through its own broadcast receiver, and then can deliver it to all The flow control program described.
  • the second channel is mainly to maintain the message transfer between the simulation program and the flow control program running on the client. Since both the simulation program and the flow control program run in the same operating system, the two can adopt a simpler way to achieve message transmission in the same way.
  • the socket mechanism or the file read and write mechanism of the Windows system can be used to read and write the socket or file, one write and one read , To achieve message delivery.
  • the simulation program can theoretically run multiple applications developed for the second operating system. Therefore, in theory, it can be allowed to simulate multiple processes in the operating environment, in order to avoid confusion caused by multiple processes sending messages at the same time, or to clarify these processes As any one of them is the recipient of the message, you can consider letting the parties in the communication channel identify the identities of these processes. Therefore, in a modified embodiment, in the process of establishing the communication channel, the simulation program may further pass the application package name of the live program on behalf of its main process and the service name on behalf of its service process to The flow control program enables the flow control program to identify the sending identity of the message to be transmitted, and it can also clarify the receiving identity of the object whose message needs to be transmitted.
  • the flow control program when the flow control program receives a live program message from the simulation program through a socket or file, its legitimacy can be determined based on the application package name and service name; and when the flow control program needs to broadcast to a specific live program
  • the program sends a message it can specify the recipient in the message to be delivered, so that the simulation program can correctly deliver the message to the corresponding main process or service process. It can be seen that by allowing the flow control program to hold the application package name and service name of the live program, it is beneficial for the flow control program to identify the main process and service process of the live program to determine the message delivery identity.
  • Step S12 After the live broadcast program starts the preview mode, the broadcast preview message is broadcast, and the simulation program notifies the flow control program of the broadcast preview message to trigger it to enter the preview state, so that it opens the preview window to display the video stream it collects:
  • the simulation program After the live broadcast program is started, the simulation program has also established the communication channel. Therefore, barrier-free communication between the live broadcast program and the flow control program can be realized through the simulation program, and the anchor user can perform regular routines. Live broadcast operation.
  • an entry or control or other control method related to the start of the preview mode will be provided on the live program interface, or directly when the user switches to a certain page, it is regarded as the start of the preview mode.
  • the live broadcast program will be triggered in this mode, taking the method in the Android system as an example, construct an intent, and run it in the simulation Broadcasting a message in the environment that indicates that the anchor user needs to start the broadcast preview is called the start broadcast preview message.
  • the broadcast receiver registered by the simulation program will receive the broadcast preview message, and after filtering the reception, it can write it to the relevant socket in accordance with the rules and format agreed with the flow control program Or in the file.
  • the flow control program reads the on-air preview message from the socket or file according to the method pre-agreeed with the simulation program, and is triggered by it to switch itself into the preview state.
  • the preview state open a preview window for displaying images in the current window or by creating a new window.
  • the flow control program will also control the camera and audio circuit to collect the video stream for it by calling the underlying driver of the first operating system. Unless the host user has a setting that prohibits immediate display for safety reasons, the video stream will be synchronized. Displayed in the preview window.
  • the flow control program itself is a program developed for the first operating system, it does not need to be converted by different operating system mechanisms. Therefore, it will have a higher video stream acquisition efficiency, ensure the video stream acquisition quality, and minimize the time The impact of problems such as delay and dropped frames.
  • the tool container is usually represented as a toolbar, which can be an independent window or integrated with other windows such as the preview window into the same window.
  • the tool container can generally provide multiple controls, and the functions implemented by these controls may be different.
  • a typical application is to provide one or more special effect controls in the tool container.
  • the host user can manipulate one or more such controls to perform special effects processing on the video effect, so that the final video image displayed in the preview window appears Corresponding special effects, and these special effects can be superimposed on the video stream data, and subsequently pushed to the live room users to watch.
  • the tool container may of course also include controls that act on the preview video in the preview window to achieve other different functions, which should be understood in the art.
  • the flow control program can generate relevant messages in response to the manipulation of the controls, and send them back to the live program through the communication channel. , So that the live program can make further decisions and processing accordingly.
  • Step S13 After the live broadcast program starts the broadcast mode, it broadcasts the cloud address message it has acquired for receiving the video stream, and the simulation program notifies the cloud address message to the streaming control program to trigger it to enter the broadcast state, so that It transmits the video stream to the corresponding cloud address:
  • the live broadcast program can provide a control or any other method recognized by the live broadcast program to initiate the start of the broadcast mode to the live broadcast program. instruction.
  • the live broadcast program is triggered by the start instruction of the host user, and according to the design logic of the program developer, the cloud address used to upload the video stream can be obtained from the cloud server first.
  • the live broadcast program will query the authentication service of the cloud server after passing the authentication, and then obtain the cloud address by querying the stream management service of the cloud server.
  • These methods involving security and addressing are all known to those skilled in the art, and do not affect the creative spirit and protection scope of the present invention, and will not be repeated.
  • the live broadcast program will obtain the cloud address provided by the cloud server through certain code logic.
  • the cloud address can theoretically be used to push the video stream collected by the live broadcast program itself, or it can be used to provide the flow control program for execution. Pushing the video stream collected by the flow control program, the present invention focuses on the latter.
  • the live streaming program broadcasts a cloud address message by constructing an intent according to the broadcast mechanism of the second operating system such as Android, that is, the cloud address is included in the intent and becomes the message body, Broadcast in a simulated operating environment.
  • the second operating system such as Android
  • the broadcast receiver pre-registered by the simulation program will filter and receive the cloud address message, and then write through the socket or file channel, and the flow control program will The socket or file is read to obtain the cloud address message, and the simulation program also completes the task of notifying the cloud address message to the flow control program.
  • the stream control program After the stream control program receives the cloud address message, it is triggered by this notification and enters the on-air state, so it can call the communication interface of the first operating system, transmit the video stream to the cloud address, and upload the video stream to Corresponding remote server, and the remote server will push this video stream directly or after processing to each user in the live broadcast room where the anchor user is located, and finally display it on the desktop of these users.
  • the flow control program can reversely send the corresponding message back to the live program through the communication channel in the above manner, so as to allow the host The user makes further adjustments and controls.
  • the simulation program notifies the stream control program of the preview stop broadcast message to trigger it to enter the stop broadcast state, and stop pushing the video stream to the cloud address:
  • the host user When the host user wants to end the live broadcast, similarly, he can issue a preview stop broadcast instruction to the live broadcast program.
  • the live broadcast program then constructs a message body according to the aforementioned broadcast mechanism to broadcast the preview stop broadcast message.
  • the simulation program filters through its broadcast receiver and receives the preview stop-broadcast message, it notifies it to the flow control program through a socket or a file.
  • the flow control program obtains the notification by reading the socket or the file, it triggers itself to switch to the stop state, so it can close the previously opened preview window and/or tool container, and synchronously stop pushing the cloud address to the cloud address.
  • the entire live broadcast process is over.
  • this method makes the live broadcast process of the host user on the personal computer more smooth, even if the operating system of the live broadcast program used by the host is not the operating system of the personal computer, it can still be used.
  • the simulation program and the flow control program of this method realize smooth and high-definition video live broadcast. Accordingly, developers only need to develop one live broadcast program, which can be applied to two operating systems.
  • a typical embodiment of the video live broadcast bridge method of the present invention is actually a specific application example obtained on the basis of each embodiment of the video live broadcast control method of the present invention, which is the basis for the realization of the simulation program Therefore, it involves the establishment principle and process of the communication channel, so I won’t repeat it.
  • This method includes the following steps:
  • Step S21 creating a second operating system simulation operating environment different from the current first operating system for running the live program:
  • the simulation program acts as the virtual machine of the operating system and runs in the first operating system such as Windows
  • a simulation operating environment of the second operating system such as Android is created to run the video stream controller. Live program.
  • Step S22 establishing a communication channel between the live broadcast program and the flow control program running in the current first operating system:
  • the second direct channel can be established with the flow control program through sockets or file reading and writing, and the live program can be established with the live program.
  • the first direct channel mainly includes the message channel from the broadcast message initiated by the live program using the broadcast mechanism to the broadcast receiver pre-registered by the simulation program, and the reverse from the simulation program to the live program.
  • Step S23 forwarding the on-air preview message broadcast by the live program to the stream control program via the communication channel, and trigger it to enter the preview state so as to preview the video stream it collects:
  • the simulation program uses the communication channel, with the aid of its broadcast receiver, to subsequently receive the start-up preview message broadcast by the live program, and then through the communication channel, use sockets or file read and write methods to transfer
  • the broadcast preview message is passed to the flow control program, thereby triggering the flow control program to enter the preview state. Accordingly, as mentioned above, the flow control program can start to collect the video stream and output the video stream to the preview
  • the window is for the anchor user to preview.
  • Step S24 forwarding the cloud address message broadcast by the live broadcast program to the stream control program via the communication channel, triggering it to enter the on-air state, so as to push the video stream to the cloud address:
  • the simulation program After the simulation program receives the cloud address message broadcast by the live broadcast program through the communication channel, with the help of its broadcast receiver, it can use the socket or file reading and writing method through the communication channel.
  • the cloud address message is passed to the flow control program, thereby triggering the flow control program to enter the broadcast state. In this state, the flow control program starts to push the collected video stream to the cloud address.
  • the stream may further include special effects loaded by the host user.
  • the simulation program After the simulation program obtains the preview stop message broadcast by the live program from the communication channel by means of its broadcast receiver, the message is transferred to the flow control program by writing a socket or a file in the same way.
  • the stream control program obtains the notification of the message through the corresponding reading socket or file, triggers itself to switch to the stop broadcast state, and closes the preview window and tool container that have been opened before, and stops pushing the video stream to the cloud address.
  • Users in the live broadcast room will also not be able to obtain the real-time video stream of the anchor user.
  • the simulation program actually plays the role of the operating system virtual machine and acts as a bridge between the flow control program of the first operating system and the live program of the second operating system.
  • the simulation program can actually provide a running environment for the live program of any operating system, and it can be adapted to the flow control program.
  • the role of standardized interfaces helps to avoid repeated development by developers for the live broadcast program itself.
  • a typical embodiment of the video live streaming control method of the present invention is actually a specific application example obtained on the basis of the various embodiments of the video live streaming control method of the present invention, and is an implementation of the streaming control program.
  • Step S31 Receive the start-up preview message forwarded by the simulation program used to provide the simulation running environment of the second operating system, start the preview window to display the video stream collected by the current bottom driver of the first operating system, and enter the preview state:
  • the flow control program of the present invention when it is running, it is in the off-broadcast state by default, but it uses the socket or file used in the communication channel mechanism to obtain the message passed by the simulation program.
  • it obtains the start preview message initiated by the live program it triggers itself to enter the preview state, starts a preview window, and calls the underlying driver of the current first operating system, such as audio driver or camera driver, To capture the video stream, display the obtained video stream in the preview window for the anchor user to preview.
  • the underlying driver of the current first operating system such as audio driver or camera driver
  • Step S32 Receive the message containing the cloud address transmitted by the simulation program, enter the on-air state, and push the video stream to the cloud address:
  • the streaming program will further obtain the cloud address message broadcast by the live program and transmitted by the simulation program through a socket or file, obtain the cloud address from it, and then send it to the Pushing the video stream by the cloud address means that the stream control program has entered the start state, and the host user's video stream is pushed to the live room user via the remote server.
  • Step S33 Receive the preview stop broadcast message delivered by the simulation program, enter the stop broadcast state, and end the push of the video stream:
  • the streaming control program can obtain the stop-broadcast message broadcasted by the live program transmitted by the simulation program through the socket or file in the same way, thereby triggering itself to return to the stop-broadcasting state. In this state, The flow control program will end pushing the video stream collected by the machine to the cloud address.
  • the flow control program can also close various open windows and containers, including the preview window and tool container.
  • the flow control program can pass through the socket
  • the word or file sends a notification message to the simulation program.
  • the notification message can be fed back to the live program by the simulation program through the service process, and the main process of the live program can display it on the interface in the simulation running environment for the anchor user to know.
  • the streaming control program functions as a standardized and independent service for pushing video streams.
  • the simulation program and the live streaming program comply with their communication methods, they can be called. Collect and push video streams to remote servers.
  • the streaming program is opened for service in this way, the development work of the developers of the live program will become simple, and only need to debug and adapt the simulation program and the existing live program belonging to the second operating system to make it compatible with The flow control program is fine.
  • the typical embodiment of the live video broadcast control method of the present invention is actually a specific application example obtained on the basis of the various embodiments of the live video control method of the present invention, and is a result of the implementation of the live broadcast program.
  • Dependent method so it involves the establishment principle and process of communication channel, so I won’t repeat it. This method includes the following steps:
  • Step S41 in response to the start preview mode command acting on the application program in the second operating system simulation running environment, trigger the display of the preview window in the first operating system providing the simulation running environment to display the information via the first operating system
  • the live program can be installed and run in the simulation running environment of the second operating system created by the simulation program.
  • the broadcast mechanism of the second operating system is used in the live program to broadcast messages to the simulation program, and a service component can be carried to construct a service process that communicates with the simulation program, so that it can receive messages from the simulation program in reverse.
  • the program and the flow control program communicate with each other through reading and writing sockets and files. Therefore, once the live broadcast program runs successfully, the communication channel between the programs is established.
  • the host user initiates the preview mode command through the user interface of the live broadcast application, and the command is transmitted to the first operating system through the simulation program in the form of broadcast start preview message, and the first operating system ,
  • the message can be read and responded to by a service such as a flow control program, so as to display a preview container on the desktop of the first operating system according to the logic of the flow control program, and at the same time, call the first
  • the bottom layer driver of the operating system collects the video stream, and outputs the collected video stream for display in the preview window.
  • Step S42 in response to the start-up mode instruction acting on the application program, trigger the first operating system to call the remote interface to push the video stream to the cloud address obtained and provided by the application program:
  • the host user When the host user confirms to start the live broadcast, he can initiate an instruction to start the broadcast mode through the entry or control provided by the application program, that is, the live broadcast program.
  • the live program will first query the authentication service and stream management service of the cloud server, and obtain the cloud address used by the cloud server to receive the video stream of the host user.
  • the live program uses the broadcast mechanism of the second operating system. A message containing the cloud address is broadcast in the simulation operating environment, and the simulation program obtains the message and writes it into a socket or file for reading by the first operating system.
  • the first operating system is triggered by this message, and can obtain the cloud address through a stream control program such as the aforementioned, and then call the remote interface to push the video stream to the remote server pointed to by the cloud address, and the remote server will The video stream is pushed to the users in the live broadcast room.
  • a stream control program such as the aforementioned
  • Step S43 in response to the preview stop instruction acting on the application program, trigger the bottom layer driver of the first operating system to stop collecting the video stream:
  • the preview stop instruction is sent to the live broadcast program.
  • the instruction is transmitted to the first operating system through the simulation program in the form of broadcast, it triggers the underlying driver of the first operating system to stop collecting the said The video stream, correspondingly, closes the start state and enters the stop state.
  • the live broadcast program functions as a playback controller for the video stream in the live broadcast room. Although it runs in the memory space of the simulated operating environment based on the first operating system, It was developed for the second operating system. Therefore, developers do not need to develop and maintain the live program for the first operating system, as long as the live program includes a configuration that can be switched to run in the simulated operating environment. When the live program leaves the first operating system and runs in the real second operating system, it can still resume its normal function of collecting and pushing video streams by relying on its own software design logic.
  • a client including a central processing unit and a memory, and the central processing unit is configured to call and run the live program, streaming program, and bridge program stored in the memory. Any one or any more of them can execute each step in the above-mentioned related method embodiment of the present invention corresponding to each program, so as to facilitate the physical manipulation of the anchor user.
  • the present invention can prevent programmers from developing different live programs for different operating systems, and can provide host users with live programs developed for the second operating system on a personal computer using the first operating system, and can ensure The image quality of the video stream collected by the live video broadcast.
  • the package of the present invention relates to a device for performing one or more of the operations and methods described in the present invention.
  • These devices may be specially designed and manufactured for the required purpose, or may also include known devices in general-purpose computers.
  • These devices have computer programs stored in their memory, which are selectively activated or reconfigured.
  • Such a computer program may be stored in a device (for example, a computer) readable medium or in any type of medium suitable for storing electronic instructions and respectively coupled to a bus.
  • the computer readable medium includes, but is not limited to, any Types of disks (including floppy disks, hard disks, CD-ROMs, CD-ROMs, and magneto-optical disks), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory) , Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the readable medium includes any medium that stores or transmits information in a readable form by a device (for example, a computer).
  • a device for example, a computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

一种视频直播控制、桥接、流控、播控方法及客户端。该控制方法包括:运行在当前第一操作***的用于模拟第二操作***的运行环境的模拟程序启动直播程序时,建立直播程序与运行于第一操作***中的流控程序的通信通道;直播程序启动预览模式后广播开播预览消息,模拟程序将该开播预览消息通知流控程序以触发其进入预览状态,使其开启预览窗口显示视频流;直播程序启动开播模式后,广播其所获取的用于接收所述视频流的云端地址消息,模拟程序将该云端地址消息通知给流控程序,以触发其进入开播状态,向云端地址传输所述的视频流。本发明能够避免程序人员为不同操作***开发不同的直播程序,并能确保视频直播所采集的视频流的图像质量。

Description

视频直播控制、桥接、流控、播控方法及客户端
本申请要求于2020年4月10日提交中国专利局、申请号为202010281352.4、发明名称为“视频直播控制、桥接、流控、播控方法及客户端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机***通信技术,尤其涉及一种视频直播控制方法及相应的客户端,相应也涉及该控制方法执行期间相关的视频直接桥接方法、视频直播流控方法以及视频直播播控方法。
背景技术
在一种操作***中通过模拟器运行为另一操作***开发的应用程序的技术虽然已经非常普遍,但在一些特殊的应用场景中,仍然存在很多技术障碍。一个非常普遍的场景中,在涉及到需要与云端交换大流量音视频数据的情况下,由于跨***交互涉及到的一些效率问题,常出现不理想的情况。
举例而言,最为基本的应用情况下,互联网视频直播平台在发布开播工具的时候,为了保证各个平台的主播都能覆盖到,通常会发布三个应用:PC开播应用、Android开播应用、IOS开播应用。这三个应用分别运行在windows***的电脑上、Android手机上和苹果手机上。
这三个应用的大部分业务功能完全相同,但由于这三个应用的开发语言和开发环境完全不同,就导致同一个业务场景,需要PC研发、Android研发、IOS研发分别开发一遍。并且在后期维护的过程中,也需要三个平台的研发对该应用分别进行维护,这样做就会造成不必要的人力浪费。
在这种背景下,为了节省掉PC那一部分的工期,开发者会选择让主播端在PC上安装定制的模拟器,先在PC机器上建立起适合Android的App运行的环境,然后在模拟器里面安装Android开播工具,这样研发只需要开发Android开播应用,就可以满足PC、Android这两个平台的使用需求。
这种方案虽然节省了PC研发的人力,但是也存在一些问题,实际运行中发现,由于开播预览页面并不是完全的PC端采集和显示,导致有一部分的机型会出现花屏、卡顿等问题,导致相应的直播间性能也非常的差,从而严重影响直播的用户体验。
理论上,不局限于PC端的Windows操作***和手机端的Android操作***,只要涉及到在一个操作***中运行为另一操作***开发的应用程序,特别是涉及到如直播这种应用需求时,均可能遭遇相同或相似的情形。
发明内容
本发明出于避免重复开发的第一目的而提供一种视频直播控制方法、一种视频直播桥接方法、一种视频直播流控方法以及一种视频直播播控方法。
本发明的第二目的在于提供一种客户端,以便为第一目的的和种方法实现硬件支持。
为满足本发明的各个目的,本发明提供如下技术方案:
本发明的一种视频直播控制方法,包括如下步骤:
运行在当前第一操作***的用于模拟第二操作***的运行环境的模拟程序启动直播程序时,模拟程序建立运行于所述运行环境中的所述直播程序与运行于第一操作***中的流控程序的通信通道;
所述直播程序启动预览模式后,广播开播预览消息,模拟程序将该开播预览消息通知流控程序以触发其进入预览状态,使其开启预览窗口用于显示其所采集的视频流;
所述直播程序启动开播模式后,广播其所获取的用于接收所述视频流的云端地址消息,模拟程序将该云端地址消息通知给流控程序,以触发其进入开播状态,使其向相应的云端地址传输所述的视频流。
进一步的实施例中,本方法还包括如下步骤:
直播程序关闭时,广播预览停播消息,模拟程序将该预览停播消息通知流控程序以触发其进入停播状态,停止向云端地址推送所述视频流。
较佳的实施例中,所述通信通道包括直播程序与模拟程序之间的第一 直接通道和所述模拟程序与所述流控程序之间的第二直接通道。
部分实施例中,按照如下方式建立所述的第一直接通道:所述直播程序携带注册到所述模拟运行环境中的服务组件,所述模拟程序携带注册到所述模拟运行环境中的广播接收器,所述模拟程序通过该服务组件构建的服务进程向该直播程序传递所述流控程序产生的消息;所述模拟程序通过所述广播接收器接收所述直播程序广播的消息,将其传递给所述的流控程序。
部分实施例中,按照如下方式建立所述的第二直接通道:所述模拟程序与所述流控程序之间通过彼此读写套接字或文件的方式建立所述的第二直接通道。
较佳的实施例中,所述模拟程序与流控程序适于运行于当前第一操作***,所述直播程序适于运行于区别于当前操作***的第二操作***,所述模拟程序适于在第一操作***中模拟所述第二操作***而为该直播程序创建相应的模拟运行环境。
部分实施实施例中,所述第一操作***为Windows或基于Linux、Unix的操作***中的任意一种,所述第二操作***为与第一操作***相异的Android、IOS、Linux、Windows操作***中的任意一种。
较佳的实施例中,所述模拟程序建立所述通信通道的过程中,将直播程序代表其主进程的应用包名及代表其服务进程的服务名传递给所述流控程序,以供所述流控程序识别所述直播程序的主进程和服务进程以便确定消息传递身份。
部分实施例中,所述流控程序进入预览状态时,开启用于控制其所采集的视频流的工具容器,该工具容器包括至少一个能够影响所述预览窗口的预览视频的特效的控件,作用于该控件而产生的消息通过所述通信通道传递给所述的直播程序。
较佳的实施例中,所述流控程序进入停播状态时,关闭所述的预览窗口。
本发明的一种视频直播桥接方法,包括如下步骤:
创建区别于当前第一操作***的第二操作***模拟运行环境,供运行 直播程序;
建立所述直播程序到在当前第一操作***中运行的流控程序之间的通信通道;
经由所述的通信通道,转发所述直播程序广播的开播预览消息给所述流控程序,触发其进入预览状态以便预览其所采集的视频流;
经由所述的通信通道,转发所述直播程序广播的云端地址消息给所述流控程序,触发其进入开播状态,以向所述云端地址推送所述的视频流。
进一步的实施例中,本方法还包括如下步骤:
经由所述的通信通道,转发所述直播程序广播的预览停播消息给所述流控程序,触发其进入停播状态,以结束所述视频流的推送。
较佳的实施例中,所述通信通道包括由本方法所实现的模拟程序与直播程序之间的第一直接通道和所述模拟程序与所述流控程序之间的第二直接通道。
部分实施例中,按照如下方式建立所述的第一直接通道:所述直播程序携带注册到所述模拟运行环境中的服务组件,所述模拟程序携带注册到所述模拟运行环境中的广播接收器,所述模拟程序通过该服务组件构建的服务进程向该直播程序传递所述流控程序产生的消息;所述模拟程序通过所述广播接收器接收所述直播程序广播的消息,将其传递给所述的流控程序。
部分实施例中,按照如下方式建立所述的第二直接通道:所述模拟程序与所述流控程序之间通过彼此读写套接字或文件的方式建立所述的第二直接通道。
较佳的实施例中,所述模拟程序建立所述通信通道的过程中,将直播程序代表其主进程的应用包名及代表其服务进程的服务名传递给所述流控程序,以供所述流控程序识别所述直播程序的主进程和服务进程以便确定消息传递身份。
本发明的一种视频直播流控方法,包括如下步骤:
接收用于提供第二操作***的模拟运行环境的模拟程序转发的开播预览消息,启动预览窗口显示经由当前第一操作***的底层驱动采集的视频 流,进入预览状态;
接收所述模拟程序传递的包含云端地址的消息,进入开播状态,向该云端地址推送所述的视频流;
接收所述模拟程序传递的预览停播消息,进入停播状态,结束所述视频流的推送。
部分实施例中,当进入预览状态时,开启用于控制所述视频流的工具容器,该工具容器包括至少一个能够影响所述预览窗口的预览视频的特效的控件。
部分实施例中,当进入停播状态时,关闭所述的预览窗口。
较多佳的实施例中,实现了本方法的流控程序与所述模拟程序之间,通过彼此读写套接字或文件的方式实现通信,以实现所述消息的传递。
部分实施例中,实现了本方法的流控程序向模拟程序发送通知消息,以便使该通知消息显示到该模拟程序创建的所述模拟运行环境中。
本发明的一种视频直播播控方法,包括如下步骤:
响应于在第二操作***模拟运行环境中作用于本应用程序的启动预览模式指令,触发提供该模拟运行环境的第一操作***中显示预览窗口,以显示经由该第一操作***的底层驱动所采集的视频流;
响应于作用于本应用程序的启动开播模式指令,触发所述第一操作***调用远程接口将该视频流推送到本应用程序获取并提供的云端地址;
响应于作用于本应用程序的预览停播指令,触发所述第一操作***的底层驱动停止采集所述的视频流。
进一步的实施例中,所述第一操作***运行一模拟程序用于创建所述的第二操作***模块运行环境,所述第一操作***运行一流控程序用于实现对所述底层驱动采集视频流的动作和对推送所述视频流的动作的执行。
部分实施例中,实现了本方法的直播程序以第二操作***的广播机制的广播方式发出消息以实现对所述第一操作***的触发操作。
部分实施例中,实现了本方法的直播程序携带用于接收所述第一操作***中产生的消息的服务组件,以便将所述第一操作中产生的消息显示给用户。
较佳的实施例中,所述第一操作***为Windows或基于Linux、Unix的操作***中的任意一种,所述第二操作***为与第一操作***相异的Android、IOS、Linux、Windows操作***中的任意一种。
本发明的一种客户端,包括中央处理器和存储器,所述中央处理器用于调用运行存储于所述存储器中的一个或多个计算机程序以执行如前所述的各种由本发明第一目的提供的方法。
相对于现有技术,本发明的优势如下:
本发明的视频直播控制方法,由运行于第一操作***的流控程序负责采集推送视频流实现流控、由运行于第一操作***的模拟程序负责创建第二操作***模拟运行环境以加载运行直播程序并负责直播程序与流控程序之间的消息传递实现桥接、由直播程序承担起用户控制终端的作用而实现播控,由此,为第二操作***开发的直播程序便可以运行于第一操作***中,直播程序负责控制播放状态的控制,在模拟程序的桥接作用实现消息传递的辅助下,流控程序可以调用第一操作***的底层驱动接口采集视频流并直接推送给由直播程序提供的云端地址,视频流无需经过模拟程序和直播程序中转,由此可大大提高视频流的推送效率,当视频流被云端服务器接收并推送到直播间用户的终端设备时,用户可以获得高保真的视频流而获得较为清晰的视频观看效果。据此,开发人员无需适应第一操作***的机制和开发语言重新开发和维护另一版本的所述直播程序,可以大大节省程序开发消耗,而节省开发成本。
依据本发明的视频直播桥接方法所实现的模拟程序,不仅可以在第一操作***中模拟出第二操作***的运行环境,以便确保直播程序在其中正常调用和运行,而且,通过建立直播程序与流控程序之间的通信通道,实现消息桥接机制,在事实上为视频流和直播控制的分离创造了基础条件,推而广之,只要相关应用程序遵守该模拟程序的接口规范,该模拟程序便可为之服务,提供到所述流控程序之间的对接通道,因此,该桥接方法相当于为不同操作***的应用程序提供了运行于第一操作***且能实现视频流分离采集和推送的服务机制,便于互联网开发者适配调用,方便兼容不同开发者开发的第二操作***的应用程序。
依据本发明的视频直播流控方法所实现的流控程序,其运行于第一操作***,专门负责视频流的采集、推送和预览,且可通过相应的通信通道经模拟程序与为第二操作***开发的直播程序提供推送视频流的服务,方便主播用户在第一操作***(一般是PC机)上进行观看和操作,更方便操控,可获得更佳的预览效果。此外,由于其遵守了与模拟程序之间的通信通道的机制,例如通过套接字(Socket)或文件读写的方式与模拟程序实现消息传递,由此,实际上也相当于提供了标准接口,方便为不同的模拟程序服务,方便接入不同开发者为第二操作***开发的虚拟机,从而便于通过匹配不同的虚拟机,在第一操作***上兼容更多类型的第二操作***的直播程序并为其提供推流服务。
依据本发明的视频直播播控方法所实现的直播程序,只要按照该方法实现相关响应和消息广播,便可接入本发明的运行于第一操作***的模拟程序,而运行于该模拟程序创建的模拟运行环境中,实现将自身的推流功能转移到第一操作***进行预览、采集以及推送的效果,由此,理论上,直播程序还可以实现轻量开发,自身未必需要提供完整的预览、采集以及推送视频流的相关功能。当然,实际开发中,开发者往往会提供全功能的直播程序,无论如何,为第二操作***开发的所述直播程序,只要遵守本播控方法的规范,便可接入所述的模拟程序,而虚拟运行于第一操作***中,实现功能扩展,方便主播用户操作。
本发明附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本发明的实践了解到。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本发明的视频直播控制方法的典型实施例的流程示意图;
图2为本发明的视频直播桥接方法的典型实施例的流程示意图;
图3为本发明的视频直播流控方法的典型实施例的流程示意图;
图4为本发明的视频直播播控方法的典型实施例的流程示意图。
具体实施方式
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能解释为对本发明的限制。
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本发明的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。应该理解,当我们称元件被“连接”或“耦接”到另一元件时,它可以直接连接或耦接到其他元件,或者也可以存在中间元件。此外,这里使用的“连接”或“耦接”可以包括无线连接或无线耦接。这里使用的措辞“和/或”包括一个或更多个相关联的列出项的全部或任一单元和全部组合。
本技术领域技术人员可以理解,除非另外定义,这里使用的所有术语(包括技术术语和科学术语),具有与本发明所属领域中的普通技术人员的一般理解相同的意义。还应该理解的是,诸如通用字典中定义的那些术语,应该被理解为具有与现有技术的上下文中的意义一致的意义,并且除非像这里一样被特定定义,否则不会用理想化或过于正式的含义来解释。
本技术领域技术人员可以理解,这里所使用的“客户端”、“终端”、“终端设备”既包括无线信号接收器的设备,其仅具备无发射能力的无线信号接收器的设备,又包括接收和发射硬件的设备,其具有能够在双向通信链路上,进行双向通信的接收和发射硬件的设备。这种设备可以包括:蜂窝或其他诸如个人计算机、平板电脑之类的通信设备,其具有单线路显示器或多线路显示器或没有多线路显示器的蜂窝或其他通信设备;PCS(Personal Communications Service,个人通信***),其可以组合语音、数据处理、传真和/或数据通信能力;PDA(Personal Digital Assistant,个 人数字助理),其可以包括射频接收器、寻呼机、互联网/内联网访问、网络浏览器、记事本、日历和/或GPS(Global Positioning System,全球定位***)接收器;常规膝上型和/或掌上型计算机或其他设备,其具有和/或包括射频接收器的常规膝上型和/或掌上型计算机或其他设备。这里所使用的“客户端”、“终端”、“终端设备”可以是便携式、可运输、安装在交通工具(航空、海运和/或陆地)中的,或者适合于和/或配置为在本地运行,和/或以分布形式,运行在地球和/或空间的任何其他位置运行。这里所使用的“客户端”、“终端”、“终端设备”还可以是通信终端、上网终端、音乐/视频播放终端,例如可以是PDA、MID(Mobile Internet Device,移动互联网设备)和/或具有音乐/视频播放功能的移动电话,也可以是智能电视、机顶盒等设备。
本发明所称的“服务器”、“客户端”、“服务节点”等名称所指向的硬件,本质上是具备个人计算机等效能力的设备,为具有中央处理器(包括运算器和控制器)、存储器、输入设备以及输出设备等冯诺依曼原理所揭示的必要构件的硬件装置,计算机程序存储于其存储器中,中央处理器将存储在外存中的程序调入内存中运行,执行程序中的指令,与输入输出设备交互,借此完成特定的功能。本发明所称的“服务器”这一概念,同理也可扩展到适用于服务器机群的情况。
本发明是为视频直播的主播端的应用场景而提出的,在这种场景中,主播采用一台安装有第一操作***例如Windows***的个人计算机作为客户端,在桌面操作运行依据本发明的视频直播桥接方法实现的模拟程序和依据本发明的视频直播流控方法实现的流控程序,在模拟程序运行后形成的界面中,打开依据本发明的视频直播播控方法实现的适用于运行在第二操作***中的直播程序,便可通过直播程序作为控制器,控制流控程序采集和预览视频流,进一步还可通过操作直播程序,驱动流控程序将视频流推送到云端服务器,由服务器推送给直播间中的用户观看。
应当理解,在这样的场景中,本发明所称的视频流,除非主播用户另行选择性控制,一般均可包括视频和音频两类流数据,而这些视频流也未 必是客户端的底层驱动所采集的原始数据,意味着主播用户可以藉由例如所述流控程序提供的特效工具对所述的视频和/或音频进行编辑和处理,以便流控程序最终将编辑和处理后的视频流推送给所述的云端服务器。
本发明所涉及的第一操作***与第二操作***,均可以为目前已知的各种操作***,也可以是未知的操作***,包括适用于各种移动终端和个人计算机的操作***。通常第一操作***和第二操作***是不同的操作***,因此正好通过所述的模拟程序实现桥接。根据目前的操作***生态,本发明的所述第一操作***推荐使用Windows或基于Linux、Unix的操作***中的任意一种,所述第二操作***为与第一操作***相异的Android、IOS、Linux、Windows操作***中的任意一种。例如,本发明的后续揭示的各种实施例,为描述的方便,均可设定所述第一操作***为Windows操作***,而第二操作***为Android操作***,但不应理解本发明的第二操作***排斥了包括IOS在内的其他操作***。
本发明所称的各程序,虽采用静态的表述,但本领域技术人员应当理解,当程序运行于个人计算机或相关设备中时,其在内存中表现为动态的进程,而进程的功能实现,正是程序的代码得以在计算机中执行使然,因此程序与进程之间的这种相应性,不应构成影响本发明的发明精神和保护范围的障碍。
需要指出的是,本发明即将揭示的各种方法的实施例,均是基于同一发明原理获得的不同部分或不同形式,因此,除非明文声明,否则,本领域技术人员不应因各实施例之间的分开阐述而机械分割各实施例之间的关联性。
请参阅图1,本发明的视频直播控制方法的一种典型实施例中,该方法包括如下步骤:
步骤S11,运行在当前第一操作***的用于模拟第二操作***的运行环境的模拟程序启动直播程序时,模拟程序建立运行于所述运行环境中的所述直播程序与运行于第一操作***中的流控程序的通信通道:
如前所述,本发明第一操作***运行例如Windows操作***,所述的 第二操作***例如可为Android操作***,所述直播程序适应Android的机制而开发,适于运行在Android操作***的移动终端中。所述的流控程序和模拟程序均为Windows操作***而开发。所述的流控程序事实上相当于开放了一个服务,可以采集视频流并实现在第一操作***的桌面窗口中进行视频预览,且可将所采集的视频流推送到指定了云端地址的云端服务器处,以便该云端服务器可以将视频流推送给主播用户所控制的直播间的各个相关参与用户。
通常,主播用户会先行运行所述的流控程序和模拟程序,而开发者开发时,也可将模拟程序和流控程序集成为同一程序,使其彼此之间实现关联性调用,简化主播用户的启动操作。
所述的流控程序初始启动时,默认处于停播状态,因而不必打开预览窗口(也可打开)和相应的工具容器,可处于后台运行。
所述的模拟程序启动时,则负责创建所述第二操作***的模拟运行环境实际上起到操作***虚拟机的作用,最终提供一个第二操作***操作界面,方便主播用户在其中安装、开启、关闭、卸载相关应用程序,包括所述的直播程序。
所述的模拟程序在其启动过程或者启动后,依照开发人员预设的协议机制,建立所述的通信通道。所述通信通道包括直播程序与模拟程序之间的第一直接通道和所述模拟程序与所述流控程序之间的第二直接通道。
第一直接通道主要是为了维持模拟程序与直播程序之间的消息传递,包括两个方向的消息传递,即模拟程序向直播程序传递的消息通道,和直播程序向模拟程序传递的消息通道。
模拟程序向直播程序传递消息的消息通道,是通过利用直播程序所携带的服务组件来实现的。直播程序在开发时,便嵌入了服务组件相关的代码,在其Androidmanifest.xml配置信息文件中已经声明了该服务组件,因此,在直播程序运行时会被解析注册到模拟运行环境中,从而构造一个服务进程。所述模拟程序通过与该服务进程实施绑定并维护与其通信,实现进程间通信,便可通过该服务进程向直播程序发送消息,通常是转发传递所述流控程序产生的消息。
直播程序向模拟程序传递消息的消息通道,是通过直播程序运用第二操作***自身的广播机制的方式,例如Android中的广播机制的方式,来实现消息广播的。而模拟程序中则在其Androidmanifest.xml文件中预先声明了一个广播接收器,这个广播接口器便可用于过滤和接收直播程序广播的各种消息。所述直播程序利用这个机制,将需要广播的消息包含到intent中实现广播,所述模拟程序通过其自身的广播接收器过滤和接收所述直播程序广播的消息,然后便可将其传递给所述的流控程序。
第二通道主要是为了维持模拟程序与客户端在运行的所述流控程序之间的消息传递。由于模拟程序与流控程序均运行于同一操作***中,所以,两者可以同理采用更为简便的方式来实现消息传递。例如在Windows操作***中,模拟程序与流控程序之间,可以借助Windows***的套接字(Socket)机制或者文件读写机制,彼此读写所述的套接字或文件,一写一读,来实现消息传递。
由此可见,经过上述的过程中,直播程序、模拟程序以及流控程序之间便起立了端到端的通信通道。
模拟程序理论上可以运行多个为第二操作***开发的应用程序,因此,理论上可以允许其模拟运行环境中存在多个进程,为了避免多个进程同时发送消息导致混淆,或者为了明确这些进程中的任何一个作为消息接收对象,可以考虑让通信通道中的各方识别这些进程的身份。因此,一种变化的实施例中,在建立所述通信通道的过程中,所述模拟程序可以进一步将所述直播程序的代表其主进程的应用包名以及代表其服务进程的服务名传递给所述的流控程序,使得所述流控程序可以识别传递消息的发送身份,也可以明确其自身消息需要传递的对象的接收身份。由此,当流控程序通过套接字或文件接收到模拟程序传递过来的某直播程序的消息时,可依据应用程序包名和服务名确定其合法性;而当流控程序要向特定的直播程序发送消息时,便可在待传递的消息中指明接收对象,以便模拟程序将该消息正确传递给相应的主进程或服务进程。可见,通过让流控程序持有直播程序的应用包名和服务名,有利于流控程序识别所述直播程序的主进程和服务进程以便确定消息传递身份。
步骤S12,所述直播程序启动预览模式后,广播开播预览消息,模拟程序将该开播预览消息通知流控程序以触发其进入预览状态,使其开启预览窗口用于显示其所采集的视频流:
在直播程序启动后,模拟程序也已经建立了所述的通信通道,因此,直播程序与所述流控程序之间便可通过所述模拟程序实现无障碍的通信,主播用户由此可以进行常规的直播操作。
按照一般的直播控制程序,直播程序界面上会提供一个启动预览模式相关的入口或控件或其他控制方式,或者,直接在用户切换到某个页面上时,便视为启动预览模式。
无论以何种方式发送预览指令促使直播程序进入所述的启动预览模式,直播程序均会在这一模式被触发后,以Android***中的方法为例,构造一个intent,在所述的模拟运行环境中广播一个表征主播用户需要进行开播预览的消息,称为开播预览消息。
依照Android的操作***原理,模拟程序已注册的广播接收器会接收到该开播预览消息,过滤接收后,便可依照与流控程序协议好的规则和格式,将其写入相关的套接字或文件中。
相应的,流控程序依照与模拟程序预协议的方法,从所述的套接字或文件中读取到该开播预览消息,受其触发,便使自身切换进入预览状态。在预览状态下,在当前窗口或者通过创建新窗口,打开一用于显示图像的预览窗口。与此同时,流控程序也会通过调用第一操作***的底层驱动,控制摄像头和音频电路等为其采集视频流,除非主播用户有出于安全考虑禁止立即显示的设置,否则同步将视频流显示到所述的预览窗口中。
可以理解,由于流控程序本身便是为第一操作***开发的程序,不必经过不同操作***机制的转换,因此,会具有更高的视频流获取效率,能够确保视频流获取质量,最小化时延和掉帧等问题的影响。
通常,考虑到主播用户的需求,在一种变化的实施例中,在进入这一预览状态后,可以进一步随同所述预览窗口的调用显示,同步开户用于控制流控程序所采集的视频流的工具容器,通常表现为一个工具栏,可以是一个独立的窗口也可以是与其他窗口如预览窗口集成为同一窗口。所述的 工具容器通常可以提供多个控件,这些控件所实现的功能可以各不相同。一种典型的应用是在工具容器中提供一个或多个特效控件,主播用户可以通过操控一个或多个这样的控件,来对视频效果进行特效加工,使得最终在预览窗口中显示的视频图像出现相应的特效,并且这些特效可以叠加到视频流数据中,后续一同被推送给直播间用户观看。除此之外,所述工具容器当然也可以包括作用于预览窗口中的预览视频的实现其他不同功能的控件,本领域对此应当理解。
为了便于直播程序的同步控制,在用户操作所述的工具容器的控件后,所述流控程序可以因应对控件的操控,产生相关消息,通过所述的通信通道回传给所述的直播程序,以便直播程序据此做进一步决策和处理。
步骤S13,所述直播程序启动开播模式后,广播其所获取的用于接收所述视频流的云端地址消息,模拟程序将该云端地址消息通知给流控程序,以触发其进入开播状态,使其向相应的云端地址传输所述的视频流:
当主播用户在预览模式下完成相关的设置之后,往往会正式开播,此时,可通过直播程序提供一的个控件或者通过任何其他为直播程序所认可的方式,向直播程序发起启动开播模式的指令。
所述直播程序受主播用户的开播指令的触发,依照程序开发者的设计逻辑,可以先向云端的服务器获取用来上传视频流的云端地址。通常的设计中,直播程序会查询云端服务器的鉴权服务通过鉴权之后,通过查询云端服务器的流管理服务来获取所述的云端地址。这些涉及安全和寻址的方式,均为本领域技术人员所知晓,也不影响本发明的创造精神和保护范围,恕不赘述。总之,直播程序通过一定的代码逻辑,将获得云端服务器提供的云端地址,该云端地址理论上既可用来由直播程序自行推送其自身采集的视频流,也可用来提供给所述流控程序进行推送流控程序采集的视频流,本发明重点在于后者。
为了让所述流控程序进行推流,所述直播程序依照第二操作***例如Android的广播机制,通过构造intent来广播一个云端地址消息,即将所述云端地址包含在intent中,成为消息体,在模拟运行环境中广播。
同理,所述的模拟程序预注册的广播接收器会过滤并接收到该云端地 址消息,然后通过套接字或者文件的渠道进行写入操作,而所述的流控程序则对所述的套接字或者文件进行读操作,由此获得所述的云端地址消息,模拟程序也便完成了将该云端地址消息通知给流控程序的任务。
流控程序收到该云端地址消息后,受这一通知触发,便进入开播状态,于是便可调用第一操作***的通信接口,向该云端地址传输所述的视频流,将视频流上传到对应的远程服务器,而远程服务器则会将这一视频流的直接或加工后推送给主播用户所在的直播间的各个用户,最终显示到这些用户的桌面上。
同理,期间如果与远程服务器的通信中断,或者出现其他故障,所述流控程序均可按照上述的方式,通过所述的通信通道,逆向将相应的消息回传给直播程序,以便允许主播用户做进一步的调整和控制。
在这一典型实施例的基础上进一步发展的实施例中,还可以包括如下步骤:
直播程序关闭时,广播预览停播消息,模拟程序将该预览停播消息通知流控程序以触发其进入停播状态,停止向云端地址推送所述视频流:
当主播用户欲结束直播时,同理可以向直播程序发出预览停播指令,直播程序于是依照前述的广播机制构造一个消息体,广播预览停播消息。模拟程序通过其广播接收器过滤并接收到该预览停播消息后,将其通过套接字或文件的方式通知给所述的流控程序。所述流控程序通过读套接字或文件获得该通知之后,触发其自身切换到停播状态,于是可以关闭先前打开的预览窗口和/或工具容器,同步停止向所述云端地址推送所述的视频流,整个直播过程便告结束。
由以上本发明的视频直播控制方法可以看出,该方法使得主播用户在个人计算机上的直播过程更加流畅,即使其使用的直播程序所适应操作***并非该个人计算机在运行的操作***,仍可藉由本方法的模拟程序和流控程序实现流畅高清的视频直播,相应的,开发人员只需开发一个直播程序,便可适用于两个操作***。
请参阅图2,本发明的视频直播桥接方法的典型实施例,实际上是在本 发明的视频直播控制方法的各个实施例的基础上获得的具体应用实例,是所述模拟程序的实现所依据的方法,因此其中涉及通信通道的建立原理和过程,恕不赘述。本方法包括如下步骤:
步骤S21,创建区别于当前第一操作***的第二操作***模拟运行环境,供运行直播程序:
如前所述,当模拟程序充当操作***虚拟机的作用,运行于第一操作***如Windows中后,便创建第二操作***如Android的模拟运行环境,以便运行充当视频流控制器的所述的直播程序。
步骤S22,建立所述直播程序到在当前第一操作***中运行的流控程序之间的通信通道:
模拟程序建立所述的模拟运行环境的过程中或者之后,便可通过套接字或文件读写的方式,与流控程序建立所述的第二直接通道,而与所述直播程序建立所述的第一直接通道,所述第一直接通道主要包括从直播程序采用广播机制发起的广播消息到模拟程序预注册的广播接收器之间的消息通道和反向从模拟程序到所述直播程序的服务组件所构建的服务进程之间的跨进程消息通道,两个直接通道的确立可用,便完成了所述通信通道建立过程,使得直播程序与流控程序之间可以通过所述模拟程序双向互通消息。
步骤S23,经由所述的通信通道,转发所述直播程序广播的开播预览消息给所述流控程序,触发其进入预览状态以便预览其所采集的视频流:
参阅前述,模拟程序通过所述的通信通道,借助其广播接收器,后续接收到所述直播程序广播的开播预览消息后,便通过该通信通道,利用套接字或文件读写的方式,将所述开播预览消息传递给所述的流控程序,从而触发该流控程序进入预览状态,相应的,如前所述,该流控程序便可开始采集视频流,并将视频流输出到预览窗口中供主播用户预览。
步骤S24,经由所述的通信通道,转发所述直播程序广播的云端地址消息给所述流控程序,触发其进入开播状态,以向所述云端地址推送所述的视频流:
同理,模拟程序通过所述的通信通道,借助其广播接收器,后续接收 到所述直播程序广播的云端地址消息后,便可通过该通信通道,利用套接字或文件读写的方式,将所述云端地址消息传递给所述的流控程序,从而触发该流控程序进入开播状态,在这一状态下,流控程序开始向所述的云端地址推送已经采集的视频流,该视频流可以进一步包含主播用户加载的特效。
在这一典型实施例的基础上进一步发展的实施例中,还可以包括如下步骤:
经由所述的通信通道,转发所述直播程序广播的预览停播消息给所述流控程序,触发其进入停播状态,以结束所述视频流的推送:
所述的模拟程序借助其广播接收器从通信通道中获得直播程序广播的预览停播消息后,同理通过写套接字或文件的方式将该消息传递给所述的流控程序。流控程序通过相应读套接字或文件获得该消息的通知,触发自身切换到停播状态,同时关闭此前已经打开的预览窗口、工具容器,停止向所述云端地址推送视频流,这种情况下,直播间用户也将无法获取主播用户的实时的视频流。
由以上本发明的视频直播桥接方法可以看出,模拟程序实际上发挥了操作***虚拟机的作用,且为第一操作***的流控程序和第二操作***的直播程序起到桥梁的作用,只要模拟程序被实现为按照任意第二操作***的逻辑而运行,那么,模拟程序实际上能为任意操作***的所述直播程序提供运行环境,且能够令其与流控程序实现适配,起到标准化接口的作用,有助于避免开发人员针对直播程序本身进行的重复开发。
请参阅图3,本发明的视频直播流控方法的典型实施例,实际上是在本发明的视频直播控制方法的各个实施例的基础上获得的具体应用实例,是所述流控程序的实现所依赖的方法,因此其中涉及通信通道的建立原理和过程,恕不赘述。本方法包括如下步骤:
步骤S31,接收用于提供第二操作***的模拟运行环境的模拟程序转发的开播预览消息,启动预览窗口显示经由当前第一操作***的底层驱动采集的视频流,进入预览状态:
对于本发明的流控程序而言,当其运行时,默认处于停播状态,但其通过所述通信通道机制中所采用的套接字或文件,来获取模拟程序传递过来的消息。当其获取到由所述直播程序发起的所述的开播预览消息后,便触发自身进入预览状态,而启动一个预览窗口,同时调用当前第一操作***的底层驱动,例如音频驱动或摄像头驱动,去采集视频流,将获得的视频流显示到该预览窗口中供主播用户预览。
主播用户预览过程中,可能需要设置视频流显示效果,因此,通常可以提供一个所述的工具容器,在工具容器中提供一个或多个控件,通过操控该些控件,来为主播的视频流添加视频特效和/或音频特效,应当理解,这个特效最终可以呈现给直播间的用户。
步骤S32,接收所述模拟程序传递的包含云端地址的消息,进入开播状态,向该云端地址推送所述的视频流:
流控程序在开播预览过程中,进一步会通过套接字或文件的方式获得直播程序广播而由模拟程序传递的所述的云端地址消息,从其中获得所述的云端地址,然后便可向该云端地址推送所述的视频流,意味着流控程序已经进入了所述的开播状态,经由远程服务器向直播间用户推送主播用户的视频流。
步骤S33,接收所述模拟程序传递的预览停播消息,进入停播状态,结束所述视频流的推送:
流控程序在开播过程中,同理可以通过套接字或文件获得模拟程序传递过来的由所述直播程序广播的停播消息,由此而触发自身恢复到停播状态,这一状态下,流控程序会结束向所述云端地址推送本机采集的视频流。通常,结合前述可知,流控程序可以一并关闭已经打开的各种窗口和容器,包括所述的预览窗口和工具容器等。
在流控程序运行的过程中,特别是在其推送视频流的过程中,如果远程服务器返回相关信息,或者通信过程遭遇故障,或者遭遇其他任何需求,流控程序均可通过所述的套接字或文件向模拟程序发送通知消息,该通知消息可以被模拟程序通过服务进程反馈给直播程序,直播程序的主进程便可将其显示到模拟运行环境中的界面中,显示给主播用户知悉。
由以上本发明的视频直播流控方法可以看出,流控程序起到了标准化的独立推送视频流的服务的作用,只要模拟程序与直播程序遵守其通信方式,便可对其实施调用,通过其向远程服务器采集和推送视频流。流控程序以这种方式开放服务的情况下,直播程序的开发人员的开发工作会变得简单,只需调试和适配模拟程序和已有的属于第二操作***的直播程序,使其与流控程序即可。
请参阅图4,本发明的视频直播播控方法的典型实施例,实际上是在本发明的视频直播控制方法的各个实施例的基础上获得的具体应用实例,是所述直播程序的实现所依赖的方法,因此其中涉及通信通道的建立原理和过程,恕不赘述。本方法包括如下步骤:
步骤S41,响应于在第二操作***模拟运行环境中作用于本应用程序的启动预览模式指令,触发提供该模拟运行环境的第一操作***中显示预览窗口,以显示经由该第一操作***的底层驱动所采集的视频流:
如前所述,当所述流控程序和模拟程序运行于第一操作***之后,便可以在模拟程序创建的第二操作***模拟运行环境中安装并运行所述的直播程序,当所述直播程序启动后,由于直播程序中运用了第二操作***的广播机制可以向模拟程序广播消息,且携带一服务组件可以构建与模拟程序通信的服务进程从而可以逆向接收模拟程序的消息,且由于模拟程序与流控程序之间通过彼此读写套接字和文件实现通信,因此,一旦直播程序成功运行,各程序之间的通信通道即告建立。
在这种情况下,主播用户通过直播应用程序的用户界面操作,发起启动预览模式指令,该指令便以广播开播预览消息的方式,经模拟程序传递给第一操作***,而第一操作***中,可以藉由流控程序之类的服务来实现对该消息的读取和响应,从而按照所述流控程序的逻辑,在第一操作***的桌面中显示一个预览容器,同时,调用第一操作***的底层驱动采集视频流,将采集到的视频流输出该预览窗口中显示。
步骤S42,响应于作用于本应用程序的启动开播模式指令,触发所述第一操作***调用远程接口将该视频流推送到本应用程序获取并提供的云端 地址:
当主播用户确认开始直播时,便可通过本应用程序即直播程序提供的入口或控件,发起启动开播模式指令。如前所述,直播程序会首先查询云端服务器的鉴权服务和流管理服务,获得云端服务器用于接收主播用户的视频流的云端地址,然而,直播程序以第二操作***的广播机制的方式在模拟运行环境中广播包含该云端地址的消息,模拟程序获取该消息后写入套接入或文件中,供第一操作***读取。第一操作***被这一消息触发,可以通过一个例如前述的流控程序来获取该云端地址,然后调用远程接口将该视频流推送到该云端地址所指向的远程服务器处,由该远程服务器将视频流推送给直播间用户。
步骤S43,响应于作用于本应用程序的预览停播指令,触发所述第一操作***的底层驱动停止采集所述的视频流:
当主播用户确认结束直播时,同理向直播程序发送预览停播指令,该指令以广播的形式,经模拟程序传递给第一操作***后,触发第一操作***的底层驱动停止采集所述的视频流,相应的,也就关闭了所述开播状态,而进入停播状态。
根据这一典型实施例可知,理论上,只要第一操作***支持实现所述流控程序和模拟程序的相关方法所实现的功能逻辑,无论这些程序是以服务还是以独立的程序的形式来提供,均不影响本典型实施例的实施。
由以上本发明的视频直播播控方法可以看出,直播程序起到了直播间的视频流的播放控制器的作用,虽然运行于在第一操作***基础上的模拟运行环境的内存空间中,但却是为第二操作***开发的,因此,开发人员不必为第一操作***而专门开发和维护该直播程序,只要使该直播程序包含能够切换到运行于该模拟运行环境的配置即可,当直播程序离开第一操作***而运行于真实的第二操作***中时,也仍可恢复其正常的依靠自身软件设计逻辑进行的采集并推送视频流的功能。
本发明再一典型实施例中,提供一种客户端,包括中央处理器和存储器,所述中央处理器用于调用运行存储于所述存储器中的所述的直播程序、 流控程序、桥接程序中的任意一个或任意多个,以执行各个程序相应的本发明前述相关方法的实施例中的各个步骤,以便利主播用户的实体操控。
综上所述,本发明能够避免程序人员为不同操作***开发不同的直播程序,而可为主播用户提供在个人计算机上利用第一操作***运行为第二操作***开发的直播程序,并能确保视频直播所采集的视频流的图像质量。
本技术领域技术人员可以理解,本发明包涉及用于执行本发明中所述操作、方法中的一项或多项的设备。这些设备可以为所需的目的而专门设计和制造,或者也可以包括通用计算机中的已知设备。这些设备具有存储在其存储器之内的计算机程序,这些计算机程序选择性地激活或重构。这样的计算机程序可以被存储在设备(例如,计算机)可读介质中或者存储在适于存储电子指令并分别耦联到总线的任何类型的介质中,所述计算机可读介质包括但不限于任何类型的盘(包括软盘、硬盘、光盘、CD-ROM、和磁光盘)、ROM(Read-Only Memory,只读存储器)、RAM(Random Access Memory,随即存储器)、EPROM(Erasable Programmable Read-Only Memory,可擦写可编程只读存储器)、EEPROM(Electrically Erasable Programmable Read-Only Memory,电可擦可编程只读存储器)、闪存、磁性卡片或光线卡片。也就是,可读介质包括由设备(例如,计算机)以能够读的形式存储或传输信息的任何介质。
本技术领域技术人员可以理解,可以用计算机程序指令来实现这些结构图和/或框图和/或流图中的每个框以及这些结构图和/或框图和/或流图中的框的组合。本技术领域技术人员可以理解,可以将这些计算机程序指令提供给通用计算机、专业计算机或其他可编程数据处理方法的处理器来实现,从而通过计算机或其他可编程数据处理方法的处理器来执行本发明公开的结构图和/或框图和/或流图的框或多个框中指定的方案。
本技术领域技术人员可以理解,本发明中已经讨论过的各种操作、方法、流程中的步骤、措施、方案可以被交替、更改、组合或删除。进一步地,具有本发明中已经讨论过的各种操作、方法、流程中的其他步骤、措 施、方案也可以被交替、更改、重排、分解、组合或删除。进一步地,现有技术中的具有与本发明中公开的各种操作、方法、流程中的步骤、措施、方案也可以被交替、更改、重排、分解、组合或删除。
以上所述仅是本发明的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (27)

  1. 一种视频直播控制方法,其特征在于,包括如下步骤:
    运行在当前第一操作***的用于模拟第二操作***的运行环境的模拟程序启动直播程序时,模拟程序建立运行于所述运行环境中的所述直播程序与运行于第一操作***中的流控程序的通信通道;
    所述直播程序启动预览模式后,广播开播预览消息,模拟程序将该开播预览消息通知流控程序以触发其进入预览状态,使其开启预览窗口用于显示其所采集的视频流;
    所述直播程序启动开播模式后,广播其所获取的用于接收所述视频流的云端地址消息,模拟程序将该云端地址消息通知给流控程序,以触发其进入开播状态,使其向相应的云端地址传输所述的视频流。
  2. 根据权利要求1所述的方法,其特征在于,还包括如下步骤:
    直播程序关闭时,广播预览停播消息,模拟程序将该预览停播消息通知流控程序以触发其进入停播状态,停止向云端地址推送所述视频流。
  3. 根据权利要求1所述的方法,其特征在于,所述通信通道包括直播程序与模拟程序之间的第一直接通道和所述模拟程序与所述流控程序之间的第二直接通道。
  4. 根据权利要求3所述的方法,其特征在于,按照如下方式建立所述的第一直接通道:所述直播程序携带注册到所述模拟运行环境中的服务组件,所述模拟程序携带注册到所述模拟运行环境中的广播接收器,所述模拟程序通过该服务组件构建的服务进程向该直播程序传递所述流控程序产生的消息;所述模拟程序通过所述广播接收器接收所述直播程序广播的消息,将其传递给所述的流控程序。
  5. 根据权利要求3所述的方法,其特征在于,按照如下方式建立所述的第二直接通道:所述模拟程序与所述流控程序之间通过彼此读写套接字或文件的方式建立所述的第二直接通道。
  6. 根据权利要求1所述的方法,其特征在于,所述模拟程序与流控程序适于运行于当前第一操作***,所述直播程序适于运行于区别于当前操作***的第二操作***,所述模拟程序适于在第一操作***中模拟所述第 二操作***而为该直播程序创建相应的模拟运行环境。
  7. 根据权利要求6所述的方法,其特征在于,所述第一操作***为Windows或基于Linux、Unix的操作***中的任意一种,所述第二操作***为与第一操作***相异的Android、IOS、Linux、Windows操作***中的任意一种。
  8. 根据权利要求1所述的方法,其特征在于,所述模拟程序建立所述通信通道的过程中,将直播程序代表其主进程的应用包名及代表其服务进程的服务名传递给所述流控程序,以供所述流控程序识别所述直播程序的主进程和服务进程以便确定消息传递身份。
  9. 根据权利要求1至8中任意一项所述的方法,其特征在于,所述流控程序进入预览状态时,开启用于控制其所采集的视频流的工具容器,该工具容器包括至少一个能够影响所述预览窗口的预览视频的特效的控件,作用于该控件而产生的消息通过所述通信通道传递给所述的直播程序。
  10. 根据权利要求2所述的方法,其特征在于,所述流控程序进入停播状态时,关闭所述的预览窗口。
  11. 一种视频直播桥接方法,其特征在于,包括如下步骤:
    创建区别于当前第一操作***的第二操作***模拟运行环境,供运行直播程序;
    建立所述直播程序到在当前第一操作***中运行的流控程序之间的通信通道;
    经由所述的通信通道,转发所述直播程序广播的开播预览消息给所述流控程序,触发其进入预览状态以便预览其所采集的视频流;
    经由所述的通信通道,转发所述直播程序广播的云端地址消息给所述流控程序,触发其进入开播状态,以向所述云端地址推送所述的视频流。
  12. 根据权利要求11所述的方法,其特征在于,还包括如下步骤:
    经由所述的通信通道,转发所述直播程序广播的预览停播消息给所述流控程序,触发其进入停播状态,以结束所述视频流的推送。
  13. 根据权利要求11所述的方法,其特征在于,所述通信通道包括由本方法所实现的模拟程序与直播程序之间的第一直接通道和所述模拟程序 与所述流控程序之间的第二直接通道。
  14. 根据权利要求13所述的方法,其特征在于,按照如下方式建立所述的第一直接通道:所述直播程序携带注册到所述模拟运行环境中的服务组件,所述模拟程序携带注册到所述模拟运行环境中的广播接收器,所述模拟程序通过该服务组件构建的服务进程向该直播程序传递所述流控程序产生的消息;所述模拟程序通过所述广播接收器接收所述直播程序广播的消息,将其传递给所述的流控程序。
  15. 根据权利要求13所述的方法,其特征在于,按照如下方式建立所述的第二直接通道:所述模拟程序与所述流控程序之间通过彼此读写套接字或文件的方式建立所述的第二直接通道。
  16. 根据权利要求1所述的方法,其特征在于,所述模拟程序建立所述通信通道的过程中,将直播程序代表其主进程的应用包名及代表其服务进程的服务名传递给所述流控程序,以供所述流控程序识别所述直播程序的主进程和服务进程以便确定消息传递身份。
  17. 一种视频直播流控方法,其特征在于,包括如下步骤:
    接收用于提供第二操作***的模拟运行环境的模拟程序转发的开播预览消息,启动预览窗口显示经由当前第一操作***的底层驱动采集的视频流,进入预览状态;
    接收所述模拟程序传递的包含云端地址的消息,进入开播状态,向该云端地址推送所述的视频流;
    接收所述模拟程序传递的预览停播消息,进入停播状态,结束所述视频流的推送。
  18. 根据权利要求17所述的方法,其特征在于,当进入预览状态时,开启用于控制所述视频流的工具容器,该工具容器包括至少一个能够影响所述预览窗口的预览视频的特效的控件。
  19. 根据权利要求17所述的方法,其特征在于,当进入停播状态时,关闭所述的预览窗口。
  20. 根据权利要求17至19中任意一项所述的方法,其特征在于,实现了本方法的流控程序与所述模拟程序之间,通过彼此读写套接字或文件 的方式实现通信,以实现所述消息的传递。
  21. 根据权利要求20所述的方法,其特征在于,实现了本方法的流控程序向模拟程序发送通知消息,以便使该通知消息显示到该模拟程序创建的所述模拟运行环境中。
  22. 一种视频直播播控方法,其特征在于,包括如下步骤:
    响应于在第二操作***模拟运行环境中作用于本应用程序的启动预览模式指令,触发提供该模拟运行环境的第一操作***中显示预览窗口,以显示经由该第一操作***的底层驱动所采集的视频流;
    响应于作用于本应用程序的启动开播模式指令,触发所述第一操作***调用远程接口将该视频流推送到本应用程序获取并提供的云端地址;
    响应于作用于本应用程序的预览停播指令,触发所述第一操作***的底层驱动停止采集所述的视频流。
  23. 根据权利要求22所述的方法,其特征在于,所述第一操作***运行一模拟程序用于创建所述的第二操作***模块运行环境,所述第一操作***运行一流控程序用于实现对所述底层驱动采集视频流的动作和对推送所述视频流的动作的执行。
  24. 根据权利要求22所述的方法,其特征在于,实现了本方法的直播程序以第二操作***的广播机制的广播方式发出消息,以实现对所述第一操作***的触发操作。
  25. 根据权利要求22所述的方法,其特征在于,实现了本方法的直播程序携带用于接收所述第一操作***中产生的消息的服务组件,以便将所述第一操作中产生的消息显示给用户。
  26. 根据权利要求22至25所述的方法,其特征在于,所述第一操作***为Windows或基于Linux、Unix的操作***中的任意一种,所述第二操作***为与第一操作***相异的Android、IOS、Linux、Windows操作***中的任意一种。
  27. 一种客户端,包括中央处理器和存储器,其特征在于,所述中央处理器用于调用运行存储于所述存储器中的一个或多个计算机程序以执行如权利要求1至26中的任意一项所述的方法。
PCT/CN2021/085783 2020-04-10 2021-04-07 视频直播控制、桥接、流控、播控方法及客户端 WO2021204141A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010281352.4 2020-04-10
CN202010281352.4A CN111510780B (zh) 2020-04-10 2020-04-10 视频直播控制、桥接、流控、播控方法及客户端

Publications (1)

Publication Number Publication Date
WO2021204141A1 true WO2021204141A1 (zh) 2021-10-14

Family

ID=71878698

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/085783 WO2021204141A1 (zh) 2020-04-10 2021-04-07 视频直播控制、桥接、流控、播控方法及客户端

Country Status (2)

Country Link
CN (1) CN111510780B (zh)
WO (1) WO2021204141A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114697647A (zh) * 2022-04-08 2022-07-01 微梦创科网络科技(中国)有限公司 一种直播测试方法和装置
CN115022669A (zh) * 2022-05-31 2022-09-06 厦门蝉羽网络科技有限公司 一种基于信息处理的直播***及直播方法

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111510780B (zh) * 2020-04-10 2021-10-26 广州方硅信息技术有限公司 视频直播控制、桥接、流控、播控方法及客户端
CN114374852B (zh) * 2020-10-14 2024-05-14 武汉斗鱼鱼乐网络科技有限公司 特效的构建方法、装置、设备及介质
CN113473158B (zh) * 2021-06-30 2024-01-30 北京百度网讯科技有限公司 直播数据处理方法、装置、电子设备、介质
CN113596561B (zh) * 2021-07-29 2023-06-27 北京达佳互联信息技术有限公司 视频流播放方法、装置、电子设备和计算机可读存储介质
CN114363281B (zh) * 2021-12-31 2024-06-04 阿里巴巴(中国)有限公司 消息传输方法、***、设备、存储介质及程序产品
CN115103218B (zh) * 2022-06-16 2023-09-19 广州市百果园网络科技有限公司 数据流回收方法及其装置、设备、介质
CN116389801B (zh) * 2023-05-31 2023-07-28 北京庭宇科技有限公司 一种多端一体的云串流客户端实现方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104142852A (zh) * 2014-08-04 2014-11-12 福州靠谱网络有限公司 在电脑上实现安卓模拟器图形加速方法
CN105991700A (zh) * 2015-02-06 2016-10-05 百度在线网络技术(北京)有限公司 处理语音数据的方法、云端服务器***和终端设备
CN106445630A (zh) * 2016-08-10 2017-02-22 北京奇虎科技有限公司 Android模拟器及实现Android模拟器的方法
CN109068179A (zh) * 2018-09-17 2018-12-21 珠海市筑巢科技有限公司 一种多平台直播方法、计算机装置及计算机可读存储介质
CN111510780A (zh) * 2020-04-10 2020-08-07 广州华多网络科技有限公司 视频直播控制、桥接、流控、播控方法及客户端

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8881222B2 (en) * 2009-09-23 2014-11-04 At&T Intellectual Property I, L.P. Multimedia interactive simulator
CN102204210A (zh) * 2011-05-18 2011-09-28 华为技术有限公司 启动应用的方法、服务器和***
CN103309690B (zh) * 2012-03-12 2016-08-17 联想(北京)有限公司 处理数据的方法和电子设备
CN103327117B (zh) * 2013-07-05 2017-02-08 百度在线网络技术(北京)有限公司 应用程序的跨***运行方法和装置
CN104007986A (zh) * 2014-05-08 2014-08-27 郭伟 跨***远程实时交互技术
CN105335282A (zh) * 2014-07-30 2016-02-17 国际商业机器公司 用于应用的跨平台测试的方法和***
US10326822B2 (en) * 2015-12-03 2019-06-18 Google Llc Methods, systems and media for presenting a virtual operating system on a display device
CN107996026A (zh) * 2016-12-27 2018-05-04 深圳前海达闼云端智能科技有限公司 多操作***多媒体编解码方法、装置及电子设备
WO2018119952A1 (zh) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 一种设备虚拟化方法、装置、***及电子设备、计算机程序产品
CN106874128B (zh) * 2017-01-22 2020-11-20 广州华多网络科技有限公司 数据传输方法及装置
CN106980481B (zh) * 2017-03-28 2020-02-04 北京奇虎科技有限公司 一种图像显示方法及设备
CN107220083B (zh) * 2017-05-22 2020-12-18 南京航空航天大学 一种安卓***中免安装运行应用程序的方法和***
CN108762815B (zh) * 2018-05-16 2021-01-01 北京麟卓信息科技有限公司 一种基于非虚拟化体系架构的Android运行环境实现方法
CN109544663B (zh) * 2018-11-09 2023-01-06 腾讯科技(深圳)有限公司 应用程序的虚拟场景识别与交互键位匹配方法及装置
CN109547812A (zh) * 2019-01-22 2019-03-29 广州虎牙信息科技有限公司 一种直播方法、装置、移动终端与存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104142852A (zh) * 2014-08-04 2014-11-12 福州靠谱网络有限公司 在电脑上实现安卓模拟器图形加速方法
CN105991700A (zh) * 2015-02-06 2016-10-05 百度在线网络技术(北京)有限公司 处理语音数据的方法、云端服务器***和终端设备
CN106445630A (zh) * 2016-08-10 2017-02-22 北京奇虎科技有限公司 Android模拟器及实现Android模拟器的方法
CN109068179A (zh) * 2018-09-17 2018-12-21 珠海市筑巢科技有限公司 一种多平台直播方法、计算机装置及计算机可读存储介质
CN111510780A (zh) * 2020-04-10 2020-08-07 广州华多网络科技有限公司 视频直播控制、桥接、流控、播控方法及客户端

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114697647A (zh) * 2022-04-08 2022-07-01 微梦创科网络科技(中国)有限公司 一种直播测试方法和装置
CN115022669A (zh) * 2022-05-31 2022-09-06 厦门蝉羽网络科技有限公司 一种基于信息处理的直播***及直播方法
CN115022669B (zh) * 2022-05-31 2024-03-12 厦门蝉羽网络科技有限公司 一种基于信息处理的直播***及直播方法

Also Published As

Publication number Publication date
CN111510780A (zh) 2020-08-07
CN111510780B (zh) 2021-10-26

Similar Documents

Publication Publication Date Title
WO2021204141A1 (zh) 视频直播控制、桥接、流控、播控方法及客户端
WO2020221190A1 (zh) 小程序状态同步方法、设备和计算机存储介质
WO2018130165A1 (zh) 云计算移动终端及其工作方法
JP5030522B2 (ja) データ処理システム、方法、コンピュータ・プログラム(アプリケーション・ユーザ・インタフェース配布のためのユーザ・インタフェース・ウィジェット・ユニット共有)
US20210090568A1 (en) In-band voice-assistant/concierge for controlling online meetings
WO2017124860A1 (zh) 分布式无线多屏虚拟机服务***
US7908325B1 (en) System and method for event-based collaboration
WO2021258617A1 (zh) 多平台同步直播方法、装置、计算机设备和可读存储介质
CN104093077A (zh) 多终端互联的方法、装置及***
US11900006B2 (en) Synchronizing local room and remote sharing
US20120317243A1 (en) Audio processing method and device for remote desktop protocol
CN110493028A (zh) 一种集群部署方法、***、装置及计算机可读存储介质
JP2023126832A (ja) ミーティングの参加者が機能デバイスを利用できるようにするための方法およびシステム
CN105323272A (zh) 一种管理剪切板的方法、终端和***
CN114245328B (zh) 语音通话转移方法及电子设备
WO2017050006A1 (zh) 远程直播方法和***
CN110865783A (zh) 投屏方法、设备、***和存储介质
CN102427465A (zh) 语音服务代理方法及装置、通过代理集成语音应用的***
CN103561106A (zh) 远程教学及会议***和方法
WO2019080222A1 (zh) 移动终端的数据传输方法、装置和移动终端
US11803606B2 (en) Device augmentation of real time communications
KR102168948B1 (ko) 모바일 영상 관제 시스템 및 그 동작 방법
WO2020025016A1 (zh) 多页面通信的节点初始化
CN108683873B (zh) 视频会议的控制装置及方法
WO2024087197A1 (zh) 直播流切换方法、装置、服务器、终端及程序产品

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

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

Country of ref document: EP

Kind code of ref document: A1