CN115412736A - Multi-channel video playing control method and device, electronic equipment and storage medium - Google Patents

Multi-channel video playing control method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115412736A
CN115412736A CN202110587377.1A CN202110587377A CN115412736A CN 115412736 A CN115412736 A CN 115412736A CN 202110587377 A CN202110587377 A CN 202110587377A CN 115412736 A CN115412736 A CN 115412736A
Authority
CN
China
Prior art keywords
player
video
playing
video stream
players
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
CN202110587377.1A
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.)
Tencent Technology Beijing Co Ltd
Original Assignee
Tencent Technology Beijing 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 Tencent Technology Beijing Co Ltd filed Critical Tencent Technology Beijing Co Ltd
Priority to CN202110587377.1A priority Critical patent/CN115412736A/en
Publication of CN115412736A publication Critical patent/CN115412736A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/21805Source of audio or video content, e.g. local disk arrays enabling multiple viewpoints, e.g. using a plurality of cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/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/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • 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/434Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
    • H04N21/4342Demultiplexing isochronously with video sync, e.g. according to bit-parallel or bit-serial interface formats, as SDI

Landscapes

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

Abstract

The embodiment of the application discloses a playing control method and device for a plurality of paths of videos, electronic equipment and a storage medium, and relates to the fields of cloud technology, video processing, big data and the like. The method comprises the following steps: responding to a received video playing request, and acquiring at least two video streams corresponding to the video playing request, wherein the at least two video streams are video streams corresponding to the same scene; calling a player control plug-in to create at least two players, wherein the at least two players correspond to the at least two video streams one by one; and controlling at least two players to synchronously play the video streams corresponding to the players on the user interface of the client through the player control plug-in. By adopting the technical scheme, in the scene of synchronous playing of the multiple paths of video streams, the complexity of the service logic of the synchronous playing of the multiple paths of video streams is reduced, and the development difficulty of the client is reduced.

Description

