CN111541926A - Multimedia file playing method and device, storage medium and electronic device - Google Patents

Multimedia file playing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN111541926A
CN111541926A CN202010382761.3A CN202010382761A CN111541926A CN 111541926 A CN111541926 A CN 111541926A CN 202010382761 A CN202010382761 A CN 202010382761A CN 111541926 A CN111541926 A CN 111541926A
Authority
CN
China
Prior art keywords
synchronization
progress
playing
deviation
multimedia file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010382761.3A
Other languages
Chinese (zh)
Other versions
CN111541926B (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202010382761.3A priority Critical patent/CN111541926B/en
Publication of CN111541926A publication Critical patent/CN111541926A/en
Application granted granted Critical
Publication of CN111541926B publication Critical patent/CN111541926B/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/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • 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/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47217End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks

Abstract

The invention provides a method, a device, a storage medium and an electronic device for playing a multimedia file, wherein the method comprises the steps of acquiring synchronous information from main equipment; determining network delay and progress deviation based on the first time and the first playing progress carried in the synchronization information; determining a synchronization deviation between the slave equipment and the master equipment based on the network delay and the progress deviation; and when the synchronization deviation is determined to be smaller than the first synchronization threshold or larger than the second synchronization threshold, adjusting the playing progress of the target multimedia file played in the slave equipment so as to enable the slave equipment and the master equipment to play the multimedia file synchronously. According to the invention, the problem of poor user experience caused by inconsistent playing progress of each device and larger error when the distributed playing devices play the multimedia files synchronously in the related technology is solved, the purpose of synchronously playing the multimedia files by the slave device and the master device is realized, and the user experience is improved.

Description

Multimedia file playing method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for playing a multimedia file, a storage medium, and an electronic apparatus.
Background
In life or actual commercial activities, for example, places such as business surpasses, restaurants, exhibition halls, and government and enterprises are large, a plurality of playing devices need to be arranged in a distributed manner, and in order to improve user experience, the plurality of devices should synchronously display the same content.
In the related art, due to hardware differences, system differences, network fluctuations, and the like, when the distributed playback devices play back multimedia files synchronously, the playback progress of each device is inconsistent, and a large error exists, resulting in poor user experience.
In view of the above problems in the related art, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a multimedia file playing method, a multimedia file playing device, a storage medium and an electronic device, and at least solves the problems that when distributed playing equipment synchronously plays multimedia files in the related art, playing progress of each piece of equipment is inconsistent, large errors exist, and user experience is poor.
According to an embodiment of the present invention, there is provided a method for playing a multimedia file, including: acquiring synchronous information from a main device; determining network delay and progress deviation based on a first time and a first playing progress carried in the synchronization information, wherein the first playing progress is the playing progress of a playing target multimedia file in the master device, the progress deviation is used for indicating the progress deviation of the playing of the multimedia file between the slave device and the master device, and the time of the master device and the time of the slave device are kept synchronous with the time of a network time protocol NTP server; determining a synchronization bias between the slave device and the master device based on the network delay and the progress bias; and when the synchronization deviation is determined to be smaller than a first synchronization threshold or larger than a second synchronization threshold, adjusting the playing progress of the target multimedia file played in the slave equipment so as to enable the slave equipment and the master equipment to play the multimedia file synchronously.
According to another embodiment of the present invention, there is provided a playing apparatus of a multimedia file, including: the acquisition module is used for acquiring the synchronization information from the main equipment; a first determining module, configured to determine a network delay and a progress deviation based on a first time and a first playing progress carried in the synchronization information, where the first playing progress is a playing progress of a target multimedia file played in the master device, the progress deviation is used to indicate a progress deviation of playing the multimedia file between the slave device and the master device, and both times of the master device and the slave device are kept synchronous with a time of a network time protocol NTP server; a second determining module for determining a synchronization deviation between the slave device and the master device based on the network delay and the progress deviation; and the adjusting module is used for adjusting the playing progress of the target multimedia file played in the slave equipment when the synchronization deviation is determined to be smaller than a first synchronization threshold or larger than a second synchronization threshold, so that the slave equipment and the master equipment synchronously play the multimedia file.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, the slave equipment acquires the synchronization information of the master equipment, determines the synchronization deviation with the master equipment according to the synchronization information, and when the synchronization deviation is smaller than the first synchronization threshold or larger than the second synchronization threshold, the playing progress of the slave equipment is adjusted, so that the progress of synchronously playing the multimedia files by a plurality of playing equipment can be controlled within a range which can not be identified by naked eyes.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal of a playing method of a multimedia file according to an embodiment of the present invention;
fig. 2 is a flowchart of a playing method of a multimedia file according to an embodiment of the present invention;
FIG. 3 is a reference diagram for adjusting the playing progress of a multimedia file according to an alternative embodiment of the present invention;
FIG. 4 is a flow chart of a method for playing a multimedia file according to an embodiment of the present invention;
fig. 5 is a block diagram of a playing apparatus of a multimedia file according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method provided by the embodiment of the application can be executed in a mobile terminal, a computer terminal or a similar operation device. Taking the example of being operated on a mobile terminal, fig. 1 is a block diagram of a hardware structure of the mobile terminal of a playing method of a multimedia file according to an embodiment of the present invention. As shown in fig. 1, the mobile terminal 10 may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of an application software, such as a computer program corresponding to the multimedia file playing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a playing method for a multimedia file is provided, and fig. 2 is a flowchart of the playing method for a multimedia file according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, acquiring synchronous information from the main equipment;
step S204, determining network delay and progress deviation based on the first time and the first playing progress carried in the synchronization information, wherein the first playing progress is the playing progress of a playing target multimedia file in the master device, the progress deviation is used for indicating the progress deviation of playing the multimedia file between the slave device and the master device, and the time of the master device and the time of the slave device are both kept synchronous with the time of a network time protocol NTP server;
step S206, determining the synchronization deviation between the slave equipment and the master equipment based on the network delay and the progress deviation;
step S208, when it is determined that the synchronization deviation is smaller than the first synchronization threshold or larger than the second synchronization threshold, adjusting a playing progress of the target multimedia file played in the slave device, so that the slave device and the master device play the multimedia file synchronously.
In the above embodiments, the multimedia file may be a video file, a picture file, or the like. The Network Time Protocol (NTP) server can be used to calibrate the Time of the master device and the Time of the slave device synchronously, so that the Time of the master device and the Time of the slave device are kept consistent or within a small error range. For example, the current time is T, and after the NTP server calibration, the master device and the slave device both have the time T or have a small error with the time T.
Optionally, the executing subject of the above steps may be the above slave device, or other devices with similar processing capabilities, and may also be a machine integrated with at least a multimedia file playing module and a data processing device, but is not limited thereto.
According to the invention, the slave equipment acquires the synchronization information of the master equipment, determines the synchronization deviation with the master equipment according to the synchronization information, and when the synchronization deviation is smaller than the first synchronization threshold or larger than the second synchronization threshold, the playing progress of the slave equipment is adjusted, so that the progress of synchronously playing the multimedia files by a plurality of playing equipment can be controlled within a range which can not be identified by naked eyes.
In an optional embodiment, determining the network delay and the progress deviation based on the first time and the first playing progress carried in the synchronization information includes: determining a difference value between a second time and the first time of the slave device as the network delay, and determining a difference value between a second playing progress of the target multimedia file played in the slave device and the first playing progress as the progress deviation; determining a synchronization bias between the slave device and the master device based on the network delay and the progress bias comprises: determining a difference between the progress deviation and the network delay as the synchronization deviation. In this embodiment, when the master device sends the synchronization information to the slave device, the slave device does not receive the synchronization information immediately due to a network or the like, and there is a difference between the time when the slave device receives the synchronization information and the time when the master device sends the synchronization information, where the difference is the network delay. When playing a video by a playing device, due to differences of hardware, systems and the like of different playing devices, the playing progress of each playing device may be different, and the difference of the progress is a progress deviation. The progress deviation may include a deviation caused by a network or the like and a playing deviation caused by a difference between hardware and a system or the like, and the deviation caused by the network or the like is removed from the progress deviation, which is a synchronization deviation between the second playing device and the first playing device. For example, when the synchronization information transmitted from the master device to the slave device includes the first time T1 and the first play schedule P1, that is, the synchronization information is (T1, P1), and the slave device acquires the synchronization information (T1, P1) through network transmission, the current time is the second time T1 and the play schedule is the second play schedule P1, that is, the information of the slave device is (T1, P1), so that it may be determined that the network delay is Δ T1 ═ T1-T1, the schedule deviation is Δ P1 ═ P1-P1, and the synchronization deviation is Δ x1 ═ Δ P1- Δ T1.
In this embodiment, theoretically, after the network delay is Δ t1, the playing schedule P1 of the slave device should be (P1+ Δ t1), i.e., the schedule P1 of the master device plus the network delay is consistent with that of the master device. However, due to the play deviation caused by the difference of hardware and system, the play progress P1 of the slave device is generally greater or smaller than (P1+ Δ t1), that is, the progress deviation Δ P1 is generally greater or smaller than the network delay Δ t1, when the synchronization deviation Δ x1 is less than 0, the play progress of the slave device is slower than that of the master device, and when the synchronization deviation Δ x1 is greater than 0, the play progress of the slave device is faster than that of the master device.
In an optional embodiment, when it is determined that the synchronization deviation is smaller than a first synchronization threshold or larger than a second synchronization threshold, adjusting the playing progress of the target multimedia file in the slave device so that the slave device and the master device play the multimedia file synchronously includes: when the synchronization deviation is determined to be smaller than the first synchronization threshold, accelerating the playing speed of the target multimedia file in the slave device until the slave device and the master device synchronously play the multimedia file; and when the synchronization deviation is determined to be larger than the second synchronization threshold, slowing down the playing speed of the target multimedia file in the slave equipment until the slave equipment and the master equipment synchronously play the multimedia file. In this embodiment, when the synchronization deviation is smaller than the first synchronization threshold or larger than the second synchronization threshold, the playing progress of the slave device needs to be adjusted (adjusted in a fast-forward or slow-play manner) to keep the same as the playing progress of the master device; when the synchronization deviation is greater than the first synchronization threshold and less than the second synchronization threshold, the human eyes of the user cannot perceive the playing difference between the two, so that the playing progress of the slave device does not need to be adjusted.
In an optional embodiment, the method further comprises: determining a maximum allowable synchronization deviation between the slave device and the master device based on a speed at which a target object identifies consecutive images; determining the inverse of the predetermined proportion of the maximum allowable synchronization deviation as the first synchronization threshold; determining the predetermined proportion of the maximum allowable synchronization deviation as the second synchronization threshold. In this embodiment, the target object may be a person, an animal, or the like, and when the target object is a person, the speed of recognizing consecutive images by a general human eye is 24 frames/second, and the maximum allowable synchronization deviation is 1000ms/24 ≈ 41.7ms, that is, when the error is greater than 1000ms/24 ≈ 41.7ms, the person can perceive the difference between consecutive frames. In practical situations, when the playing schedules of two adjacent or close slave devices a and B are in extreme situations, the playing schedule of the a slave device is 41.7ms fast, i.e. Δ xA is 41.7ms, the playing schedule of the B slave device is 41.7ms slow, i.e. Δ xB is-41.7 ms, and the error of the playing schedules of the two actual devices is 83.4ms, so that a person can perceive that the pictures played by the two devices are different. For more precise control of the synchronization of the pictures, a predetermined ratio of the maximum allowable synchronization deviation may be determined as the synchronization threshold, wherein the predetermined ratio may be one-half (the value is only one achievable way, for example, the predetermined ratio may also be one-third, etc.), and when the predetermined ratio is one-half, the synchronization threshold may be set to Δ x ═ 41.7ms/2 ≈ 20.9ms, so that when the a and B slaves are in extreme conditions, the error may still be controlled within the range of 1 frame, where the first synchronization threshold is-20.9 ms and the second synchronization threshold is 20.9 ms. When the synchronization deviation delta x1< -20.9ms or delta x1>20.9ms, the slave device performs a synchronization operation to adjust the playing progress to P1+ delta x1 (the progress is only an optional embodiment, and the playing progress can also be adjusted to other progresses to control the synchronization deviation of the slave device and the master device within the synchronization threshold range), otherwise, the synchronization is not needed. When the synchronization deviation delta x1 is larger than 20.9ms, the playing progress of the slave device is adjusted to P1+ delta x1 and is consistent with the playing progress of the master device; when the delta x1 is < -20.9ms, the playing progress of the slave device is adjusted to P1+ delta x1 and is consistent with the playing progress of the master device; when-20.9 ms < delta x1< 20.9ms, the playing progress of the slave equipment is not required to be adjusted. The playing progress is adjusted to P1+ delta x1, measures such as fast forward and slow play can be adopted, the fluency of playing the multimedia file is guaranteed, and the user experience is improved. The reference diagram for adjusting the playing progress of the multimedia file can be seen in fig. 3.
In an alternative embodiment, the NTP server may determine the master device by one of: randomly selecting one device from the devices connected with the NTP server as the main device; determining, as the master device, a device that has established a connection with the NTP server first among devices connected to the NTP server; and after the primary equipment selected for the first time is disconnected, determining the equipment which is connected with the NTP server in the rest of equipment connected with the NTP server and is connected with the NTP server firstly as the primary equipment. For example, in this embodiment, when a master device and a slave device are selected at the beginning, the NTP server may randomly use one of the playback devices as the master device, and the other devices are the slave devices, and the NTP server sends n pieces of target multimedia file information to all the devices and sends an instruction to start playing a video to all the devices. The target multimedia file may include advertisement video, movie video, picture, etc., and the target multimedia file information may include ID, duration, category, etc. of the multimedia file. When the master device and the server are disconnected, the server reassigns the slave device which is firstly kept connected as the master device. Specifically, in order to cope with the situation that the master device is accidentally dropped, for example, network disconnection and accidental restart, the master device is set with increasing priority information, when the server selects the first master device 1, the priority is set to 1, and when the master device 1 is dropped, the server selects another slave device as the master device 2 and sets the priority to 2. If the master device 1 comes online again later, the synchronization information with higher priority 2 is received, the original master device 1 will be set as a slave device, and so on. After any offline device is online again, the unique ID of the currently played multimedia file is obtained from the synchronization information, the file is found from the n pieces of target multimedia file information sent by the original server and is synchronized to the current progress, and the synchronous playing of the target multimedia file is ensured.
In this embodiment, the same video is played in different places, and the playing progress of different playing devices in the same place only needs to be consistent, and the playing progress of the playing devices in all places is not consistent, so that different groups can be set for adapting to different scenes, the playing devices are divided into a plurality of groups, each group at least comprises one master device and at least one slave device, and each group can synchronize the playing progress of the playing devices respectively.
In an alternative embodiment, obtaining synchronization information from the master device comprises: and acquiring the synchronization information sent by the main equipment according to a preset frequency. In this embodiment, the master device may transmit in a wired manner, for example, in a signal line, an optical fiber, or the like; the transmission may also be wireless, for example, using bluetooth, Wi-Fi, 4G, 5G, etc. The preset frequency may be 1 time/minute (this value is only an optional embodiment, and the preset frequency may be determined according to the actual situation, for example, 2 times/minute, 3 times/minute, etc.).
The following describes a method for playing a multimedia file with reference to a specific embodiment:
fig. 4 is a flowchart of a playing method of a multimedia file according to an embodiment of the present invention, and as shown in fig. 4, the playing method of the multimedia file in the embodiment of the present invention includes the following steps:
step S402, the server selects the master device, the server randomly selects one playing device in the system as the master device, and the other playing devices are the slave devices.
Step S404, the master device sends the current time and the video playing progress to the slave device according to the preset frequency.
In step S406, the slave device calculates the network delay and the progress deviation according to the received information, and calculates the synchronization deviation.
Step S408, determining whether the synchronization deviation is smaller than the first synchronization threshold or larger than the second synchronization threshold, if yes, executing step S410, and if no, executing step S412.
In step S410, the slave device executes the synchronization command and fast-forwards or slowly-forwards the play schedule to the designated schedule. When the playing progress of the slave equipment is faster than that of the master equipment, slowly playing the playing progress of the slave equipment to be consistent with that of the master equipment; and when the playing progress of the slave equipment is slower than that of the master equipment, fast forwarding the playing progress of the slave equipment to be consistent with that of the master equipment.
In step S412, the slave device does not execute the synchronization command, and keeps the original playing progress unchanged.
In the foregoing embodiment, the NTP service is used, the precision of the NTP service can reach 0.1ms in the local area network, and the precision of the NTP service can reach 1-50ms in most places on the internet, so that the distributed playback device has a uniform reference standard, and can calculate the network delay more accurately. In order to improve the robustness of the system, a determination method of the master device and the slave device is provided, and the message priority is increased. In order to refine the synchronization threshold value in order to cope with the extreme condition of the distributed playing device, and propose a detailed synchronization strategy, when the absolute value of the synchronization deviation is larger than the synchronization threshold value, the slave device will execute the synchronization operation, and adjust the playing progress to P1+ delta x1, and when the absolute value of the synchronization deviation is smaller than the synchronization threshold value, the synchronization is not needed. The measures of fast forward and slow play of the video are adopted during video synchronization, user experience is improved, when the same video is played in a plurality of different places, playing devices are grouped according to the places, and the playing progress synchronization of the playing devices in each place is only needed.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a playing apparatus for multimedia files is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and the description already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a playing apparatus of a multimedia file according to an embodiment of the present invention, as shown in fig. 5, the apparatus includes:
an obtaining module 52, configured to obtain synchronization information from a master device;
a first determining module 54, configured to determine a network delay and a progress deviation based on a first time and a first playing progress carried in the synchronization information, where the first playing progress is a playing progress of a target multimedia file played in the master device, the progress deviation is used to indicate a progress deviation of playing the multimedia file between a slave device and the master device, and both times of the master device and the slave device are kept synchronous with a time of a network time protocol NTP server;
a second determining module 56, configured to determine a synchronization deviation between the slave device and the master device based on the network delay and the progress deviation;
an adjusting module 58, configured to adjust a playing progress of the target multimedia file played in the slave device when it is determined that the synchronization deviation is smaller than a first synchronization threshold or larger than a second synchronization threshold, so that the slave device and the master device play the multimedia file synchronously.
In an optional embodiment, the first determining module 54 may determine the network delay and the progress deviation based on the first time and the first playing progress carried in the synchronization information by: determining a difference value between a second time and the first time of the slave device as the network delay, and determining a difference value between a second playing progress of the target multimedia file played in the slave device and the first playing progress as the progress deviation;
in an alternative embodiment, the second determining module 56 may determine the synchronization deviation between the slave device and the master device based on the network delay and the progress deviation by: determining a difference between the progress deviation and the network delay as the synchronization deviation.
In an optional embodiment, the adjusting module 58 may adjust the playing progress of the target multimedia file in the slave device when it is determined that the synchronization deviation is smaller than a first synchronization threshold or larger than a second synchronization threshold, so that the slave device and the master device play the multimedia file synchronously: when the synchronization deviation is determined to be smaller than the first synchronization threshold, accelerating the playing speed of the target multimedia file in the slave device until the slave device and the master device synchronously play the multimedia file; and when the synchronization deviation is determined to be larger than the second synchronization threshold, slowing down the playing speed of the target multimedia file in the slave equipment until the slave equipment and the master equipment synchronously play the multimedia file.
In an alternative embodiment, the apparatus may be configured to: determining a maximum allowable synchronization deviation between the slave device and the master device based on a speed at which a target object identifies consecutive images; determining the inverse of the predetermined proportion of the maximum allowable synchronization deviation as the first synchronization threshold; determining the predetermined proportion of the maximum allowable synchronization deviation as the second synchronization threshold.
In an alternative embodiment, the NTP server is configured to determine the master device by one of: randomly selecting one device from the devices connected with the NTP server as the main device; determining, as the master device, a device that has established a connection with the NTP server first among devices connected to the NTP server; and after the primary equipment selected for the first time is disconnected, determining the equipment which is connected with the NTP server in the rest of equipment connected with the NTP server and is connected with the NTP server firstly as the primary equipment.
In an alternative embodiment, the obtaining module 52 includes: and the acquisition unit is used for acquiring the synchronization information sent by the main equipment according to a preset frequency.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring the synchronous information from the main device;
s2, determining a network delay and a progress deviation based on a first time and a first playing progress carried in the synchronization information, where the first playing progress is a playing progress of a target multimedia file played in the master device, the progress deviation is used to indicate a progress deviation of playing the multimedia file between the slave device and the master device, and both the times of the master device and the slave device are kept synchronized with the time of a network time protocol NTP server;
s3, determining a synchronization deviation between the slave device and the master device based on the network delay and the progress deviation;
s4, when it is determined that the synchronization deviation is smaller than the first synchronization threshold or larger than the second synchronization threshold, adjusting a playing progress of the target multimedia file played in the slave device, so that the slave device and the master device play the multimedia file synchronously.
Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring the synchronous information from the main device;
s2, determining a network delay and a progress deviation based on a first time and a first playing progress carried in the synchronization information, where the first playing progress is a playing progress of a target multimedia file played in the master device, the progress deviation is used to indicate a progress deviation of playing the multimedia file between the slave device and the master device, and both the times of the master device and the slave device are kept synchronized with the time of a network time protocol NTP server;
s3, determining a synchronization deviation between the slave device and the master device based on the network delay and the progress deviation;
s4, when it is determined that the synchronization deviation is smaller than the first synchronization threshold or larger than the second synchronization threshold, adjusting a playing progress of the target multimedia file played in the slave device, so that the slave device and the master device play the multimedia file synchronously.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for playing a multimedia file, comprising:
acquiring synchronous information from a main device;
determining network delay and progress deviation based on a first time and a first playing progress carried in the synchronization information, wherein the first playing progress is the playing progress of a playing target multimedia file in the master device, the progress deviation is used for indicating the progress deviation of the playing of the multimedia file between the slave device and the master device, and the time of the master device and the time of the slave device are kept synchronous with the time of a network time protocol NTP server;
determining a synchronization bias between the slave device and the master device based on the network delay and the progress bias;
and when the synchronization deviation is determined to be smaller than a first synchronization threshold or larger than a second synchronization threshold, adjusting the playing progress of the target multimedia file played in the slave equipment so as to enable the slave equipment and the master equipment to play the multimedia file synchronously.
2. The method of claim 1,
determining a network delay and a progress deviation based on the first time and the first play progress carried in the synchronization information comprises: determining a difference value between a second time and the first time of the slave device as the network delay, and determining a difference value between a second playing progress of the target multimedia file played in the slave device and the first playing progress as the progress deviation;
determining a synchronization bias between the slave device and the master device based on the network delay and the progress bias comprises: determining a difference between the progress deviation and the network delay as the synchronization deviation.
3. The method of claim 1 or 2, wherein when it is determined that the synchronization deviation is smaller than a first synchronization threshold or larger than a second synchronization threshold, adjusting the playing progress of the target multimedia file in the slave device so that the slave device and the master device synchronously play the multimedia file comprises:
when the synchronization deviation is determined to be smaller than the first synchronization threshold, accelerating the playing speed of the target multimedia file in the slave device until the slave device and the master device synchronously play the multimedia file;
and when the synchronization deviation is determined to be larger than the second synchronization threshold, slowing down the playing speed of the target multimedia file in the slave equipment until the slave equipment and the master equipment synchronously play the multimedia file.
4. The method of claim 3, further comprising:
determining a maximum allowable synchronization deviation between the slave device and the master device based on a speed at which a target object identifies consecutive images;
determining the inverse of the predetermined proportion of the maximum allowable synchronization deviation as the first synchronization threshold;
determining the predetermined proportion of the maximum allowable synchronization deviation as the second synchronization threshold.
5. The method of claim 1, further comprising:
the NTP server determines the master device by one of:
randomly selecting one device from the devices connected with the NTP server as the main device;
determining, as the master device, a device that has established a connection with the NTP server first among devices connected to the NTP server;
and after the primary equipment selected for the first time is disconnected, determining the equipment which is connected with the NTP server in the rest of equipment connected with the NTP server and is connected with the NTP server firstly as the primary equipment.
6. The method of claim 1, wherein obtaining synchronization information from a master device comprises:
and acquiring the synchronization information sent by the main equipment according to a preset frequency.
7. A device for playing a multimedia file, comprising:
the acquisition module is used for acquiring the synchronization information from the main equipment;
a first determining module, configured to determine a network delay and a progress deviation based on a first time and a first playing progress carried in the synchronization information, where the first playing progress is a playing progress of a target multimedia file played in the master device, the progress deviation is used to indicate a progress deviation of playing the multimedia file between the slave device and the master device, and both times of the master device and the slave device are kept synchronous with a time of a network time protocol NTP server;
a second determining module for determining a synchronization deviation between the slave device and the master device based on the network delay and the progress deviation;
and the adjusting module is used for adjusting the playing progress of the target multimedia file played in the slave equipment when the synchronization deviation is determined to be smaller than a first synchronization threshold or larger than a second synchronization threshold, so that the slave equipment and the master equipment synchronously play the multimedia file.
8. The apparatus of claim 7, wherein the obtaining module comprises:
and the acquisition unit is used for acquiring the synchronization information sent by the main equipment according to a preset frequency.
9. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 6.
CN202010382761.3A 2020-05-08 2020-05-08 Multimedia file playing method and device, storage medium and electronic device Active CN111541926B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010382761.3A CN111541926B (en) 2020-05-08 2020-05-08 Multimedia file playing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010382761.3A CN111541926B (en) 2020-05-08 2020-05-08 Multimedia file playing method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN111541926A true CN111541926A (en) 2020-08-14
CN111541926B CN111541926B (en) 2022-05-03

Family

ID=71980352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010382761.3A Active CN111541926B (en) 2020-05-08 2020-05-08 Multimedia file playing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN111541926B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112399226A (en) * 2020-10-19 2021-02-23 广州视源电子科技股份有限公司 Cross-screen playing method, device, equipment and storage medium
CN112887769A (en) * 2021-01-21 2021-06-01 海信视像科技股份有限公司 Display device
CN113938737A (en) * 2021-10-19 2022-01-14 山东亚华电子股份有限公司 Audio and video synchronization method, system and equipment based on message communication
CN114143584A (en) * 2021-09-29 2022-03-04 杭州当虹科技股份有限公司 Broadcasting system and method for realizing synchronous broadcasting among multiple terminals
CN114339351A (en) * 2021-12-30 2022-04-12 湖南众益文化传媒股份有限公司 Synchronous playing device and method of advertising player device
CN117201854A (en) * 2023-11-02 2023-12-08 广东朝歌智慧互联科技有限公司 Method and system for accurate seek video frames applied to video synchronous playing system

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1835618A (en) * 2005-03-20 2006-09-20 华为技术有限公司 Reset method of radio network controller
CN103475908A (en) * 2013-07-23 2013-12-25 北京九华互联科技有限公司 Multi-screen synchronization play method and device
CN104902317A (en) * 2015-05-27 2015-09-09 青岛海信电器股份有限公司 Audio video synchronization method and device
CN106454449A (en) * 2016-10-25 2017-02-22 深圳芯智汇科技有限公司 Master sound box, slave sound box and method for controlling synchronous playing of audio by router
CN108108146A (en) * 2018-01-19 2018-06-01 深圳市沃特沃德股份有限公司 The method and playback equipment that multiple playback equipments are played simultaneously
CN108200457A (en) * 2018-01-19 2018-06-22 深圳市沃特沃德股份有限公司 The method and playback equipment that multiple playback equipments are played simultaneously
CN108513159A (en) * 2017-02-27 2018-09-07 中兴通讯股份有限公司 Multiple terminals synchronous broadcast controlling method, main equipment, apparatus and system
CN108540830A (en) * 2018-04-13 2018-09-14 青岛海信电器股份有限公司 A kind of more playback equipment synchronous broadcast methods, system and terminal
CN108600814A (en) * 2018-04-08 2018-09-28 浙江大华技术股份有限公司 A kind of audio video synchronization playback method and device
CN109218795A (en) * 2018-11-29 2019-01-15 青岛海信电器股份有限公司 A kind of more device plays progress synchronous method, device and terminal device
CN110545224A (en) * 2019-09-06 2019-12-06 杭州涂鸦信息技术有限公司 Device group synchronization control method, readable storage medium and computer device
CN110830823A (en) * 2019-11-27 2020-02-21 北京奇艺世纪科技有限公司 Play progress correction method and device, electronic equipment and readable storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1835618A (en) * 2005-03-20 2006-09-20 华为技术有限公司 Reset method of radio network controller
CN103475908A (en) * 2013-07-23 2013-12-25 北京九华互联科技有限公司 Multi-screen synchronization play method and device
CN104902317A (en) * 2015-05-27 2015-09-09 青岛海信电器股份有限公司 Audio video synchronization method and device
CN106454449A (en) * 2016-10-25 2017-02-22 深圳芯智汇科技有限公司 Master sound box, slave sound box and method for controlling synchronous playing of audio by router
CN108513159A (en) * 2017-02-27 2018-09-07 中兴通讯股份有限公司 Multiple terminals synchronous broadcast controlling method, main equipment, apparatus and system
CN108108146A (en) * 2018-01-19 2018-06-01 深圳市沃特沃德股份有限公司 The method and playback equipment that multiple playback equipments are played simultaneously
CN108200457A (en) * 2018-01-19 2018-06-22 深圳市沃特沃德股份有限公司 The method and playback equipment that multiple playback equipments are played simultaneously
CN108600814A (en) * 2018-04-08 2018-09-28 浙江大华技术股份有限公司 A kind of audio video synchronization playback method and device
CN108540830A (en) * 2018-04-13 2018-09-14 青岛海信电器股份有限公司 A kind of more playback equipment synchronous broadcast methods, system and terminal
CN109218795A (en) * 2018-11-29 2019-01-15 青岛海信电器股份有限公司 A kind of more device plays progress synchronous method, device and terminal device
CN110545224A (en) * 2019-09-06 2019-12-06 杭州涂鸦信息技术有限公司 Device group synchronization control method, readable storage medium and computer device
CN110830823A (en) * 2019-11-27 2020-02-21 北京奇艺世纪科技有限公司 Play progress correction method and device, electronic equipment and readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
G. C. GAUTAM ET AL.: "Time synchronization protocol for wireless sensor networks using clustering", 《2011 INTERNATIONAL CONFERENCE ON RECENT TRENDS IN INFORMATION TECHNOLOGY (ICRTIT)》 *
张逸凡: "面向分布式视频应用的时间同步技术的研究与设计", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑(月刊),2020年第02期》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112399226A (en) * 2020-10-19 2021-02-23 广州视源电子科技股份有限公司 Cross-screen playing method, device, equipment and storage medium
CN112887769A (en) * 2021-01-21 2021-06-01 海信视像科技股份有限公司 Display device
CN112887769B (en) * 2021-01-21 2023-09-19 青岛海信传媒网络技术有限公司 Display equipment
CN114143584A (en) * 2021-09-29 2022-03-04 杭州当虹科技股份有限公司 Broadcasting system and method for realizing synchronous broadcasting among multiple terminals
CN114143584B (en) * 2021-09-29 2024-03-26 杭州当虹科技股份有限公司 Broadcasting system and method for realizing synchronous broadcasting among multiple terminals
CN113938737A (en) * 2021-10-19 2022-01-14 山东亚华电子股份有限公司 Audio and video synchronization method, system and equipment based on message communication
CN113938737B (en) * 2021-10-19 2023-12-15 山东亚华电子股份有限公司 Audio and video synchronization method, system and equipment based on message communication
CN114339351A (en) * 2021-12-30 2022-04-12 湖南众益文化传媒股份有限公司 Synchronous playing device and method of advertising player device
CN117201854A (en) * 2023-11-02 2023-12-08 广东朝歌智慧互联科技有限公司 Method and system for accurate seek video frames applied to video synchronous playing system

Also Published As

Publication number Publication date
CN111541926B (en) 2022-05-03

Similar Documents

Publication Publication Date Title
CN111541926B (en) Multimedia file playing method and device, storage medium and electronic device
US10904832B2 (en) Wireless system, wireless device, non-transitory computer-readable storage medium having stored therein communication program, and communication method
CN106303648A (en) A kind of method and device synchronizing to play multi-medium data
CN109842508B (en) Multi-terminal cooperative work method, terminal equipment and multi-terminal cooperative system
US8233648B2 (en) Ad-hoc adaptive wireless mobile sound system
EP3185621B1 (en) Wireless device
EP2328349A1 (en) Information processing system and information processing device
CN107360475B (en) Video synchronous playing and control method, control terminal and playing terminal
CN101511042B (en) Data synchronization method and device
CN106851799B (en) Method and device for sending heartbeat packet in long connection
CN112752109B (en) Video playing control method and system
CN112165413B (en) Equipment state reporting method and device and electronic device
CN104467928A (en) Method and equipment for cooperation between terminal equipment
US11922976B2 (en) Audio time synchronization using prioritized schedule
KR20210078985A (en) Method of display playback synchronization of digital contents in multiple connected devices and apparatus using the same
CN107948703B (en) Method and device for synchronizing playing progress
CN103796277B (en) Method, system and device for indicating beacon frame sending and sending beacon frame
CN114047689B (en) Lighting equipment control method and device, lighting equipment and storage medium
US10797957B2 (en) Network management apparatus, network management method, network management system, and program
CN112004132B (en) Video synchronous playing method and device
CN114144758B (en) Display method, display control method, display terminal, server and display system
CN114866829A (en) Synchronous playing control method and device
CN108988973A (en) Aggregated links clock control method and system
CN115426518B (en) Display control system, image display method and LED display control system
KR20180138122A (en) Peer and operating mehtod of thereof

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