WO2016155527A1 - Streaming media alignment method, device and storage medium - Google Patents
Streaming media alignment method, device and storage medium Download PDFInfo
- Publication number
- WO2016155527A1 WO2016155527A1 PCT/CN2016/076853 CN2016076853W WO2016155527A1 WO 2016155527 A1 WO2016155527 A1 WO 2016155527A1 CN 2016076853 W CN2016076853 W CN 2016076853W WO 2016155527 A1 WO2016155527 A1 WO 2016155527A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- streaming media
- cross
- streaming
- correlation
- time
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B17/00—Monitoring; Testing
Definitions
- the present invention relates to the field of computer technologies, and in particular, to a streaming media alignment method, device, and storage medium.
- Streaming media is a stream of data that is played in time order, such as audio songs, video movies, and the like.
- songs as an example, in the Internet, the same song may be rewritten into many different versions due to the need of transmission and production, resulting in the song's vocal position is not the same, but in fact the lyrics and the main melody of the song are Are the same.
- certain resources eg, lyrics, video
- Embodiments of the present invention provide a streaming media alignment method, device, and storage medium.
- a streaming media alignment method includes:
- a streaming media alignment device includes: one or more processors and a storage medium storing operation instructions, when executing an operation instruction in the storage medium, the processor performs the following steps:
- FIG. 1 is a schematic flowchart of a media stream alignment method according to an embodiment of the present invention
- FIG. 2 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention.
- FIG. 3 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present disclosure.
- FIG. 4 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention.
- FIG. 5 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention.
- FIG. 6 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention.
- FIG. 7 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present disclosure.
- FIG. 8 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention.
- FIG. 9 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention.
- the embodiment of the invention provides a streaming media alignment method, which can be applied to a terminal device such as a mobile phone or a computer, and can also be applied to a server or the like. As shown in FIG. 1, the method includes steps 101 to 103.
- step 101 the first streaming media and the second streaming media are obtained, where the first streaming media and the second streaming media are different versions of the same streaming media.
- the “first streaming media” and the “second streaming media” in the embodiment of the present invention are used to distinguish two different versions of streaming media.
- the streaming media may be various audio media such as audio/video, which is not limited by the embodiment of the present invention.
- step 102 performing cross-correlation calculation on the first streaming media and the second streaming media, and obtaining a first time point of the first streaming media corresponding to the maximum correlation value of the cross-correlation and a second time point of the corresponding second streaming media, according to The first time point and the second time point determine a time offset between the first streaming medium and the second streaming medium.
- the process of performing cross-correlation calculation may be performing cross-correlation calculation on all data of the first streaming media and the second streaming media, or performing cross-correlation calculation on one segment of the data, which is not implemented in the embodiment of the present invention.
- Uniqueness is limited.
- step 103 the first streaming media and the second streaming media are aligned according to a time offset between the first streaming media and the second streaming media.
- the first time point of the first streaming media corresponding to the maximum correlation value and the second time point of the corresponding second streaming media are determined by cross-correlation calculation, and then the first time point and the second time pass.
- the point determines the time offset between the first streaming media and the second streaming media, and the time offset between the different versions of the streaming media can be accurately determined to achieve streaming media version alignment.
- the method before the cross-correlation calculation is performed on the first streaming media and the second streaming media, the method further includes: downsampling the first streaming media and the second streaming media.
- the performing cross-correlation calculation on the first streaming media and the second streaming media may include:
- the sampling rate of the downsampling may determine the sampling rate corresponding thereto according to the data computing capability of the executing device, thereby improving the matching degree.
- the method before the cross-correlation calculation is performed on the first streaming media and the second streaming media, the method further includes: intercepting data in the first streaming media and the second streaming media reference time period.
- the cross-correlation calculation of the first streaming media and the second streaming media includes:
- Cross-correlation calculation is performed on data in the first streaming media and the second streaming media reference time period.
- the intercepted time period may be dynamically adjusted to accommodate possible time offsets between different streaming media versions, for example, data intercepting the first streaming media and the second streaming media reference time period.
- the above methods also include:
- the reference time period is determined according to a cross-correlation time difference between the first streaming medium and the second streaming medium.
- the above methods also include:
- the embodiment of the present invention further provides a solution for calculating cross-correlation and determining a maximum value of cross-correlation, as follows: performing cross-correlation calculation on the first streaming media and the second streaming media, and obtaining a maximum correlation value includes:
- x represents data of the first streaming medium
- y represents data of the second streaming medium
- ⁇ ⁇ represents a window function
- n is a time sampling point
- the first time point of the first streaming medium corresponding to the maximum value and the second time point of the corresponding second streaming medium are determined according to the calculated maximum value of the ⁇ value.
- the following embodiments illustrate the embodiments of the present invention by taking songs in an audio medium as an example.
- the technical solution of the embodiment of the present invention mainly uses the cross-correlation method to perform the initial singing position of two songs. Positioned.
- Step 2 Selection of cross-correlation time period
- the embodiment of the present invention may not calculate the cross-correlation of the whole song.
- different time periods are selected for the cross-correlation calculation for the case where the time difference between the two songs is different. For example, if the time difference between two songs is less than 10s, the cross-correlation time is calculated as the first 15s, and the time difference is within 5s. The cross-correlation time is calculated as the first 10s. As a rule of thumb, this ensures both accuracy and computational effort.
- x represents the data of the first song
- y represents the data of the second song
- ⁇ ⁇ represents the window function
- the window function is the time period corresponding to the selection of the cross-correlation time period described above.
- Step 4 Select the starting position of the song
- the cross-correlation maximum value can be obtained, and the first time point of the first song corresponding to the maximum cross-correlation value and the second time point of the corresponding second song are determined, according to the first time
- the point and the second time point determine a time offset between the first song and the second song, and align the two songs according to the time offset.
- the sing position of two different versions of the song can be accurately aligned; at the same time, the cross-correlation time length classification technique used can reduce the calculation amount and improve the calculation speed.
- the embodiment of the invention further provides a streaming media alignment device, as shown in FIG. 2, comprising:
- the media obtaining unit 201 is configured to acquire the first streaming media and the second streaming media, where the first streaming media and the second streaming media are different versions of the same streaming media.
- the calculating unit 202 is configured to perform cross-correlation calculation on the first streaming media and the second streaming media, to obtain a first time point of the first streaming media corresponding to the maximum cross-correlation coefficient and a corresponding second streaming media Two time points;
- the offset determining unit 203 is configured to determine a time offset between the first streaming media and the second streaming media according to the first time point and the second time point;
- the aligning unit 204 is configured to align the first streaming media and the second streaming media according to a time offset between the first streaming media and the second streaming media.
- the streaming media may be various audio media such as audio/video, which is not limited by the embodiment of the present invention.
- the process of performing cross-correlation calculation may be performing cross-correlation calculation on all data of the first streaming media and the second streaming media, or performing cross-correlation calculation on one segment of the data, which is not unique in the embodiment of the present invention.
- Sexual limitation For the method of cross-correlation calculation, reference may be made to a mature algorithm, and the embodiment of the present invention does not uniquely define the cross-correlation algorithm.
- the first time point of the first streaming media corresponding to the maximum correlation value and the second time point of the corresponding second streaming media are determined by cross-correlation calculation, and then the first time point and the second time pass.
- the point determines the time offset between the first streaming media and the second streaming media, and the time offset between the different versions of the streaming media can be accurately determined to achieve streaming media version alignment.
- the aligning apparatus may further include:
- the sampling unit 301 is configured to downsample the first streaming media and the second streaming media before performing cross-correlation calculation on the first streaming media and the second streaming media.
- the calculating unit 202 is configured to perform cross-correlation calculation on the downsampled first streaming media and the second streaming media.
- the sampling rate of the downsampling may determine the sampling rate corresponding thereto according to the data computing capability of the executing device, thereby improving the matching degree.
- the foregoing aligning apparatus may further include:
- the intercepting unit 401 is configured to intercept data in the first streaming media and the second streaming media reference time period before performing cross-correlation calculation on the first streaming media and the second streaming media.
- the calculating unit 202 is configured to perform cross-correlation calculation on data in the first streaming media and the second streaming media reference time period.
- the intercepted time period may be dynamically adjusted to adapt to a time offset that may exist between different streaming media versions.
- the foregoing aligning device may further include:
- a time determining unit 501 configured to intercept the first streaming media and the second streaming media reference time period Before the data, the reference time period is determined according to the cross-correlation time difference between the first stream medium and the second stream medium.
- the foregoing aligning device further includes:
- the flow control unit 601 is configured to suspend the process of performing streaming media version alignment if the cross-correlation time difference exceeds a predetermined threshold.
- the embodiment of the present invention further provides a solution for calculating the cross-correlation and determining the maximum value of the cross-correlation, as follows:
- the calculating unit 202 is configured to calculate a cross-correlation between the first streaming media and the second streaming media by using the following formula:
- x represents the data of the first streaming media
- y represents the data of the second streaming media
- ⁇ ⁇ represents the window function
- n is the time sampling point
- the maximum value of the ⁇ value is obtained according to the calculation, and the first stream corresponding to the maximum value is determined The first time point of the media and the second time point of the corresponding second streaming media.
- FIG. 7 Another embodiment of the present invention further provides a streaming media alignment device, as shown in FIG. 7, comprising: a receiver 701, a transmitter 702, a processor 703, and a memory 704.
- the processor 703 is configured to acquire the first streaming media and the second streaming media, where the first streaming media and the second streaming media are different versions of the same streaming media, and performing cross-correlation calculation on the first streaming media and the second streaming media to obtain mutual Determining a first time point of the first streaming media corresponding to the maximum value and a second time point of the corresponding second streaming media, determining, between the first streaming media and the second streaming media, according to the first time point and the second time point Time offset; aligning the first streaming media and the second streaming media according to a time offset between the first streaming media and the second streaming media.
- the streaming media may be various audio media such as audio/video, which is not limited by the embodiment of the present invention.
- the process of performing cross-correlation calculation may be performing cross-correlation calculation on all data of the first streaming media and the second streaming media, or performing cross-correlation calculation on one segment of the data, which is not unique in the embodiment of the present invention.
- Sexual limitation For the method of cross-correlation calculation, reference may be made to a mature algorithm, and the embodiment of the present invention does not uniquely define the cross-correlation algorithm.
- the cross-correlation calculation is used to determine the first medium corresponding to the maximum value of the cross-correlation The first time point of the body and the second time point of the corresponding second streaming medium, and determining the time offset between the first streaming media and the second streaming media through the first time point and the second time point, which can be accurately Determine the time offset between different versions of streaming media to achieve streaming media version alignment.
- the processor 703 is further configured to downsample the first streaming media and the second streaming media before performing cross-correlation calculation on the first streaming media and the second streaming media.
- the performing cross-correlation calculation on the first streaming media and the second streaming media may include:
- the sampling rate of the downsampling may determine the sampling rate corresponding thereto according to the data computing capability of the executing device, thereby improving the matching degree.
- the processor 703 is further configured to intercept data in the first streaming media and the second streaming media reference time period before performing cross-correlation calculation on the first streaming media and the second streaming media.
- the cross-correlation calculation of the first streaming media and the second streaming media includes:
- Cross-correlation calculation is performed on data in the first streaming media and the second streaming media reference time period.
- the intercepted time period may be dynamically adjusted to accommodate a time offset that may exist between different streaming media versions.
- the processor 703 is further configured to intercept the first streaming media and the second streaming media.
- the reference time period is determined according to the cross-correlation time difference between the first streaming media and the second streaming media.
- the processor 703 is further configured to suspend the process of performing streaming media version alignment if the cross-correlation time difference exceeds a predetermined threshold.
- the embodiment of the present invention further provides a solution for calculating cross-correlation and determining a maximum value of cross-correlation, as follows:
- the processor 703 is configured to calculate cross-correlation between the first streaming media and the second streaming media by using the following formula:
- x represents data of the first streaming medium
- y represents data of the second streaming medium
- ⁇ ⁇ represents a window function
- n is a time sampling point
- the embodiment of the present invention further provides another streaming media aligning device.
- FIG. 8 for the convenience of description, only parts related to the embodiment of the present invention are shown. If the specific technical details are not disclosed, please refer to the implementation of the present invention. Example method section.
- the aligning device is illustrated in FIG. 8 as a terminal, and the terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, and the like.
- the terminal is a mobile phone as an example:
- FIG. 8 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present invention.
- the mobile phone includes: a radio frequency (RF) circuit 810 , a memory 820 , an input unit 830 , a display unit 840 , a sensor 850 , an audio circuit 860 , a wireless fidelity (WiFi) module 870 , and a processor 880 .
- RF radio frequency
- the RF circuit 810 can be used for receiving and transmitting signals during the transmission or reception of information or during a call. Specifically, after receiving the downlink information of the base station, it is processed by the processor 880. In addition, the uplink data is designed to be sent to the base station. Generally, RF circuit 810 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 810 can also communicate with the network and other devices via wireless communication. The above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), E-mail, Short Messaging Service (SMS), and the like.
- GSM Global System of Mobile communication
- GPRS General Packet Radio Service
- the memory 820 can be used to store software programs and modules, and the processor 880 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 820.
- the memory 820 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of mobile phones (such as audio data, phone book) and many more.
- memory 820 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
- the input unit 830 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the handset.
- the input unit 830 may include a touch panel 831 and other input devices 832.
- the touch panel 831 also referred to as a touch screen, can collect touch operations on or near the user (such as the user using a finger, a stylus, or the like on the touch panel 831 or near the touch panel 831. Operation), and drive the corresponding connecting device according to a preset program.
- the touch panel 831 can include two parts: a touch detection device and a touch controller.
- the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
- the processor 880 is provided and can receive commands from the processor 880 and execute them.
- the touch panel 831 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
- the input unit 830 may also include other input devices 832.
- other input devices 832 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
- the display unit 840 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone.
- the display unit 840 can include a display panel 841.
- the display panel 841 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
- the touch panel 831 can cover the display panel 841. When the touch panel 831 detects a touch operation thereon or nearby, the touch panel 831 transmits to the processor 880 to determine the type of the touch event, and then the processor 880 according to the touch event. The type provides a corresponding visual output on display panel 841.
- the touch panel 831 and the display panel 841 are two independent components to implement the input and input functions of the mobile phone, in some embodiments, the touch panel 831 can be integrated with the display panel 841. Realize the input and output functions of the phone.
- the handset can also include at least one type of sensor 850, such as a light sensor, motion sensor, and other sensors.
- the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor may close the display panel 841 and/or when the mobile phone moves to the ear. Or backlight.
- the speedometer sensor can detect the acceleration of each direction (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration).
- Vibration recognition related functions such as pedometer, tapping), etc.; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which can be configured on the mobile phone, will not be described here.
- An audio circuit 860, a speaker 861, and a microphone 862 can provide an audio interface between the user and the handset.
- the audio circuit 860 can transmit the converted electrical data of the received audio data to the speaker 861 for conversion to the sound signal output by the speaker 861; on the other hand, the microphone 862 converts the collected sound signal into an electrical signal by the audio circuit 860. After receiving, it is converted into audio data, and then processed by the audio data output processor 880, sent to the other mobile phone via the RF circuit 810, or outputted to the memory 820 for further processing.
- WiFi is a short-range wireless transmission technology
- the mobile phone can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 870, which provides users with wireless broadband Internet access.
- FIG. 8 shows the WiFi module 870, it can be understood that it does not belong to the essential configuration of the mobile phone, and can be omitted as needed within the scope of not changing the essence of the invention.
- the processor 880 is the control center of the handset, and connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 820, and invoking data stored in the memory 820, executing The phone's various functions and processing data, so that the overall monitoring of the phone.
- the processor 880 may include one or more processing units; preferably, the processor 880 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
- the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 880.
- the handset also includes a power source 890 (such as a battery) that supplies power to the various components.
- a power source 890 such as a battery
- the power source can be logically coupled to the processor 880 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
- the mobile phone may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
- the processor 880 included in the terminal further has the capability of executing the above flow media alignment method flow.
- FIG. 9 is another streaming media alignment device according to an embodiment of the present invention.
- the server 900 can vary considerably depending on configuration or performance, and can include one or more central processing units (CPU) 922 and memory 932, one or more storage applications 942 or data.
- Storage medium 930 of 944 may be short-term storage or persistent storage.
- the program stored on storage medium 930 may include one or more logic modules (not shown), each of which may include a series of instruction operations in the server.
- central processor 922 can be configured to communicate with storage medium 930, executing a series of instruction operations in storage medium 930 on server 900.
- Server 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input and output interfaces 958, and/or one or more operating systems 941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM and more.
- operating systems 941 such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM and more.
- the streaming media alignment method in the above embodiment may be based on the server structure shown in FIG.
- any device that needs to be aligned with the streaming media other than the above-mentioned example hardware may not be understood as the uniqueness of the embodiment of the present invention. limited.
- each unit included is only divided according to functional logic, but is not limited to the foregoing division, as long as the corresponding function can be implemented;
- the names are also for convenience of distinction from each other and are not intended to limit the scope of protection of the present invention.
- the storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
Landscapes
- Physics & Mathematics (AREA)
- Electromagnetism (AREA)
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
A streaming media alignment method, device and storage medium. The method comprises: obtaining a first streaming media and a second streaming media, the first streaming media and the second streaming media being different versions of a same streaming media; performing a cross-correlation calculation on the first streaming media and the second streaming media to obtain a first time point of the first streaming media and a second time point of the second streaming media corresponding to a maximum cross-correlation value, and determining a time offset between the first streaming media and the second streaming media according to the first time point and the second time point; and aligning the first streaming media and the second streaming media according to the time offset. The present solution can accurately determine the time offset between different versions of a streaming media, thus aligning versions of the streaming media.
Description
本申请要求于2015年4月2日提交中国专利局、申请号为201510154259.6、发明名称为“一种流媒体版本对齐方法,及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 201510154259.6, entitled "A Streaming Media Version Alignment Method, and Equipment" filed on April 2, 2015, the entire contents of which are incorporated by reference. In this application.
本发明涉及计算机技术领域,特别涉及一种流媒体对齐方法,设备以及存储介质。The present invention relates to the field of computer technologies, and in particular, to a streaming media alignment method, device, and storage medium.
流媒体是以时间为顺序播放的数据流,例如:音频类的歌曲、视频类的电影等。以歌曲为例,在互联网中,同一首歌曲由于传输和制作的需要,可能会被改写成很多不同的版本,导致该歌曲的起唱位置并不相同,但是实际上歌词以及歌曲的主要旋律都是相同的。为了某些资源(例如:歌词、视频)在呈现给用户的时候可以复用,有必要找出同一首歌曲的不同版本的起唱点,或者寻找不同版本的歌曲之间的时间延迟。Streaming media is a stream of data that is played in time order, such as audio songs, video movies, and the like. Taking songs as an example, in the Internet, the same song may be rewritten into many different versions due to the need of transmission and production, resulting in the song's vocal position is not the same, but in fact the lyrics and the main melody of the song are Are the same. In order for certain resources (eg, lyrics, video) to be multiplexed when presented to the user, it may be necessary to find a different version of the vocal point of the same song, or to find a time delay between different versions of the song.
发明内容Summary of the invention
本发明实施例提供了一种流媒体对齐方法,设备以及存储介质。Embodiments of the present invention provide a streaming media alignment method, device, and storage medium.
一种流媒体对齐方法,包括:A streaming media alignment method includes:
获取第一流媒体和第二流媒体,所述第一流媒体和所述第二流媒体为同一流媒体的不同版本;Acquiring the first streaming media and the second streaming media, where the first streaming media and the second streaming media are different versions of the same streaming media;
对所述第一流媒体和所述第二流媒体进行互相关计算,得到互相关最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第二时间点,根据所述第一时间点和所述第二时间点确定所述第一流媒体和所述第二流媒体之间的时间偏移;Performing cross-correlation calculation on the first streaming media and the second streaming media to obtain a first time point of the first streaming media corresponding to the maximum correlation value of the cross-correlation and a second time point of the corresponding second streaming media, according to the Determining a time offset between the first streaming media and the second streaming media at the first time point and the second time point;
依据所述时间偏移对所述第一流媒体和所述第二流媒体进行对齐。
Aligning the first streaming media and the second streaming media according to the time offset.
一种流媒体对齐设备,包括:一个或多个处理器和存储有操作指令的存储介质,当运行所述存储介质中的操作指令时,所述处理器执行如下步骤:A streaming media alignment device includes: one or more processors and a storage medium storing operation instructions, when executing an operation instruction in the storage medium, the processor performs the following steps:
获取第一流媒体和第二流媒体,所述第一流媒体和所述第二流媒体为同一流媒体的不同版本;Acquiring the first streaming media and the second streaming media, where the first streaming media and the second streaming media are different versions of the same streaming media;
对所述第一流媒体和所述第二流媒体进行互相关计算,得到互相关最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第二时间点,根据所述第一时间点和所述第二时间点确定所述第一流媒体和所述第二流媒体之间的时间偏移;Performing cross-correlation calculation on the first streaming media and the second streaming media to obtain a first time point of the first streaming media corresponding to the maximum correlation value of the cross-correlation and a second time point of the corresponding second streaming media, according to the Determining a time offset between the first streaming media and the second streaming media at the first time point and the second time point;
依据所述时间偏移对所述第一流媒体和所述第二流媒体进行对齐。Aligning the first streaming media and the second streaming media according to the time offset.
一种非瞬时性的计算机可读存储介质,其上存储有计算机可执行指令,当计算机中运行所述可执行指令时,执行如下步骤:A non-transitory computer readable storage medium having stored thereon computer executable instructions for performing the following steps when the executable instructions are executed in a computer:
获取第一流媒体和第二流媒体,所述第一流媒体和所述第二流媒体为同一流媒体的不同版本;Acquiring the first streaming media and the second streaming media, where the first streaming media and the second streaming media are different versions of the same streaming media;
对所述第一流媒体和所述第二流媒体进行互相关计算,得到互相关最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第二时间点,根据所述第一时间点和所述第二时间点确定所述第一流媒体和所述第二流媒体之间的时间偏移;Performing cross-correlation calculation on the first streaming media and the second streaming media to obtain a first time point of the first streaming media corresponding to the maximum correlation value of the cross-correlation and a second time point of the corresponding second streaming media, according to the Determining a time offset between the first streaming media and the second streaming media at the first time point and the second time point;
依据所述时间偏移对所述第一流媒体和所述第二流媒体进行对齐。Aligning the first streaming media and the second streaming media according to the time offset.
图1为本发明实施例所提供的媒体流对齐方法流程示意图;1 is a schematic flowchart of a media stream alignment method according to an embodiment of the present invention;
图2为本发明实施例所提供的媒体流对齐设备结构示意图;2 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention;
图3为本发明实施例所提供的媒体流对齐设备结构示意图;FIG. 3 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present disclosure;
图4为本发明实施例所提供的媒体流对齐设备结构示意图;4 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention;
图5为本发明实施例所提供的媒体流对齐设备结构示意图;FIG. 5 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention;
图6为本发明实施例所提供的媒体流对齐设备结构示意图;FIG. 6 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention;
图7为本发明实施例所提供的媒体流对齐设备结构示意图;FIG. 7 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present disclosure;
图8为本发明实施例所提供的媒体流对齐设备结构示意图;以及
FIG. 8 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention;
图9为本发明实施例所提供的媒体流对齐设备结构示意图。FIG. 9 is a schematic structural diagram of a media stream alignment device according to an embodiment of the present invention.
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部份实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The present invention will be further described in detail with reference to the accompanying drawings, in which . All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例提供了一种流媒体对齐方法,该方法可以应用于手机、电脑等终端设备,也可以应用于服务器等设备中。如图1所示,该方法包括步骤101至步骤103。The embodiment of the invention provides a streaming media alignment method, which can be applied to a terminal device such as a mobile phone or a computer, and can also be applied to a server or the like. As shown in FIG. 1, the method includes steps 101 to 103.
在步骤101中,获取第一流媒体和第二流媒体,其中第一流媒体和第二流媒体为同一流媒体的不同版本。In step 101, the first streaming media and the second streaming media are obtained, where the first streaming media and the second streaming media are different versions of the same streaming media.
在本发明实施例的“第一流媒体”和“第二流媒体”用于区分两个不同版本的流媒体。流媒体在本实施例中可以是音频\视频等各种流媒体,本发明实施例对此不作唯一性限定。The "first streaming media" and the "second streaming media" in the embodiment of the present invention are used to distinguish two different versions of streaming media. In this embodiment, the streaming media may be various audio media such as audio/video, which is not limited by the embodiment of the present invention.
在步骤102中,对第一流媒体和第二流媒体进行互相关计算,得到互相关最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第二时间点,根据第一时间点和第二时间点确定第一流媒体和第二流媒体之间的时间偏移。In step 102, performing cross-correlation calculation on the first streaming media and the second streaming media, and obtaining a first time point of the first streaming media corresponding to the maximum correlation value of the cross-correlation and a second time point of the corresponding second streaming media, according to The first time point and the second time point determine a time offset between the first streaming medium and the second streaming medium.
在本实施例中,进行互相关计算的过程可以是对第一流媒体和上述第二流媒体的所有数据进行互相关计算,也可以是对其中的一段数据进行互相关计算,本发明实施例不作唯一性限定。互相关计算的方法,可以参考成熟的算法,本发明实施例不对互相关算法进行唯一性限定。In this embodiment, the process of performing cross-correlation calculation may be performing cross-correlation calculation on all data of the first streaming media and the second streaming media, or performing cross-correlation calculation on one segment of the data, which is not implemented in the embodiment of the present invention. Uniqueness is limited. For the method of cross-correlation calculation, reference may be made to a mature algorithm, and the embodiment of the present invention does not uniquely define the cross-correlation algorithm.
在步骤103中,依据第一流媒体和第二流媒体之间的时间偏移对第一流媒体和第二流媒体进行对齐。In step 103, the first streaming media and the second streaming media are aligned according to a time offset between the first streaming media and the second streaming media.
根据本发明实施例,采用互相关计算确定互相关最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第二时间点,再通过第一时间点和第二时间点确定第一流媒体和第二流媒体之间的时间偏移,可以准确地确定不同版本的流媒体之间的时间偏移从而实现流媒体版本对齐。
According to the embodiment of the present invention, the first time point of the first streaming media corresponding to the maximum correlation value and the second time point of the corresponding second streaming media are determined by cross-correlation calculation, and then the first time point and the second time pass. The point determines the time offset between the first streaming media and the second streaming media, and the time offset between the different versions of the streaming media can be accurately determined to achieve streaming media version alignment.
在本发明另一实施例中,在对第一流媒体和第二流媒体进行互相关计算之前,上述方法还包括:对第一流媒体和第二流媒体进行降采样。In another embodiment of the present invention, before the cross-correlation calculation is performed on the first streaming media and the second streaming media, the method further includes: downsampling the first streaming media and the second streaming media.
上述对第一流媒体和第二流媒体进行互相关计算可以包括:The performing cross-correlation calculation on the first streaming media and the second streaming media may include:
对降采样后的第一流媒体和第二流媒体进行互相关计算。Perform cross-correlation calculation on the downsampled first stream and the second stream.
在本实施例中,降采样的采样率可以依据执行设备的数据计算能力确定与之对应的采样率,从而提高匹配度。In this embodiment, the sampling rate of the downsampling may determine the sampling rate corresponding thereto according to the data computing capability of the executing device, thereby improving the matching degree.
在本发明另一实施例中,在对第一流媒体和第二流媒体进行互相关计算之前,上述方法还包括:截取第一流媒体和第二流媒体参考时间段内的数据。In another embodiment of the present invention, before the cross-correlation calculation is performed on the first streaming media and the second streaming media, the method further includes: intercepting data in the first streaming media and the second streaming media reference time period.
上述对第一流媒体和第二流媒体进行互相关计算包括:The cross-correlation calculation of the first streaming media and the second streaming media includes:
对第一流媒体和第二流媒体参考时间段内的数据进行互相关计算。Cross-correlation calculation is performed on data in the first streaming media and the second streaming media reference time period.
在本发明实施例中,截取的时间段可以是动态调整的,以适应不同流媒体版本之间可能存在的时间偏移,例如,在截取第一流媒体和第二流媒体参考时间段内的数据之前,上述方法还包括:In the embodiment of the present invention, the intercepted time period may be dynamically adjusted to accommodate possible time offsets between different streaming media versions, for example, data intercepting the first streaming media and the second streaming media reference time period. Previously, the above methods also include:
依第一流媒体和第二流媒体的互相关时间差确定参考时间段。The reference time period is determined according to a cross-correlation time difference between the first streaming medium and the second streaming medium.
由于截取的时间段太长,数据量可能会太大,这样会导致设备长时间无法获得处理结果,甚至出现卡顿现象,为了避免这种情况的发生,本发明实施例提供了如下解决方案:上述方法还包括:Since the time period of the interception is too long, the amount of data may be too large, which may result in the device not being able to obtain the processing result for a long time, and even the occurrence of a jamming phenomenon. To avoid this, the embodiment of the present invention provides the following solutions: The above methods also include:
若上述互相关时间差超过预定阈值,则中止执行流媒体版本对齐的流程。If the cross-correlation time difference exceeds a predetermined threshold, the flow of performing streaming media version alignment is suspended.
本发明实施例还提供了计算互相关并确定互相关最大值的方案,具体如下:对第一流媒体和第二流媒体进行互相关计算,得到互相关性最大值包括:The embodiment of the present invention further provides a solution for calculating cross-correlation and determining a maximum value of cross-correlation, as follows: performing cross-correlation calculation on the first streaming media and the second streaming media, and obtaining a maximum correlation value includes:
通过如下公式计算上述第一流媒体和上述第二流媒体的互相关:Calculating the cross-correlation of the first streaming media and the second streaming media by using the following formula:
其中,x表示第一流媒体的数据,y表示第二流媒体的数据,ωτ表示窗函数,n为时间采样点; Where x represents data of the first streaming medium, y represents data of the second streaming medium, ω τ represents a window function, and n is a time sampling point;
依据计算得到的τ值的最大值,并确定该最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第二时间点。The first time point of the first streaming medium corresponding to the maximum value and the second time point of the corresponding second streaming medium are determined according to the calculated maximum value of the τ value.
以下实施例将音频媒体中的歌曲为例对本发明实施例进行举例说明。本发明实施例的技术方案,主要是通过互相关法,对两首歌曲的起始唱歌位置进行
定位的。The following embodiments illustrate the embodiments of the present invention by taking songs in an audio medium as an example. The technical solution of the embodiment of the present invention mainly uses the cross-correlation method to perform the initial singing position of two songs.
Positioned.
步骤一、降采样Step one, downsampling
在本发明实施例中,为了能够降低计算量,同时不失计算准确性,通过实验,统一对歌曲降采样至8000Hz可以获得较好的效果。In the embodiment of the present invention, in order to reduce the amount of calculation without losing the calculation accuracy, it is better to uniformly downsample the song to 8000 Hz through experiments.
步骤二、互相关时间段的选择Step 2: Selection of cross-correlation time period
为了进一步降低计算量,本发明实施例可以不对整首歌计算互相关,根据经验,对两首歌曲时间差不同的情况,选择了不同的时间段进行互相关计算。比如两首歌曲时间差在10s以内的,则选择计算互相关时间为前15s,时间差在5s以内的,计算互相关时间为前10s。根据经验,这样既能保证准确度,同时也减少计算量。In order to further reduce the amount of calculation, the embodiment of the present invention may not calculate the cross-correlation of the whole song. According to experience, different time periods are selected for the cross-correlation calculation for the case where the time difference between the two songs is different. For example, if the time difference between two songs is less than 10s, the cross-correlation time is calculated as the first 15s, and the time difference is within 5s. The cross-correlation time is calculated as the first 10s. As a rule of thumb, this ensures both accuracy and computational effort.
步骤三、求互相关Step 3, seeking cross-correlation
这里计算互相关的方法,如下式:Here we calculate the method of cross-correlation, as follows:
其中,x表示第一首歌曲的数据,y表示第二首歌曲的数据,ωτ表示窗函数,在这里窗函数即为上述互相关时间段的选择对应的时间段。Where x represents the data of the first song, y represents the data of the second song, and ω τ represents the window function, where the window function is the time period corresponding to the selection of the cross-correlation time period described above.
步骤四、选择歌曲的起唱位置Step 4: Select the starting position of the song
通过前述求互相关的计算,可以得到互相关最大值,确定互相关最大值所对应的第一首歌的第一时间点和所对应的第二首歌的第二时间点,根据第一时间点和第二时间点确定第一首歌和第二首歌之间的时间偏移,并根据该时间偏移对齐两首歌曲。Through the foregoing cross-correlation calculation, the cross-correlation maximum value can be obtained, and the first time point of the first song corresponding to the maximum cross-correlation value and the second time point of the corresponding second song are determined, according to the first time The point and the second time point determine a time offset between the first song and the second song, and align the two songs according to the time offset.
采用本发明实施例方案,可以准确地对齐两个不同版本歌曲的起唱位置;同时,使用的互相关时间长度分类技术,可以减少计算量,提高计算速度。With the solution of the embodiment of the present invention, the sing position of two different versions of the song can be accurately aligned; at the same time, the cross-correlation time length classification technique used can reduce the calculation amount and improve the calculation speed.
本发明实施例还提供了一种流媒体对齐设备,如图2所示,包括:The embodiment of the invention further provides a streaming media alignment device, as shown in FIG. 2, comprising:
媒体获取单元201,用于获取第一流媒体和第二流媒体,其中第一流媒体和第二流媒体为同一流媒体的不同版本;The media obtaining unit 201 is configured to acquire the first streaming media and the second streaming media, where the first streaming media and the second streaming media are different versions of the same streaming media.
计算单元202,用于对第一流媒体和第二流媒体进行互相关计算,得到互相关性最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第
二时间点;The calculating unit 202 is configured to perform cross-correlation calculation on the first streaming media and the second streaming media, to obtain a first time point of the first streaming media corresponding to the maximum cross-correlation coefficient and a corresponding second streaming media
Two time points;
偏移确定单元203,用于根据第一时间点和第二时间点确定第一流媒体和第二流媒体之间的时间偏移;The offset determining unit 203 is configured to determine a time offset between the first streaming media and the second streaming media according to the first time point and the second time point;
对齐单元204,用于依据第一流媒体和第二流媒体之间的时间偏移对第一流媒体和第二流媒体进行对齐。The aligning unit 204 is configured to align the first streaming media and the second streaming media according to a time offset between the first streaming media and the second streaming media.
流媒体在本实施例中可以是音频\视频等各种流媒体,本发明实施例对此不作唯一性限定。在本实施例中,进行互相关计算的过程可以是对第一流媒体和第二流媒体的所有数据进行互相关计算,也可以是对其中的一段数据进行互相关计算,本发明实施例不作唯一性限定。互相关计算的方法,可以参考成熟的算法,本发明实施例不对互相关算法进行唯一性限定。In this embodiment, the streaming media may be various audio media such as audio/video, which is not limited by the embodiment of the present invention. In this embodiment, the process of performing cross-correlation calculation may be performing cross-correlation calculation on all data of the first streaming media and the second streaming media, or performing cross-correlation calculation on one segment of the data, which is not unique in the embodiment of the present invention. Sexual limitation. For the method of cross-correlation calculation, reference may be made to a mature algorithm, and the embodiment of the present invention does not uniquely define the cross-correlation algorithm.
根据本发明实施例,采用互相关计算确定互相关最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第二时间点,再通过第一时间点和第二时间点确定第一流媒体和第二流媒体之间的时间偏移,可以准确地确定不同版本的流媒体之间的时间偏移从而实现流媒体版本对齐。According to the embodiment of the present invention, the first time point of the first streaming media corresponding to the maximum correlation value and the second time point of the corresponding second streaming media are determined by cross-correlation calculation, and then the first time point and the second time pass. The point determines the time offset between the first streaming media and the second streaming media, and the time offset between the different versions of the streaming media can be accurately determined to achieve streaming media version alignment.
在本发明另一实施例中,如图3所示,上述对齐设备还可以包括:In another embodiment of the present invention, as shown in FIG. 3, the aligning apparatus may further include:
采样单元301,用于在对第一流媒体和第二流媒体进行互相关计算之前,对第一流媒体和第二流媒体进行降采样。The sampling unit 301 is configured to downsample the first streaming media and the second streaming media before performing cross-correlation calculation on the first streaming media and the second streaming media.
上述计算单元202,可用于对降采样后的第一流媒体和第二流媒体进行互相关计算。The calculating unit 202 is configured to perform cross-correlation calculation on the downsampled first streaming media and the second streaming media.
在本实施例中,降采样的采样率可以依据执行设备的数据计算能力确定与之对应的采样率,从而提高匹配度。In this embodiment, the sampling rate of the downsampling may determine the sampling rate corresponding thereto according to the data computing capability of the executing device, thereby improving the matching degree.
在本发明另一实施例中,如图4所示,上述对齐设备还可以包括:In another embodiment of the present invention, as shown in FIG. 4, the foregoing aligning apparatus may further include:
截取单元401,用于在对第一流媒体和第二流媒体进行互相关计算之前,截取第一流媒体和第二流媒体参考时间段内的数据。The intercepting unit 401 is configured to intercept data in the first streaming media and the second streaming media reference time period before performing cross-correlation calculation on the first streaming media and the second streaming media.
上述计算单元202,可用于对第一流媒体和第二流媒体参考时间段内的数据进行互相关计算。The calculating unit 202 is configured to perform cross-correlation calculation on data in the first streaming media and the second streaming media reference time period.
在本发明实施例中,截取的时间段可以是动态调整的,以适应不同流媒体版本之间可能存在的时间偏移,例如,如图5所示,上述对齐设备还可以包括:In the embodiment of the present invention, the intercepted time period may be dynamically adjusted to adapt to a time offset that may exist between different streaming media versions. For example, as shown in FIG. 5, the foregoing aligning device may further include:
时间确定单元501,用于在截取第一流媒体和第二流媒体参考时间段内的
数据之前,依第一流媒体和第二流媒体的互相关时间差确定参考时间段。a time determining unit 501, configured to intercept the first streaming media and the second streaming media reference time period
Before the data, the reference time period is determined according to the cross-correlation time difference between the first stream medium and the second stream medium.
由于截取的时间段太长,数据量可能会太大,这样会导致设备长时间无法获得处理结果,甚至出现卡顿现象,为了避免这种情况的发生,本发明实施例提供了如下解决方案:进一步地,如图6所示,上述对齐设备还包括:Since the time period of the interception is too long, the amount of data may be too large, which may result in the device not being able to obtain the processing result for a long time, and even the occurrence of a jamming phenomenon. To avoid this, the embodiment of the present invention provides the following solutions: Further, as shown in FIG. 6, the foregoing aligning device further includes:
流程控制单元601,用于若上述互相关时间差超过预定阈值,则中止执行流媒体版本对齐的流程。The flow control unit 601 is configured to suspend the process of performing streaming media version alignment if the cross-correlation time difference exceeds a predetermined threshold.
本发明实施例还提供了计算互相关并确定互相关最大值的方案,具体如下:可选地,上述计算单元202,用于通过如下公式计算第一流媒体和第二流媒体的互相关:The embodiment of the present invention further provides a solution for calculating the cross-correlation and determining the maximum value of the cross-correlation, as follows: Optionally, the calculating unit 202 is configured to calculate a cross-correlation between the first streaming media and the second streaming media by using the following formula:
其中,x表示第一流媒体的数据,y表示第二流媒体的数据,ωτ表示窗函数,n为时间采样点;依据计算得到τ值的最大值,并确定该最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第二时间点。 Where x represents the data of the first streaming media, y represents the data of the second streaming media, ω τ represents the window function, n is the time sampling point; the maximum value of the τ value is obtained according to the calculation, and the first stream corresponding to the maximum value is determined The first time point of the media and the second time point of the corresponding second streaming media.
本发明实施例还提供了另一种流媒体对齐设备,如图7所示,包括:接收器701、发射器702、处理器703以及存储器704。Another embodiment of the present invention further provides a streaming media alignment device, as shown in FIG. 7, comprising: a receiver 701, a transmitter 702, a processor 703, and a memory 704.
其中,处理器703,用于获取第一流媒体和第二流媒体,第一流媒体和第二流媒体为同一流媒体的不同版本;对第一流媒体和第二流媒体进行互相关计算,得到互相关最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第二时间点,根据第一时间点和第二时间点确定第一流媒体和第二流媒体之间的时间偏移;依据第一流媒体和第二流媒体之间的时间偏移对第一流媒体和第二流媒体进行对齐。The processor 703 is configured to acquire the first streaming media and the second streaming media, where the first streaming media and the second streaming media are different versions of the same streaming media, and performing cross-correlation calculation on the first streaming media and the second streaming media to obtain mutual Determining a first time point of the first streaming media corresponding to the maximum value and a second time point of the corresponding second streaming media, determining, between the first streaming media and the second streaming media, according to the first time point and the second time point Time offset; aligning the first streaming media and the second streaming media according to a time offset between the first streaming media and the second streaming media.
流媒体在本实施例中可以是音频\视频等各种流媒体,本发明实施例对此不作唯一性限定。在本实施例中,进行互相关计算的过程可以是对第一流媒体和第二流媒体的所有数据进行互相关计算,也可以是对其中的一段数据进行互相关计算,本发明实施例不作唯一性限定。互相关计算的方法,可以参考成熟的算法,本发明实施例不对互相关算法进行唯一性限定。In this embodiment, the streaming media may be various audio media such as audio/video, which is not limited by the embodiment of the present invention. In this embodiment, the process of performing cross-correlation calculation may be performing cross-correlation calculation on all data of the first streaming media and the second streaming media, or performing cross-correlation calculation on one segment of the data, which is not unique in the embodiment of the present invention. Sexual limitation. For the method of cross-correlation calculation, reference may be made to a mature algorithm, and the embodiment of the present invention does not uniquely define the cross-correlation algorithm.
根据本发明实施例,采用互相关计算确定互相关最大值所对应的第一流媒
体的第一时间点和所对应的第二流媒体的第二时间点,再通过第一时间点和第二时间点确定第一流媒体和第二流媒体之间的时间偏移,可以准确地确定不同版本的流媒体之间的时间偏移从而实现流媒体版本对齐。According to the embodiment of the present invention, the cross-correlation calculation is used to determine the first medium corresponding to the maximum value of the cross-correlation
The first time point of the body and the second time point of the corresponding second streaming medium, and determining the time offset between the first streaming media and the second streaming media through the first time point and the second time point, which can be accurately Determine the time offset between different versions of streaming media to achieve streaming media version alignment.
在本发明另一实施例中,处理器703还用于在对第一流媒体和第二流媒体进行互相关计算之前,对第一流媒体和第二流媒体进行降采样。In another embodiment of the present invention, the processor 703 is further configured to downsample the first streaming media and the second streaming media before performing cross-correlation calculation on the first streaming media and the second streaming media.
上述对第一流媒体和第二流媒体进行互相关计算可以包括:The performing cross-correlation calculation on the first streaming media and the second streaming media may include:
对降采样后的第一流媒体和第二流媒体进行互相关计算。Perform cross-correlation calculation on the downsampled first stream and the second stream.
在本实施例中,降采样的采样率可以依据执行设备的数据计算能力确定与之对应的采样率,从而提高匹配度。In this embodiment, the sampling rate of the downsampling may determine the sampling rate corresponding thereto according to the data computing capability of the executing device, thereby improving the matching degree.
在本发明另一实施例中,处理器703还可以用于在对第一流媒体和第二流媒体进行互相关计算之前,截取第一流媒体和第二流媒体参考时间段内的数据。In another embodiment of the present invention, the processor 703 is further configured to intercept data in the first streaming media and the second streaming media reference time period before performing cross-correlation calculation on the first streaming media and the second streaming media.
上述对第一流媒体和第二流媒体进行互相关计算包括:The cross-correlation calculation of the first streaming media and the second streaming media includes:
对第一流媒体和第二流媒体参考时间段内的数据进行互相关计算。Cross-correlation calculation is performed on data in the first streaming media and the second streaming media reference time period.
在本发明实施例中,截取的时间段可以是动态调整的,以适应不同流媒体版本之间可能存在的时间偏移,例如,处理器703还用于在截取第一流媒体和第二流媒体参考时间段内的数据之前,依第一流媒体和第二流媒体的互相关时间差确定参考时间段。In the embodiment of the present invention, the intercepted time period may be dynamically adjusted to accommodate a time offset that may exist between different streaming media versions. For example, the processor 703 is further configured to intercept the first streaming media and the second streaming media. Before referring to the data in the time period, the reference time period is determined according to the cross-correlation time difference between the first streaming media and the second streaming media.
由于截取的时间段太长,数据量可能会太大,这样会导致设备长时间无法获得处理结果,甚至出现卡顿现象,为了避免这种情况的发生,本发明实施例提供了如下解决方案:上述处理器703,还用于若上述互相关时间差超过预定阈值,则中止执行流媒体版本对齐的流程。Since the time period of the interception is too long, the amount of data may be too large, which may result in the device not being able to obtain the processing result for a long time, and even the occurrence of a jamming phenomenon. To avoid this, the embodiment of the present invention provides the following solutions: The processor 703 is further configured to suspend the process of performing streaming media version alignment if the cross-correlation time difference exceeds a predetermined threshold.
本发明实施例还提供了计算互相关并确定互相关最大值的方案,具体如下:处理器703用于通过如下公式计算第一流媒体和第二流媒体进行互相关:The embodiment of the present invention further provides a solution for calculating cross-correlation and determining a maximum value of cross-correlation, as follows: The processor 703 is configured to calculate cross-correlation between the first streaming media and the second streaming media by using the following formula:
其中,x表示第一流媒体的数据,y表示第二流媒体的数据,ωτ表示窗函数,n为时间采样点; Where x represents data of the first streaming medium, y represents data of the second streaming medium, ω τ represents a window function, and n is a time sampling point;
依据计算得到τ值的最大值,并确定该最大值所对应的第一流媒体的第一
时间点和所对应的第二流媒体的第二时间点。Calculating the maximum value of the τ value according to the calculation, and determining the first of the first streaming media corresponding to the maximum value
The time point and the second time point of the corresponding second streaming medium.
本发明实施例还提供了另一种流媒体对齐设备,如图8所示,为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。该对齐设备在图8中示意为终端,该终端可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑等任意终端设备,以终端为手机为例:The embodiment of the present invention further provides another streaming media aligning device. As shown in FIG. 8 , for the convenience of description, only parts related to the embodiment of the present invention are shown. If the specific technical details are not disclosed, please refer to the implementation of the present invention. Example method section. The aligning device is illustrated in FIG. 8 as a terminal, and the terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, and the like. The terminal is a mobile phone as an example:
图8示出的是与本发明实施例提供的终端相关的手机的部分结构的框图。参考图8,手机包括:射频(Radio Frequency,RF)电路810、存储器820、输入单元830、显示单元840、传感器850、音频电路860、无线保真(Wireless Fidelity,WiFi)模块870、处理器880、以及电源890等部件。本领域技术人员可以理解,图8中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。FIG. 8 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present invention. Referring to FIG. 8 , the mobile phone includes: a radio frequency (RF) circuit 810 , a memory 820 , an input unit 830 , a display unit 840 , a sensor 850 , an audio circuit 860 , a wireless fidelity (WiFi) module 870 , and a processor 880 . And power supply 890 and other components. It will be understood by those skilled in the art that the structure of the handset shown in FIG. 8 does not constitute a limitation to the handset, and may include more or less components than those illustrated, or some components may be combined, or different component arrangements.
下面结合图8对手机的各个构成部件进行具体的介绍。The components of the mobile phone will be specifically described below with reference to FIG.
RF电路810可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器880处理;另外,将设计上行的数据发送给基站。通常,RF电路810包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路810还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE)、电子邮件、短消息服务(Short Messaging Service,SMS)等。The RF circuit 810 can be used for receiving and transmitting signals during the transmission or reception of information or during a call. Specifically, after receiving the downlink information of the base station, it is processed by the processor 880. In addition, the uplink data is designed to be sent to the base station. Generally, RF circuit 810 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 810 can also communicate with the network and other devices via wireless communication. The above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), E-mail, Short Messaging Service (SMS), and the like.
存储器820可用于存储软件程序以及模块,处理器880通过运行存储在存储器820的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器820可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本
等)等。此外,存储器820可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 820 can be used to store software programs and modules, and the processor 880 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 820. The memory 820 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of mobile phones (such as audio data, phone book)
and many more. Moreover, memory 820 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
输入单元830可用于接收输入的数字或字符信息,以及产生与手机的用户设置以及功能控制有关的键信号输入。具体地,输入单元830可包括触控面板831以及其他输入设备832。触控面板831,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板831上或在触控面板831附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板831可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器880,并能接收处理器880发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板831。除了触控面板831,输入单元830还可以包括其他输入设备832。具体地,其他输入设备832可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 830 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the handset. Specifically, the input unit 830 may include a touch panel 831 and other input devices 832. The touch panel 831, also referred to as a touch screen, can collect touch operations on or near the user (such as the user using a finger, a stylus, or the like on the touch panel 831 or near the touch panel 831. Operation), and drive the corresponding connecting device according to a preset program. Optionally, the touch panel 831 can include two parts: a touch detection device and a touch controller. Wherein, the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information. The processor 880 is provided and can receive commands from the processor 880 and execute them. In addition, the touch panel 831 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 831, the input unit 830 may also include other input devices 832. In particular, other input devices 832 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
显示单元840可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元840可包括显示面板841,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板841。进一步的,触控面板831可覆盖显示面板841,当触控面板831检测到在其上或附近的触摸操作后,传送给处理器880以确定触摸事件的类型,随后处理器880根据触摸事件的类型在显示面板841上提供相应的视觉输出。虽然在图8中,触控面板831与显示面板841是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板831与显示面板841集成而实现手机的输入和输出功能。The display unit 840 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone. The display unit 840 can include a display panel 841. Alternatively, the display panel 841 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. Further, the touch panel 831 can cover the display panel 841. When the touch panel 831 detects a touch operation thereon or nearby, the touch panel 831 transmits to the processor 880 to determine the type of the touch event, and then the processor 880 according to the touch event. The type provides a corresponding visual output on display panel 841. Although in FIG. 8, the touch panel 831 and the display panel 841 are two independent components to implement the input and input functions of the mobile phone, in some embodiments, the touch panel 831 can be integrated with the display panel 841. Realize the input and output functions of the phone.
手机还可包括至少一种传感器850,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板841的亮度,接近传感器可在手机移动到耳边时,关闭显示面板841和/或背光。作为运动传感器的一种,加
速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The handset can also include at least one type of sensor 850, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor may close the display panel 841 and/or when the mobile phone moves to the ear. Or backlight. As a kind of motion sensor, plus
The speedometer sensor can detect the acceleration of each direction (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration). Vibration recognition related functions (such as pedometer, tapping), etc.; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which can be configured on the mobile phone, will not be described here.
音频电路860、扬声器861,传声器862可提供用户与手机之间的音频接口。音频电路860可将接收到的音频数据转换后的电信号,传输到扬声器861,由扬声器861转换为声音信号输出;另一方面,传声器862将收集的声音信号转换为电信号,由音频电路860接收后转换为音频数据,再将音频数据输出处理器880处理后,经RF电路810以发送给比如另一手机,或者将音频数据输出至存储器820以便进一步处理。An audio circuit 860, a speaker 861, and a microphone 862 can provide an audio interface between the user and the handset. The audio circuit 860 can transmit the converted electrical data of the received audio data to the speaker 861 for conversion to the sound signal output by the speaker 861; on the other hand, the microphone 862 converts the collected sound signal into an electrical signal by the audio circuit 860. After receiving, it is converted into audio data, and then processed by the audio data output processor 880, sent to the other mobile phone via the RF circuit 810, or outputted to the memory 820 for further processing.
WiFi属于短距离无线传输技术,手机通过WiFi模块870可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图8示出了WiFi模块870,但是可以理解的是,其并不属于手机的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。WiFi is a short-range wireless transmission technology, and the mobile phone can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 870, which provides users with wireless broadband Internet access. Although FIG. 8 shows the WiFi module 870, it can be understood that it does not belong to the essential configuration of the mobile phone, and can be omitted as needed within the scope of not changing the essence of the invention.
处理器880是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器820内的软件程序和/或模块,以及调用存储在存储器820内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器880可包括一个或多个处理单元;优选的,处理器880可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器880中。The processor 880 is the control center of the handset, and connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 820, and invoking data stored in the memory 820, executing The phone's various functions and processing data, so that the overall monitoring of the phone. Optionally, the processor 880 may include one or more processing units; preferably, the processor 880 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like. The modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 880.
手机还包括给各个部件供电的电源890(比如电池),优选的,电源可以通过电源管理系统与处理器880逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The handset also includes a power source 890 (such as a battery) that supplies power to the various components. Preferably, the power source can be logically coupled to the processor 880 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
尽管未示出,手机还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown, the mobile phone may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
在本发明实施例中,该终端所包括的处理器880还具有执行以上流媒体对齐方法流程的能力。In the embodiment of the present invention, the processor 880 included in the terminal further has the capability of executing the above flow media alignment method flow.
图9是本发明实施例提供的另一种流媒体对齐设备,该设备在图9中示意
为服务器,该服务器900可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)922和存储器932,一个或一个以上存储应用程序942或数据944的存储介质930。其中,存储器932和存储介质930可以是短暂存储或持久存储。存储在存储介质930的程序可以包括一个或一个以上逻辑模块(图示没标出),每个逻辑模块可以包括对服务器中的一系列指令操作。更进一步地,中央处理器922可以设置为与存储介质930通信,在服务器900上执行存储介质930中的一系列指令操作。FIG. 9 is another streaming media alignment device according to an embodiment of the present invention. The device is illustrated in FIG.
For a server, the server 900 can vary considerably depending on configuration or performance, and can include one or more central processing units (CPU) 922 and memory 932, one or more storage applications 942 or data. Storage medium 930 of 944. Among them, the memory 932 and the storage medium 930 may be short-term storage or persistent storage. The program stored on storage medium 930 may include one or more logic modules (not shown), each of which may include a series of instruction operations in the server. Still further, central processor 922 can be configured to communicate with storage medium 930, executing a series of instruction operations in storage medium 930 on server 900.
服务器900还可以包括一个或一个以上电源926,一个或一个以上有线或无线网络接口950,一个或一个以上输入输出接口958,和/或,一个或一个以上操作系统941,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。 Server 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input and output interfaces 958, and/or one or more operating systems 941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM and more.
上述实施例中的流媒体对齐方法可以基于该图9所示的服务器结构。The streaming media alignment method in the above embodiment may be based on the server structure shown in FIG.
以上示例了手机以及服务器的实体设备结构,在本发明实施例实现过程中,可以除了以上举例硬件以外的其他任意需要进行流媒体对齐的设备,以上举例不应理解为对本发明实施例的唯一性限定。The above is exemplified by the physical device structure of the mobile phone and the server. In the implementation of the embodiment of the present invention, any device that needs to be aligned with the streaming media other than the above-mentioned example hardware may not be understood as the uniqueness of the embodiment of the present invention. limited.
值得注意的是,上述对齐设备实施例中,所包括的各个单元只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。It should be noted that, in the foregoing aligning device embodiment, each unit included is only divided according to functional logic, but is not limited to the foregoing division, as long as the corresponding function can be implemented; The names are also for convenience of distinction from each other and are not intended to limit the scope of protection of the present invention.
另外,本领域普通技术人员可以理解实现上述各方法实施例中的全部或部分步骤是可以通过程序来指令相关的硬件完成,相应的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。In addition, those skilled in the art can understand that all or part of the steps in implementing the foregoing method embodiments may be performed by a program to instruct related hardware, and the corresponding program may be stored in a computer readable storage medium. The storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
以上仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明实施例揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。
The above is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the embodiments of the present invention. All should be covered by the scope of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims (13)
- 一种流媒体对齐方法,包括:A streaming media alignment method includes:获取第一流媒体和第二流媒体,所述第一流媒体和所述第二流媒体为同一流媒体的不同版本;Acquiring the first streaming media and the second streaming media, where the first streaming media and the second streaming media are different versions of the same streaming media;对所述第一流媒体和所述第二流媒体进行互相关计算,得到互相关最大值所对应的所述第一流媒体的第一时间点和所对应的所述第二流媒体的第二时间点,根据所述第一时间点和所述第二时间点确定所述第一流媒体和所述第二流媒体之间的时间偏移;Performing cross-correlation calculation on the first streaming media and the second streaming media to obtain a first time point of the first streaming media corresponding to the maximum correlation value of the cross-correlation and a second time of the corresponding second streaming media Point, determining, according to the first time point and the second time point, a time offset between the first streaming media and the second streaming media;依据所述时间偏移对所述第一流媒体和所述第二流媒体进行对齐。Aligning the first streaming media and the second streaming media according to the time offset.
- 根据权利要求1所述方法,在对所述第一流媒体和所述第二流媒体进行互相关计算之前,还包括:对所述第一流媒体和第二流媒体进行降采样;The method of claim 1, before performing cross-correlation calculation on the first streaming media and the second streaming media, further comprising: downsampling the first streaming media and the second streaming media;所述对所述第一流媒体和所述第二流媒体进行互相关计算包括:Performing cross-correlation calculation on the first streaming media and the second streaming media includes:对降采样后的所述第一流媒体和所述第二流媒体进行互相关计算。Performing cross-correlation calculation on the downsampled first streaming media and the second streaming media.
- 根据权利要求1所述方法,在对所述第一流媒体和所述第二流媒体进行互相关计算之前,还包括:The method of claim 1, before performing cross-correlation calculation on the first streaming media and the second streaming media, further comprising:截取所述第一流媒体和第二流媒体参考时间段内的数据;Intercepting data in the first streaming media and the second streaming media reference time period;所述对所述第一流媒体和所述第二流媒体进行互相关计算包括:Performing cross-correlation calculation on the first streaming media and the second streaming media includes:对所述第一流媒体和第二流媒体参考时间段内的数据进行互相关计算。Perform cross-correlation calculation on the data in the first streaming media and the second streaming media reference time period.
- 根据权利要求3所述方法,在截取所述第一流媒体和第二流媒体对应的参考时间段内的数据之前,所述方法还包括:The method according to claim 3, before the data in the reference time period corresponding to the first streaming media and the second streaming media is intercepted, the method further includes:依所述第一流媒体和所述第二流媒体的互相关时间差确定所述参考时间段。Determining the reference time period according to a cross-correlation time difference between the first streaming media and the second streaming media.
- 根据权利要求4所述方法,还包括:The method of claim 4 further comprising:若所述互相关时间差超过预定阈值,则中止执行流媒体对齐的流程。 If the cross-correlation time difference exceeds a predetermined threshold, the flow of performing streaming media alignment is suspended.
- 根据权利要求1至5任意一项所述方法,所述对所述第一流媒体和所述第二流媒体进行互相关计算,得到互相关最大值所对应的第一流媒体的第一时间点和所对应的第二流媒体的第二时间点包括:The method according to any one of claims 1 to 5, wherein the cross-correlation calculation is performed on the first streaming media and the second streaming media, and the first time point of the first streaming media corresponding to the maximum correlation value is obtained. The second time point of the corresponding second streaming media includes:通过如下公式计算所述第一流媒体和所述第二流媒体的互相关:Calculating the cross-correlation between the first streaming media and the second streaming media by using the following formula:其中,x表示所述第一流媒体的数据,y表示所述第二流媒体的数据,ωτ表示窗函数,n为时间采样点; Where x represents data of the first streaming medium, y represents data of the second streaming medium, ω τ represents a window function, and n is a time sampling point;依据计算得到的τ值的最大值,并确定所述最大值所对应的所述第一流媒体的第一时间点和所述第二流媒体的第二时间点。Calculating a maximum value of the τ value according to the calculation, and determining a first time point of the first streaming medium and a second time point of the second streaming medium corresponding to the maximum value.
- 一种流媒体对齐设备,包括:一个或多个处理器和存储有操作指令的存储介质,当运行所述存储介质中的操作指令时,所述处理器执行如下步骤:A streaming media alignment device includes: one or more processors and a storage medium storing operation instructions, when executing an operation instruction in the storage medium, the processor performs the following steps:获取第一流媒体和第二流媒体,所述第一流媒体和所述第二流媒体为同一流媒体的不同版本;Acquiring the first streaming media and the second streaming media, where the first streaming media and the second streaming media are different versions of the same streaming media;对所述第一流媒体和所述第二流媒体进行互相关计算,得到互相关最大值所对应的所述第一流媒体的第一时间点和所对应的所述第二流媒体的第二时间点,根据所述第一时间点和所述第二时间点确定所述第一流媒体和所述第二流媒体之间的时间偏移;Performing cross-correlation calculation on the first streaming media and the second streaming media to obtain a first time point of the first streaming media corresponding to the maximum correlation value of the cross-correlation and a second time of the corresponding second streaming media Point, determining, according to the first time point and the second time point, a time offset between the first streaming media and the second streaming media;依据所述时间偏移对所述第一流媒体和所述第二流媒体进行对齐。Aligning the first streaming media and the second streaming media according to the time offset.
- 根据权利要求7所述设备,在对所述第一流媒体和所述第二流媒体进行互相关计算之前,所述处理器还执行:对所述第一流媒体和第二流媒体进行降采样;The device according to claim 7, before performing cross-correlation calculation on the first streaming media and the second streaming media, the processor further performing: downsampling the first streaming media and the second streaming media;所述处理器执行对所述第一流媒体和所述第二流媒体进行互相关计算时,执行:对降采样后的所述第一流媒体和所述第二流媒体进行互相关计算。When performing the cross-correlation calculation on the first streaming media and the second streaming media, the processor performs: performing cross-correlation calculation on the downsampled first streaming media and the second streaming media.
- 根据权利要求7所述设备,在对所述第一流媒体和所述第二流媒体进行互相关计算之前,所述处理器还执行:截取所述第一流媒体和第二流媒体参 考时间段内的数据;The device according to claim 7, before performing cross-correlation calculation on the first streaming media and the second streaming media, the processor further performing: intercepting the first streaming media and the second streaming media parameter Data during the test period;所述处理器执行对所述第一流媒体和所述第二流媒体进行互相关计算时,执行:对所述第一流媒体和第二流媒体参考时间段内的数据进行互相关计算。When performing the cross-correlation calculation on the first streaming media and the second streaming media, the processor performs: performing cross-correlation calculation on the data in the first streaming media and the second streaming media reference time period.
- 根据权利要求3所述设备,所述处理器还执行:The apparatus of claim 3, said processor further executing:在截取所述第一流媒体和第二流媒体对应的参考时间段内的数据之前,依所述第一流媒体和所述第二流媒体的互相关时间差确定所述参考时间段。The reference time period is determined according to a cross-correlation time difference between the first streaming media and the second streaming media, before the data in the reference time period corresponding to the first streaming media and the second streaming media is intercepted.
- 根据权利要求10所述设备,所述处理器还执行:The apparatus of claim 10, said processor further executing:若所述互相关时间差超过预定阈值,则中止执行流媒体版本对齐的流程。If the cross-correlation time difference exceeds a predetermined threshold, the process of performing streaming media version alignment is suspended.
- 根据权利要求7至11任意一项所述设备,所述处理器通过如下公式计算所述第一流媒体和所述第二流媒体的互相关:The apparatus according to any one of claims 7 to 11, wherein the processor calculates a cross-correlation of the first streaming medium and the second streaming medium by:其中,x表示所述第一流媒体的数据,y表示所述第二流媒体的数据,ωτ表示窗函数,n为时间采样点; Where x represents data of the first streaming medium, y represents data of the second streaming medium, ω τ represents a window function, and n is a time sampling point;依据计算得到的τ值的最大处确定互相关性最大值,并确定所述最大值所对应的所述第一流媒体的第一时间点和所述第二流媒体的第二时间点。Determining a maximum correlation value according to the calculated maximum value of the τ value, and determining a first time point of the first streaming medium and a second time point of the second streaming medium corresponding to the maximum value.
- 一种非瞬时性的计算机可读存储介质,其上存储有计算机可执行指令,当计算机中运行所述可执行指令时,执行如下步骤:A non-transitory computer readable storage medium having stored thereon computer executable instructions for performing the following steps when the executable instructions are executed in a computer:获取第一流媒体和第二流媒体,所述第一流媒体和所述第二流媒体为同一流媒体的不同版本;Acquiring the first streaming media and the second streaming media, where the first streaming media and the second streaming media are different versions of the same streaming media;对所述第一流媒体和所述第二流媒体进行互相关计算,得到互相关最大值所对应的所述第一流媒体的第一时间点和所对应的所述第二流媒体的第二时间点,根据所述第一时间点和所述第二时间点确定所述第一流媒体和所述第二流媒体之间的时间偏移;Performing cross-correlation calculation on the first streaming media and the second streaming media to obtain a first time point of the first streaming media corresponding to the maximum correlation value of the cross-correlation and a second time of the corresponding second streaming media Point, determining, according to the first time point and the second time point, a time offset between the first streaming media and the second streaming media;依据所述时间偏移对所述第一流媒体和所述第二流媒体进行对齐。 Aligning the first streaming media and the second streaming media according to the time offset.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510154259.6 | 2015-04-02 | ||
CN201510154259.6A CN104978982B (en) | 2015-04-02 | 2015-04-02 | A kind of Streaming Media version alignment schemes, and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016155527A1 true WO2016155527A1 (en) | 2016-10-06 |
Family
ID=54275433
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/076853 WO2016155527A1 (en) | 2015-04-02 | 2016-03-21 | Streaming media alignment method, device and storage medium |
Country Status (3)
Country | Link |
---|---|
CN (1) | CN104978982B (en) |
HK (1) | HK1213082A1 (en) |
WO (1) | WO2016155527A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104978982B (en) * | 2015-04-02 | 2018-01-05 | 广州酷狗计算机科技有限公司 | A kind of Streaming Media version alignment schemes, and equipment |
CN106028158B (en) * | 2016-05-26 | 2019-04-16 | 成都掌中全景信息技术有限公司 | A kind of progress recognition methods based on more video sources |
CN108008930B (en) | 2017-11-30 | 2020-06-30 | 广州酷狗计算机科技有限公司 | Method and device for determining K song score |
CN108711415B (en) | 2018-06-11 | 2021-10-08 | 广州酷狗计算机科技有限公司 | Method, apparatus and storage medium for correcting time delay between accompaniment and dry sound |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7412380B1 (en) * | 2003-12-17 | 2008-08-12 | Creative Technology Ltd. | Ambience extraction and modification for enhancement and upmix of audio signals |
CN102025852A (en) * | 2009-09-23 | 2011-04-20 | 宝利通公司 | Detection and suppression of returned audio at near-end |
CN104125022A (en) * | 2013-11-27 | 2014-10-29 | 腾讯科技(成都)有限公司 | Audio transmission delay measuring method and system |
US20140323036A1 (en) * | 2013-04-29 | 2014-10-30 | Motorola Mobility Llc | Systems and Methods for Syncronizing Multiple Electronic Devices |
CN104978982A (en) * | 2015-04-02 | 2015-10-14 | 腾讯科技(深圳)有限公司 | Stream media version aligning method and stream media version aligning equipment |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6553086B1 (en) * | 1998-10-02 | 2003-04-22 | Lg Electronics, Inc. | Method and apparatus for recording time information for digital data streams |
CN103473011B (en) * | 2013-09-03 | 2016-04-13 | 小米科技有限责任公司 | A kind of mobile terminal performance detection method, device and mobile terminal |
CN104091600B (en) * | 2014-03-21 | 2015-11-11 | 腾讯科技(深圳)有限公司 | A kind of song method for detecting position and device |
-
2015
- 2015-04-02 CN CN201510154259.6A patent/CN104978982B/en active Active
-
2016
- 2016-01-27 HK HK16100879.8A patent/HK1213082A1/en unknown
- 2016-03-21 WO PCT/CN2016/076853 patent/WO2016155527A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7412380B1 (en) * | 2003-12-17 | 2008-08-12 | Creative Technology Ltd. | Ambience extraction and modification for enhancement and upmix of audio signals |
CN102025852A (en) * | 2009-09-23 | 2011-04-20 | 宝利通公司 | Detection and suppression of returned audio at near-end |
US20140323036A1 (en) * | 2013-04-29 | 2014-10-30 | Motorola Mobility Llc | Systems and Methods for Syncronizing Multiple Electronic Devices |
CN104125022A (en) * | 2013-11-27 | 2014-10-29 | 腾讯科技(成都)有限公司 | Audio transmission delay measuring method and system |
CN104978982A (en) * | 2015-04-02 | 2015-10-14 | 腾讯科技(深圳)有限公司 | Stream media version aligning method and stream media version aligning equipment |
Also Published As
Publication number | Publication date |
---|---|
HK1213082A1 (en) | 2016-06-24 |
CN104978982A (en) | 2015-10-14 |
CN104978982B (en) | 2018-01-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019154181A1 (en) | Display control method and mobile terminal | |
WO2017041664A1 (en) | Credit rating determination method and device, and storage medium | |
WO2020156123A1 (en) | Information processing method and terminal device | |
WO2016206491A1 (en) | Method and device for determining motion trajectory of target subject, and storage medium | |
WO2017215635A1 (en) | Sound effect processing method and mobile terminal | |
CN108334272B (en) | Control method and mobile terminal | |
WO2016116041A1 (en) | Information recommendation management method, device and system | |
CN106487984B (en) | A kind of method and apparatus adjusting volume | |
WO2019114522A1 (en) | Screen control method, screen control apparatus, and mobile terminal | |
CN108984066B (en) | Application icon display method and mobile terminal | |
WO2016155527A1 (en) | Streaming media alignment method, device and storage medium | |
WO2019154360A1 (en) | Interface switching method and mobile terminal | |
CN107665162B (en) | Application processing method and mobile terminal | |
CN111143002A (en) | Application sharing method, electronic equipment and computer readable storage medium | |
WO2020024770A1 (en) | Method for determining communication object, and mobile terminal | |
WO2017206853A1 (en) | Swiping response acceleration method and related products | |
WO2021147583A1 (en) | Method, apparatus and system for determining relative angle between smart devices, and smart device | |
CN111651030B (en) | Sensor detection method and device, storage medium and mobile terminal | |
WO2019120190A1 (en) | Dialing method and mobile terminal | |
CN107728920B (en) | Copying method and mobile terminal | |
TWI575458B (en) | Method, device and system for providing service based on application | |
CN108886548B (en) | Method for determining device power consumption of electronic equipment, electronic equipment and storage medium | |
CN108021315B (en) | Control method and mobile terminal | |
CN109947617B (en) | Method, terminal and readable storage medium for monitoring display content of application interface | |
JP7114747B2 (en) | Random access resource selection method and terminal device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16771282 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16771282 Country of ref document: EP Kind code of ref document: A1 |