Multi-channel video playing control method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of cloud technologies, video processing, big data, and the like, and in particular, to a method and an apparatus for controlling playing of multiple channels of video, an electronic device, and a storage medium.
Background
At present, in some scenes, with the increasing demand for live broadcasting, for example, in games, sports competitions such as football, basketball and the like, higher demands are also put forward on the live broadcasting.
In order to provide more interactive experience for users, a multi-channel video stream function begins to appear in the current live broadcast application, a client can pull and watch different channels of video streams, audiences can watch live broadcast at multiple visual angles to a certain extent, and the effect of being personally on the scene is simulated. In a scene of simultaneously playing multiple paths of video streams, it is particularly important to implement multi-view picture synchronization, and in the prior art, service logic for implementing multi-view picture synchronization is complex and the effect is not ideal.
Disclosure of Invention
The embodiment of the application provides a playing control method and device for a plurality of paths of videos, electronic equipment and a storage medium, and in a scene where a plurality of paths of video streams are played synchronously, the complexity of service logic of the multi-path video stream playing synchronously is reduced, and the development difficulty of a client is reduced.
In one aspect, an embodiment of the present application provides a method for controlling playback of multiple channels of video, where the method includes:
responding to a received video playing request, and acquiring at least two video streams corresponding to the video playing request, wherein the at least two video streams are video streams corresponding to the same scene;
calling a player control plug-in to create at least two players, wherein the at least two players correspond to the at least two paths of video streams one by one;
and controlling the at least two players to synchronously play the video streams corresponding to the players on the user interface of the client through the player control plug-in.
In one aspect, an embodiment of the present application provides a device for controlling playing of multiple channels of videos, where the device includes:
the video stream acquisition module is used for responding to a received video playing request and acquiring at least two video streams corresponding to the video playing request, wherein the at least two video streams are video streams corresponding to the same scene;
the creating module is used for calling a player control plug-in and creating at least two players, and the at least two players correspond to the at least two paths of video streams one by one;
and the video stream playing control module is used for controlling the at least two players to synchronously play the video streams corresponding to the players on the user interface of the client through the player control plug-in.
In an optional embodiment, when the player control plug-in is called, the video stream playing control module is configured to:
and creating a thread corresponding to the player control plug-in, and calling the player control plug-in through the thread corresponding to the player control plug-in, wherein the thread corresponding to the player control plug-in and the thread corresponding to the player belong to the same process.
In an optional embodiment, when the video stream playing control module controls the at least two players to synchronously play the respective video streams on the user interface of the client through the player control plug-in, the video stream playing control module is configured to:
the following operations are repeatedly executed by the player control plug-in until the playing ending condition is met:
acquiring the playing progress of the video stream played by each player;
and taking the slowest playing progress in the playing progresses as a reference playing progress, and controlling the playing progress of the played video stream of each other player according to the difference between the playing progress corresponding to each other player and the playing progress of the reference playing progress, wherein each other player refers to each player except the reference player in the at least two players, and the reference player is the player corresponding to the reference playing progress.
In an optional embodiment, when controlling the playing progress of the played video stream of each of the other players, the video stream playing control module is configured to:
for each of the other players, if the playing progress difference corresponding to the player is greater than or equal to a first threshold, or if the playing progress difference corresponding to the player is less than or equal to a second threshold, playing the video stream corresponding to the player according to the playing progress of the player, wherein the first threshold is greater than the second threshold;
and for each of the other players, if the playing progress difference corresponding to the player is smaller than the first threshold and larger than the second threshold, controlling the playing progress of the player according to the playing progress difference corresponding to the player.
In an optional embodiment, for each of the other players, when the video stream playing control module controls the playing progress of the player according to the playing progress difference corresponding to the player, the video stream playing control module is configured to:
if the player is in a first state, controlling the video stream of the player to be in a second state, wherein the maximum duration of the player in the second state is equal to the playing progress difference, the first state is a playing state, and the second state is a pause state;
and if the player is in the second state, keeping the player in the second state.
In an optional embodiment, for each video stream, the video stream includes video data and audio data, where the audio data and the video data have respective corresponding timestamps, and the video stream playing control module, when acquiring a playing progress of the video stream played by each player, is configured to:
for each player, executing the following operations by the player control plug-in to obtain the playing progress of the video stream played by the player:
acquiring a first time stamp of audio data and a second time stamp of video data of a video stream currently played by the player;
if the time difference between the first time stamp and the second time stamp is greater than or equal to a third threshold, controlling the synchronization of the audio data and the video data played by the player according to the time difference;
and taking the playing time information of the synchronized audio data and video data as the playing progress of the player.
In an optional embodiment, for each video stream, the video stream includes video data and audio data, and the video stream playing control module, when invoking a player control plug-in to control the at least two players to synchronously play the respective video streams on the user interface of the client, is configured to:
and calling the player control plug-in, controlling a player corresponding to a target video stream in the at least two video streams to play audio data and video data of the target video stream, and controlling other players except the player corresponding to the target video stream to play video data of respective corresponding video streams, wherein the target video stream is one of the at least two video streams.
In an optional embodiment, the user interface of the client includes a first display area and at least one second display area, and the video stream playing control module, when controlling the at least two players to synchronously play the respective video streams on the user interface of the client, is configured to:
controlling a first player of the at least two players to play a video stream corresponding to the first player in a first display area of a user interface of the client, and controlling second players except the first player to play a video stream corresponding to each second display area;
the target video stream is a video stream corresponding to a first display area;
the apparatus further comprises a video stream switching module, configured to:
and responding to the video stream switching operation of a user, controlling a second player corresponding to the video stream switching operation to play a corresponding video stream in a first display area through the player control plug-in, and controlling the first player to play a corresponding video stream in a second display area.
In one aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, where the processor and the memory are connected to each other; the memory is used for storing a computer program; the processor is configured to execute the method provided by any possible implementation manner of the playing control method of the multi-channel video when the computer program is called.
In one aspect, the present application provides a computer-readable storage medium, where a computer program is stored, where the computer program is executed by a processor to implement the method provided in any one of the possible implementation manners of the above multi-channel video playing control method.
In one aspect, embodiments of the present application provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided by any possible implementation manner of the play control method of the multi-channel video.
The beneficial effect that technical scheme that this application provided brought is:
in this embodiment of the present application, a method, an apparatus, an electronic device, and a storage medium for controlling playing of multiple channels of videos provided in this embodiment of the present application initiate a video playing request through a client, respond to the video playing request, obtain at least two channels of video streams corresponding to the video playing request, where the at least two channels of video streams are video streams corresponding to a same scene, then create at least two players, where the at least two players correspond to the at least two channels of video streams one to one, and then control the at least two players to synchronously play their respective corresponding video streams on a video playing interface of the client by calling a player control plug-in. By adopting the technical scheme, the player control plug-in is called to control the synchronous playing of each video stream on the user interface of the client, and the client only needs to receive the synchronous playing result of the player control plug-in on the plurality of video streams, so that the complexity of the service logic for realizing the synchronous playing of the plurality of paths of video streams by the client is reduced, and the development difficulty of the client is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic implementation flow diagram of a playing control system for multiple channels of videos in an application scenario according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a playing control method for multiple channels of video according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating a principle of synchronous playing of multiple players according to an embodiment of the present application;
fig. 4 is a schematic flowchart illustrating a process of opening a player control plug-in according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a method for displaying multiple video streams on a client user interface according to an embodiment of the present application;
fig. 6 is a schematic diagram of a playing progress of a player according to an embodiment of the present application;
fig. 7 is a schematic flowchart illustrating a process of controlling a plurality of players to play synchronously through a player control plug-in according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a playing control device for multiple channels of videos according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The playing control method for the multi-channel video provided by the embodiment of the application relates to various fields of Cloud technologies, such as Cloud computing, cloud services, cloud videos and the like in the Cloud technology, and related data computing and processing fields in the big data field.
The cloud technology is a hosting technology for unifying series resources such as hardware, software, network and the like in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data. The playing control method for the multi-channel video provided by the embodiment of the application can be realized based on cloud computing (cloud computing) in the cloud technology.
Cloud Computing refers to obtaining required resources in an on-demand and easily-extensible manner through a Network, and is a product of development and fusion of traditional computers and Network Technologies, such as Grid Computing (Grid Computing), distributed Computing (Distributed Computing), parallel Computing (Parallel Computing), utility Computing (Utility Computing), network Storage (Network Storage Technologies), virtualization (Virtualization), load balancing (Load Balance), and the like.
Cloud video (Cloud video) refers to a video network platform service based on Cloud computing business model application. On a cloud platform, all video suppliers, agents, planning service providers, manufacturers, industry associations, management organizations, industry media, legal structures and the like are integrated into a resource pool in a centralized cloud mode, all resources are mutually displayed and interacted and communicated as required to achieve the intention, so that the cost is reduced, the efficiency is improved, and the concept is the cloud video concept. For example, the video stream in the embodiment of the present application may be a video stream from a cloud platform.
Big data (Big data) refers to a data set which cannot be captured, managed and processed by a conventional software tool within a certain time range, and is a massive, high-growth-rate and diversified information asset which can have stronger decision-making power, insight discovery power and flow optimization capability only by a new processing mode. With the advent of the cloud era, big data has attracted more and more attention. The playing control method for the multi-channel video provided by the embodiment is effectively implemented based on the fact that the big data needs a special technology, wherein the technology suitable for the big data includes a massively parallel processing database, data mining, a distributed file system, a distributed database, the cloud computing and the like.
As an example, fig. 1 shows a schematic implementation flow diagram of a play control system applied to multiple channels of videos in an application scenario, and it can be understood that the play control method for multiple channels of videos provided in the embodiment of the present application can be applied to, but is not limited to, the application scenario shown in fig. 1.
The playing control system of the multi-channel video in the present example may include, but is not limited to, the user terminal 101, the network 102, and the server 103. A user terminal 101, such as a user's smartphone, may communicate with a server 103 over a network 102. The user terminal 101 may have a client for video applications, where the client has a video playing function, and a user may watch a video through the client.
In the embodiment of the present application, the method for controlling playback of multiple channels of video may be executed by any electronic device, for example, the method may be executed by a user terminal, or may be executed by interaction between the user terminal and a server, and optionally, in the following example, the method is executed by the user terminal, and a specific interaction process of the system for controlling playback of multiple channels of video in the present application may include steps S1 to S3:
step S1, a user initiates a video playing request at a client of a video application program through a human-computer interaction screen of a user terminal 101, for example, the user opens the client of the video application program in the user terminal, and clicks an interested video at the client to watch, where the video is a video providing at least two paths of video streams, such as a sports competition video.
The at least two video streams may also be referred to as multiple video streams, where the multiple video streams refer to multiple independent video streams displayed on the same video playing interface (i.e., a user interface of a client) through multiple players, and one video stream corresponds to one player. Each of the multiple video streams associated with each other corresponds to the content, and needs to be displayed synchronously.
In the multi-path video stream, a main video stream and a plurality of auxiliary video streams are included. During the playing of the main video stream, the user can select one or more secondary video streams to be displayed synchronously with the main video stream.
Taking a football game as an example, the primary video stream may be a video stream with a view angle towards the whole football stadium, and the secondary video stream may be a video stream with a view angle towards a auditorium, a video stream with a view angle towards a studio, a video stream of close-up shots of one or more players, etc., without any limitation.
Step S2, the user terminal 101 receives the video playing request initiated by the user through the client, and responds to the video playing request, and obtains at least two video streams corresponding to the video playing request from the server 103, where the at least two video streams are video streams corresponding to the same scene.
And S3, calling a player control plug-in by the user terminal 101 to create at least two players, wherein the at least two players correspond to the at least two paths of video streams one by one.
The player control plug-in is not included in the client, or the player control plug-in is a plug-in outside the client. The meaning of invoking here is to invoke a player control plug-in that the client does not contain.
When at least two players are created, an additional player control plug-in is called, the at least two players are created through the player control plug-in, and the at least two players are controlled to synchronously play the video streams corresponding to the players on the user interface of the client.
And S4, the user terminal 101 controls at least two players to synchronously play the corresponding video streams on the user interface of the client by calling the player control plug-in.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server or a server cluster providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like. Such networks may include, but are not limited to: a wired network, a wireless network, wherein the wired network comprises: a local area network, a metropolitan area network, and a wide area network, the wireless network comprising: bluetooth, wi-Fi, and other networks that enable wireless communication. The user terminal may be a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a notebook computer, a digital broadcast receiver, an MID (Mobile Internet Devices), a PDA (personal digital assistant), a desktop computer, a vehicle-mounted terminal (e.g., a vehicle-mounted navigation terminal), a smart speaker, a smart watch, etc., and the user terminal and the server may be directly or indirectly connected through wired or wireless communication, but are not limited thereto. The determination may also be based on the requirements of the actual application scenario, and is not limited herein.
Optionally, the server 103 may be a server of the application program, or may be a CDN server in communication with the server of the application program, where the CDN server may receive a video playing request from the server of the application program, and send at least two video streams corresponding to the video playing request to the application program in response to the video playing request.
Referring to fig. 2, fig. 2 is a schematic flowchart of a method for controlling playback of multiple channels of video according to an embodiment of the present disclosure, where the method may be executed by any electronic device, may be executed by a user terminal (including but not limited to a mobile phone, a computer, a television, and the like), may be completed by interaction between the user terminal and a server, may be executed by a client, and optionally may be executed by the user terminal, as shown in fig. 2, the method for controlling playback of multiple channels of video according to the embodiment of the present disclosure includes the following steps:
step S201, in response to a received video playing request, obtaining at least two video streams corresponding to the video playing request, where the at least two video streams are video streams corresponding to a same scene.
Step S202, calling a player control plug-in to create at least two players, wherein the at least two players correspond to the at least two paths of video streams one by one.
Step S203, controlling the at least two players to synchronously play the respective corresponding video streams on the user interface of the client through the player control plug-in.
Optionally, the client may be a web client, an applet client, or an Application (APP) client, where the client may be a client of a social media Application, and the client has a function of playing multiple video streams simultaneously, for example, the client may be a video Application client, and the embodiment of the present Application is not limited herein.
It is to be understood that the above-mentioned at least two players refer to a plurality of player instances created by the terminal device, each player instance may be created by calling a multimedia service component of the operating system. The player is used for analyzing the acquired slave video stream and playing the analyzed video stream.
In some application scenarios, in order to improve the user's appearance, a plurality of pictures with different viewing angles can be provided, so that the user can watch videos from a plurality of viewing angles, for example, in some sports competitions, the user can watch the pictures with a plurality of viewing angles simultaneously, taking a football match as an example, the user can watch the pictures with a plurality of viewing angles switched by the director, such as the pictures with viewing angles of auditorium, whole court, studio, close-up features of players, close-up features of football, etc., and in this process, it is particularly important to realize that the pictures with a plurality of viewing angles are played simultaneously.
In order to implement synchronous playing of multiple video streams, an optional implementation manner is that a client pulls multiple video streams from a front-end server (i.e., the server 103 described above, that is, a server corresponding to the client), and then controls multiple players to synchronously play respective video streams, and in the process of controlling the multiple players to synchronize the players, the client needs to frequently acquire the current playing position of each player in a cross-process communication manner with each player, that is, frequently acquire the current playing progress of each player, and frequently communicate with each player, so that system performance loss of the client is greatly increased, service logic of the client is increased, and development difficulty of the client is increased.
In order to solve the above problem and better achieve synchronous playing of multiple video streams, a method for controlling playing of multiple channels of videos in this embodiment of the present application is described below with reference to fig. 3 by taking a live football game as an example, where the implementation process of the method may include the following steps:
the method includes the steps that streams are recorded in real time from a plurality of different angles through recording equipment (such as a camera and the like), the recording equipment can also be called as audio and video acquisition equipment, the recording equipment has the function of recording videos and audios, multiple paths of video streams are acquired in real time and transmitted to a front-end server (namely the server 103 described in the foregoing, namely the server corresponding to the client), the front-end server pushes the video streams to each existing network, the client pulls the streams to watch the different paths of video streams, and the client synchronously plays the video streams corresponding to the different paths of video streams through a plurality of players, and the specific process is as follows:
step 1, recording a plurality of game live pictures and live audios of a football game from a plurality of different visual angles through a plurality of recording devices on the scene of the football game to form a plurality of corresponding video streams, and transmitting the recorded video streams to a front-end server.
For each video stream, the video stream includes audio data and video data, and the audio data and the video data carry respective corresponding timestamps.
The code stream specification of the video stream transmitted by the recording device to the front-end server may include 720P30, 1080P50, 1080P60, and the like, where P denotes Progressive scan (Progressive scan), 720 denotes that the resolution of each frame is 1280 × 720, 1080 denotes that the resolution of each frame is 1920 × 1080, 30/50/60 denotes that 30/50/60 frames are played per second, and taking the code stream specification of the video stream as 720P30 as an example, denotes that the resolution of each frame in the video stream is 1280 × 720, and 30 frames are played per second.
In practical applications, the number of recording devices is not limited, and may be configured according to actual requirements or empirical values, for example, the number of recording devices may be determined according to the number of selected views, and at least one spare recording device may be provided, as an example, fig. 3 shows 3 recording devices, that is, recording device 1, recording device 2, recording device 3, and recording device 4.
And 2, the front-end server receives the video stream recorded by the recording equipment.
And 3, selecting pictures of at least two interested visual angles by a user through an interface of a client in the user terminal or directly selecting the default pictures of at least two visual angles provided by the client, and initiating a video playing request through a human-computer interaction interface of the client.
And responding to the video playing request, and pulling at least two paths of video streams corresponding to the video playing request from a front-end server, wherein the two paths of video streams are video streams in the football match scene.
When the user terminal pulls at least two paths of video streams from the front-end server, namely the front-end server pushes the video streams to the user terminal, the pushed video streams are high-quality code streams, and the server keeps high-efficiency and high-stability real-time transmission. The front-end server needs to ensure that the video stream transmitted to the client has low delay and no packet loss through mechanisms such as packet loss retransmission and congestion control.
The front-end server can be a CDN server, so that a user can obtain content to be accessed nearby, namely at least two paths of video streams corresponding to the video playing request nearby, and the response speed of the user access request is improved.
And 4, calling a player control plug-in to create at least two players, wherein the at least two players correspond to the at least two video streams one to one.
In order to realize synchronous playing of multiple video streams, at least two players corresponding to at least two video streams one to one need to be created, as shown in fig. 3, 4 players are created, namely, player 1, player 2, player 3 and player 4. Wherein the created at least two players refer to a plurality of player instances created by the terminal device, and each player instance may be created by calling a multimedia service component of the operating system. The player is used for analyzing the acquired slave video stream and playing the analyzed video stream.
And 5, controlling at least two players to synchronously play the corresponding video streams on the user interface of the client by calling the player control plug-in.
The player control plug-in can be understood as a tool kit having a function of realizing synchronous playing of the video streams corresponding to the players.
The detailed flow of calling the player control plug-in is shown in fig. 4, and the specific steps are as follows:
step S401, the client calls the bottom-layer central control playing platform and starts the multicast picture synchronization function.
Wherein, the bottom layer center console can be understood as an interface of the player control center hub. The player control plug-in can be formed by the bottom layer central control playing platform and the player control center hub. Starting the multicast picture synchronization function may be understood as that, if the client supports a multi-channel video stream synchronization playing function and the video selected by the user at the client includes multiple video streams, the multicast picture synchronization function may be started in response to a video playing request of the user.
Step S402, detecting whether the multicast picture synchronization mode is turned on, if so, executing step S503, and if not, turning on the multicast picture synchronization function again.
In step S403, a multicast picture player control center hub thread is started, where the thread corresponding to the player control center hub shown in fig. 3 is a thread corresponding to the player control plug-in.
In an optional embodiment, the invoking of the player control plug-in includes:
and creating a thread corresponding to the player control plug-in, and calling the player control plug-in through the thread corresponding to the player control plug-in, wherein the thread corresponding to the player control plug-in and the thread corresponding to the player belong to the same process.
Optionally, the player control plug-in may be invoked by creating a thread corresponding to the player plug-in, and for each player, there are corresponding threads, such as a decoding thread and a rendering thread, where the decoding thread corresponding to the player is used to decode the acquired video stream, and the rendering thread is used to perform picture rendering on the decoded video stream. And the thread corresponding to each player and the thread corresponding to the player control plug-in belong to the same large process, so that the thread corresponding to the player and the thread corresponding to the player control plug-in can communicate in the same process, cross-process communication is reduced, and communication efficiency is improved.
As shown in fig. 3, the player 1, the player 2, the player 3, and the player 4 may be continuously controlled to synchronously play the video streams of the respective corresponding video streams on the user interface of the client by invoking the player control plug-in. The method can enable audiences to watch live broadcast at multiple visual angles, and simulate the effect of being personally on the scene. As shown in fig. 5, the display screen shown in fig. 5 can be seen on the user interface of the client, and it can be seen that the user interface of the client has four display areas, namely, a display area 51, a display area 52, a display area 53, and a display area 54, the four display areas correspond to the 4 players, respectively, the main screen is displayed on the display area 51, and 3 sub screens (namely, the sub screen 1, the sub screen 2, and the sub screen 3 shown in the figure) are displayed on the display area 52, the display area 53, and the display area 54, respectively. And, the video streams displayed by the four display areas are different. For example, the main screen may display a panoramic view of a soccer field, the auxiliary screen 1 may display a highlight (e.g., a goal of a player, a dribbling shot of a player, etc.), the auxiliary screen 2 may display a close-up of a player, and the auxiliary screen 3 may display an auditorium screen. The played audio may be only one, for example, the played audio may be a live commentary of a presenter in a studio, and is not limited herein.
Optionally, the video streams displayed by the four display areas are matched with corresponding video streams, and may be partially identical, completely identical, or completely different, and this embodiment of the present application is not limited herein.
Compared with the implementation manner in the prior art, as can be seen from the foregoing steps 1 to 5, in the implementation manner shown in fig. 3 in the embodiment of the present application, when the video streams of the video streams corresponding to the at least two players are synchronously played on the user interface of the client, the video streams are controlled by invoking the player control plug-in, so that the service logic of the client is greatly reduced. The method has the advantages of being convenient to obtain player information, high in timeliness, capable of reducing cross-process communication between the client and the player and capable of reducing CPU load.
The following details the detailed process of the player control plug-in to implement the multi-picture synchronous playing.
In an optional embodiment, the controlling, by the player control plug-in, the at least two players to synchronously play the video streams of the respective corresponding video streams on the user interface of the client includes:
the following operations are repeatedly executed by the player control plug-in until the playing ending condition is met:
acquiring the playing progress of the video stream played by each player;
and taking the slowest playing progress in the playing progresses as a reference playing progress, and controlling the playing progress of the played video stream of each other player according to the difference between the playing progress corresponding to each other player and the playing progress of the reference playing progress, wherein each other player refers to each player except the reference player in the at least two players, and the reference player is the player corresponding to the reference playing progress.
Optionally, since playing the video stream is a continuous process, and multiple paths of video streams need to be continuously and synchronously played, the multiple paths of video streams need to be continuously and repeatedly played through the player control process, and in practical applications, the player control process can repeatedly execute the synchronous playing of the multiple paths of video streams at certain intervals.
The main principle of controlling at least two players to play synchronously by calling the player control plug-in is as follows: the multi-view picture synchronization principle is realized by continuously acquiring the real-time playing position of each player, controlling the pause or the playing of each player and adopting the slowest player as a reference clock object. In one example, the following operations may be repeatedly performed by the player control plug-in until the play end condition is satisfied:
the playing progress of the video stream currently played by each player is obtained, where the playing progress refers to a current playing position of the video stream played by the player, and colloquially, that is, where the video stream played by the player is played, as shown in fig. 6, it can be seen that, among the four players, the player 1 is the slowest player 1 in playing progress, assuming that the playing progress of the video stream currently played by the player 1 is time 1, the playing progress of the video stream currently played by the player 2 is time 2, the playing progress of the video stream currently played by the player 3 is time 3, and the playing progress of the video stream currently played by the player 4 is time 4, the player 1 can be used as a reference player, and the playing progress corresponding to the reference player is used as a reference playing progress.
Then, the difference between the playing rate corresponding to each of the player 2, the player 3, and the player 4 and the reference playing rate corresponding to the reference player (i.e., the player 1) is calculated, that is, the time difference 1 between the time 2 and the time 1, the time difference 2 between the time 3 and the time 1, and the time difference 3 between the time 4 and the time 1 are calculated, respectively. The time difference is the play progress difference described above.
Then, the playing progress of the video streams played by the player 2, the player 3 and the player 4 is controlled by the obtained time difference 1, the time difference 2 and the time difference 3.
The player control process is a continuous loop process when controlling synchronous playing of each player, where the loop period is very small, for example, the loop period may be once in 20ms (millisecond), and the loop end condition may be that a request for stopping watching the video is received from a user, or that the video playing is ended, which is not limited herein.
By the method and the device, the video streams of the players can be continuously synchronized through the player control process, on one hand, the video streams with multiple visual angles can be provided for users, the impression experience of the users is improved, and on the other hand, the service logic of the client side is reduced.
The following describes how to control the playing progress of the video streams played by the players other than the reference player.
In an optional embodiment, the invoking a player control plug-in to control the at least two players to synchronously play the respective corresponding video streams on the user interface of the client includes:
the following operations are repeatedly executed by the player control plug-in until the playing ending condition is met:
acquiring the playing progress of the video stream played by each player;
and taking the slowest playing progress in the playing progresses as a reference playing progress, and controlling the playing progress of the played video stream of each other player according to the difference between the playing progress corresponding to each other player and the playing progress of the reference playing progress, wherein each other player refers to each player except the reference player in the at least two players, and the reference player is the player corresponding to the reference playing progress.
Alternatively, considering that the attention of the human eye is in the time range of 2s, the human eye may recognize that the picture is out of synchronization when the attention is longer than 2s, and thus the first threshold may be set to 2s (seconds). The second threshold may be an empirical value, such as 400ms, and is not limited herein.
For each of the other players, there may be the following situations for controlling the playing progress of the video stream played by the player:
case 1: for each of the other players, if the difference between the playing progress of the player and the reference player progress of the reference player is greater than or equal to the first threshold (2 s), human eyes may recognize that the player is not synchronized because the difference between the playing progress of the player and the reference player is greater than or equal to 2s, at this time, the player may be in a free playing state, and the free playing may be understood as causing the player to play the video stream corresponding to the player according to its own playing progress.
For example, as shown in fig. 6, if the time difference value 1 (i.e., the play progress difference) between the player 2 and the reference player (i.e., the player 1) in fig. 6 is greater than 2s, the player 2 can be made to be in the free play state.
Case 2: for each of the other players, if the difference between the playing schedules of the player and the reference player schedule of the reference player is less than or equal to the second threshold (400 ms), it indicates that the difference between the playing schedules of the player and the reference player is relatively small, and for a human, the human cannot perceive that the player and the reference player are not synchronous, so that the player can be in a normal playing state, and the corresponding video stream can be continuously played according to the playing schedule corresponding to the player.
For example, as shown in fig. 6, if the time difference 3 (i.e., the play progress difference) between the player 4 and the reference player (i.e., the player 1) in fig. 6 is less than 400ms, the player 4 may continue to play according to its own play progress.
In case 3, for each of the other players, if the difference between the playing progress of the player and the reference player progress of the reference player is greater than the second threshold (400 ms) and smaller than the first threshold (2 s), at this time, the player needs to be synchronously played, optionally, the playing progress of the player may be controlled according to the difference between the playing progress of the player and the reference player, for example, the player may be paused for a certain duration, and the duration of the paused playing is not greater than the playing progress difference.
For example, as shown in fig. 6, if the time difference 2 (i.e., the play progress difference) between the player 3 and the reference player (i.e., the player 1) in fig. 6 is greater than 400ms and less than 2s, the player 3 may be paused for a certain period of time so that the play progress difference between the player and the reference player becomes small.
According to the above situations, the players can be controlled to be in a relatively synchronous state.
Through the embodiment of the application, the playing progress of other players can be controlled through the playing progress difference between other players and the reference player and the size between the first threshold and the second threshold, the mode is simple and flexible, and the efficiency is improved.
In an optional embodiment, for each of the other players, the controlling the playing progress of the player according to the playing progress difference corresponding to the player includes:
if the player is in a first state, controlling the video stream of the player to be in a second state, wherein the maximum duration of the player in the second state is equal to the playing progress difference, the first state is a playing state, and the second state is a pause state;
if the player is in the second state, the player is kept in the second state.
Optionally, for each player whose play progress difference between the play progress of the player in the other players and the play progress of the reference player is greater than the second threshold and smaller than the first threshold, controlling the play progress of the player according to the play progress difference corresponding to the player may be implemented in the following manner:
the method includes the steps of firstly obtaining current state information of the player, and if the player is in a first state (namely a playing state), switching the player from the first state to a second state, namely switching the playing state to a pause state, wherein the maximum duration of the player in the pause state is equal to the corresponding playing progress difference. If the player is in the second state (i.e., the paused state), the player may continue to be maintained in the paused state.
Optionally, the following describes in detail a process of controlling each player to perform synchronous playing by invoking a player control plug-in, with reference to an example, as shown in fig. 7, the specific process is as follows:
step 1, performing enqueue operation on players corresponding to each path of video stream, wherein the queue is a play queue, acquiring specific play time (i.e. play progress) of a play picture (i.e. video stream) of each player in the queue, comparing the specific play time of each player one by one, finding the player with the slowest play progress as a reference player, taking the specific play time corresponding to the reference player as a reference clock (i.e. reference play progress), and taking audio time of the reference player as an audio reference clock. The audio reference clock can be used as a reference clock for the audio of all players, and for the user, the sound heard at the client is based on the audio reference clock. Wherein the clock unit is milliseconds (ms).
When the specific playing time of the playing picture of each player is determined, the playing progress corresponding to each player can be determined according to the timestamp of the corresponding video stream.
And 2, after the reference clock is received, judging the difference value between the playing progress of the video streams played by other players and the reference clock, namely determining the playing progress difference between the playing progress of each player and the reference player. The playing progress difference may be used as a reference threshold for adjusting synchronous playing of multiple players, and a value range of the playing progress difference is [400ms,2s ], that is, if the playing progress difference between the playing progress of the other players and the playing progress of the reference player is within a range of [400ms,2s ], the playing progress of the other players needs to be adjusted, so that the playing progress of the other players and the playing progress of the reference player are in relatively same synchronous playing (relative to synchronous playing which cannot be perceived by human eyes).
In an optional example, for each player whose play progress difference from the reference player is greater than 400ms and less than 2s, the player is considered to be a player ahead of the reference player, and a synchronization link needs to be entered, that is, whether the player is in a play state (i.e., start state) is determined, if so, the player is in a pause state (i.e., pause state), and the play progresses of the player and the reference player are synchronized by pausing the player. Because the synchronous playing is always in a loop, when the synchronous playing is performed next time, whether the playing progress difference between the player and the reference player of the next loop is less than 400ms can be judged, and if the playing progress difference is less than the playing progress difference, the player can be switched from the pause state to the playing state when the playing is performed next time.
The attention of human eyes is within 2s, and human eyes can recognize that the pictures are not synchronous when exceeding 2s, so that the pictures are synchronous within a range smaller than 2s in a pause mode.
For each player with the playing progress difference with the reference player being greater than 2 seconds, because the attention of human eyes is within 2s, and human eyes can recognize that the pictures are not synchronous after exceeding 2s, the player is in a free playing state and is not synchronous with other video streams in real time for each player with the playing progress difference with the reference player being greater than 2 seconds, because if the players are synchronous, the pictures are blocked due to too long pause time, and the visual experience is influenced.
For each player with the playing progress difference smaller than 400ms from the reference player, the player can normally play according to the corresponding playing progress regardless of whether the player is in the playing state.
In an optional embodiment, for each video stream, the video stream includes video data and audio data, the audio data and the video data have respective corresponding timestamps, and the acquiring a playing progress of the video stream played by each player includes:
for each player, executing the following operations by the player control plug-in to obtain the playing progress of the video stream played by the player:
acquiring a first time stamp of audio data and a second time stamp of video data of a video stream currently played by the player;
if the time difference between the first time stamp and the second time stamp is greater than or equal to a third threshold, controlling the synchronization of the audio data and the video data played by the player according to the time difference;
and taking the playing time information of the synchronized audio data and video data as the playing progress of the player.
Optionally, each video stream includes video data and audio data, and timestamps corresponding to the video data and the audio data, for each player, besides ensuring synchronous playing with other players, for the player itself, it is also necessary to ensure sound-picture synchronization of the player, that is, ensuring synchronous playing of the audio data and the video data corresponding to the player, and the specific implementation process is as follows:
for the video stream corresponding to each player, the following operations are executed by the player control plug-in:
the method includes the steps of obtaining a first time stamp of audio data of a video stream currently played by the player and a second time stamp of the video data, determining a time difference value between the first time stamp of the audio data of the video stream currently played by the player and the second time stamp of the video data, if the time difference value between the first time stamp and the second time stamp is greater than or equal to a third threshold (such as 50 ms), indicating that the playing progress of the video data is slower than that of the audio data, adopting a synchronization strategy of dropping a part of video frames to catch up an audio clock, if the time difference value is smaller than the third threshold, indicating that the playing progress of the video data is faster than that of the audio data, and adopting a strategy of waiting or slow playing (such as 0.6-time playing) to make the playing progress of the audio data catch up with that of the video data, even if the video data is paused for a certain time or the video data is played at a speed lower than a normal speed. Wherein the third threshold is associated with perception by the human ear, beyond which the human ear may perceive that there is a distinct discontinuity in sound.
In the scenario of synchronous playing by multiple players, in order to further improve the precision of synchronous playing, the second threshold may be adjusted based on the threshold for sound-picture synchronization by a single player. Theoretically, the processing precision of the synchronized playing cannot exceed the precision of the synchronized time (i.e. the third threshold) of the single player, and in practical application, the second threshold can be close to the synchronization precision of the single player according to the scene, and meanwhile, attention needs to be paid to the influence of the synchronization of the single player on the synchronization strategy of the multi-player. That is, in practical applications, the second threshold is greater than the third threshold. In an optional example, the second threshold may also be 400ms to 50ms =350ms, and the embodiment of the present application is not limited in any way as to a specific value of the second threshold.
According to the above manner, the video stream corresponding to each player can be subjected to sound-picture synchronization processing, and the playing time information corresponding to the video stream subjected to the sound-picture synchronization processing is used as the playing progress of the corresponding player.
By the embodiment of the application, synchronous playing among the players is ensured, and meanwhile, sound and picture synchronization of each player can be ensured through the player control process, so that higher-quality playing effect and visual experience are provided.
In an optional embodiment, for each video stream, the video stream includes video data and audio data, and the invoking player control plug-in controls the at least two players to synchronously play respective corresponding video streams on the user interface of the client:
and calling a player control plug-in to control a player corresponding to a target video stream in the at least two video streams to play audio data and video data of the target video stream, and to control other players except the player corresponding to the target video stream to play video data of respective corresponding video streams, wherein the target video stream is one of the at least two video streams.
Optionally, in practical applications, the user interface of the client may display video streams of video streams corresponding to at least two players, and for each video stream data, there may be corresponding audio data, and if the audio data corresponding to at least two video streams is played at the client at the same time, it is unreasonable that the user can hear at least two audio streams at the same time, and in order to avoid this, only one audio stream may be provided, where the audio stream is the reference audio. Optionally, an audio reference clock may be set, and the audio reference clock may be used as a reference clock for audio corresponding to all video streams. The reference audio corresponding to the audio reference clock may only include a single-channel audio, or may include at least two channels of audio. For example, the reference audio may only include the commentary audio corresponding to the commentator, or may be a mixed audio including the commentary audio corresponding to the commentator and the auditorium audio of the live audience, which is not limited herein.
In an optional example, a player control plug-in may control a player corresponding to a target video stream of the at least two video streams to play audio data of the target video stream, where the target video stream may be one of the at least two video streams, and control other players except the player corresponding to the target video stream to play video data of respective corresponding video streams. The following details a detailed process of playing audio data corresponding to the target video stream. The target video stream is a video stream corresponding to a main picture hereinafter.
Each video stream may correspond to a reference audio, that is, each player has a corresponding reference audio, and the reference audio corresponding to each player is matched with the video stream of the corresponding video stream. For example, in the case of a soccer game, assume that there are 3 video streams, video stream 1, video stream 2, and video stream 3. Where video stream 1 corresponds to a studio view and the corresponding reference audio is the commentator audio. Video stream 2 is the auditorium view angle and the corresponding reference audio is the auditorium audio. The video stream 3 is the view angle of the football court, and the corresponding reference audio is the mixed audio corresponding to the commentator audio, the auditorium audio and the whistle of the referee. At the client, the user can freely select an interested main picture, and control to play the corresponding reference audio corresponding to the main picture selected by the user, for example, if the main picture selected by the user is a video stream corresponding to a view angle of a football court, the audio played at this time is a mixed audio corresponding to commentator audio + audience audio + referee whistle. When the user switches the main picture view angle to the studio view angle, the played reference audio can be switched to the corresponding commentator audio.
It can be understood that the above is only an example, and the embodiment of the present application is not limited to how to play audio.
According to the method and the device, the player control plug-in can be used for controlling and playing the audio data corresponding to the target video stream, and the audio data corresponding to the target video stream is played due to the fact that the target video stream is related to the main picture visual angle selected by the user, so that user experience is greatly improved.
In an optional embodiment, the user interface of the client includes a first display area and at least one second display area, and the controlling the at least two players to synchronously play the respective video streams on the user interface of the client includes:
controlling a first player of the at least two players to play a video stream corresponding to the first player in a first display area of a user interface of the client, and controlling second players except the first player to play a video stream corresponding to each second display area;
the target video stream is a video stream corresponding to a first display area;
optionally, the method may further include:
and responding to the video stream switching operation of a user, controlling a second player corresponding to the video stream switching operation to play a corresponding video stream in a first display area through the player control plug-in, and controlling the first player to play a corresponding video stream in a second display area.
Optionally, the user interface of the client includes a first display area and at least one second display area, as shown in fig. 5, the display area corresponding to the main picture is the first display area, and the display areas corresponding to the auxiliary pictures 1, 2, and 3 are all the second display areas. That is, the display area 51 shown in fig. 5 is a first display area, and the display area 52, the display area 53, and the display area 54 are second display areas.
Through the player control plug-in, at least two players are controlled to synchronously play the video streams of the respective corresponding video streams on the user interface of the client, which can be realized according to the following modes:
a first player of the at least two players may be controlled to play the corresponding video stream in a first display area of the client, where the video stream played by the first player is the target video stream, that is, the target video stream may be played in the first display area, and each of the second players except the first player may be controlled to play the video stream of the corresponding video stream in the corresponding second display area,
for example, in one example, a video stream of a video stream corresponding to the first player may be displayed in the display area 51 (i.e., the first display area) as shown in fig. 5. Video streams of video streams corresponding to players other than the first player are displayed in the display area 52, the display area 53, and the display area 54, respectively.
Optionally, the user may initiate a target video stream switching operation, and through the target video stream switching operation, the user may switch a picture in which the user is interested to be a main picture at will, at this time, control a second player corresponding to the target video stream switching operation to play a video stream of a corresponding video stream in the first display area, and switch a video stream of the first player, which was played in the main picture originally, to a second display area for playing.
For example, in one example, it is assumed that a video stream of a video stream corresponding to the player 1 is displayed in the display area 51 (i.e., the first display area) as shown in fig. 5. The video stream corresponding to the player 2 is displayed on the display area 52, the video stream corresponding to the player 3 is displayed on the display area 53, and the video stream corresponding to the player 4 is displayed on the display area 54. When receiving a target video stream switching operation of a user, for example, displaying a video stream of a video stream corresponding to the player 4 on the main screen, at this time, the player 1 is controlled to display the video stream of the video stream corresponding to the player 1 on the display area 54, the player 4 is controlled to display the video stream of the video stream corresponding to the player 4 on the display area 51, and the video streams of the respective corresponding video streams are continuously displayed on the display areas where the player 2 and the player 3 are originally located.
According to the embodiment of the application, the video streams of the players can be displayed through the display areas, the main picture can be switched according to the switching operation of the target video stream of the user, the user can freely switch the perceptual picture to be the main picture, and the watching experience of watching the video by the user is improved.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a playback control apparatus for multiple videos according to an embodiment of the present application. The playing control device 1 for multiple channels of videos provided by the embodiment of the present application includes:
a video stream obtaining module 11, configured to respond to a received video playing request, and obtain at least two video streams corresponding to the video playing request, where the at least two video streams are video streams corresponding to a same scene;
a creating module 12, configured to invoke a player control plug-in, and create at least two players, where the at least two players correspond to the at least two video streams one to one;
and a video stream playing control module 13, configured to control the at least two players to synchronously play the respective corresponding video streams on the user interface of the client through the player control plug-in.
In an optional embodiment, when the player control plug-in is called, the video stream playing control module is configured to:
and creating a thread corresponding to the player control plug-in, and calling the player control plug-in through the thread corresponding to the player control plug-in, wherein the thread corresponding to the player control plug-in and the thread corresponding to the player belong to the same process.
In an optional embodiment, when the video stream playing control module controls the at least two players to synchronously play the respective video streams on the user interface of the client through the player control plug-in, the video stream playing control module is configured to:
the following operations are repeatedly executed by the player control plug-in until the playing ending condition is met:
acquiring the playing progress of the video stream played by each player;
and taking the slowest playing progress in the playing progresses as a reference playing progress, and controlling the playing progress of the played video stream of each other player according to the difference between the playing progress corresponding to each other player and the playing progress of the reference playing progress, wherein each other player refers to each player except the reference player in the at least two players, and the reference player is the player corresponding to the reference playing progress.
In an optional embodiment, when controlling the playing progress of the played video stream of each of the other players, the video stream playing control module is configured to:
for each of the other players, if the playing progress difference corresponding to the player is greater than or equal to a first threshold, or if the playing progress difference corresponding to the player is less than or equal to a second threshold, playing the video stream corresponding to the player according to the playing progress of the player, wherein the first threshold is greater than the second threshold;
and for each of the other players, if the playing progress difference corresponding to the player is smaller than the first threshold and larger than the second threshold, controlling the playing progress of the player according to the playing progress difference corresponding to the player.
In an optional embodiment, for each of the other players, when the video stream playing control module controls the playing progress of the player according to the playing progress difference corresponding to the player, the video stream playing control module is configured to:
if the player is in a first state, controlling the video stream of the player to be in a second state, wherein the maximum duration of the player in the second state is equal to the playing progress difference, the first state is a playing state, and the second state is a pause state;
and if the player is in the second state, keeping the player in the second state.
In an optional embodiment, for each video stream, the video stream includes video data and audio data, where the audio data and the video data have respective corresponding timestamps, and the video stream playing control module, when acquiring a playing progress of the video stream played by each player, is configured to:
for each player, executing the following operations by the player control plug-in to obtain the playing progress of the video stream played by the player:
acquiring a first time stamp of audio data and a second time stamp of video data of a video stream currently played by the player;
if the time difference between the first time stamp and the second time stamp is greater than or equal to a third threshold, controlling the synchronization of the audio data and the video data played by the player according to the time difference;
and taking the playing time information of the synchronized audio data and video data as the playing progress of the player.
In an optional embodiment, for each video stream, the video stream includes video data and audio data, and the video stream playing control module, when invoking a player control plug-in to control the at least two players to synchronously play the respective video streams on the user interface of the client, is configured to:
and calling the player control plug-in, controlling a player corresponding to a target video stream in the at least two video streams to play audio data and video data of the target video stream, and controlling other players except the player corresponding to the target video stream to play video data of respective corresponding video streams, wherein the target video stream is one of the at least two video streams.
In an optional embodiment, the user interface of the client includes a first display area and at least one second display area, and the video stream playing control module, when controlling the at least two players to synchronously play the respective video streams on the user interface of the client, is configured to:
controlling a first player of the at least two players to play a video stream corresponding to the first player in a first display area of a user interface of the client, and controlling second players except the first player to play a video stream corresponding to each second display area;
the target video stream is a video stream corresponding to a first display area;
the apparatus further comprises a video stream switching module configured to:
and responding to the video stream switching operation of a user, controlling a second player corresponding to the video stream switching operation to play a corresponding video stream in a first display area through the player control plug-in, and controlling the first player to play a corresponding video stream in a second display area.
According to the method and the device, the player control plug-in is called to control the synchronous playing of the video streams on the user interface of the client, and the client only needs to receive the synchronous playing result of the player control plug-in on the multiple video streams, so that the complexity of the business logic for realizing the synchronous playing of the multiple video streams by the client is reduced, and the development difficulty of the client is reduced.
In a specific implementation, the playing control device 1 of the multiple channels of videos may execute the implementation manners provided in the above steps in fig. 2 through the built-in functional modules, which may be referred to the implementation manners provided in the above steps, and will not be described herein again.
Although the execution subject is mainly described as hardware to implement the multi-channel video playing control method in the present application, the execution subject of the multi-channel video playing control method in the present application is not limited to hardware, the execution subject of the multi-channel video playing control method in the present application may also be software, and the multi-channel video playing control device may be a computer program (including program codes) running in a computer device, for example, the multi-channel video playing control device is an application software; the apparatus may be used to perform the corresponding steps in the methods provided by the embodiments of the present application.
In some embodiments, the playing control Device of the multi-channel video provided in the embodiments of the present Application may be implemented by combining hardware and software, and as an example, the playing control Device of the multi-channel video provided in the embodiments of the present Application may be a processor in the form of a hardware decoding processor, which is programmed to execute the playing control method of the multi-channel video provided in the embodiments of the present Application, for example, the processor in the form of the hardware decoding processor may employ one or more Application Specific Integrated Circuits (ASICs), DSPs, programmable Logic Devices (PLDs), complex Programmable Logic Devices (CPLDs), field Programmable Gate Arrays (FPGAs), or other electronic components.
In other embodiments, the playing control device for multiple videos provided in this embodiment of the present application may be implemented in a software manner, and the playing control device 1 for multiple videos shown in fig. 8 may be software in the form of programs, plug-ins, and the like, and includes a series of modules, including a video stream obtaining module 11, a creating module 12, and a video stream playing control module, for implementing the playing control method for multiple videos provided in this embodiment of the present application.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 9, the electronic device 1000 in the present embodiment may include: the processor 1001, the network interface 1004, and the memory 1005, in addition, the electronic device 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 9, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the electronic device 1000 shown in fig. 9, the network interface 1004 may provide a network communication function; the user interface 1003 is an interface for providing a user with input; and the processor 1001 may be used to invoke computer programs stored in the memory 1005.
It should be understood that in some possible embodiments, the processor 1001 may be a Central Processing Unit (CPU), and the processor may be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The memory may include both read-only memory and random access memory, and provides instructions and data to the processor. The portion of memory may also include non-volatile random access memory. For example, the memory may also store device type information.
In a specific implementation, the electronic device 1000 may execute, through each built-in functional module thereof, the implementation manner provided in each step in fig. 2, which may be specifically referred to as the implementation manner provided in each step, and is not described herein again.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and is executed by a processor to implement the method provided in each step in fig. 2, which may specifically refer to the implementation manner provided in each step, and is not described herein again.
The computer readable storage medium may be an internal storage unit of the task processing device provided in any of the foregoing embodiments, for example, a hard disk or a memory of an electronic device. The computer readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, a flash card (flash card), and the like, which are provided on the electronic device. The computer readable storage medium may further include a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), and the like. Further, the computer readable storage medium may also include both an internal storage unit and an external storage device of the electronic device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the electronic device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided by any one of the possible embodiments of fig. 2.
The terms "first", "second", and the like in the claims and in the description and drawings of the present application are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments. The term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. 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 application.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (11)

