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

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

Info

Publication number
CN112911343A
CN112911343A CN202110061697.3A CN202110061697A CN112911343A CN 112911343 A CN112911343 A CN 112911343A CN 202110061697 A CN202110061697 A CN 202110061697A CN 112911343 A CN112911343 A CN 112911343A
Authority
CN
China
Prior art keywords
video
sub
time information
main
playing
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.)
Granted
Application number
CN202110061697.3A
Other languages
Chinese (zh)
Other versions
CN112911343B (en
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202110061697.3A priority Critical patent/CN112911343B/en
Publication of CN112911343A publication Critical patent/CN112911343A/en
Application granted granted Critical
Publication of CN112911343B publication Critical patent/CN112911343B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/236Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream
    • H04N21/2365Multiplexing of several video streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/242Synchronization processes, e.g. processing of PCR [Program Clock References]
    • 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/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering

Abstract

The embodiment of the invention provides a method and a device for playing multi-channel videos, electronic equipment and a storage medium, wherein the method is applied to the electronic equipment and comprises the following steps: under the condition that a playing instruction for multiple paths of videos is obtained, obtaining current playing time information of a main video and starting time information of each path of video, wherein the multiple paths of videos comprise the main video and sub videos, and the contents of the main video and the sub videos have correlation; determining a first target video frame in each path of sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video, wherein the playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video; and playing the main video from the currently played video frame of the main video, and starting to play each path of sub-video from the corresponding first target video frame. By adopting the embodiment of the invention, the synchronous playing of the multi-channel video can be realized.

Description

Multi-channel video playing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method and an apparatus for playing multiple channels of video, an electronic device, and a storage medium.
Background
When a user watches videos of sports events, art programs and the like, there may be a need to watch multiple different videos with relevance at the same time. For example, a user may wish to view a video of a fan and a video of a tutor at the same time while viewing a video of a fantasy program of the dance game class.
Currently, for the purpose of playing multiple videos simultaneously, multiple players may be used to play multiple videos simultaneously. However, since the players are independent of each other, the user may not have good control, so that the players may not be able to play multiple channels of video at the same time.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for playing multi-channel videos, electronic equipment and a storage medium, so as to realize synchronous playing of the multi-channel videos. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for playing multiple channels of videos, where the method is applied to an electronic device, and the method includes:
under the condition that a playing instruction for multiple paths of videos is obtained, obtaining current playing time information of a main video and starting time information of each path of video, wherein the multiple paths of videos comprise the main video and sub videos, and the contents of the main video and the sub videos have correlation;
determining a first target video frame in each path of the sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video, wherein the playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video;
and playing the main video from the currently played video frame of the main video, and starting to play each path of the sub video from the corresponding first target video frame.
Optionally, the step of determining a first target video frame in each path of the sub-video based on the current playing time information and the start time information of the main video and the start time information of the sub-video includes:
calculating a difference value between a time point represented by the current playing time information and a time point represented by the start time information of the main video as a first difference value;
calculating, for each path of the sub video, a difference between a time point indicated by start time information of the sub video and a time point indicated by start time information of the main video as a second difference;
calculating a difference value between the first difference value and a second difference value corresponding to each path of the sub-video, and determining target playing time information of the sub-video based on the difference value and a time point represented by the starting time information of the sub-video;
and determining the video frame corresponding to the target playing time information of the sub-video as the first target video frame of the sub-video for each path of the sub-video.
Optionally, before the step of obtaining the current playing time information of the main video and the start time information of each path of video, the method further includes:
acquiring a video description file, wherein the video description file comprises start time information of each path of video in a plurality of paths of videos;
analyzing the video description file to obtain the start time information of each path of video;
the step of obtaining the current playing time information of the main video and the starting time information of each path of video comprises the following steps:
and acquiring the current playing time information of the main video, and reading the starting time information of each path of video.
Optionally, before the step of determining the first target video frame in each path of the sub-video based on the current playing time information and the start time information of the main video and the start time information of the sub-video, the method further includes:
determining whether a time point represented by the current play time information of the main video is earlier than a time point represented by the start time information of the sub video;
when the time point represented by the current playing time information of the main video is not earlier than the time point represented by the starting time information of the sub video, the step of determining a first target video frame in each path of the sub video based on the current playing time information of the main video, the starting time information and the starting time information of the sub video is executed;
and under the condition that the time point represented by the current playing time information of the main video is earlier than the time point represented by the starting time information of the sub video, playing the main video from the current playing video frame of the main video, and displaying playing prompt information when the difference value between the time point represented by the starting time information of the sub video and the time point represented by the current playing time information of the main video is not more than a preset threshold value, wherein the playing prompt information is used for prompting a user that the sub video is about to be played.
Optionally, after the steps of playing the main video from the currently played video frame of the main video and playing each path of the sub-video from the corresponding first target video frame, the method further includes:
when a progress adjustment instruction is obtained, determining a video frame after progress adjustment from the main video, wherein the video frame after progress adjustment is a video frame corresponding to playing time information indicated by the progress adjustment instruction in the main video;
determining a second target video frame in each path of the sub-video based on the playing time information indicated by the progress adjusting instruction, the starting time information of the main video and the starting time information of the sub-video;
and continuously playing the main video from the video frame after the progress adjustment, and continuously playing each path of the sub video from the corresponding second target video frame.
Optionally, the main video and each path of the sub-video are generated in advance;
the generation mode of the main video and each path of the sub video comprises the following steps:
acquiring original video data of the main video and original video data of each path of the sub video;
and respectively compressing the original video data of the main video and the original video data of each path of the sub-video to obtain the main video and each path of the sub-video, wherein the key frame interval of the main video and each path of the sub-video is less than 1 second.
Optionally, the electronic device comprises a player;
the step of playing the main video from the currently played video frame of the main video and playing each path of the sub-video from the corresponding first target video frame includes:
rendering the currently played video frame of the main video to a preset main video display area through the player so that the player plays the main video from the currently played video frame of the main video;
and for each path of the sub-video, rendering the first target video frame of the sub-video to a preset sub-video display area corresponding to the sub-video through the player, so that the player starts to play the sub-video from the first target video frame of the sub-video.
Optionally, the electronic device comprises a plurality of decoders;
before the step of determining the first target video frame in each path of the sub-video based on the current playing time information, the start time information of the main video and the start time information of the sub-video, the method further includes:
and respectively decoding the main video and each path of the sub video through the plurality of decoders to obtain the main video after decoding processing and each path of the sub video after decoding processing.
In a second aspect, an embodiment of the present invention provides a multi-channel video playing apparatus, which is applied to an electronic device, and the apparatus includes:
the information acquisition module is used for acquiring current playing time information of a main video and start time information of each path of video under the condition of acquiring a playing instruction for a plurality of paths of videos, wherein the plurality of paths of videos comprise the main video and sub videos, and the contents of the main video and the sub videos have correlation;
a first target video frame determining module, configured to determine a first target video frame in each path of the sub-video based on current playing time information and starting time information of the main video and starting time information of the sub-video, where playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video;
and the first video playing module is used for playing the main video from the currently played video frame of the main video and playing each path of the sub video from the corresponding first target video frame.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the steps of the multi-channel video playing method when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method for playing multiple videos includes any one of the above steps.
In the scheme provided by the embodiment of the invention, under the condition that the electronic equipment acquires the playing instruction aiming at the multi-channel video, the current playing time information of the main video and the starting time information of each channel of video are acquired, wherein the multi-channel video comprises the main video and the sub video, and the contents of the main video and the sub video have correlation; determining a first target video frame in each path of sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video, wherein the playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video; and playing the main video from the currently played video frame of the main video, and starting to play each path of sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each path of sub-video according to the current playing time information and the starting time information of the main video and the starting time information of the sub-video, and because the playing time information of the first target video frame of the sub-video in the main video is consistent with the current playing time information of the main video, the electronic equipment plays the main video from the current playing video frame of the main video and starts to play each path of sub-video from the corresponding first target video frame, the video picture of the main video and the video picture of each path of sub-video are synchronously displayed, so that the synchronous playing of multiple paths of videos is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart of a method for playing multiple channels of video according to an embodiment of the present invention;
FIG. 2 is a detailed flowchart of step S102 in the embodiment shown in FIG. 1;
fig. 3 is another flowchart of a playing method of multiple videos according to an embodiment of the present invention;
fig. 4 is a flowchart of a video progress adjustment method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an electronic device including a plurality of decoders and a player in an embodiment of the invention;
FIG. 6 is a schematic diagram of a display interface in an embodiment of the invention;
fig. 7 is a schematic structural diagram of a multi-channel video playing device according to an embodiment of the present invention;
FIG. 8 is a block diagram of the first target video frame determination module 702 in the embodiment shown in FIG. 7;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In order to realize synchronous playing of multiple paths of videos, embodiments of the present invention provide a method and an apparatus for playing multiple paths of videos, an electronic device, a computer-readable storage medium, and a computer program product. First, a method for playing a multi-channel video according to an embodiment of the present invention is described below.
The playing method of the multi-channel video provided by the embodiment of the invention can be applied to any electronic equipment which needs to play the multi-channel video, such as a computer, a tablet computer, a mobile phone and the like. For clarity of description, the electronic device is referred to hereinafter.
As shown in fig. 1, a method for playing a multi-channel video is applied to an electronic device, and the method includes:
s101, under the condition that a playing instruction for multiple paths of videos is obtained, obtaining current playing time information of a main video and starting time information of each path of video;
wherein the multi-path video comprises the main video and the sub-video, and the contents of the main video and the sub-video have correlation.
S102, determining a first target video frame in each path of the sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video;
and the playing time information of the first target video frame corresponding to the main video is consistent with the current playing time information of the main video.
S103, playing the main video from the currently played video frame of the main video, and starting to play each path of the sub-video from the corresponding first target video frame.
Therefore, in the scheme provided by the embodiment of the invention, under the condition that the electronic equipment acquires the playing instruction for the multiple videos, the electronic equipment acquires the current playing time information of the main video and the starting time information of each video, wherein the multiple videos comprise the main video and the sub-videos, and the contents of the main video and the sub-videos have correlation; determining a first target video frame in each path of sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video, wherein the playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video; and playing the main video from the currently played video frame of the main video, and starting to play each path of sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each path of sub-video according to the current playing time information and the starting time information of the main video and the starting time information of the sub-video, and because the playing time information of the first target video frame of the sub-video in the main video is consistent with the current playing time information of the main video, the electronic equipment plays the main video from the current playing video frame of the main video and starts to play each path of sub-video from the corresponding first target video frame, the video picture of the main video and the video picture of each path of sub-video are synchronously displayed, so that the synchronous playing of multiple paths of videos is realized.
When a user watches videos of sports events, art programs and the like through an electronic device, there may be a need to watch multiple different videos having correlation at the same time. For example, a user may wish to view a video of a player and a video of a game interface simultaneously during a video of a game match. In this case, the user may issue a play instruction for multiple videos, and the electronic device may acquire the current play time information of the main video and the start time information of each video in the case of receiving the play instruction for multiple videos, that is, perform step S101 described above.
The multi-path video comprises a main video and a sub video, and the contents of the main video and the sub video have correlation, for example, the main video is a game video of a basketball game, and the sub video can be a video of a game player of the basketball game; for another example, the main video may be a video of a guest in the attraction program, and the sub-video may be a video of a host in the attraction program. For a main video, there may be a plurality of sub-videos, and the frame rate of the main video is the same as that of each sub-video.
The current playing time information is information representing a current playing time point of the main video. For example, if the main video is currently playing a video frame of 20 minutes 31 seconds, the current playing time information may be "20 minutes 31 seconds", which indicates that the current playing time point of the main video is 20 minutes 31 seconds.
In one embodiment, the start time information is a playing time point corresponding to the first frame of the video, for example, the start time information of the video Z1 may be "0 min 0 sec", which indicates that the time point corresponding to the first frame of the video Z1 is 0 min 0 sec.
In another embodiment, the start time information of the sub-video is a corresponding time point of the first frame of the sub-video in the main video. For example, if the time point of the first frame of the sub video z1 in the main video corresponds to the time point corresponding to the 3 rd minute and 15 th second from the playing of the main video, the start time information of the sub video z1 may be "3 rd minute and 15 second", which indicates that the time point indicated by the start time information of the sub video z1 is the time point corresponding to the 3 rd minute and 15 th second from the playing of the main video of the sub video z 1.
The current playing time information and the starting time information may be time stamps, and the starting point of the time stamp may be greenwich mean time 1970, 01, 00 hours, 00 minutes and 00 seconds, for example. In one embodiment, the current playing Time information may be a PTS (Presentation Time Stamp).
After acquiring the current playing time information of the main video and the start time information of each video, in step S102, the electronic device may determine the first target video frame in the sub video based on the current playing time information and the start time information of the main video and the start time information of the sub video. The corresponding playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video, that is, the first target video frame in the sub video and the current playing video frame of the main video need to be played synchronously during playing, so that the synchronous playing of the multiple paths of videos can be ensured.
Specifically, the time point corresponding to the current playing time information of the main video is later than or equal to the time point corresponding to the start time information of the main video, and the time point corresponding to the start time information of the sub video is also later than or equal to the time point corresponding to the start time information of the main video. And when the sub video exists at the time point corresponding to the current playing time information of the main video, the time point corresponding to the starting time information of the sub video is later than or equal to the time point corresponding to the current playing time information of the main video.
Then, the electronic device may determine a difference between a time point corresponding to the current play time information of the main video and a time point corresponding to the start time information of the main video as a first difference, and determine a difference between a time point corresponding to the start time information of the sub video and a time point corresponding to the start time information of the main video as a second difference. Then, the electronic device may determine, according to the first difference, the second difference, and the time point corresponding to the start time information of the sub-video, play time information corresponding to a video frame that the sub-video should start to play currently, and may further determine, according to the play time information, a first target video frame, that is, a video frame that the sub-video should start to play currently, from the sub-video.
The point in time indicated by the start time information of the main video may be the same as the point in time indicated by the start time information of the sub video. In this case, the electronic device does not start playing both the main video and the sub video when acquiring the play instruction for the multi-path video. For this situation, in an embodiment, when the electronic device acquires the play instruction for the multiple videos, it may determine that a currently playing video frame of the main video is a first frame of the main video, and determine that a first target video frame of the sub video is a first frame of the sub video.
After determining the first target video frame of the sub-video, the electronic device may play the main video from the current video frame of the main video and start playing the sub-video from the first target video frame of the sub-video, that is, perform step S103. Therefore, the first target video frame in the sub video and the currently played video frame of the main video can be played synchronously, so that the electronic equipment can be ensured to play the main video and the sub video synchronously, and the synchronous playing of multiple paths of videos is realized.
As an implementation manner of the embodiment of the present invention, as shown in fig. 2, the step of determining the first target video frame in each sub video based on the current playing time information and the starting time information of the main video and the starting time information of the sub video may include:
s201, calculating a difference between a time point represented by the current playing time information and a time point represented by the start time information of the main video as a first difference;
in order to determine the first target video frame in the sub video, the electronic device may first calculate a difference between a time point represented by the current play time information and a time point represented by the start time information of the main video as a first difference. For example, the time point indicated by the current playing time information is the time point from the playing of the main video Z2 to 0 minute 47 seconds, the time point indicated by the starting time information of the main video Z2 is the time point from the playing of the main video Z2 to 0 minute 0 seconds, and the first difference is 47 seconds.
S202, for each path of the sub video, calculating a difference between a time point indicated by the start time information of the sub video and a time point indicated by the start time information of the main video as a second difference;
for each path of the sub video, the electronic device may calculate a difference value between a time point represented by the start time information of the sub video and a time point represented by the start time information of the main video as the second difference value. For example, the time point indicated by the start time information of the sub video Z2 is the time point from the playing of the main video Z2 to the 0 th minute and 14 seconds, and the time point indicated by the start time information of the main video Z2 is the time point from the playing of the main video Z2 to the 0 th minute and 0 seconds, so that the second difference is 14 seconds.
S203, calculating a difference value between the first difference value and a second difference value corresponding to each path of the sub-video, and determining target playing time information of the sub-video based on the difference value and a time point represented by the starting time information of the sub-video;
for each sub-video, the electronic device may calculate a difference between the first difference and a second difference corresponding to the sub-video. For example, based on the above examples of step S201 and step S202, if the first difference is 47 seconds, and the second difference corresponding to the sub-video z2 is 14 seconds, the difference between the first difference and the second difference corresponding to the sub-video z2 is 33 seconds.
After obtaining the difference between the first difference and the second difference corresponding to the sub-video, the electronic device may determine target playing time information of the sub-video based on the difference and the time point indicated by the start time information of the sub-video. Specifically, the electronic device may determine a time point corresponding to the sum of the difference between the first difference and the second difference and the time point indicated by the start time information of the sub-video, and then determine the play time information corresponding to the time point in the sub-video as the target play time information. That is, the time point indicated by the target playing time information of the sub-video is the time point indicated by the current playing time information of the main video of the sub-video.
For example, based on the above examples of step S201 and step S202, the difference between the first difference and the second difference corresponding to the sub video z2 is 33 seconds. The start time information of the sub video z2 represents a time point when the sub video z2 is played to 0 th minute 0 second, the electronic device may determine that the target playing time information of the sub video z2 is "0 minute 33 seconds", which represents 0 th minute 33 seconds of the playing of the sub video z 2.
And S204, aiming at each path of the sub-video, determining a video frame corresponding to the target playing time information of the sub-video as a first target video frame of the sub-video.
For each path of sub-video, after determining the target playing time information corresponding to the sub-video, the electronic device may determine the video frame corresponding to the target playing time information of the sub-video as the first target video frame of the sub-video. For example, based on the example of step S203, the target playing time information of the sub video z2 is "0 min 33 sec", which indicates that the 0 min 33 sec played by the sub video z2, and then the first target video frame of the sub video z2 is the video frame corresponding to the 0 min 33 sec played by the sub video z 2.
In one embodiment, the target playing time information of the sub-video may be a display time stamp of the sub-video, and the electronic device may determine that a video frame corresponding to the display time stamp of the sub-video is a first target video frame of the sub-video.
Because the playing time information corresponding to the video frame corresponding to the target playing time information in the sub-video in the main video is consistent with the current playing time information of the main video, the first target video frame of the sub-video and the current playing video frame of the main video are synchronously played during playing, so that the electronic equipment can realize synchronous playing of the main video and the sub-video when the main video is played from the current playing video frame of the main video and the sub-video is played from the first target video frame.
As can be seen, in the scheme provided in the embodiment of the present invention, the electronic device may calculate a difference between a time point represented by the current playing time information and a time point represented by the start time information of the main video, as a first difference; calculating, for each path of the sub video, a difference between a time point indicated by start time information of the sub video and a time point indicated by start time information of the main video as a second difference; calculating a difference value between the first difference value and a second difference value corresponding to each path of the sub-video, and determining target playing time information of the sub-video based on the difference value and a time point represented by the starting time information of the sub-video; and determining the video frame corresponding to the target playing time information of the sub-video as the first target video frame of the sub-video for each path of the sub-video. In this way, the electronic device can accurately determine the first target video frame of the sub-video, so that the main video and the sub-video can be ensured to be played synchronously.
As an implementation manner of the embodiment of the present invention, before the step of acquiring the current playing time information of the main video and the start time information of each path of video, the method may further include:
acquiring a video description file; and analyzing the video description file to obtain the start time information of each path of video.
When generating a multi-channel video, a video description file corresponding to the multi-channel video may be generated. The video description file may include start time information of each video in the plurality of videos. Before acquiring the current playing time information of the main video and the start time information of each path of video, the electronic device may acquire a video description file, and then parse the video description file to obtain the start time information of each path of video. The video Description file may be an MPD (Media Presentation Description) file, an m3u8 file, and the like, which is not limited herein.
For example, the multi-channel video includes a main video Z3 and its sub videos Z31, Z32 and Z33, and the start time information included in the video description file M1 corresponding to the multi-channel video is shown in the following table:
video Start time information
Main video Z3 T1
Sub-video z31 T2
Sub-video z32 T3
Sub-video z33 T4
After acquiring the video description file M1, the electronic device may parse the video description file M1 to obtain start time information T1 of the main video Z3, start time information T2 of the sub video Z31, start time information T3 of the sub video Z32, and start time information T4 of the sub video Z31.
In an implementation, the video description file may further include a uniform resource locator of each video, the electronic device may parse the video description file to obtain the uniform resource locator of each video, and when a certain one or more videos of the multiple videos need to be obtained, the electronic device may obtain the one or more videos from a storage location indicated by the parsed uniform resource locator.
Correspondingly, the step of obtaining the current playing time information of the main video and the start time information of each path of video may include:
and acquiring the current playing time information of the main video, and reading the starting time information of each path of video.
After analyzing the video description file to obtain the start time information of each video in the multiple videos, the electronic device may obtain the current playing time information of the main video and read the start time information of each video. In this way, the electronic device can quickly and accurately obtain the start time information of each path of video, so that the efficiency of determining the first target video frame in each path of sub-video can be improved.
Therefore, in the scheme provided by the embodiment of the invention, the electronic equipment can acquire the video description file; and analyzing the video description file to obtain the start time information of each path of video, acquiring the current playing time information of the main video, and reading the start time information of each path of video. In this way, the electronic device can quickly and accurately obtain the start time information of each path of video, so that the efficiency of determining the first target video frame in each path of sub-video can be improved.
As an implementation manner in the embodiment of the present invention, as shown in fig. 3, a method for playing multiple channels of videos provided in the embodiment of the present invention may include:
s101, under the condition that a playing instruction for multiple paths of videos is obtained, obtaining current playing time information of a main video and starting time information of each path of video;
s301, determining whether the time point represented by the current playing time information of the main video is earlier than the time point represented by the starting time information of the sub video, if so, executing the step S302; if not, executing step S102;
when the electronic device acquires a playing instruction for a plurality of paths of videos, it is possible that the sub-video does not exist at a time point indicated by the current playing time information of the main video. In order to determine whether the sub video exists at the time point indicated by the current play time information of the main video, the electronic device may determine whether the time point indicated by the current play time information of the main video is earlier than the time point indicated by the start time information of the sub video.
If the time point indicated by the current playing time information of the main video is earlier than the time point indicated by the starting time information of the sub video, which indicates that the time point indicated by the current playing time information of the main video has not yet reached the time point indicated by the starting time information of the sub video, then the sub video does not yet exist at the time point indicated by the current playing time information of the main video, and at this time, the electronic device cannot start playing the sub video, in which case the electronic device may perform step S302.
If the time point indicated by the current playing time information of the main video is not earlier than the time point indicated by the starting time information of the sub video, it is indicated that the time point indicated by the current playing time information of the main video has reached the time point indicated by the starting time information of the sub video, or the time point indicated by the current playing time information of the main video has exceeded the time point indicated by the starting time information of the sub video. Then, the sub video exists at the time point indicated by the current playing time information of the main video, and the electronic device may start playing the sub video, in which case the electronic device may perform step S102.
S302, playing the main video from the currently played video frame of the main video, and displaying playing prompt information when the difference value between the time point represented by the starting time information of the sub video and the time point represented by the currently played time information of the main video is not more than a preset threshold value;
when the time point represented by the current playing time information of the main video is earlier than the time point represented by the starting time information of the sub video, it is described that the sub video does not exist at the time point represented by the current playing time information of the main video yet, and the electronic device cannot play the sub video yet, in this case, the electronic device may continue to play the main video from the currently playing video frame of the main video, and continuously monitor whether a difference between the time point represented by the starting time information of the sub video and the time point represented by the current playing time information of the main video is not greater than a preset threshold, where the preset threshold may be set as required, for example, may be set to 5 seconds, 3 seconds, 1 second, and the like, and is not specifically limited herein.
When the difference between the time point represented by the start time information of the sub-video and the time point represented by the current playing time information of the main video is greater than the preset threshold, it indicates that the time length from the time point represented by the start time information of the sub-video is still longer, and then the sub-video cannot be played, so that the electronic device can continue to play the main video, and monitor whether the difference between the time point represented by the start time information of the sub-video and the time point represented by the current playing time information of the main video is greater than the preset threshold.
When the difference between the time point represented by the start time information of the sub-video and the time point represented by the current playing time information of the main video is not greater than the preset threshold, it indicates that the time length from the time point represented by the start time information of the sub-video at this time is relatively short, and then the electronic device is about to start playing the sub-video, in which case the electronic device may display the playing prompt information. The playing prompt information is used for prompting a user that the sub-video is to be played. The playing prompt information may be text information, and when a difference between a time point represented by the start time information of the sub video and a time point represented by the current playing time information of the main video is not greater than a preset threshold, the electronic device may display the text information, for example, when the name of the sub video is "video S", the content of the text information may be "video S to be played next".
S102, determining a first target video frame in each path of the sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video;
s103, playing the main video from the currently played video frame of the main video, and starting to play each path of the sub-video from the corresponding first target video frame.
As can be seen, in the scheme provided in the embodiment of the present invention, the electronic device may determine whether the time point indicated by the current playing time information of the main video is earlier than the time point indicated by the starting time information of the sub video, play the main video from the currently playing video frame of the main video when the time point indicated by the current playing time information of the main video is earlier than the time point indicated by the starting time information of the sub video, and display the play prompt information when a difference between the time point indicated by the starting time information of the sub video and the time point indicated by the current playing time information of the main video is not greater than a preset threshold. Therefore, the electronic equipment can remind the user of the fact that the sub-video is about to be played in time.
As an implementation manner of the embodiment of the present invention, as shown in fig. 4, the method for playing multiple channels of video according to the embodiment of the present invention may further include:
s401, when a progress adjustment instruction is obtained, determining a video frame after progress adjustment from the main video;
the user may want to adjust the viewing progress while viewing the multi-channel video, for example, the user may perform a fast forward operation or a fast backward operation on the multi-channel video being viewed. In this case, the user may issue a progress adjustment instruction, and the electronic device may acquire the progress adjustment instruction issued by the user. In one embodiment, the electronic device may display a progress bar of the main video, and the user may issue a progress adjustment instruction by clicking the progress bar; in another embodiment, the electronic device may provide a fast forward button and a fast backward button, and the user may issue the progress adjustment instruction by clicking the fast forward button or the fast backward button.
When the electronic device obtains the progress adjustment instruction, the video frame after the progress adjustment can be determined from the main video, and the video frame after the progress adjustment is the video frame corresponding to the playing time information indicated by the progress adjustment instruction in the main video.
For example, when the electronic device acquires the progress adjustment instruction, it is determined that the playing time information indicated by the progress adjustment instruction is "20 minutes 35 seconds", which indicates a time point when the main video is played to 20 minutes 35 seconds, and then the electronic device may determine that a video frame corresponding to the time point of the main video of 20 minutes 35 seconds is a video frame after the progress adjustment.
S402, determining a second target video frame in each path of the sub-video based on the playing time information indicated by the progress adjusting instruction, the starting time information of the main video and the starting time information of the sub-video;
in order to enable the main video and the sub video to continue to be played synchronously, for each path of the sub video, the electronic device may determine a second target video frame in the sub video based on the playing time information indicated by the progress adjustment instruction, the start time information of the main video, and the start time information of the sub video. Specifically, the electronic device may determine the second target video frame in the sub-video according to the following steps:
step A: calculating a difference value between a time point represented by the playing time information indicated by the progress adjustment instruction and a time point represented by the start time information of the main video as a third difference value;
and B: acquiring a second difference value corresponding to each sub-video aiming at each path of sub-video, wherein the second difference value is the difference value between the time point represented by the starting time information of the sub-video and the time point represented by the starting time information of the main video;
and C: calculating a difference value between a third difference value and a second difference value corresponding to each sub-video aiming at each path of sub-video, and determining the playing time information of the sub-video after the progress adjustment based on the difference value and the time point represented by the starting time information of the sub-video;
step D: and determining the video frame corresponding to the playing time information after the progress of the sub-video is adjusted as a second target video frame of the sub-video for each path of sub-video.
The above steps A to D are described below by specific examples.
For example, the electronic device acquires the playing time information indicated by the progress adjustment command x1 for the main video Z4 and the sub video Z41, and the time point indicated by the playing time information is the time point from the playing of the main video Z4 to the 15 th minute 45 seconds. The time point indicated by the start time information of the main video Z4 is the time point from the playing of the main video Z4 to the 0 th minute 0 second, and the time point indicated by the start time information of the sub video Z41 is the time point from the playing of the main video Z4 to the 15 th minute 10 second. Then, the electronic device may determine that the third difference value corresponding to the main video Z4 is: 15 minutes and 45 seconds, the second difference value corresponding to the sub-video z41 is: 15 minutes 10 seconds. Then, the electronic device may determine that a difference between a third difference corresponding to the main video Z4 and a second difference corresponding to the sub video Z41 is 35 seconds, and further, the electronic device may determine that the playing time information after the progress adjustment of the sub video Z41 is "0 minutes 35 seconds", which indicates a time point when the sub video Z41 is played to 0 minutes 35 seconds, that is, a time point when the main video Z4 is played to 15 minutes 45 seconds. Then, the electronic device may determine that the video frame corresponding to the 0 minute 35 second time point in the sub-video z41 is the second target video frame of the sub-video z 41.
And S403, continuously playing the main video from the video frame after the progress adjustment, and continuously playing each path of the sub-video from the corresponding second target video frame.
After determining the second target video frame corresponding to the sub-video, the electronic device may continue to play the main video from the video frame after the progress adjustment, and continue to play each path of sub-video from the corresponding second target video frame. The playing time information corresponding to the video frame in the main video, which corresponds to the playing time information after the progress adjustment of the sub video, is consistent with the playing time information corresponding to the video frame in the main video, so that the second target video frame of the sub video and the video frame after the progress adjustment are synchronously played during playing, and thus the electronic equipment can continue to synchronously play the main video and the sub video.
As can be seen, in the scheme provided in the embodiment of the present invention, after the main video is played from the currently played video frame of the main video and each path of sub-video is played from the corresponding first target video frame, the electronic device may determine the video frame after the progress adjustment from the main video when the progress adjustment instruction is obtained; determining a second target video frame in each path of sub-video based on the playing time information indicated by the progress adjusting instruction, the starting time information of the main video and the starting time information of the sub-video; and continuously playing the main video from the video frame after the progress is adjusted, and continuously playing each path of sub video from the corresponding second target video frame. Therefore, when the user adjusts the playing progress of the multi-channel video, the electronic equipment can continue to play the multi-channel video synchronously.
As an implementation manner of the embodiment of the present invention, the main video and each sub video are generated in advance, and the device for generating the main video and each sub video may be an electronic device such as a computer, a processor, a server, and the like, and for convenience of description, the device is hereinafter referred to as a generating device. Of course, it is reasonable that the generating device and the electronic device for playing multiple channels of video may be the same device or different devices.
For this case, the generating manner of the main video and each path of sub-video may include:
acquiring original video data of a main video and original video data of each path of sub-video; and respectively compressing the original video data of the main video and the original video data of each path of sub-video to obtain the main video and each path of sub-video.
To generate the main video and each path of the sub-video thereof, the electronic device may acquire original video data of the main video and original video data of each path of the sub-video. The original video data of the main video and the original video data of each path of sub-video can be obtained by shooting a target through a plurality of video shooting devices. For example, with the targets of actor Y1 and presenter Y2 in the attraction program, by photographing actor Y1 and presenter Y2 with a plurality of video devices, respectively, raw video data with content of actor Y1 and raw video data with content of Y2 can be obtained. Of course, the original video data of the main video and the original video data of each path of sub-video may also be obtained by other corresponding technologies in the field of video shooting technologies, and are not limited herein.
After the original video data of each path of video in the multi-path video is obtained, the generating device can compress the original video data of the path of video according to each path of video in the multi-path video to obtain the path of video.
For each path Of video in the multiple paths Of videos, in the process Of compression processing, a Group Of Pictures (GOP) interval Of the path Of video may be set to be less than 1 second. A GOP includes a plurality of consecutive video frames, which typically include an I-frame, a plurality of P-frames, and a plurality of B-frames. When performing video decoding processing, for each GOP, it is necessary to decode an I frame first, and then decode B frames and P frames based on the decoded I frame. When the key frame interval of the video is less than 1 second, the electronic device can decode the video in any 1 second in the video playing process, so that the electronic device can conveniently play the video at any playing time point.
Therefore, in the scheme provided by the embodiment of the invention, the generating equipment can acquire the original video data of the main video and the original video data of each path of sub-video; and respectively compressing the original video data of the main video and the original video data of each path of sub-video to obtain the main video and each path of sub-video. Therefore, the electronic equipment can conveniently start playing the video at any playing time point.
As an implementation manner of the embodiment of the present invention, as shown in fig. 5, the electronic device may include a player.
As shown in fig. 5, the electronic device includes one player, and the electronic device can simultaneously play multiple videos through the one player.
For this situation, the step of playing the main video from the currently playing video frame of the main video and playing each path of the sub video from the corresponding first target video frame may include:
rendering a currently played video frame of a main video to a preset main video display area through a player so that the player plays the main video from the currently played video frame of the main video; and for each path of sub-video, rendering the first target video frame of the sub-video to a preset sub-video display area corresponding to the sub-video through a player, so that one player starts to play the sub-video from the first target video frame of the sub-video.
In order to facilitate the user to watch multiple videos, a main video display area and a sub video display area can be preset in a display interface of the electronic device. When the main video and each path of sub-video are played, the electronic device can render the currently played video frame of the main video to the main video display area through one player, so that the one player plays the main video from the currently played video frame of the main video. Meanwhile, for each path of sub-video, the electronic device may render the first target video frame of the sub-video to a preset sub-video display area corresponding to the sub-video through one player, so that the one player starts playing the sub-video from the first target video frame of the sub-video.
As shown in fig. 6, the display interface 601 includes a main video display area 602, a sub video display area 603, and a sub video display area 604. When the main video Z5, the sub video Z51 and the sub video Z52 are played, the electronic device may render a currently playing video frame of the main video Z5 to the main video display area 602 through one player, render a first target video frame of the sub video Z51 to the sub video display area 603 through the one player, and render a first target video frame of the sub video Z52 to the sub video display area 604 through the one player.
Therefore, in the scheme provided by the embodiment of the invention, the electronic device can render the currently played video frame of the main video to the preset main video display area through one player, so that one player plays the main video from the currently played video frame of the main video; and for each path of sub-video, rendering the first target video frame of the sub-video to a preset sub-video display area corresponding to the sub-video through a player, so that one player starts to play the sub-video from the first target video frame of the sub-video. Thus, the electronic equipment can be ensured to play multiple paths of videos synchronously.
As an implementation manner of the embodiment of the present invention, as shown in fig. 5, the electronic device may include a plurality of decoders.
As shown in fig. 5, the electronic device has a plurality of decoders, including decoder 1, decoder 2, decoder 3 …, and decoder n, where n is a positive integer. The electronic device can decode the multiple paths of videos through the decoder 1, the decoder 2 and the decoder 3 … to obtain the decoded videos.
For this case, before the step of determining the first target video frame in each path of the sub-video based on the current playing time information of the main video, the start time information of the main video, and the start time information of the sub-video, the method may further include:
and respectively decoding the main video and each path of sub-video through a plurality of decoders to obtain the main video after decoding and each path of sub-video after decoding.
After the electronic device acquires the main video and the plurality of sub-videos, the main video and each path of sub-video can be decoded by the plurality of decoders respectively, so that the decoded main video and each path of sub-video are obtained. In this way, the electronic device can decode each of the multiple paths of videos in parallel, thereby ensuring that each of the multiple paths of videos can be decoded in time. The decoder may be a hardware decoder or a software decoder, and is not limited herein.
Therefore, when the data volume of the video in the multiple paths of videos is large, because one decoder cannot decode the multiple paths of videos at the same time, the electronic equipment can acquire the multiple paths of videos and decode the acquired multiple paths of videos through the multiple decoders respectively, so that the electronic equipment can be ensured to decode the acquired multiple paths of videos in time.
As can be seen, in the scheme provided in the embodiment of the present invention, the electronic device may perform decoding processing on the main video and each path of sub-video through a plurality of decoders, respectively, to obtain the main video after decoding processing and each path of sub-video after decoding processing. In this way, the electronic device can decode each of the multiple paths of videos in parallel, thereby ensuring that each of the multiple paths of videos can be decoded in time.
Corresponding to the playing method of the multi-channel video, the embodiment of the invention also provides a playing device of the multi-channel video. The following describes a multi-channel video playing device according to an embodiment of the present invention.
As shown in fig. 7, a playing apparatus for multiple videos is applied to an electronic device, and the apparatus may include:
the information acquisition module 701 is configured to acquire current playing time information of a main video and start time information of each video when a playing instruction for multiple videos is acquired;
wherein the multi-path video comprises the main video and the sub-video, and the contents of the main video and the sub-video have correlation.
A first target video frame determining module 702, configured to determine a first target video frame in each path of the sub-video based on the current playing time information and the start time information of the main video and the start time information of the sub-video;
and the playing time information of the first target video frame corresponding to the main video is consistent with the current playing time information of the main video.
The first video playing module 703 is configured to play the main video from a currently played video frame of the main video, and start playing each path of the sub-video from a corresponding first target video frame.
Therefore, in the scheme provided by the embodiment of the invention, under the condition that the electronic equipment acquires the playing instruction for the multiple videos, the electronic equipment acquires the current playing time information of the main video and the starting time information of each video, wherein the multiple videos comprise the main video and the sub-videos, and the contents of the main video and the sub-videos have correlation; determining a first target video frame in each path of sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video, wherein the playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video; and playing the main video from the currently played video frame of the main video, and starting to play each path of sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each path of sub-video according to the current playing time information and the starting time information of the main video and the starting time information of the sub-video, and because the playing time information of the first target video frame of the sub-video in the main video is consistent with the current playing time information of the main video, the electronic equipment plays the main video from the current playing video frame of the main video and starts to play each path of sub-video from the corresponding first target video frame, the video picture of the main video and the video picture of each path of sub-video are synchronously displayed, so that the synchronous playing of multiple paths of videos is realized.
As an implementation manner of the embodiment of the present invention, as shown in fig. 8, the first target video frame determining module 702 may include:
a first difference value calculating sub-module 801, configured to calculate a difference value between a time point represented by the current playing time information and a time point represented by the start time information of the main video, as a first difference value;
a second difference value calculating sub-module 802, configured to calculate, as a second difference value, a difference value between a time point indicated by the start time information of the sub video and a time point indicated by the start time information of the main video for each path of the sub video;
a target information determining sub-module 803, configured to calculate, for each path of the sub-video, a difference between the first difference and a second difference corresponding to the sub-video, and determine target playing time information of the sub-video based on the difference and a time point indicated by the start time information of the sub-video;
and the target video frame determining submodule 804 is configured to determine, for each path of the sub-video, a video frame corresponding to the target playing time information of the sub-video as a first target video frame of the sub-video.
As an implementation manner of the embodiment of the present invention, the apparatus may further include:
a description file obtaining module (not shown in fig. 7) configured to obtain a video description file before obtaining the current playing time information of the main video and the start time information of each video;
wherein the video description file comprises start time information of each video in the plurality of videos.
And an analyzing module (not shown in fig. 7) configured to analyze the video description file to obtain start time information of each video.
The information obtaining module 701 may include:
and an information obtaining sub-module (not shown in fig. 7) for obtaining the current playing time information of the main video and reading the start time information of each video.
As an implementation manner of the embodiment of the present invention, the apparatus may further include:
a determining module (not shown in fig. 7) configured to determine whether a time point indicated by the current playing time information of the main video is earlier than a time point indicated by the start time information of the sub video before determining the first target video frame in each path of the sub video based on the current playing time information of the main video, the start time information, and the start time information of the sub video;
an executing module (not shown in fig. 7) configured to trigger the first target video frame determining module if a time point indicated by the current playing time information of the main video is not earlier than a time point indicated by the start time information of the sub video;
a prompt information display module (not shown in fig. 7) configured to play the main video from the currently played video frame of the main video if a time point indicated by the currently played time information of the main video is earlier than a time point indicated by the start time information of the sub video, and display play prompt information if a difference between the time point indicated by the start time information of the sub video and the time point indicated by the currently played time information of the main video is not greater than a preset threshold;
and the playing prompt information is used for prompting a user that the sub-video is to be played.
As an implementation manner of the embodiment of the present invention, the apparatus may further include:
a progress adjustment module (not shown in fig. 7) configured to, after the main video is played from a currently played video frame of the main video and each path of the sub video is played from a corresponding first target video frame, determine a video frame after progress adjustment from the main video when a progress adjustment instruction is obtained;
and the video frame after the progress adjustment is the video frame corresponding to the playing time information indicated by the progress adjustment instruction in the main video.
A second target video frame determination module (not shown in fig. 7) configured to determine a second target video frame in each of the sub videos based on the playing time information indicated by the progress adjustment instruction, the start time information of the main video, and the start time information of the sub videos;
and a second video playing module (not shown in fig. 7) configured to continue to play the main video from the video frame after the progress adjustment, and continue to play each path of the sub video from the corresponding second target video frame.
As an implementation manner of the embodiment of the present invention, the main video and each path of sub-video are generated in advance by a video coding module (not shown in fig. 7);
the video encoding module may include:
an original video acquiring sub-module (not shown in fig. 7) for acquiring original video data of the main video and original video data of each path of the sub-video;
a video compression sub-module (not shown in fig. 7) configured to perform compression processing on original video data of the main video and original video data of each path of the sub-video respectively to obtain the main video and each path of the sub-video;
and the key frame interval of the main video and each path of the sub video is less than 1 second.
As an implementation manner of the embodiment of the present invention, the electronic device includes a player;
the first video playing module 703 may include:
a main video playing sub-module (not shown in fig. 7) for rendering, by the one player, a currently playing video frame of the main video to a preset main video display area, so that the one player plays the main video from the currently playing video frame of the main video;
and a sub-video playing sub-module (not shown in fig. 7) configured to render, by the one player, the first target video frame of the sub-video to a preset sub-video display area corresponding to the sub-video, so that the one player starts playing the sub-video from the first target video frame of the sub-video, for each path of the sub-video.
As an implementation manner of the embodiment of the present invention, the electronic device includes a plurality of decoders;
the above apparatus may further include:
a decoding module (not shown in fig. 7), configured to perform, before determining a first target video frame in each path of the sub video based on the current playing time information and the start time information of the main video and the start time information of the sub video, decoding processing on the main video and each path of the sub video through the multiple decoders, respectively, to obtain a main video after the decoding processing and each path of the sub video after the decoding processing.
An embodiment of the present invention further provides an electronic device, as shown in fig. 9, which includes a processor 901, a communication interface 902, a memory 903, and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 complete mutual communication through the communication bus 904,
a memory 903 for storing computer programs;
the processor 901 is configured to implement the steps of the method for playing multiple channels of video according to any of the above embodiments when executing the program stored in the memory 903.
Therefore, in the scheme provided by the embodiment of the invention, under the condition that the electronic equipment acquires the playing instruction for the multiple videos, the electronic equipment acquires the current playing time information of the main video and the starting time information of each video, wherein the multiple videos comprise the main video and the sub-videos, and the contents of the main video and the sub-videos have correlation; determining a first target video frame in each path of sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video, wherein the playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video; and playing the main video from the currently played video frame of the main video, and starting to play each path of sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each path of sub-video according to the current playing time information and the starting time information of the main video and the starting time information of the sub-video, and because the playing time information of the first target video frame of the sub-video in the main video is consistent with the current playing time information of the main video, the electronic equipment plays the main video from the current playing video frame of the main video and starts to play each path of sub-video from the corresponding first target video frame, the video picture of the main video and the video picture of each path of sub-video are synchronously displayed, so that the synchronous playing of multiple paths of videos is realized.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the method for playing multiple videos in any one of the above embodiments.
As can be seen, in the solution provided in the embodiment of the present invention, when a computer program stored in a computer-readable storage medium is executed by a processor, and a play instruction for a plurality of videos is obtained, current play time information of a main video and start time information of each video are obtained, where the plurality of videos include a main video and a sub video, and contents of the main video and the sub video have a correlation; determining a first target video frame in each path of sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video, wherein the playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video; and playing the main video from the currently played video frame of the main video, and starting to play each path of sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each path of sub-video according to the current playing time information and the starting time information of the main video and the starting time information of the sub-video, and because the playing time information of the first target video frame of the sub-video in the main video is consistent with the current playing time information of the main video, the electronic equipment plays the main video from the current playing video frame of the main video and starts to play each path of sub-video from the corresponding first target video frame, the video picture of the main video and the video picture of each path of sub-video are synchronously displayed, so that the synchronous playing of multiple paths of videos is realized.
In another embodiment of the present invention, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute the method for playing multiple videos described in any one of the above embodiments.
As can be seen, in the solution provided in the embodiment of the present invention, when a computer program product including an instruction runs on a computer, and a playing instruction for multiple videos is obtained, the current playing time information of a main video and the start time information of each video are obtained, where the multiple videos include a main video and a sub video, and the contents of the main video and the sub video have a correlation; determining a first target video frame in each path of sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video, wherein the playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video; and playing the main video from the currently played video frame of the main video, and starting to play each path of sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each path of sub-video according to the current playing time information and the starting time information of the main video and the starting time information of the sub-video, and because the playing time information of the first target video frame of the sub-video in the main video is consistent with the current playing time information of the main video, the electronic equipment plays the main video from the current playing video frame of the main video and starts to play each path of sub-video from the corresponding first target video frame, the video picture of the main video and the video picture of each path of sub-video are synchronously displayed, so that the synchronous playing of multiple paths of videos is realized.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (11)

1. A playing method of multi-channel videos is applied to electronic equipment, and the method comprises the following steps:
under the condition that a playing instruction for multiple paths of videos is obtained, obtaining current playing time information of a main video and starting time information of each path of video, wherein the multiple paths of videos comprise the main video and sub videos, and the contents of the main video and the sub videos have correlation;
determining a first target video frame in each path of the sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video, wherein the playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video;
and playing the main video from the currently played video frame of the main video, and starting to play each path of the sub video from the corresponding first target video frame.
2. The method of claim 1, wherein the step of determining the first target video frame in each sub-video based on the current playing time information and the starting time information of the main video and the starting time information of the sub-video comprises:
calculating a difference value between a time point represented by the current playing time information and a time point represented by the start time information of the main video as a first difference value;
calculating, for each path of the sub video, a difference between a time point indicated by start time information of the sub video and a time point indicated by start time information of the main video as a second difference;
calculating a difference value between the first difference value and a second difference value corresponding to each path of the sub-video, and determining target playing time information of the sub-video based on the difference value and a time point represented by the starting time information of the sub-video;
and determining the video frame corresponding to the target playing time information of the sub-video as the first target video frame of the sub-video for each path of the sub-video.
3. The method according to claim 1, wherein before the step of obtaining the current playing time information of the main video and the start time information of each video, the method further comprises:
acquiring a video description file, wherein the video description file comprises start time information of each path of video in a plurality of paths of videos;
analyzing the video description file to obtain the start time information of each path of video;
the step of obtaining the current playing time information of the main video and the starting time information of each path of video comprises the following steps:
and acquiring the current playing time information of the main video, and reading the starting time information of each path of video.
4. The method of claim 1, wherein before the step of determining the first target video frame in each of the sub-videos based on the current playing time information of the main video, the start time information, and the start time information of the sub-videos, the method further comprises:
determining whether a time point represented by the current play time information of the main video is earlier than a time point represented by the start time information of the sub video;
when the time point represented by the current playing time information of the main video is not earlier than the time point represented by the starting time information of the sub video, the step of determining a first target video frame in each path of the sub video based on the current playing time information of the main video, the starting time information and the starting time information of the sub video is executed;
and under the condition that the time point represented by the current playing time information of the main video is earlier than the time point represented by the starting time information of the sub video, playing the main video from the current playing video frame of the main video, and displaying playing prompt information when the difference value between the time point represented by the starting time information of the sub video and the time point represented by the current playing time information of the main video is not more than a preset threshold value, wherein the playing prompt information is used for prompting a user that the sub video is about to be played.
5. The method according to any of claims 1-4, wherein after the steps of playing the main video from a currently playing video frame of the main video and playing each of the sub-videos starting from a corresponding first target video frame, the method further comprises:
when a progress adjustment instruction is obtained, determining a video frame after progress adjustment from the main video, wherein the video frame after progress adjustment is a video frame corresponding to playing time information indicated by the progress adjustment instruction in the main video;
determining a second target video frame in each path of the sub-video based on the playing time information indicated by the progress adjusting instruction, the starting time information of the main video and the starting time information of the sub-video;
and continuously playing the main video from the video frame after the progress adjustment, and continuously playing each path of the sub video from the corresponding second target video frame.
6. The method according to any one of claims 1-4, wherein the main video and each of the sub-videos are pre-generated;
the generation mode of the main video and each path of the sub video comprises the following steps:
acquiring original video data of the main video and original video data of each path of the sub video;
and respectively compressing the original video data of the main video and the original video data of each path of the sub-video to obtain the main video and each path of the sub-video, wherein the key frame interval of the main video and each path of the sub-video is less than 1 second.
7. The method of any of claims 1-4, wherein the electronic device comprises a player;
the step of playing the main video from the currently played video frame of the main video and playing each path of the sub-video from the corresponding first target video frame includes:
rendering the currently played video frame of the main video to a preset main video display area through the player so that the player plays the main video from the currently played video frame of the main video;
and for each path of the sub-video, rendering the first target video frame of the sub-video to a preset sub-video display area corresponding to the sub-video through the player, so that the player starts to play the sub-video from the first target video frame of the sub-video.
8. The method of any of claims 1-4, wherein the electronic device includes a plurality of decoders;
before the step of determining the first target video frame in each path of the sub-video based on the current playing time information, the start time information of the main video and the start time information of the sub-video, the method further includes:
and respectively decoding the main video and each path of the sub video through the plurality of decoders to obtain the main video after decoding processing and each path of the sub video after decoding processing.
9. A playing device of multi-channel video is characterized in that the device is applied to electronic equipment, and the device comprises:
the information acquisition module is used for acquiring current playing time information of a main video and start time information of each path of video under the condition of acquiring a playing instruction for a plurality of paths of videos, wherein the plurality of paths of videos comprise the main video and sub videos, and the contents of the main video and the sub videos have correlation;
a first target video frame determining module, configured to determine a first target video frame in each path of the sub-video based on current playing time information and starting time information of the main video and starting time information of the sub-video, where playing time information of the first target video frame in the main video is consistent with the current playing time information of the main video;
and the first video playing module is used for playing the main video from the currently played video frame of the main video and playing each path of the sub video from the corresponding first target video frame.
10. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 8 when executing a program stored in the memory.
11. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-8.
CN202110061697.3A 2021-01-18 2021-01-18 Multi-channel video playing method and device, electronic equipment and storage medium Active CN112911343B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110061697.3A CN112911343B (en) 2021-01-18 2021-01-18 Multi-channel video playing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110061697.3A CN112911343B (en) 2021-01-18 2021-01-18 Multi-channel video playing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112911343A true CN112911343A (en) 2021-06-04
CN112911343B CN112911343B (en) 2023-04-28

Family

ID=76114596

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110061697.3A Active CN112911343B (en) 2021-01-18 2021-01-18 Multi-channel video playing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112911343B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923495A (en) * 2021-09-08 2022-01-11 北京奇艺世纪科技有限公司 Video playing method, system, electronic equipment and storage medium
CN113923530A (en) * 2021-10-18 2022-01-11 北京字节跳动网络技术有限公司 Interactive information display method and device, electronic equipment and storage medium
CN114025150A (en) * 2021-10-29 2022-02-08 歌尔光学科技有限公司 Video frame synchronization method and device for multi-head-mounted equipment, head-mounted equipment and medium
CN115529492A (en) * 2022-08-22 2022-12-27 海信视像科技股份有限公司 Image rendering method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101052105A (en) * 2006-04-03 2007-10-10 广州市纽帝亚资讯科技有限公司 Video frequency relative information expressing method and its playing system
US20170223328A1 (en) * 2014-11-04 2017-08-03 Panasonic Intellectual Property Corporation Of America Playback method, playback device, and non-transitory computer-readable recording medium storing program
CN109714623A (en) * 2019-03-12 2019-05-03 北京旷视科技有限公司 Image presentation method, device, electronic equipment and computer readable storage medium
CN110996157A (en) * 2019-12-20 2020-04-10 上海众源网络有限公司 Video playing method and device, electronic equipment and machine-readable storage medium
CN111246301A (en) * 2020-01-15 2020-06-05 腾讯科技(深圳)有限公司 Video playing method and device, electronic equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101052105A (en) * 2006-04-03 2007-10-10 广州市纽帝亚资讯科技有限公司 Video frequency relative information expressing method and its playing system
US20170223328A1 (en) * 2014-11-04 2017-08-03 Panasonic Intellectual Property Corporation Of America Playback method, playback device, and non-transitory computer-readable recording medium storing program
CN109714623A (en) * 2019-03-12 2019-05-03 北京旷视科技有限公司 Image presentation method, device, electronic equipment and computer readable storage medium
CN110996157A (en) * 2019-12-20 2020-04-10 上海众源网络有限公司 Video playing method and device, electronic equipment and machine-readable storage medium
CN111246301A (en) * 2020-01-15 2020-06-05 腾讯科技(深圳)有限公司 Video playing method and device, electronic equipment and computer readable storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923495A (en) * 2021-09-08 2022-01-11 北京奇艺世纪科技有限公司 Video playing method, system, electronic equipment and storage medium
CN113923495B (en) * 2021-09-08 2024-01-12 北京奇艺世纪科技有限公司 Video playing method, system, electronic equipment and storage medium
CN113923530A (en) * 2021-10-18 2022-01-11 北京字节跳动网络技术有限公司 Interactive information display method and device, electronic equipment and storage medium
CN114025150A (en) * 2021-10-29 2022-02-08 歌尔光学科技有限公司 Video frame synchronization method and device for multi-head-mounted equipment, head-mounted equipment and medium
CN115529492A (en) * 2022-08-22 2022-12-27 海信视像科技股份有限公司 Image rendering method and device and electronic equipment

Also Published As

Publication number Publication date
CN112911343B (en) 2023-04-28

Similar Documents

Publication Publication Date Title
CN112911343B (en) Multi-channel video playing method and device, electronic equipment and storage medium
US11741110B2 (en) Aiding discovery of program content by providing deeplinks into most interesting moments via social media
US20230118824A1 (en) System and method for presenting contextual clips for distributed content
US20230222797A1 (en) Video processing for enabling sports highlights generation
US9191422B2 (en) Processing of social media for selected time-shifted multimedia content
TWI519150B (en) Tracking user interaction from a receiving device
EP2954693B1 (en) Processing of social media for selected time-shifted multimedia content
US20160269803A1 (en) Smart tv media player and playback progress adjustment method thereof, and smart tv
CN109257631B (en) Video carousel playing method and device, computer equipment and storage medium
WO2017107649A1 (en) Video transmission method and device
JP6607968B2 (en) Method, server and terminal for inserting push information into live video streaming
US20190259423A1 (en) Dynamic media recording
WO2015090095A1 (en) Information pushing method, device, and system
US20130138673A1 (en) Information processing device, information processing method, and program
US11677711B2 (en) Metrics-based timeline of previews
KR20150014722A (en) Device, system and method for providing screen shot
CN112753227A (en) Audio processing for detecting the occurrence of crowd noise in a sporting event television program
US10021433B1 (en) Video-production system with social-media features
EP3061095A1 (en) Dynamic media viewing
US10390110B2 (en) Automatically and programmatically generating crowdsourced trailers
CN111316661B (en) Management of non-linear content presentation and experience
CN112135159B (en) Public screen broadcasting method and device, intelligent terminal and storage medium
US20180210906A1 (en) Method, apparatus and system for indexing content based on time information
CN103607605A (en) Data processing method and apparatus for audience rating statistics
JP2012134840A (en) Recording/playback apparatus

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
GR01 Patent grant
GR01 Patent grant