Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In one embodiment, as shown in FIG. 1, a diagram of an application environment for a playback method is provided. Referring to fig. 1, the playing method is applied to a playing system. The playback system includes a terminal 110 and a satellite 120. Among them, the terminal 110 may include a first terminal 111 and a second terminal 112, etc. The terminal 110 receives satellite signals of the satellite 120 by wireless. The terminal 110 may specifically be a fixed terminal or a mobile terminal, the mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a notebook computer, and the like, and the fixed terminal may specifically be at least one of a television, a desktop computer, an advertisement terminal, and the like.
Fig. 2 is a schematic diagram of an internal structure of the terminal in one embodiment. As shown in fig. 2, the terminal includes a processor, memory and display screen, input devices and speakers connected by a system bus. The memory may include, among other things, a non-volatile storage medium and an internal memory. The non-volatile storage medium of the terminal may store an operating system and also a computer program which, when executed by the processor, causes the processor to perform a playback method. The internal memory of the terminal, which provides an environment for running the computer program in the non-volatile storage medium, may store computer readable instructions that, when executed by the processor, cause the processor to perform a playback method. The processor is used for providing calculation and control capability and supporting the operation of the whole terminal. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen, and the input device can be a touch screen covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the terminal, or an external keyboard, a touch pad or a mouse, and the like. The terminal can be a tablet computer, a television, an advertising terminal, a personal digital assistant or a wearable device and the like. Those skilled in the art will appreciate that the configuration shown in fig. 2 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation on the terminal to which the present application is applied, and that a particular terminal may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
As shown in fig. 3, in one embodiment, a playing method is provided, and this embodiment is exemplified by applying the method to the terminal in fig. 1. The method specifically comprises the following steps:
s302, acquiring a reference time point of the positioning device.
The local terminal is a terminal for playing a content sequence to be played, and may be an advertisement terminal. The sequence of content to be played may include at least one of video, audio, a collection of pictures, a document, and the like.
A positioning device is a device for receiving positioning information. The positioning device may particularly be a satellite positioning device, which is a device that receives positioning information from satellites. The Satellite Positioning device is, for example, a GPS (Global Positioning System) receiver or a BDS (BeiDou Navigation Satellite System, BeiDou Satellite Navigation System) receiver. The reference time point is a time point as a reference for comparison. The positioning means may be built into the terminal. The positioning means may also be a separate component connected point-to-point with the terminals. Point-to-point connections such as bluetooth or cable connections.
Specifically, the terminal may acquire time information in the positioning information of the positioning device, and directly use the time information as a reference time point. The terminal can also synchronize the time of the local machine according to the time information in the positioning information of the positioning device, and further acquire the current time point of the local machine as the reference time point. The positioning device can provide high-precision time information, and the reference time points can be obtained by the positioning device, so that the terminals basically have the same reference time points.
And S304, calculating the time length between the preset absolute time point and the reference time point.
The preset absolute time point is any preset time point, and the same preset absolute time point exists on each terminal. The preset absolute time point refers to a certain time point which is uniformly preset on each terminal in advance. The preset absolute time point may be any preset time point, for example, an absolute time point before the current actual time, or an absolute time point after the current actual time. The time length refers to the length of the distance between two time points. The preset absolute time point may be an absolute time point in a time period, such as nine am every day, or three pm every week, or nine pm every first day every month, etc.
Specifically, each terminal stores the same preset absolute time point, and meanwhile, each terminal acquires the same reference time point from the respective positioning device, and then calculates the difference between the reference time point and the preset absolute time point, so as to obtain the time length between the preset absolute time point and the reference time point. If the difference is found to be negative, the difference can be taken as an absolute value, so that the time length between the preset absolute time point and the reference time point is obtained.
S306, acquiring the total playing time of the content sequence to be played.
The content sequence to be played is a content set formed by the content to be played by the terminal according to the playing sequence. The sequence to be played is at least one of audio, video, photo album, document, etc. The total playing time length is the time length required by the terminal to play a content sequence to be played.
In one embodiment, the content sequence to be played may be built in the terminal, may be downloaded from a network, or may be read from a memory externally connected to the terminal.
In one embodiment, the terminal may obtain a flag bit value carried by the content sequence to be played; when the obtained flag bit value is the first value, step S302 to step S312 in this embodiment are executed to play the content sequence to be played; and when the obtained flag bit value is a second value, directly playing the content sequence to be played from the head. The flag bit value is a value indicating a playing mode of the content sequence to be played, and may include at least one of characters such as numbers, letters, or symbols. The first value may be, for example, 1, and the second value may be, for example, 0.
And S308, the time length is left according to the total playing time length to obtain a playing time point.
Residue taking may also be referred to as modulo, which refers to a mathematical remainder taking operation. For example, the mathematical expression for a being left over by b can be expressed as: a% b. The playing time point refers to a certain time point of the content sequence to be played being played by each terminal, and represents that the content to be played corresponding to the playing time point can be played currently. For example, assuming that the total playing time of the content sequence to be played is 5 minutes, the playing time point may be 61 seconds, which indicates that the content to be played corresponding to the 61 th second from the head of the content sequence to be played may be currently played.
Specifically, according to the obtained time length and the total playing time length of the content sequence to be played, remainder calculation is performed on the time length according to the total playing time length, so that a playing time point is obtained, that is, a playing time point from which each terminal should start playing at present is determined.
In one embodiment, the start-up time may be different for each terminal. As long as each terminal calculates the playing time point according to steps S302 to S308 after being started, the same playing time point can be obtained. In other words, the terminal can realize synchronous playing with other terminals playing the content sequence to be played no matter when the terminal is started, and no matter how many times other terminals have cyclically played the content sequence to be played, that is, each terminal plays the content to be played corresponding to the same playing time point.
S310, searching the content to be played corresponding to the playing time point from the content sequence to be played.
The content to be played is content to be played by the terminal at a certain point in time. Specifically, each content to be played in the sequence of contents to be played may correspond to a time stamp, and the terminal may search for the time stamp corresponding to the playing time point, and then determine the content to be played corresponding to the searched time stamp.
And S312, playing the content sequence to be played from the searched content to be played.
Specifically, the terminal may start playing the searched content to be played from the current time, and sequentially play subsequent contents to be played in the content sequence to be played from the content to be played according to the time sequence of the contents to be played in the content sequence to be played.
According to the playing method, the positioning devices at different ends can provide accurate reference time points, the preset absolute time points are recorded at each end, and then the same time length can be calculated at each end, based on the time length, the same playing time points can be obtained for the same content sequence to be played, and each end plays the content sequence to be played from the playing time point, so that synchronous playing at different ends can be realized. And each end can realize synchronous playing no matter whether the starting time is consistent or not. The local area network does not need to be additionally configured, and a special server for time synchronization does not need to be constructed in the local area network, so that the dependency on a hardware environment is reduced.
In one embodiment, the step of acquiring the reference time point of the local positioning device is periodically executed according to a preset period; the playing method further comprises the following steps: comparing the reference time point with a preset absolute time point; when the reference time point is greater than or equal to the preset absolute time point, step S304 is performed.
The preset period is a preset time interval for regularly executing the designated action. The preset period may be a time interval between two adjacent reference time points acquired by the terminals, where the two adjacent reference time points are uniformly set in advance, and each terminal has the same preset period. The preset period may be specifically set according to an actual application scenario, for example, set to 1 second.
Specifically, each terminal periodically executes a step of acquiring time information from positioning information of a local positioning device according to the same preset period, and takes the acquired time information as a reference time point. After each terminal acquires the reference time point, the acquired reference time point is compared with a preset absolute time point. When the reference time point is smaller than the preset absolute time point, the terminal returns to step S302 according to the preset period to continue the execution. When the reference time point is greater than or equal to the predetermined absolute time point, the terminal will continue to perform the above step S304 and the subsequent steps.
In this embodiment, after acquiring the reference time point, the terminal compares the acquired reference time point with a preset absolute time point, and when the reference time point is smaller than the preset absolute time point, the step of acquiring the reference time point is periodically executed according to a preset period. When the reference time point is greater than or equal to the preset absolute time point, steps S304 to S312 in this embodiment are executed, so as to realize the timed play start of the terminal. And each terminal regularly acquires the reference time point according to the same preset period, so that the time synchronization of each terminal can be effectively ensured.
In one embodiment, the compared preset absolute time points include a plurality of preset absolute time points corresponding to the plurality of content sequences to be played one by one; in the playing method, when the reference time point is greater than or equal to the preset absolute time point, the step of executing step S304 includes: screening out a preset absolute time point with the latest time before the reference time point from the plurality of preset absolute time points according to the comparison result; and executing step S304 for the screened preset absolute time point.
The preset absolute time point for comparison is the preset absolute time point for comparison with the acquired reference time point in the playing method.
The content sequence to be played of each terminal may be multiple, the multiple content sequences to be played correspond to time points at which timing starts respectively, and the time points at which timing starts corresponding to each content sequence to be played are different from each other. And sequencing the plurality of content sequences to be played according to the sequence of the corresponding time points of the timing start to form a playing schedule. Each terminal can uniformly take the time points of the timing start corresponding to the content sequences to be played as the preset absolute time points corresponding to the content sequences to be played one by one respectively.
Specifically, each terminal includes a plurality of content sequences to be played, and time points at which timings corresponding to the plurality of content sequences to be played respectively start are used as respective corresponding preset absolute time points. There are a plurality of preset absolute time points for comparison with the reference time point, and the plurality of preset absolute time points are respectively compared with the reference time point. And further comparing all the screened preset absolute time points by comparing and screening all the preset absolute time points before the reference time point, thereby screening the latest preset absolute time point. And then, calculating the difference between the reference time point and the preset absolute time point screened out through the two comparisons, and calculating the time length between the reference time point and the preset absolute time point.
In this embodiment, when there are multiple content sequences to be played at each terminal, the latest preset absolute time point before the current reference time point is screened out through two comparisons, so as to accurately position the content to be played at the current reference time point, and implement synchronous playing of the multiple content sequences to be played. And the time point of the timing start corresponding to a certain content sequence to be played is taken as a preset absolute time point corresponding to the content sequence to be played, and when the reference time point is greater than or equal to the preset absolute time point, the content sequence to be played is started to be played, so that the timing start playing of a plurality of content sequences to be played is realized.
In one embodiment, the content sequence to be played is a sequence of corresponding time-stamped frames; step S310 in the playing method includes: in the frame sequence, searching a key frame corresponding to a timestamp matched with a playing time point; step S312 includes: and when the time stamp corresponding to the searched key frame is reached, playing the frame sequence frame by frame from the searched key frame.
The timestamp refers to an identifier that can characterize a specific time point. The time stamp may be a specific time point corresponding to each content to be played in the sequence of contents to be played. The time stamp may be at least one of a number, a letter, a symbol, and other identification characters, and may be used to uniquely identify a specific time point. A frame is one scene of a minimum unit. The frame sequence refers to a specific sequence consisting of a plurality of frames arranged in time sequence. The frame sequence may be a content sequence consisting of a plurality of scenes. The frame sequence may specifically be at least one of video, audio, a photo album and a document. For example, when the frame sequence is a picture set, each picture in the picture set corresponds to a key frame. In a frame sequence, timestamps may correspond one-to-one to key frames. Matching means that the two aspects of comparison are identical or highly similar. Matching may be that the two values compared are equal or close, for example, the values a and B match, which may mean that a and B are equal, or that a and B have a small difference.
Specifically, when the content sequence to be played is a frame sequence in which each key frame corresponds to a time stamp, the terminal may search for the time stamp corresponding to the playing time point in the frame sequence, determine the key frame corresponding to the time stamp according to the one-to-one correspondence relationship between the time stamp and the key frame, and further determine the key frame to be played at the playing time point. After the found key frame is determined, when the time stamp corresponding to the key frame arrives, the frame sequence is played frame by frame from the key frame.
In one embodiment, when the terminal finds that a certain timestamp in the frame sequence is equal to the playing time point, the key frame corresponding to the timestamp is used as the found key frame, and when the timestamp corresponding to the found key frame is reached, the frame sequence is played frame by frame from the found key frame.
In one embodiment, the terminal takes a key frame corresponding to a timestamp closest to a playing time point in the frame sequence as a searched key frame, and plays the frame sequence frame by frame from the searched key frame when the timestamp corresponding to the searched key frame is reached.
In this embodiment, when the content sequence to be played is a frame sequence corresponding to a time stamp, the searched time stamp is determined according to the corresponding relationship between the time stamp and the playing time point, the searched key frame is determined according to the corresponding relationship between the time stamp and the key frame, and the frame sequence is played frame by frame from the searched key frame, so that the searching efficiency of the key frame is improved, and the synchronous playing of each terminal is effectively realized.
In one embodiment, in the playing method, the step of searching for a key frame corresponding to a timestamp matching the playing time point in the frame sequence comprises: searching a timestamp which is greater than the playing time point and is closest to the playing time point from timestamps corresponding to all key frames in the frame sequence; and taking the key frame corresponding to the searched timestamp as the searched key frame.
Specifically, when each terminal searches for a key frame to be played at a playing time point in a frame sequence, first, a time stamp corresponding to each key frame in the frame sequence and larger than the playing time point is found, then, a time stamp closest to the playing time point is found in the found time stamps, and the key frame corresponding to the time stamp determined through the two searches is used as the found key frame.
In this embodiment, after the playing time point in the frame sequence is searched, and the time stamp closest to the playing time point is used to search the key frame that should be played at the playing time point, so as to further improve the searching efficiency of the key frame.
In one embodiment, the step of finding key frames in the frame sequence corresponding to timestamps matching the play time point further comprises: when the playing time point is equal to the time stamp corresponding to one key frame in the frame sequence, taking the key frame as the searched key frame; when the playing time point is not equal to the time stamp corresponding to any key frame in the frame sequence, the step of searching the time stamp which is larger than the playing time point and is closest to the playing time point from the time stamps corresponding to the key frames in the frame sequence is executed.
Specifically, in the frame sequence, when the terminal finds a timestamp equal to the playing time point, the key frame corresponding to the timestamp is used as the found key frame. And when the terminal compares the playing time point with the time stamps corresponding to all the key frames in the frame sequence and does not find the key frame equal to the playing time point, searching the earliest time stamp after the playing time point in the frame sequence and taking the key frame corresponding to the time stamp as the searched key frame.
In one embodiment, when the playing time point is not equal to the timestamp corresponding to any key frame in the frame sequence, the key frame corresponding to the timestamp which is greater than the playing time point and closest to the playing time point is used as the found key frame. And before the time stamp corresponding to the searched key frame comes, the terminal is in a waiting playing state. And when the timestamp corresponding to the searched key frame arrives, the terminal starts playing frame by frame from the searched key frame.
In this embodiment, if there is a timestamp equal to the playing time point, the key frame corresponding to the timestamp is used as the searched key frame, and the key frame is played frame by frame from the key frame. If the timestamp equal to the playing time point is not found in the frame sequence, the key frame corresponding to the earliest timestamp after the playing time point is used as the found key frame, and the key frame is played frame by frame from the key frame when the timestamp corresponding to the key frame arrives. The searched key frame is determined according to the corresponding relation between the playing time point and the time stamp, and a corresponding playing strategy is given, so that the searching efficiency of the key frame which is played at the playing time point is improved.
In one embodiment, step S312 in the playing method further includes: before the timestamp corresponding to the searched key frame is reached, positioning the key frame corresponding to the maximum timestamp before the timestamp corresponding to the searched key frame; and playing according to the positioned key frames.
Specifically, when the playing time point is not equal to the time stamp corresponding to any key frame in the frame sequence, the key frame corresponding to the time stamp which is greater than the playing time point and closest to the playing time point is used as the searched key frame. And before the timestamp corresponding to the searched key frame comes, positioning the key frame corresponding to the maximum timestamp before the timestamp corresponding to the searched key frame, namely positioning the previous key frame of the searched key frame, and starting to play frame by frame from the previous key frame of the searched key frame. And when the timestamp corresponding to the searched key frame arrives, directly jumping to the frame-by-frame playing from the searched key frame.
In the above embodiment, when the playing time point is not equal to the timestamp corresponding to any one of the key frames, the key frame corresponding to the earliest timestamp after the playing time point is used as the found key frame. And playing the previous key frame of the searched key frame, and directly jumping to play frame by frame from the searched key frame when the timestamp corresponding to the searched key frame arrives. The synchronous playing of the frame sequence by each terminal is realized by the skip playing mode, and the playing mode can start playing as long as the terminal is started, so that the playing starting speed is increased, and the visual effect is enhanced.
In one embodiment, the content sequence to be played is a sequence of corresponding time-stamped frames; step S310 in the playing method includes: searching a timestamp which is smaller than the playing time point and is closest to the playing time point from timestamps corresponding to all key frames in the frame sequence; taking the key frame corresponding to the searched timestamp as a searched key frame; step S312 includes: and playing the frame sequence frame by frame from the searched key frame at a frame rate higher than the default frame rate of the frame sequence until the key frame corresponding to the current playing time point in the frame sequence is played, and starting to play the frame by frame from the key frame corresponding to the current playing time point at the default frame rate.
The frame rate is the number of frames that can be displayed in a unit time, for example, 60 fps. The default frame rate is the frame rate of play inherent to a frame sequence.
In this embodiment, the terminal takes the key frame corresponding to the latest timestamp before the playing time point as the searched key frame, and plays the frame sequence frame by frame from the searched key frame quickly until the key frame currently played by the terminal is the key frame corresponding to the current playing time point, and plays the frame sequence by frame at the default frame rate of the frame sequence from the key frame corresponding to the current playing time point. By the catching-up playing mode, each terminal can start playing the frame sequence after being started, and the frame rate higher than the default frame rate is used for fast playing, so that the synchronous playing of each terminal is fast realized.
As shown in fig. 4, in a specific embodiment, the content sequence to be played in the playing method may be a video, and the specific steps of implementing synchronous playing of the video by each terminal are as follows:
s402, periodically acquiring the reference time point of the positioning device according to a preset period.
And S404, comparing the reference time point with a preset absolute time point.
And S406, when the reference time point is greater than or equal to the preset absolute time point, calculating the time length between the preset absolute time point and the reference time point.
S408, acquiring the total playing time of the video.
And S410, obtaining the playing time point by taking the rest of the time length according to the total playing time length.
S412, when the playing time point is equal to the timestamp corresponding to a certain key frame in the video, the key frame is used as the found key frame, and the step S416 is skipped.
S414, when the playing time point is not equal to the timestamp corresponding to any key frame in the video, searching for a timestamp which is greater than the playing time point and is closest to the playing time point in the video, taking the key frame corresponding to the timestamp as the searched key frame, and jumping to step S416.
And S416, when the time stamp corresponding to the searched key frame is reached, the video is played frame by frame from the searched key frame.
In this embodiment, each terminal periodically acquires substantially the same reference time point according to a preset period, and through comparison and judgment, when the reference time point is greater than or equal to a preset absolute time point, the time length between the reference time point and the preset absolute time point is calculated, based on the same time length, the same playing time point can be acquired for the same video, and the searched key frame is determined according to the corresponding relationship between the playing time point and the timestamp corresponding to each key frame in the video. When the timestamp corresponding to the searched key frame is reached, each terminal plays the video frame by frame from the searched key frame, and further the timing synchronous playing at different terminals can be realized. And each terminal can realize timing synchronous playing no matter whether the starting time is consistent or not. The local area network does not need to be additionally configured, and a special server for time synchronization does not need to be constructed in the local area network, so that the dependency on a hardware environment is reduced.
As shown in fig. 5, in an embodiment, in the playing method, each terminal may store a plurality of videos to be played synchronously, and the specific steps of playing the plurality of videos synchronously by each terminal are as follows:
and S502, periodically acquiring the reference time point of the positioning device according to a preset period.
S504, comparing the reference time point with the preset absolute time point, and screening out a plurality of preset absolute time points before the reference time point.
S506, screening out the latest preset absolute time point from the screened preset absolute time points.
And S508, calculating the time length between the screened preset absolute time point and the reference time point.
And S510, acquiring the total playing time of the video.
And S512, the time length is left according to the total playing time length to obtain a playing time point.
S514, when the playing time point is equal to the time stamp corresponding to a certain key frame in the video, the key frame is taken as the searched key frame, and the step S520 is skipped.
S516, when the playing time point is not equal to the timestamp corresponding to any key frame in the video, a timestamp which is greater than the playing time point and is closest to the playing time point is searched in the video, and the key frame corresponding to the timestamp is used as the searched key frame.
S518, before the timestamp corresponding to the searched key frame is reached, the key frame corresponding to the maximum timestamp before the timestamp corresponding to the searched key frame is positioned, and playing is carried out according to the positioned key frame.
And S520, when the time stamp corresponding to the searched key frame is reached, playing the video frame by frame from the searched key frame.
In this embodiment, when each terminal has a plurality of videos to be played synchronously, the same playing time point is calculated based on the same video by comparing and screening the latest preset absolute time point before the reference time point and calculating the time length between the screened preset absolute time point and the reference time point. And when the playing time point is not equal to the time stamp corresponding to any key frame, taking the key frame corresponding to the time stamp which is after the playing time point and is closest to the playing time point as the searched key frame. And the last key frame of the searched key frame is positioned and played, and when the time stamp corresponding to the searched key frame is reached, the video is played frame by frame from the key frame, so that the synchronous playing of each terminal is realized. The synchronous playing of the plurality of videos can be realized no matter whether the starting time is consistent or not by each terminal. The local area network does not need to be additionally configured, and a special server for time synchronization does not need to be constructed in the local area network, so that the dependency on a hardware environment is reduced.
In one embodiment, as shown in fig. 6, a playback device 600 is provided. Referring to fig. 6, the playback apparatus 600 includes: a reference time point obtaining module 601, a time length calculating module 602, a total playing time length obtaining module 603, a playing time point calculating module 604, a to-be-played content searching module 605, and a playing module 606.
The reference time point obtaining module 601 is configured to obtain a reference time point of a local positioning apparatus.
A time length calculating module 602, configured to calculate a time length between the preset absolute time point and the reference time point.
A total playing time length obtaining module 603, configured to obtain a total playing time length of the content sequence to be played.
And a playing time point calculating module 604, configured to take the remaining time length according to the total playing time length to obtain a playing time point.
A to-be-played content searching module 605, configured to search for a to-be-played content corresponding to the playing time point from the to-be-played content sequence.
The playing module 606 is configured to play the content sequence to be played from the searched content to be played.
According to the playing device 600, the positioning devices at different ends can provide accurate reference time points, a preset absolute time point is recorded at each end, and then the same time length can be calculated at each end, based on the time length, the same playing time point can be obtained for the same content sequence to be played, and each end plays the content sequence to be played from the playing time point, so that synchronous playing at different ends can be realized. And each end can realize synchronous playing no matter whether the starting time is consistent or not. The local area network does not need to be additionally configured, and a special server for time synchronization does not need to be constructed in the local area network, so that the dependency on a hardware environment is reduced.
In one embodiment, the reference time point acquiring module 601 is further configured to periodically perform the step of acquiring the reference time point of the local positioning apparatus according to a preset period.
The playback device 600 further includes: a time point comparison module 607.
A time point comparing module 607 for comparing the reference time point with a preset absolute time point; when the reference time point is greater than or equal to the preset absolute time point, the time length calculation module 602 is caused to perform the step of calculating the time length between the preset absolute time point and the reference time point.
In this embodiment, after acquiring the reference time point, the terminal compares the acquired reference time point with a preset absolute time point, and when the reference time point is smaller than the preset absolute time point, the step of acquiring the reference time point is periodically executed according to a preset period. When the reference time point is greater than or equal to the preset absolute time point, the step of calculating the time length between the preset absolute time point and the reference time point is executed to obtain the same time length, and the same playing time point is obtained according to the same time length, so that the timed playing of the terminal is started. And each terminal regularly acquires the reference time point according to the same preset period, so that the time synchronization of each terminal can be effectively ensured.
In one embodiment, the compared preset absolute time points include a plurality of preset absolute time points corresponding to the plurality of content sequences to be played one by one; the playback device 600 further includes: the absolute time point filtering module 608 is preset.
The preset absolute time point screening module 608 is configured to screen out a preset absolute time point with the latest time before the reference time point from the plurality of preset absolute time points according to the comparison result.
The time length calculating module 602 is further configured to calculate a time length between the filtered preset absolute time point and the reference time point.
In this embodiment, when there are multiple content sequences to be played at each terminal, the latest preset absolute time point before the current reference time point is screened out through two comparisons, so as to accurately position the content to be played at the current reference time point, and implement synchronous playing of the multiple content sequences to be played. And the time point of the timing start corresponding to a certain content sequence to be played is taken as a preset absolute time point corresponding to the content sequence to be played, and when the reference time point is greater than or equal to the preset absolute time point, the content sequence to be played is started to be played, so that the timing start playing of a plurality of content sequences to be played is realized.
In one embodiment, the content sequence to be played is a sequence of corresponding time-stamped frames; the to-be-played content search module 605 is further configured to search the frame sequence for a key frame corresponding to a timestamp matching the playing time point. The playing module 606 is further configured to play the frame sequence frame by frame from the found key frame when the timestamp corresponding to the found key frame is reached.
In this embodiment, when the content sequence to be played is a frame sequence corresponding to a time stamp, the searched time stamp is determined according to the corresponding relationship between the time stamp and the playing time point, the searched key frame is determined according to the corresponding relationship between the time stamp and the key frame, and the frame sequence is played frame by frame from the searched key frame, so that the searching efficiency of the key frame is improved, and the synchronous playing of each terminal is effectively realized.
In an embodiment, the to-be-played content searching module 605 is further configured to search, from the timestamps corresponding to the key frames in the frame sequence, a timestamp which is greater than the playing time point and is closest to the playing time point; and taking the key frame corresponding to the searched timestamp as the searched key frame.
In this embodiment, after the playing time point in the frame sequence is searched, and the time stamp closest to the playing time point is used to search the key frame that should be played at the playing time point, so as to further improve the searching efficiency of the key frame.
In an embodiment, the to-be-played content searching module 605 is further configured to, when the playing time point is equal to a timestamp corresponding to one key frame in the frame sequence, use the one key frame as the found key frame; when the playing time point is not equal to the time stamp corresponding to any key frame in the frame sequence, the step of searching the time stamp which is larger than the playing time point and is closest to the playing time point from the time stamps corresponding to the key frames in the frame sequence is executed.
In this embodiment, if there is a timestamp equal to the playing time point, the key frame corresponding to the timestamp is used as the searched key frame, and the key frame is played frame by frame from the key frame. If the timestamp equal to the playing time point is not found in the frame sequence, the key frame corresponding to the earliest timestamp after the playing time point is used as the found key frame, and the key frame is played frame by frame from the key frame when the timestamp corresponding to the key frame arrives. The searched key frame is determined according to the corresponding relation between the playing time point and the time stamp, and a corresponding playing strategy is given, so that the searching efficiency of the key frame which is played at the playing time point is improved.
In an embodiment, the to-be-played content searching module 605 is configured to, before reaching the timestamp corresponding to the searched key frame, locate the key frame corresponding to the largest timestamp before the timestamp corresponding to the searched key frame, so that the playing module 606 plays according to the located key frame.
In the above embodiment, when the playing time point is not equal to the timestamp corresponding to any one of the key frames, the key frame corresponding to the earliest timestamp after the playing time point is used as the found key frame. And playing the previous key frame of the searched key frame, and directly jumping to play frame by frame from the searched key frame when the timestamp corresponding to the searched key frame arrives. The synchronous playing of the frame sequence by each terminal is realized by the skip playing mode, and the playing mode can start playing as long as the terminal is started, so that the playing starting speed is increased, and the visual effect is enhanced.
In one embodiment, the content sequence to be played is a sequence of corresponding time-stamped frames; the to-be-played content searching module 605 is further configured to search a timestamp which is smaller than the playing time point and is closest to the playing time point from timestamps corresponding to the key frames in the frame sequence; taking the key frame corresponding to the searched timestamp as a searched key frame; the playing module 606 is further configured to play the frame sequence frame by frame from the found key frame at a frame rate higher than the default frame rate of the frame sequence until the key frame corresponding to the current playing time point in the frame sequence is played, and start to play frame by frame from the key frame corresponding to the current playing time point at the default frame rate.
In this embodiment, the terminal takes the key frame corresponding to the latest timestamp before the playing time point as the searched key frame, and plays the frame sequence frame by frame from the searched key frame quickly until the key frame currently played by the terminal is the key frame corresponding to the current playing time point, and plays the frame sequence by frame at the default frame rate of the frame sequence from the key frame corresponding to the current playing time point. By the catching-up playing mode, each terminal can start playing the frame sequence after being started, and the frame rate higher than the default frame rate is used for fast playing, so that the synchronous playing of each terminal is fast realized.
In one embodiment, there is provided a computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of: acquiring a reference time point of a positioning device of the machine; calculating the time length between a preset absolute time point and a reference time point; acquiring the total playing time of a content sequence to be played; the time length is left according to the total playing time length to obtain a playing time point; searching the content to be played corresponding to the playing time point from the content sequence to be played; and playing the content sequence to be played from the searched content to be played.
In one embodiment, the step of acquiring the reference time point of the local positioning device is periodically executed according to a preset period; the computer program further causes the processor to perform the steps of: comparing the reference time point with a preset absolute time point; when the reference time point is greater than or equal to the preset absolute time point, the step of calculating the time length between the preset absolute time point and the reference time point is performed.
In one embodiment, the compared preset absolute time points include a plurality of preset absolute time points corresponding to the plurality of content sequences to be played one by one; the computer program further causes the processor to perform the steps of: screening out a preset absolute time point with the latest time before the reference time point from the plurality of preset absolute time points according to the comparison result; and aiming at the screened preset absolute time point, executing the step of calculating the time length between the preset absolute time point and the reference time point.
In one embodiment, the content sequence to be played is a sequence of corresponding time-stamped frames; the computer program further causes the processor to perform the steps of: in the frame sequence, searching a key frame corresponding to a timestamp matched with a playing time point; the computer program further causes the processor to perform the steps of: and when the time stamp corresponding to the searched key frame is reached, playing the frame sequence frame by frame from the searched key frame.
In one embodiment, the computer program further causes the processor to perform the steps of: searching a timestamp which is greater than the playing time point and is closest to the playing time point from timestamps corresponding to all key frames in the frame sequence; and taking the key frame corresponding to the searched timestamp as the searched key frame.
In one embodiment, the computer program further causes the processor to perform the steps of: when the playing time point is equal to the time stamp corresponding to one key frame in the frame sequence, taking the key frame as the searched key frame; when the playing time point is not equal to the time stamp corresponding to any key frame in the frame sequence, the step of searching the time stamp which is larger than the playing time point and is closest to the playing time point from the time stamps corresponding to the key frames in the frame sequence is executed.
In one embodiment, the computer program further causes the processor to perform the steps of: before the timestamp corresponding to the searched key frame is reached, positioning the key frame corresponding to the maximum timestamp before the timestamp corresponding to the searched key frame; and playing according to the positioned key frames.
In one embodiment, the content sequence to be played is a sequence of corresponding time-stamped frames; the computer program further causes the processor to perform the steps of: searching a timestamp which is smaller than the playing time point and is closest to the playing time point from timestamps corresponding to all key frames in the frame sequence; taking the key frame corresponding to the searched timestamp as a searched key frame; the computer program further causes the processor to perform the steps of: and playing the frame sequence frame by frame from the searched key frame at a frame rate higher than the default frame rate of the frame sequence until the key frame corresponding to the current playing time point in the frame sequence is played, and starting to play the frame by frame from the key frame corresponding to the current playing time point at the default frame rate.
According to the computer equipment, the positioning devices on different ends can provide accurate reference time points, the preset absolute time points are recorded on each end, and then the same time length can be calculated by each end, based on the time length, the same playing time points can be obtained for the same content sequence to be played, each end plays the content sequence to be played from the playing time point, and then synchronous playing on different ends can be realized. And each end can realize synchronous playing no matter whether the starting time is consistent or not. The local area network does not need to be additionally configured, and a special server for time synchronization does not need to be constructed in the local area network, so that the dependency on a hardware environment is reduced.
In one embodiment, a computer readable storage medium is provided, storing a computer program that, when executed by a processor, causes the processor to perform the steps of: acquiring a reference time point of a positioning device of the machine; calculating the time length between a preset absolute time point and a reference time point; acquiring the total playing time of a content sequence to be played; the time length is left according to the total playing time length to obtain a playing time point; searching the content to be played corresponding to the playing time point from the content sequence to be played; and playing the content sequence to be played from the searched content to be played.
In one embodiment, the step of acquiring the reference time point of the local positioning device is periodically executed according to a preset period; the computer program, when executed by the processor, further causes the processor to perform the steps of: comparing the reference time point with a preset absolute time point; when the reference time point is greater than or equal to the preset absolute time point, the step of calculating the time length between the preset absolute time point and the reference time point is performed.
In one embodiment, the compared preset absolute time points include a plurality of preset absolute time points corresponding to the plurality of content sequences to be played one by one; the computer program, when executed by the processor, further causes the processor to perform the steps of: screening out a preset absolute time point with the latest time before the reference time point from the plurality of preset absolute time points according to the comparison result; and aiming at the screened preset absolute time point, executing the step of calculating the time length between the preset absolute time point and the reference time point.
In one embodiment, the content sequence to be played is a sequence of corresponding time-stamped frames; the computer program, when executed by the processor, further causes the processor to perform the steps of: in the frame sequence, searching a key frame corresponding to a timestamp matched with a playing time point; the computer program further causes the processor to perform the steps of: and when the time stamp corresponding to the searched key frame is reached, playing the frame sequence frame by frame from the searched key frame.
In one embodiment, the computer program, when executed by the processor, further causes the processor to perform the steps of: searching a timestamp which is greater than the playing time point and is closest to the playing time point from timestamps corresponding to all key frames in the frame sequence; and taking the key frame corresponding to the searched timestamp as the searched key frame.
In one embodiment, the computer program, when executed by the processor, further causes the processor to perform the steps of: when the playing time point is equal to the time stamp corresponding to one key frame in the frame sequence, taking the key frame as the searched key frame; when the playing time point is not equal to the time stamp corresponding to any key frame in the frame sequence, the step of searching the time stamp which is larger than the playing time point and is closest to the playing time point from the time stamps corresponding to the key frames in the frame sequence is executed.
In one embodiment, the computer program, when executed by the processor, further causes the processor to perform the steps of: before the timestamp corresponding to the searched key frame is reached, positioning the key frame corresponding to the maximum timestamp before the timestamp corresponding to the searched key frame; and playing according to the positioned key frames.
In one embodiment, the content sequence to be played is a sequence of corresponding time-stamped frames; the computer program, when executed by the processor, further causes the processor to perform the steps of: searching a timestamp which is smaller than the playing time point and is closest to the playing time point from timestamps corresponding to all key frames in the frame sequence; taking the key frame corresponding to the searched timestamp as a searched key frame; the computer program, when executed by the processor, further causes the processor to perform the steps of: and playing the frame sequence frame by frame from the searched key frame at a frame rate higher than the default frame rate of the frame sequence until the key frame corresponding to the current playing time point in the frame sequence is played, and starting to play the frame by frame from the key frame corresponding to the current playing time point at the default frame rate.
According to the computer-readable storage medium, the positioning devices at different ends can provide accurate reference time points, a preset absolute time point is recorded at each end, and then the same time length can be calculated at each end, based on the time length, the same playing time point can be obtained for the same content sequence to be played, and each end plays the content sequence to be played from the playing time point, so that synchronous playing at different ends can be realized. And each end can realize synchronous playing no matter whether the starting time is consistent or not. The local area network does not need to be additionally configured, and a special server for time synchronization does not need to be constructed in the local area network, so that the dependency on a hardware environment is reduced.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, and the program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium of the present application may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), and the like.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.