CN112911343B - 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
CN112911343B
CN112911343B CN202110061697.3A CN202110061697A CN112911343B CN 112911343 B CN112911343 B CN 112911343B CN 202110061697 A CN202110061697 A CN 202110061697A CN 112911343 B CN112911343 B CN 112911343B
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.)
Active
Application number
CN202110061697.3A
Other languages
Chinese (zh)
Other versions
CN112911343A (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Television Signal Processing For Recording (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the invention provides a method, a device, electronic equipment and a storage medium for playing multi-channel video, wherein the method is applied to the electronic equipment and comprises the following steps: under the condition that a playing instruction aiming at multiple paths of videos is acquired, current playing time information of a main video and starting time information of each path of video are acquired, wherein the multiple paths of videos comprise 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 sub-video based on the current playing time information, the starting time information and the starting time information of the main 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 current playing video frame of the main video, and starting to play each sub-video from the corresponding first target video frame. By adopting the embodiment of the invention, the synchronous playing of multiple paths of videos 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 apparatus for playing multiple video, an electronic device, and a storage medium.
Background
When a user views videos of a sports event, a variety of shows, etc., there may be a need to view multiple different videos having relevance at the same time. For example, when viewing video of a variety program of a dance game, a user may wish to be able to view a video picture of a player and a video picture of a guide at the same time.
Currently, in order to achieve the purpose of playing multiple videos simultaneously, multiple players can be utilized to play multiple videos simultaneously. However, since the players are independent of each other, the user may not be able to control well, so that the players may not play multiple videos normally at the same time.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device, electronic equipment and a storage medium for playing multi-path videos so as to realize synchronous playing of the multi-path videos. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for playing multiple video, which is applied to an electronic device, where the method includes:
under the condition that a playing instruction aiming at a plurality of paths of videos is acquired, acquiring current playing time information of a main video and starting time information of each path of video, 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;
Determining a first target video frame in each path of the sub video based on the current playing time information, the starting time information and the starting time information of the main 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 current playing video frame of the main video, and starting to play each path of sub video from the corresponding first target video frame.
Optionally, the step of determining the first target video frame in each path of the sub video based on the current playing time information, the starting time information of the main video and the starting time information of the sub video includes:
calculating a difference between a time point represented by the current playing time information and a time point represented by the starting 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 the sub video for each path of the sub video, and determining target playing time information of the sub video based on a time point represented by the difference value and starting time information of the sub video;
And 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 aiming at each path of the sub video.
Optionally, before the step of obtaining the current playing time information of the main video and the starting time information of each path of video, the method further includes:
acquiring a video description file, wherein the video description file comprises starting time information of each path of video in multiple paths of videos;
analyzing the video description file to obtain the starting 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, the starting time information, and the starting time information of the sub video, the method further includes:
determining whether a time point represented by the current playing time information of the main video is earlier than a time point represented by the starting time information of the sub video;
Executing 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, in the case that 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;
and playing the main video from the current playing video frame of the main video under the condition that 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 displaying playing prompt information when the 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, wherein the playing prompt information is used for prompting a user that the sub video is about to be played.
Optionally, after 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, the method further includes:
when a progress adjustment instruction is acquired, 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 adjustment instruction, the starting time information of the main video and the starting time information of the sub video;
and continuing to play the main video from the video frames after the progress adjustment, and continuing to play each path of sub video from the corresponding second target video frames.
Optionally, the main video and each path of the sub video 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 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 includes a player;
the step of playing the main video from the current playing video frame of the main video and playing each path of the sub video from the corresponding first target video frame comprises the following steps:
Rendering a 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 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 aiming at each path of the sub video, so that the player starts to play the sub video from the first target video frame of the sub video.
Optionally, 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 starting time information of the main video and the starting time information of the sub video, the method further includes:
and respectively decoding the main video and each path of sub video through the plurality of decoders to obtain the main video after decoding and each path of sub video after decoding.
In a second aspect, an embodiment of the present invention provides a device for playing multiple video, where the device is applied to an electronic device, and the device includes:
The information acquisition module is used for acquiring current playing time information of a main video and starting time information of each path of video under the condition that a playing instruction aiming at a plurality of paths of videos is acquired, wherein the plurality of paths of videos comprise the main video and the sub video, and the contents of the main video and the sub video have correlation;
the first target video frame determining module is used for determining a first target video frame in each path of the sub video based on the current playing time information, the starting time information and the starting time information of the main 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;
the first video playing module is used for playing the main video from the current playing video frame of the main video and playing each path of 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, the communication interface, and the memory complete communication with each other through the communication bus;
A memory for storing a computer program;
and the processor is used for realizing any of the steps of the multi-path 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, where the computer program when executed by a processor implements any of the above-mentioned steps of a method for playing multiple videos.
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-path video, acquiring the current playing time information of the main video and the 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; determining a first target video frame in each sub-video based on the current playing time information, the starting time information and the starting time information of the main 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 current playing video frame of the main video, and starting to play each sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each sub-video according to the current playing time information of the main video, the starting time information and the starting time information of the sub-video, and the playing time information corresponding to 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, so that the electronic equipment plays the main video from the current playing video frame of the main video, and synchronously displays the video picture of the main video and the video picture of each sub-video when each sub-video starts to be played from the corresponding first target video frame, thereby realizing synchronous playing of multiple paths of videos.
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 video according to an embodiment of the present invention;
FIG. 2 is a flowchart showing step S102 in the embodiment shown in FIG. 1;
fig. 3 is another flowchart of a method for playing multiple video 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 multiple decoders and a player in an embodiment of the invention;
FIG. 6 is a schematic diagram of a display interface in accordance with an embodiment of the present 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 schematic structural diagram of a first target video frame determining 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 accompanying drawings in the embodiments of the present invention.
In order to realize synchronous playing of multiple paths of videos, the embodiment of the invention provides a playing method, a device, electronic equipment, a computer readable storage medium and a computer program product of the multiple paths of videos. The following first describes a method for playing multiple paths of videos provided by the embodiment of the present invention.
The method for playing the multi-path video provided by the embodiment of the invention can be applied to any electronic equipment needing to play the multi-path video, and can be a computer, a tablet personal computer, a mobile phone and the like. For clarity of description, hereinafter, referred to as an electronic device.
As shown in fig. 1, a method for playing multiple paths of videos is applied to an electronic device, and the method includes:
s101, under the condition that a playing instruction aiming at multiple paths of videos is obtained, current playing time information of a main video and starting time information of each path of video are obtained;
the multi-path video comprises the main video and the sub video, and the contents of the main video and the sub video have relevance.
S102, determining a first target video frame in each path of sub video based on current playing time information, starting time information and starting time information of the main video;
And the playing time information corresponding to the first target video frame in the main video is consistent with the current playing time information of the main video.
S103, playing the main video from the current playing video frame of the main video, and starting to play each path of sub video from the corresponding first target video frame.
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-path video, the current playing time information of the main video and the starting time information of each path of video are 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; determining a first target video frame in each sub-video based on the current playing time information, the starting time information and the starting time information of the main 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 current playing video frame of the main video, and starting to play each sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each sub-video according to the current playing time information of the main video, the starting time information and the starting time information of the sub-video, and the playing time information corresponding to 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, so that the electronic equipment plays the main video from the current playing video frame of the main video, and synchronously displays the video picture of the main video and the video picture of each sub-video when each sub-video starts to be played from the corresponding first target video frame, thereby realizing synchronous playing of multiple paths of videos.
When a user views videos of a sports event, a variety of shows, etc. through an electronic device, there may be a need to view multiple different videos having relevance at the same time. For example, a user may wish to be able to view a video of a player and a video of a game interface at the same time when playing video of a game play. In this case, the user may issue a play instruction for the multi-path video, and the electronic device may acquire current play time information of the main video and acquire start time information of each path of video when receiving the play instruction for the multi-path video, that is, perform step S101 described above.
The multi-path video comprises a main video and a sub video, wherein 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 a variety program, and the sub video may be a video of a host in the variety 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 indicating 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 play time point corresponding to the first frame of the video, for example, the start time information of the video Z1 may be "0 minutes 0 seconds", which indicates that the time point corresponding to the first frame of the video Z1 is 0 minutes 0 seconds.
In another embodiment, the start time information of the sub video is a point in time corresponding to a first frame of the sub video in the main video. For example, when the time point corresponding to the first frame of the sub video z1 in the main video is the time point corresponding to the main video played to the 3 rd minute 15 second, the start time information of the sub video z1 may be "3 minute 15 second", which indicates that the time point indicated by the start time information of the sub video z1 is the time point of the 3 rd minute 15 second played of the main video of the sub video z 1.
The current playing time information and the starting time information may be time stamps, for example, a starting point of the time stamps may be greenwich time 1970, 01 month 01, 00 days 00 minutes 00 seconds. In one embodiment, the current playing time information may be PTS (Presentation Time Stamp, display time stamp).
After the current playing time information of the main video and the starting time information of each path of video are obtained, in the step S102, the electronic device may determine the first target video frame in 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. 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 synchronously played when being played, so that synchronous playing of 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 starting time information of the main video, and the time point corresponding to the starting time information of the sub video is also later than or equal to the time point corresponding to the starting time information of the main video. 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 earlier than or equal to the time point corresponding to the current playing time information of the main video.
Then, the electronic device may determine, as the first difference, a difference between a point in time corresponding to the current playing time information of the main video and a point in time corresponding to the starting time information of the main video, and determine, as the second difference, a difference between a point in time corresponding to the starting time information of the sub video and a point in time corresponding to the starting time information of the main video. 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 playing currently, and further determine, according to the play time information, a first target video frame, that is, a video frame that the sub-video should start playing 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 a play instruction for the multi-path video is acquired. In this case, in one embodiment, when the electronic device obtains a play instruction for multiple videos, it may determine that a currently played 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 described above. Therefore, the first target video frame in the sub video and the current playing video frame of the main video can be synchronously played, so that synchronous playing of the main video and the sub video by the electronic equipment can be ensured, and synchronous playing of multiple paths of videos is realized.
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, the starting time information, and the starting time information of the sub-video may include:
S201, calculating a difference value between a time point indicated by the current playing time information and a time point indicated by the starting time information of the main video as a first difference value;
to determine a first target video frame in the sub-video, the electronic device may first calculate a difference between a point in time indicated by the current play time information and a point in time indicated by the start time information of the main video as a first difference. For example, when the current playing time information indicates a time point from the playing of the main video Z2 to the time point of 0 minutes and 47 seconds, and the starting time information of the main video Z2 indicates a time point from the playing of the main video Z2 to the time point of 0 minutes and 0 seconds, the first difference is 47 seconds.
S202, calculating 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 as a second difference value for each path of the sub video;
for each sub-video, the electronic device may calculate, as the second difference value, a difference value between a point in time indicated by the start time information of the sub-video and a point in time indicated by the start time information of the main video. 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 14 th second of the 0 th minute, 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 the second difference is 14 seconds.
S203, calculating a difference value between the first difference value and a second difference value corresponding to the sub video for each path of the sub video, and determining target playing time information of the sub video based on a time point represented by the difference value and 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, the first difference is 47 seconds, the second difference corresponding to the sub-video z2 is 14 seconds, and then 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 the 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. Specifically, the electronic device may determine a time point corresponding to a sum of a difference between the first difference and the second difference and a time point indicated by start time information of the sub video, and then determine play time information corresponding to the time point in the sub video as 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 indicates a time point when the sub-video z2 is played to 0 th minute 0 second, and then the electronic device may determine that the target play time information of the sub-video z2 is "0 minute 33 second", indicating 0 th minute 33 second when the sub-video z2 is played.
S204, 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 aiming at each path of the sub video.
For each 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 minutes 33 seconds", which indicates that the sub-video z2 plays 0 minutes 33 seconds, and then the first target video frame of the sub-video z2 is the video frame corresponding to the 0 minutes 33 seconds 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 solution provided by the embodiment of the present invention, the electronic device may calculate, as the first difference, a difference between a time point indicated by the current playing time information and a time point indicated by the start time information of the main video; 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 the sub video for each path of the sub video, and determining target playing time information of the sub video based on a time point represented by the difference value and starting time information of the sub video; and 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 aiming at 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 synchronous play of the main video and the sub-video can be ensured.
As an implementation manner of the embodiment of the present invention, before the step of obtaining the current playing time information of the main video and the starting time information of each video, the method may further include:
acquiring a video description file; and analyzing the video description file to obtain the starting time information of each path of video.
When generating the multi-path video, a video description file corresponding to the multi-path video can be generated. The video description file may include start time information of each of the multiple paths of videos. Before the electronic device obtains the current playing time information of the main video and the starting time information of each path of video, the electronic device can obtain a video description file, and then analyze the video description file to obtain the starting time information of each path of video. The video description file may be an MPD (Media Presentation Description, media representation description) file, an m3u8 file, or the like, which is not limited herein.
For example, the multiple video includes a main video Z3 and sub-videos Z31, Z32, Z33 thereof, and start time information included in the video description file M1 corresponding to the multiple video is shown in the following table:
video frequency Start time information
Main video Z3 T1
Sub video z31 T2
Sub video z32 T3
Sub video z33 T4
After the electronic device obtains the video description file M1, the video description file M1 may be parsed to obtain the start time information T1 of the main video Z3, the start time information T2 of the sub video Z31, the start time information T3 of the sub video Z32, and the start time information T4 of the sub video Z31.
In an embodiment, the video description file may further include a uniform resource locator of each path of video, the electronic device may parse the video description file to obtain the uniform resource locator of each path of video, and when one or more paths of video in the multiple paths of video need to be acquired, the electronic device may acquire the one or more paths of video 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 starting 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 the video description file is parsed to obtain the starting time information of each path of video in the multiple paths of videos, the electronic equipment can acquire the current playing time information of the main video and read the starting 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 sub-video can be improved.
In the scheme provided by the embodiment of the invention, the electronic equipment can acquire the video description file; analyzing the video description file to obtain the starting time information of each path of video, acquiring the current playing time information of the main video, and reading the starting 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 sub-video can be improved.
As an implementation manner of the embodiment of the present invention, as shown in fig. 3, a method for playing multiple paths of video provided by the embodiment of the present invention may include:
s101, under the condition that a playing instruction aiming at multiple paths of videos is obtained, current playing time information of a main video and starting time information of each path of video are obtained;
s301, determining whether a time point represented by the current playing time information of the main video is earlier than a time point represented by the starting time information of the sub video, and if so, executing step S302; if not, executing step S102;
when the electronic device acquires a playing instruction for the multi-path video, there may be no sub video 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 a 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 a 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 reached the time point indicated by the starting time information of the sub-video, then the sub-video does not exist yet at the time point indicated by the current playing time information of the main video, and the electronic device cannot start playing the sub-video yet, 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 explained 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 current playing video frame of the main video, and displaying playing prompt information when the 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 value;
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, it is indicated that the sub video does not exist at the time point indicated by the current playing time information of the main video, and the electronic device cannot play the sub video yet, in this case, the electronic device may continue playing the main video from the current playing video frame of the main video, and continuously monitor whether the 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, where the preset threshold may be set as required, for example, may be set to 5 seconds, 3 seconds, 1 second, and so on, and is not limited herein.
When the difference between the time point indicated by the start time information of the sub video and the time point indicated by the current play time information of the main video is greater than the preset threshold, the duration between the time points indicated by the start time information of the sub video is longer, and then the sub video cannot be played, so that the electronic device can continue playing the main video, and monitor whether the difference between the time point indicated by the start time information of the sub video and the time point indicated by the current play time information of the main video is greater than the preset threshold.
When the difference between the time point indicated by the start time information of the sub-video and the time point indicated by the current play time information of the main video is not greater than the preset threshold, it is indicated that the time period between the time points indicated by the start time information of the sub-video is relatively short, and then the electronic device is about to start playing the sub-video, in which case the electronic device can display playing prompt information. The play prompt information is used for prompting a user that the sub-video is about to be played. The play cue information may be text information, and when a difference between a time point indicated by the start time information of the sub-video and a time point indicated by the current play time information of the main video is not greater than a preset threshold, the electronic device may display the text information, for example, when a name of the sub-video is "video S", the content of the text information may be "video S will be played next".
S102, determining a first target video frame in each path of sub video based on current playing time information, starting time information and starting time information of the main video;
s103, playing the main video from the current playing video frame of the main video, and starting to play each path of sub video from the corresponding first target video frame.
It can be seen that, in the scheme provided by 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, 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, play the main video from the current playing video frame of the main video, and when the 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 the preset threshold, display playing prompt information. Thus, the electronic device can prompt the user in time that the sub-video is about to start playing.
As an implementation manner of the embodiment of the present invention, as shown in fig. 4, the method for playing multiple paths of video provided in the embodiment of the present invention may further include:
s401, when a progress adjustment instruction is acquired, determining a video frame after progress adjustment from the main video;
the user may want to adjust the viewing progress while watching the multi-path video, for example, the user may perform a fast forward operation or a fast reverse operation on the multi-path video being watched. 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 reverse button, and the user may issue the progress adjustment instruction by clicking the fast forward button or the fast reverse button.
When the electronic device obtains the progress adjustment instruction, a video frame after progress adjustment can be determined from the main video, and the video frame after 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 determines that the play time information indicated by the progress adjustment instruction is "20 minutes 35 seconds", which indicates a time point from the main video to 20 minutes 35 seconds, and then the electronic device may determine that a video frame corresponding to the time point of 20 minutes 35 seconds of the main video 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 adjustment 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 to continue to be played synchronously with the sub-videos, for each sub-video, the electronic device may determine a second target video frame in the sub-video based on the play 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 between a time point indicated by the play time information indicated by the progress adjustment instruction and a time point indicated by the start time information of the main video as a third difference;
and (B) step (B): for each sub-video, acquiring a second difference value corresponding to the sub-video, wherein the second difference value is the difference value between a time point represented by the starting time information of the sub-video and a time point represented by the starting time information of the main video;
step C: for each sub-video, calculating a difference value between a third difference value and a second difference value corresponding to the sub-video, and determining play time information after progress adjustment of the sub-video based on a time point represented by the difference value and start time information of the sub-video;
step D: and aiming at each sub video, determining the video frame corresponding to the play time information after the progress adjustment of the sub video as a second target video frame of the sub video.
The above steps A-D are described below by way of specific examples.
For example, the electronic device acquires the play time information indicated by the progress adjustment instruction x1 for the main video Z4 and the sub video Z41, and the time point indicated by the play time information is the time point from the play 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 play 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 play 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 45 seconds, the second difference corresponding to sub-video z41 is: 15 minutes and 10 seconds. Then, the electronic device may determine that the difference between the third difference corresponding to the main video Z4 and the second difference corresponding to the sub video Z41 is 35 seconds, and further, the electronic device may determine that the play 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 plays to 0 minutes 35 seconds, that is, a time point when the main video Z4 plays to 15 minutes 45 seconds. The electronic device may then determine the video frame corresponding to the 0 th minute 35 second point in sub-video z41 as the second target video frame of sub-video z 41.
S403, continuing to play the main video from the video frame after the progress adjustment, and continuing to play each path of 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 playing the main video from the progress-adjusted video frame, and continue playing each sub-video from the corresponding second target video frame. Because the play time information corresponding to the video frames corresponding to the play time information after the progress adjustment of the sub-video is consistent with the play time information corresponding to the video frames after the progress adjustment of the main video in the main video, the second target video frames of the sub-video and the video frames after the progress adjustment are synchronously played during the play, and thus the electronic equipment can continuously synchronously play the main video and the sub-video.
In the scheme provided by the embodiment of the invention, after the main video is played from the current playing video frame of the main video and each sub video is played from the corresponding first target video frame, the electronic device can determine the video frame after the progress adjustment from the main video when the progress adjustment instruction is acquired; determining a second target video frame in each sub-video based on the play 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; and continuing to play the main video from the video frames after the progress adjustment, and continuing to play each sub-video from the corresponding second target video frames. Thus, when the user adjusts the playing progress of the multi-path video, the electronic device can continue to synchronously play the multi-path video.
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, or the like, which is hereinafter referred to as a generating device for convenience of description. Of course, the generating device and the electronic device for playing multiple paths of videos may be the same device or different devices, which is reasonable.
For this case, the generation method of the main video and each sub video may include:
acquiring original video data of a main video and original video data of each sub-video; and respectively compressing the original video data of the main video and the original video data of each sub video to obtain the main video and each sub video.
To generate a main video and its per-sub video, an electronic device may acquire raw video data of the main video and raw video data of the per-sub video. The original video data of the main video and the original video data of each sub video can be obtained by shooting targets through a plurality of video shooting devices. For example, the actors Y1 and the host Y2 in the variety program are targeted, and the original video data with the content of the actor Y1 and the original video data with the content of the host Y2 can be obtained by photographing the actors Y1 and the host Y2 respectively through a plurality of video apparatuses. Of course, the original video data of the main video and the original video data of each sub-video may also be obtained by other corresponding techniques in the field of video capturing technology, which is not specifically limited herein.
After the original video data of each path of video in the multiple paths of videos is obtained, the generating equipment can compress the original video data of each path of video in the multiple paths of videos to obtain the path of video.
For each of the multiple paths of video, a key frame interval (GOP, group Of Pictures) of the path of video may be set to less than 1 second during the compression process. A GOP includes a succession of video frames, typically including an I frame, P frames, and B frames. In video decoding, for each GOP, I frames need to be decoded first, and then B frames and P frames can be decoded based on the decoded I frames. When the key frame interval of the video is less than 1 second, the electronic equipment can decode the video at any 1 second in the video playing process, so that the electronic equipment can conveniently start playing the video at any playing time point.
In the scheme provided by the embodiment of the invention, the generating device can acquire the original video data of the main video and the original video data of each sub-video; and respectively compressing the original video data of the main video and the original video data of each sub video to obtain the main video and each sub video. Thus, the electronic equipment can conveniently start playing the video at any playing time point.
As shown in fig. 5, the electronic device may include a player as an implementation of the embodiment of the present invention.
As shown in fig. 5, the electronic device includes one player through which the electronic device can simultaneously play multiple videos.
For this case, 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 may include:
rendering a current playing video frame of the main video to a preset main video display area through a player so that the player plays the main video from the current playing video frame of the main video; and rendering the first target video frame of the sub-video to a preset sub-video display area corresponding to the sub-video through one player aiming at each sub-video, so that one player starts to play the sub-video from the first target video frame of the sub-video.
In order to facilitate users to watch multiple paths of videos, a main video display area and a sub video display area can be preset in a display interface of the electronic equipment. When playing the main video and each sub video, the electronic device may 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 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 a player, so that the 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. In playing the main video Z5, the sub video Z51, and the sub video Z52, the electronic device may render the currently played video frame of the main video Z5 to the main video display area 602 through one player, render the first target video frame of the sub video Z51 to the sub video display area 603 through the one player, and render the first target video frame of the sub video Z52 to the sub video display area 604 through the one player.
In the scheme provided by the embodiment of the invention, the electronic device can render the current playing video frame of the main video to the preset main video display area through one player so that the one player plays the main video from the current playing video frame of the main video; and rendering the first target video frame of the sub-video to a preset sub-video display area corresponding to the sub-video through one player aiming at each sub-video, so that one player starts to play the sub-video from the first target video frame of the sub-video. In this way, it can be ensured that the electronic device can play multiple video simultaneously.
As an implementation 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, there are a plurality of decoders in the electronic device, including decoder 1, decoder 2, decoder 3 and …, and decoder n is a positive integer. The electronic device can decode the multi-path video through the decoder 1, the decoder 2 and the decoder 3 and … and the decoder n respectively to obtain the decoded video.
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, the starting time information, and the starting time information of the sub video, the method may further include:
and respectively decoding the main video and each sub video through a plurality of decoders to obtain the main video after decoding and each sub video after decoding.
After the electronic device acquires the main video and the plurality of sub-videos, the electronic device can respectively decode the main video and each sub-video through a plurality of decoders to obtain the main video after decoding and each sub-video after decoding. Thus, the electronic device can decode each path of video in the multiple paths of videos in parallel, so that decoding processing of each path of video in the multiple paths of videos in time can be ensured. The decoder may be a hardware decoder or a software decoder, which is not particularly limited herein.
Therefore, when the data volume of the videos in the multi-path video is large, as one decoder cannot decode the multiple videos at the same time, the electronic equipment can acquire the multi-path video and respectively decode the acquired multi-path video through the multiple decoders, so that the electronic equipment can be ensured to decode the acquired multi-path video in time.
Therefore, in the scheme provided by the embodiment of the invention, the electronic device can respectively decode the main video and each sub-video through a plurality of decoders to obtain the decoded main video and each sub-video. Thus, the electronic device can decode each path of video in the multiple paths of videos in parallel, so that decoding processing of each path of video in the multiple paths of videos in time can be ensured.
Corresponding to the above method for playing multiple paths of videos, the embodiment of the invention also provides a device for playing multiple paths of videos. The following describes a multi-channel video playing device provided by the embodiment of the invention.
As shown in fig. 7, a multi-channel video playing device is applied to an electronic device, and the device may include:
the information obtaining module 701 is configured to obtain current playing time information of a main video and starting time information of each path of video when a playing instruction for multiple paths of videos is obtained;
The multi-path video comprises the main video and the sub video, and the contents of the main video and the sub video have relevance.
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 current playing time information, starting time information of the main video, and starting time information of the sub-video;
and the playing time information corresponding to the first target video frame in 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 playing video frame of the main video, and start playing each path of the sub video from a corresponding first target video frame.
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-path video, the current playing time information of the main video and the starting time information of each path of video are 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; determining a first target video frame in each sub-video based on the current playing time information, the starting time information and the starting time information of the main 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 current playing video frame of the main video, and starting to play each sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each sub-video according to the current playing time information of the main video, the starting time information and the starting time information of the sub-video, and the playing time information corresponding to 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, so that the electronic equipment plays the main video from the current playing video frame of the main video, and synchronously displays the video picture of the main video and the video picture of each sub-video when each sub-video starts to be played from the corresponding first target video frame, thereby realizing synchronous playing of multiple paths of videos.
As shown in fig. 8, as an implementation manner of the embodiment of the present invention, the first target video frame determining module 702 may include:
a first difference calculating sub-module 801, configured to calculate, as a first difference, a difference between a time point indicated by the current playing time information and a time point indicated by the start time information of the main video;
a second difference calculating sub-module 802, configured to calculate, for each 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;
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 a time point indicated by the difference and start time information of the sub-video;
the target video frame determining sub-module 804 is configured to determine, for each 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 foregoing apparatus may further include:
A description file acquisition module (not shown in fig. 7) for acquiring a video description file before acquiring current playing time information of the main video and starting time information of each path of video;
the video description file comprises starting time information of each path of video in the multiple paths of videos.
And the analysis module (not shown in fig. 7) is used for analyzing the video description file to obtain the starting time information of each path of video.
The information acquisition module 701 may include:
an information acquisition sub-module (not shown in fig. 7) for acquiring current playing time information of the main video and reading start time information of each path of video.
As an implementation manner of the embodiment of the present invention, the foregoing apparatus may further include:
a judging module (not shown in fig. 7) for determining whether a time point represented by the current playing time information of the main video is earlier than a time point represented by the starting time information of the sub video before 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;
an execution module (not shown in fig. 7) for triggering the first target video frame determination module in a case where a time point indicated by current play time information of the main video is not earlier than a time point indicated by start time information of the sub video;
A cue information display module (not shown in fig. 7) for playing the main video from a current play video frame of the main video in a case where a time point indicated by the current play time information of the main video is earlier than a time point indicated by the start time information of the sub video, and displaying play cue information when a difference between the time point indicated by the start time information of the sub video and the time point indicated by the current play time information of the main video is not greater than a preset threshold;
the play prompt information is used for prompting a user that the sub video is about to be played.
As an implementation manner of the embodiment of the present invention, the foregoing apparatus may further include:
a progress adjustment module (not shown in fig. 7) configured to determine a progress-adjusted video frame from the main video when a progress adjustment instruction is acquired after playing the main video from a currently played video frame of the main video and starting playing each path of the sub video from a corresponding first target video frame;
the video frames after progress adjustment are video frames corresponding to playing time information indicated by the progress adjustment instruction in the main video.
A second target video frame determining module (not shown in fig. 7) configured to determine a second target video frame in each path of the sub-video based on the play 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;
and a second video playing module (not shown in fig. 7) for continuing to play the main video from the video frame after the progress adjustment, and continuing to play each path of the sub video from the corresponding second target video frame.
As an implementation of the embodiment of the present invention, the main video and each sub-video are pre-generated by a video encoding module (not shown in fig. 7);
the video encoding module may include:
an original video acquisition 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) for 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;
the key frame interval of the main video and each path of 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;
a sub-video playing sub-module (not shown in fig. 7) is configured to render, for each path of the sub-video, a first target video frame of the sub-video to a preset sub-video display area corresponding to the sub-video by using the one player, so that the one player starts playing the sub-video from the first target video frame of the sub-video.
As an implementation of the embodiment of the present invention, the electronic device includes a plurality of decoders;
the apparatus may further include:
a decoding module (not shown in fig. 7) configured to, before determining a first target video frame in each path of the sub-video based on current playing time information, starting time information, and starting time information of the main video, perform decoding processing on the main video and each path of the sub-video through the plurality of decoders, respectively, to obtain a main video after the decoding processing and each sub-video after the decoding processing.
The embodiment of the present invention also provides an electronic device, as shown in fig. 9, including 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 perform communication with each other through the communication bus 904,
a memory 903 for storing a computer program;
the processor 901 is configured to implement the steps of the method for playing multiple video according to any one of the embodiments described above when executing the program stored in the memory 903.
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-path video, the current playing time information of the main video and the starting time information of each path of video are 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; determining a first target video frame in each sub-video based on the current playing time information, the starting time information and the starting time information of the main 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 current playing video frame of the main video, and starting to play each sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each sub-video according to the current playing time information of the main video, the starting time information and the starting time information of the sub-video, and the playing time information corresponding to 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, so that the electronic equipment plays the main video from the current playing video frame of the main video, and synchronously displays the video picture of the main video and the video picture of each sub-video when each sub-video starts to be played from the corresponding first target video frame, thereby realizing synchronous playing of multiple paths of videos.
The communication bus mentioned by the above electronic device may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The memory may include random access memory (Random Access Memory, RAM) or 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 aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In still another embodiment of the present invention, a computer readable storage medium is provided, where a computer program is stored, where the computer program is executed by a processor to implement the method for playing multiple video according to any one of the foregoing embodiments.
It can be seen that 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, under the condition that a play instruction for multiple paths of videos is obtained, current play time information of a main video and start time information of each path of video are obtained, where the multiple paths of videos include a main video and a sub video, and contents of the main video and the sub video have correlation; determining a first target video frame in each sub-video based on the current playing time information, the starting time information and the starting time information of the main 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 current playing video frame of the main video, and starting to play each sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each sub-video according to the current playing time information of the main video, the starting time information and the starting time information of the sub-video, and the playing time information corresponding to 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, so that the electronic equipment plays the main video from the current playing video frame of the main video, and synchronously displays the video picture of the main video and the video picture of each sub-video when each sub-video starts to be played from the corresponding first target video frame, thereby realizing synchronous playing of multiple paths of videos.
In yet another embodiment of the present invention, a computer program product containing instructions that, when executed on a computer, cause the computer to perform the method for playing multiple video according to any one of the foregoing embodiments is also provided.
In the scheme provided by the embodiment of the invention, when a computer program product containing instructions runs on a computer, under the condition that a playing instruction for multiple paths of videos is obtained, current playing time information of a main video and starting time information of each path of video are obtained, wherein the multiple paths of videos comprise 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 sub-video based on the current playing time information, the starting time information and the starting time information of the main 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 current playing video frame of the main video, and starting to play each sub-video from the corresponding first target video frame. The electronic equipment can determine the first target video frame in each sub-video according to the current playing time information of the main video, the starting time information and the starting time information of the sub-video, and the playing time information corresponding to 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, so that the electronic equipment plays the main video from the current playing video frame of the main video, and synchronously displays the video picture of the main video and the video picture of each sub-video when each sub-video starts to be played from the corresponding first target video frame, thereby realizing synchronous playing of multiple paths of videos.
In the above embodiments, it may be implemented in whole or in part 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, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more 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)), etc.
It is noted that relational terms such as first and second, and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A method for playing multiple paths of videos, which is applied to an electronic device, the method comprising:
under the condition that a playing instruction aiming at a plurality of paths of videos is acquired, acquiring current playing time information of a main video and starting time information of each path of video, 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;
determining whether a time point represented by the current playing time information of the main video is earlier than a time point represented by the starting time information of the sub video;
if not, calculating a difference between the time point indicated by the current playing time information and the time point indicated by the starting 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 the sub video for each path of the sub video, and determining target playing time information of the sub video based on a time point represented by the difference value and starting time information of the sub video;
For 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; 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;
and playing the main video from the current playing video frame of the main video, and starting to play each path of sub video from the corresponding first target video frame.
2. The method according to claim 1, wherein before the step of acquiring 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 starting time information of each path of video in multiple paths of videos;
analyzing the video description file to obtain the starting 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.
3. The method according to claim 1, wherein in the case where a point in time indicated by the current playing time information of the main video is earlier than a point in time indicated by the start time information of the sub video, playing the main video from a current playing video frame of the main video, and in the case where a difference between the point in time indicated by the start time information of the sub video and the point in time indicated by the current playing time information of the main video is not greater than a preset threshold, playing prompt information for prompting a user that the sub video is about to be played is displayed.
4. A method according to any of claims 1-3, wherein after the step of playing the main video from a currently playing video frame of the main video and playing each of the sub-videos from a corresponding first target video frame, the method further comprises:
when a progress adjustment instruction is acquired, 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 adjustment instruction, the starting time information of the main video and the starting time information of the sub video;
and continuing to play the main video from the video frames after the progress adjustment, and continuing to play each path of sub video from the corresponding second target video frames.
5. A method according to any one of claims 1-3, 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 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.
6. A method according to any one of claims 1-3, wherein the electronic device comprises a player;
the step of playing the main video from the current playing video frame of the main video and playing each path of the sub video from the corresponding first target video frame comprises the following steps:
rendering a 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 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 aiming at each path of the sub video, so that the player starts to play the sub video from the first target video frame of the sub video.
7. A method according to any of claims 1-3, wherein 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 starting time information of the main video and the starting time information of the sub video, the method further includes:
and respectively decoding the main video and each path of sub video through the plurality of decoders to obtain the main video after decoding and each path of sub video after decoding.
8. A multi-channel video playing device, applied to an electronic device, comprising:
the information acquisition module is used for acquiring current playing time information of a main video and starting time information of each path of video under the condition that a playing instruction aiming at a plurality of paths of videos is acquired, wherein the plurality of paths of videos comprise the main video and the sub video, and the contents of the main video and the sub video have correlation;
a judging module, configured to determine whether a time point indicated by current playing time information of the main video is earlier than a time point indicated by start time information of the sub video;
a first target video frame determining module, configured to calculate, as a first difference, a difference between a time point indicated by the current playing time information and a time point indicated by the start time information of the main video when the determination result of the determining module is no; 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 the sub video for each path of the sub video, and determining target playing time information of the sub video based on a time point represented by the difference value and starting time information of the sub video; for 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; 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 is used for playing the main video from the current playing video frame of the main video and playing each path of sub video from the corresponding first target video frame.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method of any of claims 1-7 when executing a program stored on a memory.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-7.
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 CN112911343A (en) 2021-06-04
CN112911343B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923495B (en) * 2021-09-08 2024-01-12 北京奇艺世纪科技有限公司 Video playing method, system, electronic equipment and storage medium
CN113923530B (en) * 2021-10-18 2023-12-22 北京字节跳动网络技术有限公司 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