1. A playing control method of a multi-channel video is characterized by comprising the following steps:
responding to a received video playing request, and acquiring at least two video streams corresponding to the video playing request, wherein the at least two video streams are video streams corresponding to the same scene;
calling a player control plug-in to create at least two players, wherein the at least two players correspond to the at least two video streams one by one;
and controlling the at least two players to synchronously play the video streams corresponding to the players on the user interface of the client through the player control plug-in.
2. The method of claim 1, wherein invoking the player control plug-in comprises:
and creating a thread corresponding to the player control plug-in, and calling the player control plug-in through the thread corresponding to the player control plug-in, wherein the thread corresponding to the player control plug-in and the thread corresponding to the player belong to the same process.
3. The method according to claim 1, wherein the controlling, by the player control plug-in, the at least two players to synchronously play the respective corresponding video streams on the user interface of the client comprises:
repeatedly executing the following operations by the player control plug-in until a playing ending condition is met:
acquiring the playing progress of the video stream played by each player;
and taking the slowest play progress in the play progresses as a reference play progress, and controlling the play progress of the played video stream of each other player according to the difference between the play progress corresponding to each other player and the play progress of the reference play progress, wherein each other player refers to each player except the reference player in the at least two players, and the reference player is the player corresponding to the reference play progress.
4. The method of claim 3, wherein the controlling the progress of the playing of the played video stream of each of the other players comprises:
for each of the other players, if the playing progress difference corresponding to the player is greater than or equal to a first threshold, or if the playing progress difference corresponding to the player is less than or equal to a second threshold, playing the video stream corresponding to the player according to the playing progress of the player, where the first threshold is greater than the second threshold;
and for each of the other players, if the playing progress difference corresponding to the player is smaller than the first threshold and larger than the second threshold, controlling the playing progress of the player according to the playing progress difference corresponding to the player.
5. The method of claim 4, wherein for each of the other players, the controlling the playing progress of the player according to the playing progress difference corresponding to the player comprises:
if the player is in a first state, controlling the video stream of the player to be in a second state, wherein the maximum duration of the player in the second state is equal to the playing progress difference, the first state is a playing state, and the second state is a pause state;
and if the player is in the second state, keeping the player in the second state.
6. The method according to claim 3, wherein for each video stream, the video stream includes video data and audio data, the audio data and the video data have respective corresponding timestamps, and the obtaining the playing progress of the video stream played by each player includes:
for each player, the following operations are executed by the player control plug-in to obtain the playing progress of the video stream played by the player:
acquiring a first time stamp of audio data and a second time stamp of video data of a video stream currently played by the player;
if the time difference value between the first time stamp and the second time stamp is greater than or equal to a third threshold value, controlling the synchronization of the audio data and the video data played by the player according to the time difference value;
and taking the playing time information of the synchronized audio data and video data as the playing progress of the player.
7. The method according to claim 1, wherein for each video stream, the video stream includes video data and audio data, and the invoking a player control plug-in controls the at least two players to synchronously play the respective video streams on the user interface of the client, including:
and calling the player control plug-in, controlling a player corresponding to a target video stream in the at least two video streams to play audio data and video data of the target video stream, and controlling other players except the player corresponding to the target video stream to play video data of respective corresponding video streams, wherein the target video stream is one of the at least two video streams.
8. The method according to claim 7, wherein the user interface of the client includes a first display area and at least one second display area, and the controlling the at least two players to synchronously play the respective corresponding video streams on the user interface of the client comprises:
controlling a first player of the at least two players to play a video stream corresponding to the first player in a first display area of a user interface of the client, and controlling second players except the first player to play a video stream corresponding to each second display area;
the target video stream is a video stream corresponding to a first display area;
the method further comprises the following steps:
responding to the video stream switching operation of a user, controlling a second player corresponding to the video stream switching operation to play a corresponding video stream in a first display area through the player control plug-in, and controlling the first player to play a corresponding video stream in a second display area.
9. A playback control apparatus for a plurality of videos, comprising:
the video stream acquisition module is used for responding to a received video playing request and acquiring at least two video streams corresponding to the video playing request, wherein the at least two video streams are video streams corresponding to the same scene;
the creating module is used for calling a player control plug-in and creating at least two players, and the at least two players correspond to the at least two paths of video streams one by one;
and the video stream playing control module is used for controlling the at least two players to synchronously play the respective corresponding video streams on the user interface of the client through the player control plug-in.
10. An electronic device comprising a processor and a memory, the processor and the memory being interconnected;
the memory is used for storing a computer program;
the processor is configured for performing the method as claimed in any one of claims 1 to 8 when the computer program is invoked.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method as claimed in any one of claims 1 to 8.
CN202110587377.1A 2021-05-27 2021-05-27 Multi-channel video playing control method and device, electronic equipment and storage medium Pending CN115412736A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110587377.1A CN115412736A (en) 2021-05-27 2021-05-27 Multi-channel video playing control method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110587377.1A CN115412736A (en) 2021-05-27 2021-05-27 Multi-channel video playing control method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115412736A true CN115412736A (en) 2022-11-29

Family

ID=84156293

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110587377.1A Pending CN115412736A (en) 2021-05-27 2021-05-27 Multi-channel video playing control method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115412736A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116366905A (en) * 2023-02-28 2023-06-30 北京优酷科技有限公司 Video playing method and device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116366905A (en) * 2023-02-28 2023-06-30 北京优酷科技有限公司 Video playing method and device and electronic equipment
CN116366905B (en) * 2023-02-28 2024-01-09 北京优酷科技有限公司 Video playing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN114984569B (en) Detecting and compensating for display hysteresis in gaming systems
US11366632B2 (en) User interface for screencast applications
CN111526927B (en) Temporary game control via user simulation after loss of active control
US11356713B2 (en) Live interactive video streaming using one or more camera devices
US8875204B2 (en) Information processor, information processing method and program
CA2808309C (en) A system and method for synchronized playback of streaming digital content
EP3807766B1 (en) Shadow tracking of real-time interactive simulations for complex system analysis
CN113457123B (en) Interaction method and device based on cloud game, electronic equipment and readable storage medium
US11481983B2 (en) Time shifting extended reality media
CN112752109B (en) Video playing control method and system
JP2008053916A (en) Content distribution system, information terminal equipment, content distribution method, and image switching program
CN105898395A (en) Network video playing method, device and system
CN114546308A (en) Application interface screen projection method, device, equipment and storage medium
CN114895787A (en) Multi-person interaction method and device, electronic equipment and storage medium
CN115412736A (en) Multi-channel video playing control method and device, electronic equipment and storage medium
KR101922968B1 (en) Live streaming method for virtual reality contents and system thereof
KR101915065B1 (en) Live streaming system for virtual reality contents and operating method thereof
CN114554277B (en) Multimedia processing method, device, server and computer readable storage medium
CN107613376A (en) A kind of live broadcasting method and device
CN112995692A (en) Interactive data processing method, device, equipment and medium
KR102051985B1 (en) Synchronization of Media Rendering in Heterogeneous Networking Environments
CN114125576A (en) Multimedia resource synchronization method and device, storage medium and electronic equipment
CN113490001A (en) Audio and video data sharing method, server, device and medium
CN117768708A (en) Local video loop display method in video conference, electronic equipment and storage medium
EE et al. Published

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