Family Cites Families (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
CN106464828B (en) * 2014-11-04 2020-03-13 松下电器(美国)知识产权公司 Reproducing method, reproducing apparatus, and recording medium
CN109714623B (en) * 2019-03-12 2021-11-16 北京旷视科技有限公司 Image display method and 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
CN111246301B (en) * 2020-01-15 2023-03-21 深圳市雅阅科技有限公司 Video playing method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN112911343A (en) 2021-06-04

Similar Documents

Publication Publication Date Title
CN112911343B (en) Multi-channel video playing method and device, electronic equipment and storage medium
US10757359B1 (en) System and methods providing sports event related media to internet-enabled devices synchronized with a live broadcast of the sports event
US11741110B2 (en) Aiding discovery of program content by providing deeplinks into most interesting moments via social media
TWI519150B (en) Tracking user interaction from a receiving device
CN109257631B (en) Video carousel playing method and device, computer equipment and storage medium
US9191422B2 (en) Processing of social media for selected time-shifted multimedia content
KR101983107B1 (en) Method for inserting information push into live video streaming, server and terminal
EP2954693B1 (en) Processing of social media for selected time-shifted multimedia content
WO2017121303A1 (en) Method and apparatus for playing push information during video live broadcast
US20130138673A1 (en) Information processing device, information processing method, and program
CN112753227A (en) Audio processing for detecting the occurrence of crowd noise in a sporting event television program
JP4621758B2 (en) Content information reproducing apparatus, content information reproducing system, and information processing apparatus
US10021433B1 (en) Video-production system with social-media features
CN111316661B (en) Management of non-linear content presentation and experience
US20180210906A1 (en) Method, apparatus and system for indexing content based on time information
CN103581744A (en) Method for acquiring data and electronic equipment
JP7487398B1 (en) Video distribution device, video distribution method, video distribution program, and video distribution system
JP2012028920A (en) Recording and reproducing device with video display function
WO2023205772A1 (en) Multimedia content management and packaging distributed ledger system and method of operation thereof
WO2013080394A1 (en) Information processing device, information processing method, and program
KR101380963B1 (en) System and method for providing relevant information
CN114666667A (en) Video key point generation method and device, electronic equipment and storage medium

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