WO2013152562A1 - Method and system for synchronizing mobile multimedia broadcasting and subtitles - Google Patents

Method and system for synchronizing mobile multimedia broadcasting and subtitles Download PDF

Info

Publication number
WO2013152562A1
WO2013152562A1 PCT/CN2012/077420 CN2012077420W WO2013152562A1 WO 2013152562 A1 WO2013152562 A1 WO 2013152562A1 CN 2012077420 W CN2012077420 W CN 2012077420W WO 2013152562 A1 WO2013152562 A1 WO 2013152562A1
Authority
WO
WIPO (PCT)
Prior art keywords
subtitle
time
audio
frame
relative
Prior art date
Application number
PCT/CN2012/077420
Other languages
French (fr)
Chinese (zh)
Inventor
夏智海
黄泽武
陈志兵
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2013152562A1 publication Critical patent/WO2013152562A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • H04N21/43074Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen of additional data with content streams on the same device, e.g. of EPG data or interactive icon with a TV program
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/414Specialised client platforms, e.g. receiver in car or embedded in a mobile appliance
    • H04N21/41407Specialised client platforms, e.g. receiver in car or embedded in a mobile appliance embedded in a portable device, e.g. video client on a mobile phone, PDA, laptop
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8126Monomedia components thereof involving additional data, e.g. news, sports, stocks, weather forecasts

Definitions

  • the present invention relates to the field of mobile multimedia broadcasting, and in particular, to a method and system for synchronizing mobile multimedia broadcast subtitles.
  • CMMB China Mobile Multimedia Broadcasting
  • CMMB complementary metal-oxide-semiconductor
  • the subtitles are embedded in pure audio data, and the subtitle form is fixed in a single manner;
  • the subtitle information is transmitted through the mobile multimedia broadcast data segment to solve the problem that the subtitles are fixed single, but this method cannot guarantee the synchronization of the subtitles and audio broadcasted, and the subtitles cannot be flexibly inserted, for example, the programs A and B are sequentially played, only Program B provides subtitles;
  • the subtitles are sent to the terminal, and the user who uses the terminal manually adjusts the playing time of the subtitles to synchronize the subtitles with the audio. This way the user experience is poor.
  • the terminal After the subtitle is sent to the terminal, the synchronization information of the subtitle and the audio is sent to the terminal, and the terminal adjusts the playing time of the subtitle according to the synchronization information. In this manner, the terminal reserves a large storage space to buffer the entire subtitle file, and needs Subtitles are sent for a long time in advance, resulting in poor real-time performance.
  • Embodiments of the present invention provide a mobile multimedia subtitle synchronization method and system to solve the technical problem of how to implement subtitle and audio synchronization.
  • the character string of the subtitle, the audio start playing time, and the time offset of the subtitle relative to the audio start playing time are encapsulated into the data segment of the audio sub-frame corresponding to the subtitle;
  • the data segment is transmitted to a mobile multimedia broadcast terminal.
  • the step of determining a time offset of the subtitle relative to an audio start playing time includes:
  • a time offset of the subtitle relative to the start time of the audio playback is determined based on the synchronization flag.
  • the method further includes determining, according to the start time of the subtitle in a local time zone, the encapsulation time, where:
  • the start time of the subtitle in the local time zone is M
  • the current time (TOD) provided by the local GPS is N
  • the transmission time difference from receiving the subtitle data packet to transmitting the data segment is R
  • the encapsulation time is S
  • M, N, R And the unit of S is seconds
  • the subtitle obtained according to the subtitle data packet is composed of multiple subtitles
  • the character string of the subtitle piece, the start playing time of the audio, and the time offset of the subtitle piece relative to the audio start playing time are encapsulated into an audio sub-frame corresponding to the subtitle. Data segment.
  • the step of determining, according to the synchronization mark, a time offset of the subtitle piece relative to an audio start playing time includes:
  • the time offset of the subtitle piece relative to the audio start playing time is calculated.
  • a receiving module configured to receive a subtitle data packet sent by the subtitle server and an audio sub-frame sent by the audio encoder
  • An obtaining module configured to acquire a subtitle from the subtitle data packet, and obtain an audio starting time from the audio sub-frame
  • a time offset determination module configured to determine a time offset of the subtitle relative to an audio start playing time
  • a packaging module configured to encapsulate a character string of the subtitle, an audio start playing time, and a time offset of the subtitle relative to an audio start playing time to an audio sub-frame corresponding to the subtitle when the encapsulation time arrives Data segment;
  • a sending module configured to send the data segment to the mobile multimedia broadcast terminal.
  • the time offset determining module is configured to determine a time offset of the subtitle relative to an audio start playing time in the following manner:
  • the encapsulating module is further configured to determine the encapsulation time according to a start time of the subtitle in a local time zone in the following manner:
  • the start time of the subtitle in the local time zone is M
  • the current time (TOD) provided by the local GPS is N
  • the transmission time difference from receiving the subtitle data packet to transmitting the data segment is R
  • the encapsulation time is S
  • M, N, R And the unit of S is seconds
  • the acquiring module is configured to obtain a subtitle composed of a plurality of subtitles from the subtitle data packet;
  • the time offset determining module is configured to determine, according to the synchronization flag, a time offset of the title film relative to the audio start playing time;
  • the encapsulating module is configured to, when the encapsulation time arrives, encapsulate a character string of the subtitle piece, a start playing time of the audio, and a time offset of the subtitle piece relative to the audio start playing time to the audio subtitle corresponding to the subtitle The data segment of the frame.
  • the time offset determining module is configured to determine, according to the synchronization flag, a time offset of the beginning time of the movie with respect to the audio according to the synchronization flag:
  • the time offset of the subtitle piece relative to the audio start playing time is calculated.
  • the data segment of the encapsulated audio sub-frame includes a time start of audio start time and a time offset of the subtitle relative to the audio start play time, so that the mobile multimedia broadcast terminal that receives the audio sub-frame can
  • the time offset of the audio start playing time determines the playing time of the subtitle, achieving the technical effect of synchronizing with the audio.
  • FIG. 1 is a flowchart of a mobile multimedia broadcast caption synchronization method according to an embodiment of the present invention
  • 2 is a schematic diagram of a package for transmitting data streams to a multiplexer by an application example caption server
  • FIG. 3 is a schematic diagram of a format of a data segment of an audio sub-frame in which caption information is encapsulated according to an application example
  • FIG. 4 is a mobile multimedia broadcast of the present embodiment.
  • the subtitle synchronization system forms a module diagram.
  • FIG. 1 is a flowchart of a mobile multimedia broadcast caption synchronization method according to an embodiment of the present invention.
  • S101 receiving a subtitle data packet sent by the subtitle server and an audio sub-frame sent by the audio encoder; S102: acquiring audio from the audio sub-frame to start playing time;
  • the subtitle data packet is also allowed to include information indicating the time-lapse data of the subtitle data packet (such as Coordinated Universal Time UTC time system), information indicating the time zone in which the subtitle data packet is located, and the start time of the subtitle in the time zone in which it is located.
  • information indicating the time-lapse data of the subtitle data packet such as Coordinated Universal Time UTC time system
  • information indicating the time zone in which the subtitle data packet is located such as Coordinated Universal Time UTC time system
  • the start time of the subtitle in the time zone in which it is located After receiving the data packet, correcting the subtitle in the time zone of the time zone in which the subtitle data packet is located according to the information indicating the time slot system of the subtitle data packet, the information indicating the time zone in which the subtitle data packet is located, and the time zone in which the receiving end is locally located. The start time of the local time zone.
  • the information indicating the time capping system of the caption data is UTC, indicating that the time zone of the caption data packet is the East 5 zone, the start time of the caption in the time zone where the caption is located is 0 o'clock, and the time zone of the local end of the receiving end is In the East 8th district, the revised subtitles start at 3 o'clock in the local time zone.
  • the subtitle data packet may further include other information according to different application requirements, for example, in order to clearly distinguish from the audio sub-frame, add a representation in the subtitle data packet.
  • the data packet is information of the subtitle; in order to enable the terminal to select the correct character set, the subtitle string encoding mode is added in the subtitle data packet; in order for the terminal to recognize the subtitle display duration and end the subtitle display at an appropriate time, the subtitle Increase the duration of subtitles in the packet.
  • S104 determines a time offset of the subtitle relative to the start time of the audio playing time
  • the encapsulation time is determined according to a start time of the subtitle in a local time zone, and the determining step includes: setting a start time of the subtitle in the local time zone to be M, and a current time TOD (Time of Day) provided by the local global positioning system (GPS) is N
  • the transmission time difference from receiving the subtitle data packet to the transmission data segment is R, the encapsulation time is S; the units of M, N, R, and S are seconds;
  • S106 sends the data segment to the mobile multimedia broadcast terminal.
  • the caption string parsed from the caption data packet may also be composed of a plurality of captions to facilitate long caption data transmission or to be applied to multi-lingual subtitles.
  • the caption may be determined according to the synchronization mark. a time offset of the audio start playing time; when the encapsulation time arrives, the start play time of the audio, the time offset of the subtitle piece relative to the audio start play time, and the character string of the subtitle piece are encapsulated to correspond to the subtitle The data segment of the audio sub-frame.
  • the mobile multimedia broadcast terminal After receiving the data segment of the audio sub-frame, the mobile multimedia broadcast terminal performs an operation of playing a character string of the subtitle according to a start time of the audio included in the data segment and a time offset of the subtitle relative to the start time of the audio; Encapsulated in the segment is the subtitle piece information, and the character string of the subtitle piece is played according to the start play time of the audio contained in the data segment and the time offset of the subtitle piece relative to the start time of the audio start time.
  • the mobile multimedia broadcast caption synchronization method of the above embodiment is further described below with a specific application example.
  • the application example relates to a subtitle server, an audio encoder and a multiplexer, wherein the data stream transmitted between the subtitle server and the multiplexer is encapsulated in UDP, and the encapsulation format is as shown in FIG. 2.
  • the subtitle synchronization method of this application example includes the following steps:
  • Step 1 The subtitle server sends a UDP encapsulated data stream to the multiplexer, where each UDP message body part is used to form a subtitle data packet; the audio encoder sends an audio sub-frame to the multiplexer; the subtitle data packet includes an indication The time zone information of the subtitle data packet, the subtitle update sequence number, the start time of the subtitle in the time zone in which it is located, the encoding mode, the number of subtitles, the subtitle slice 1 parameter, the subtitle slice 2 parameter subtitle slice n parameter, and the subtitle content, wherein
  • the subtitle update sequence number (4bit), when the subtitle is updated, the sequence number is incremented by 1.
  • the multiplexer can compare whether the received sequence number is carried in the subtitle data packet and whether the serial number carried in the received subtitle data packet is consistent, and whether the re-determination is re-determined.
  • the start time of the subtitle in its time zone (32bit);
  • the subtitle piece n parameter (80bit), which further contains three fields, respectively: subtitle piece n play time (32bit), subtitle piece n end time (32bit) and subtitle piece n length (16bit);
  • Subtitle content according to the number of subtitles included in the subtitle data packet and the length of the subtitle piece n, the corresponding subtitle piece content can be extracted from the subtitle content.
  • Step 2 After receiving the UDP encapsulated data stream, the multiplexer extracts the message body from the UDP to form the subtitle data packet; after receiving the audio sub-frame, the multiplexer extracts the audio starting time from the audio sub-frame;
  • Step 3 The multiplexer parses the information identifying the relationship between the subtitle and the subframe from the UDP encapsulated data stream, and determines a subframe corresponding to the subtitle according to the information;
  • Step 4 The multiplexer obtains, from the subtitle data packet, information indicating a time zone in which the subtitle data packet is located and a start time of the subtitle in a time zone in which the subtitle is located, and the multiplexer compares information about the time zone in which the subtitle data packet is located The time zone in which the multiplexer is located (ie, the local time zone) is compared. If they are consistent, the start time of the subtitle contained in the subtitle packet is the start time of the subtitle in the local time zone; if not, the subtitle is The start time of the time zone in which it is located is corrected to the start time of the subtitle in the local time zone;
  • Step 5 The multiplexer sets a synchronization mark of the subtitle and the audio sub-frame according to the start time of the subtitle in the local time zone and the time stamp of the audio sub-frame corresponding to the subtitle;
  • Step 6 the multiplexer determines, according to the synchronization mark, a time offset of the time when the subtitle piece starts playing with respect to the audio;
  • Step 7 The multiplexer obtains the current time TOD from the local GPS as N, and the multiplexer obtains the time difference of the received and sent data according to the debugging statistics as R, and the units of N and R are seconds;
  • Step 8 The multiplexer starts a timer.
  • the subtitle information is encapsulated into the data segment of the audio sub-frame corresponding to the subtitle.
  • the format of the data segment is as shown in FIG. 3.
  • / _ 3 ⁇ 4or(
  • J floor(R)
  • ⁇ ( ⁇ ) means round
  • means absolute value
  • means the start time of the local time zone of the subtitle, The unit is seconds;
  • the data segment is composed of a data segment header, a data unit 1, and a data unit 2 data unit ⁇ ; wherein, the data segment header is further composed of a data unit number, a data unit 1 parameter, a data unit 2 parameter, ..., a data unit ⁇ parameter, CRC composition; the data unit ⁇ parameter includes two fields of data unit type and data unit length;
  • the data unit n is sequentially divided by the service ID (16bit), the reserved field (16bit), the encoding mode (32bit), the reserved field, the audio start playing time (32bit), and the time offset of the subtitle piece n relative to the audio start playing time (16bit). , subtitle piece n continuous play time (32bit), subtitle piece n length (16bit) and subtitle content;
  • the multiplexer encapsulates the subframe into a multiframe, and converts the multiframe into a PMS stream and sends it to the mobile multimedia broadcast terminal.
  • FIG. 4 is a block diagram showing the components of the mobile multimedia broadcast caption synchronization system of the embodiment.
  • the system includes:
  • a receiving module configured to receive a subtitle data packet sent by the subtitle server and an audio sub-frame sent by the audio encoder
  • Obtaining a module configured to acquire a subtitle according to the subtitle data packet, and obtain an audio start playback time according to the audio sub-frame;
  • a time offset determining module configured to determine a time offset of the subtitle relative to an audio start playing time
  • the time offset determining module may be configured to: obtain information about a relationship between a subtitle and an audio sub-frame from a data stream that includes the subtitle data packet; and determine an audio sub-subtitle corresponding to the subtitle according to the information of the subtitle and the audio sub-frame relationship a frame; setting a synchronization flag of the subtitle and the audio sub-frame according to a start time of the subtitle in a local time zone and a time stamp of the audio sub-frame corresponding to the subtitle; determining, according to the synchronization flag, a subtitle relative to an audio start playing time Time offset
  • the encapsulating module is configured to, when the encapsulation time arrives, encapsulate a character string of the subtitle, an audio start playing time, and a time offset of the subtitle relative to the audio start playing time to the data of the audio sub-frame corresponding to the subtitle Paragraph
  • the start time of the subtitle in the local time zone is M
  • the current time TOD provided by the local GPS is N
  • the transmission time difference from receiving the subtitle data packet to the transmission data segment is R
  • the encapsulation time is S; units of M, N, R and S In seconds;
  • a sending module configured to send the data segment to the mobile multimedia broadcast terminal.
  • the subtitle string obtained by the obtaining module according to the subtitle data packet in the foregoing embodiment may be composed of a plurality of subtitle chips
  • the time offset determining module is configured to determine a time offset of the subtitle piece relative to the audio start playing time according to the synchronization mark;
  • the time offset determining module can start a timer, set a timing length of the timer and a synchronization mark equivalent; when the timing length is reached, calculate a time offset of the subtitle piece relative to the audio start playing time.
  • a packaging module configured to: when the encapsulation time arrives, time start playback time of the audio, time offset of the subtitle piece relative to the audio start play time, and a character string of the subtitle piece to the audio sub-frame corresponding to the subtitle Data segment.
  • each module/unit in the foregoing embodiment may be implemented in the form of hardware, or may use software functions.
  • the form of the module is implemented. The invention is not limited to any specific form of combination of hardware and software.
  • the data segment of the encapsulated audio sub-frame includes a time start of audio start time and a time offset of the subtitle relative to the audio start play time, so that the mobile multimedia broadcast terminal receiving the audio sub-frame can The time offset of the subtitle relative to the start time of the audio determines the playback time of the subtitle, achieving the technical effect of synchronizing with the audio.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)
  • Television Systems (AREA)

Abstract

A method and a system for synchronizing mobile multimedia broadcasting and subtitles. The method comprises: receiving a subtitle data packet sent by a subtitle server and an audio subframe sent by an audio coder; obtaining the start time of audio play from the audio subframe; obtaining a subtitle from the subtitle data packet; determining the time offset of the subtitle relative to the start time of audio play; when encapsulation time is up, encapsulating character strings of the subtitle, the start time of audio play and the time offset of the subtitle relative to the start time of audio play into a data segment of the audio subframe corresponding to the subtitle; and sending the data segment to a mobile multimedia broadcasting terminal.

Description

一种移动多媒体广播字幕同步的方法和系统  Method and system for synchronizing mobile multimedia broadcast subtitles
技术领域 Technical field
本发明涉及移动多媒体广播领域, 尤其涉及一种移动多媒体广播字幕同 步的方法和系统。  The present invention relates to the field of mobile multimedia broadcasting, and in particular, to a method and system for synchronizing mobile multimedia broadcast subtitles.
背景技术 Background technique
随着中国移动多媒体广播(CMMB ) 的商用和用户数量的增加, 用户群 体和用户需求呈现多元化的倾向。 提供多样的灵活的业务是提高用户体检, 增加用户忠诚度的手段之一。  As the number of commercial and subscribers of China Mobile Multimedia Broadcasting (CMMB) increases, the user community and user needs tend to diversify. Providing a variety of flexible services is one of the means to improve user physical examination and increase user loyalty.
现有 CMMB中, 为纯音频节目提供字幕的方式一般有以下几种: 将字幕内嵌在纯音频数据中, 这种方式字幕形式固定单一;  In the existing CMMB, there are generally the following ways to provide subtitles for pure audio programs: The subtitles are embedded in pure audio data, and the subtitle form is fixed in a single manner;
将字幕信息通过移动多媒体广播数据段发送解决了字幕固定单一的问 题, 但是这种方式不能保证播出的字幕和音频同步, 同时也无法灵活地插入 字幕, 如节目 A和 B顺序播放, 仅为节目 B提供字幕;  The subtitle information is transmitted through the mobile multimedia broadcast data segment to solve the problem that the subtitles are fixed single, but this method cannot guarantee the synchronization of the subtitles and audio broadcasted, and the subtitles cannot be flexibly inserted, for example, the programs A and B are sequentially played, only Program B provides subtitles;
将字幕发送到终端, 由使用终端的用户手动调整字幕的播放时间, 以实 现字幕与音频同步, 这种方式用户体验性差。  The subtitles are sent to the terminal, and the user who uses the terminal manually adjusts the playing time of the subtitles to synchronize the subtitles with the audio. This way the user experience is poor.
将字幕发送到终端后, 再将字幕与音频的同步信息发送至终端, 由终端 根据该同步信息调整字幕的播放时间, 这种方式需要终端预留较大的存储空 间緩存整个字幕文件, 且需要字幕提前很长时间发送导致实时性差。  After the subtitle is sent to the terminal, the synchronization information of the subtitle and the audio is sent to the terminal, and the terminal adjusts the playing time of the subtitle according to the synchronization information. In this manner, the terminal reserves a large storage space to buffer the entire subtitle file, and needs Subtitles are sent for a long time in advance, resulting in poor real-time performance.
发明内容 Summary of the invention
本发明实施例提供了一种移动多媒体字幕同步方法和系统, 以解决如何 实现字幕与音频同步的技术问题。  Embodiments of the present invention provide a mobile multimedia subtitle synchronization method and system to solve the technical problem of how to implement subtitle and audio synchronization.
本发明实施例的移动多媒体广播字幕同步的方法包括:  The method for synchronizing mobile multimedia broadcast captions in the embodiment of the present invention includes:
接收字幕服务器发送的字幕数据包和音频编码器发送的音频子帧; 从所述音频子帧中获取音频开始播放时间; 从所述字幕数据包中获取字幕; Receiving a subtitle data packet sent by the subtitle server and an audio sub-frame sent by the audio encoder; acquiring audio from the audio sub-frame to start playing time; Obtaining a subtitle from the subtitle data packet;
确定字幕相对于音频开始播放时间的时间偏移;  Determining the time offset of the subtitle relative to the start time of the audio;
在封装时间到达时, 将所述字幕的字符串、 音频开始播放时间、 字幕相 对于音频开始播放时间的时间偏移封装到与所述字幕对应的音频子帧的数据 段; 以及  When the encapsulation time arrives, the character string of the subtitle, the audio start playing time, and the time offset of the subtitle relative to the audio start playing time are encapsulated into the data segment of the audio sub-frame corresponding to the subtitle;
将所述数据段发送至移动多媒体广播终端。  The data segment is transmitted to a mobile multimedia broadcast terminal.
可选的, 确定所述字幕相对于音频开始播放时间的时间偏移的步骤包 括:  Optionally, the step of determining a time offset of the subtitle relative to an audio start playing time includes:
从包含所述字幕数据包的数据流中获取字幕与音频子帧关系的信息; 4艮据所述字幕与音频子帧关系的信息确定与字幕对应的音频子帧; 根据该字幕在本地时区的开始时间及所述与字幕对应的音频子帧的时间 戳设置字幕与该音频子帧的同步标记; 以及  Obtaining information about a relationship between a subtitle and an audio sub-frame from a data stream including the subtitle data packet; determining an audio sub-frame corresponding to the subtitle according to the information of the subtitle and the audio sub-frame relationship; according to the subtitle in a local time zone a start time and a time stamp of the audio sub-frame corresponding to the subtitle setting a synchronization mark of the subtitle and the audio sub-frame;
根据该同步标记确定字幕相对于音频开始播放时间的时间偏移。  A time offset of the subtitle relative to the start time of the audio playback is determined based on the synchronization flag.
可选的, 上述方法还包括根据所述字幕在本地时区的开始时间确定所述 封装时间, 其中:  Optionally, the method further includes determining, according to the start time of the subtitle in a local time zone, the encapsulation time, where:
设字幕在本地时区的开始时间为 M, 本地 GPS提供的当前时间 ( TOD ) 为 N, 从接收字幕数据包到发送所述数据段的收发时差为 R,封装时间为 S; M、 N、 R和 S的单位为秒;  The start time of the subtitle in the local time zone is M, the current time (TOD) provided by the local GPS is N, and the transmission time difference from receiving the subtitle data packet to transmitting the data segment is R, and the encapsulation time is S; M, N, R And the unit of S is seconds;
所述 M与 N的时间差为 / = floor(\M - N|) , floor )表示取整, 卜|表示取绝 对值;  The time difference between M and N is / = floor(\M - N|) , floor ) means rounding, and 卜| means taking the absolute value;
J = floor ;  J = floor ;
则, S=I+J。  Then, S=I+J.
可选的, 根据所述字幕数据包获取的字幕由多个字幕片组成;  Optionally, the subtitle obtained according to the subtitle data packet is composed of multiple subtitles;
根据所述同步标记确定所述字幕片相对于音频开始播放时间的时间偏 移;  Determining, according to the synchronization mark, a time offset of the subtitle piece relative to an audio start playing time;
在所述封装时间到达时, 将字幕片的字符串、 音频的开始播放时间、 字 幕片相对于音频开始播放时间的时间偏移封装到与所述字幕对应的音频子帧 的数据段。 When the encapsulation time arrives, the character string of the subtitle piece, the start playing time of the audio, and the time offset of the subtitle piece relative to the audio start playing time are encapsulated into an audio sub-frame corresponding to the subtitle. Data segment.
可选的, 所述根据该同步标记确定所述字幕片相对于音频开始播放时间 的时间偏移的步骤包括:  Optionally, the step of determining, according to the synchronization mark, a time offset of the subtitle piece relative to an audio start playing time includes:
开启一定时器, 设置该定时器的定时长度与同步标记等值;  Turn on a timer, set the timing length of the timer and the value of the synchronization flag;
当达到所述定时长度时, 计算所述字幕片相对于音频开始播放时间的时 间偏移。  When the timing length is reached, the time offset of the subtitle piece relative to the audio start playing time is calculated.
本发明实施例的移动多媒体广播字幕同步的系统包括: The system for moving multimedia broadcast subtitle synchronization in the embodiment of the present invention includes:
接收模块, 其设置为接收字幕服务器发送的字幕数据包和音频编码器发 送的音频子帧;  a receiving module, configured to receive a subtitle data packet sent by the subtitle server and an audio sub-frame sent by the audio encoder;
获取模块, 其设置为从所述字幕数据包中获取字幕, 从所述音频子帧中 获取音频开始播放时间;  An obtaining module, configured to acquire a subtitle from the subtitle data packet, and obtain an audio starting time from the audio sub-frame;
时间偏移确定模块, 其设置为确定所述字幕相对于音频开始播放时间的 时间偏移;  a time offset determination module configured to determine a time offset of the subtitle relative to an audio start playing time;
封装模块, 其设置为在所述封装时间到达时, 将所述字幕的字符串、 音 频开始播放时间、 字幕相对于音频开始播放时间的时间偏移封装到与所述字 幕对应的音频子帧的数据段; 以及  a packaging module, configured to encapsulate a character string of the subtitle, an audio start playing time, and a time offset of the subtitle relative to an audio start playing time to an audio sub-frame corresponding to the subtitle when the encapsulation time arrives Data segment;
发送模块, 其设置为将所述数据段发送至移动多媒体广播终端。  And a sending module, configured to send the data segment to the mobile multimedia broadcast terminal.
可选的, 所述时间偏移确定模块是设置为以如下方式确定所述字幕相对 于音频开始播放时间的时间偏移:  Optionally, the time offset determining module is configured to determine a time offset of the subtitle relative to an audio start playing time in the following manner:
从包含所述字幕数据包的数据流中获取字幕与音频子帧关系的信息; 根 据所述字幕与音频子帧关系的信息确定与字幕对应的音频子帧; 根据该字幕 在本地时区的开始时间及所述与字幕对应的音频子帧的时间戳设置字幕与该 音频子帧的同步标记; 根据该同步标记确定字幕相对于音频开始播放时间的 时间偏移。  Acquiring information of a relationship between a subtitle and an audio sub-frame from a data stream that includes the subtitle data packet; determining an audio sub-frame corresponding to the subtitle according to the information of the subtitle and the audio sub-frame relationship; according to the start time of the subtitle in the local time zone And the time stamp of the audio sub-frame corresponding to the subtitle sets a synchronization mark of the subtitle and the audio sub-frame; and determining, according to the synchronization mark, a time offset of the sub-title relative to the audio start playing time.
可选的, 所述封装模块还设置为以如下方式根据所述字幕在本地时区的 开始时间确定所述封装时间: 设字幕在本地时区的开始时间为 M, 本地 GPS提供的当前时间 ( TOD ) 为 N, 从接收字幕数据包到发送所述数据段的收发时差为 R,封装时间为 S; M、 N、 R和 S的单位为秒; Optionally, the encapsulating module is further configured to determine the encapsulation time according to a start time of the subtitle in a local time zone in the following manner: The start time of the subtitle in the local time zone is M, the current time (TOD) provided by the local GPS is N, and the transmission time difference from receiving the subtitle data packet to transmitting the data segment is R, and the encapsulation time is S; M, N, R And the unit of S is seconds;
设所述 M与 N的时间差为 / = floor(\M - N|) , floor )表示取整, 卜|表示取 绝对值;  Let the time difference between M and N be / = floor(\M - N|) , floor ) denote rounding, and b| denote absolute value;
J = floor ; 则, S=I+J。  J = floor ; Then, S=I+J.
可选的, 所述获取模块是设置为从所述字幕数据包中获取由多个字幕片 组成的字幕;  Optionally, the acquiring module is configured to obtain a subtitle composed of a plurality of subtitles from the subtitle data packet;
所述时间偏移确定模块是设置为才艮据所述同步标记确定所述字幕片相对 于音频开始播放时间的时间偏移;  The time offset determining module is configured to determine, according to the synchronization flag, a time offset of the title film relative to the audio start playing time;
所述封装模块是设置为在所述封装时间到达时, 将字幕片的字符串、 音 频的开始播放时间、 字幕片相对于音频开始播放时间的时间偏移封装到与所 述字幕对应的音频子帧的数据段。  The encapsulating module is configured to, when the encapsulation time arrives, encapsulate a character string of the subtitle piece, a start playing time of the audio, and a time offset of the subtitle piece relative to the audio start playing time to the audio subtitle corresponding to the subtitle The data segment of the frame.
可选的, 所述时间偏移确定模块是设置为以如下方式才艮据该同步标记确 定所述字幕片相对于音频开始播放时间的时间偏移:  Optionally, the time offset determining module is configured to determine, according to the synchronization flag, a time offset of the beginning time of the movie with respect to the audio according to the synchronization flag:
开启一定时器, 设置该定时器的定时长度与同步标记等值;  Turn on a timer, set the timing length of the timer and the value of the synchronization flag;
当达到所述定时长度时, 计算所述字幕片相对于音频开始播放时间的时 间偏移。  When the timing length is reached, the time offset of the subtitle piece relative to the audio start playing time is calculated.
上述技术方案, 封装后的音频子帧的数据段中包含了音频开始播放时间 和字幕相对于音频开始播放时间的时间偏移, 使得接收到该音频子帧的移动 多媒体广播终端能够根据字幕相对于音频开始播放时间的时间偏移确定字幕 的播放时间, 达到与音频同步的技术效果。 In the above technical solution, the data segment of the encapsulated audio sub-frame includes a time start of audio start time and a time offset of the subtitle relative to the audio start play time, so that the mobile multimedia broadcast terminal that receives the audio sub-frame can The time offset of the audio start playing time determines the playing time of the subtitle, achieving the technical effect of synchronizing with the audio.
附图概述 BRIEF abstract
图 1为本实施例的移动多媒体广播字幕同步方法流程图; 图 2为本应用示例字幕服务器向复用器传输数据流的封装示意图; 图 3为本应用示例封装了字幕信息的音频子帧的数据段的格式示意图; 图 4为本实施例的移动多媒体广播字幕同步系统组成模块图。 本发明的较佳实施方式 1 is a flowchart of a mobile multimedia broadcast caption synchronization method according to an embodiment of the present invention; 2 is a schematic diagram of a package for transmitting data streams to a multiplexer by an application example caption server; FIG. 3 is a schematic diagram of a format of a data segment of an audio sub-frame in which caption information is encapsulated according to an application example; FIG. 4 is a mobile multimedia broadcast of the present embodiment. The subtitle synchronization system forms a module diagram. Preferred embodiment of the invention
下文中将结合附图对本发明的实施例进行详细说明。 需要说明的是, 在 不冲突的情况下, 本申请中的实施例及实施例中的特征可以相互任意组合。  Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
图 1为本实施例的移动多媒体广播字幕同步方法流程图。  FIG. 1 is a flowchart of a mobile multimedia broadcast caption synchronization method according to an embodiment of the present invention.
S101 接收字幕服务器发送的字幕数据包和音频编码器发送的音频子帧; S102从所述音频子帧中获取音频开始播放时间;  S101: receiving a subtitle data packet sent by the subtitle server and an audio sub-frame sent by the audio encoder; S102: acquiring audio from the audio sub-frame to start playing time;
S103从所述字幕数据包中获取字幕;  S103: acquiring a subtitle from the subtitle data packet;
在实际应用中, 也允许字幕数据包包含指示字幕数据包釆用时间体系的 信息(如协调世界时 UTC时间体系)、 指示字幕数据包所处时区的信息以及 字幕在其所处时区的开始时间; 当接收到该数据包后, 根据指示字幕数据包 釆用时间体系的信息、 指示字幕数据包所处时区的信息以及接收端本地所处 时区将字幕在其所处时区的开始时间修正为字幕在本地时区的开始时间。如, 指示字幕数据包釆用时间体系的信息为 UTC, 指示字幕数据包所处时区的信 息为东 5区, 字幕在其所处时区的开始时间为 0点整, 接收端本地所处时区 为东 8区, 修正后的字幕在本地时区的开始时间为 3点整。  In practical applications, the subtitle data packet is also allowed to include information indicating the time-lapse data of the subtitle data packet (such as Coordinated Universal Time UTC time system), information indicating the time zone in which the subtitle data packet is located, and the start time of the subtitle in the time zone in which it is located. After receiving the data packet, correcting the subtitle in the time zone of the time zone in which the subtitle data packet is located according to the information indicating the time slot system of the subtitle data packet, the information indicating the time zone in which the subtitle data packet is located, and the time zone in which the receiving end is locally located. The start time of the local time zone. For example, the information indicating the time capping system of the caption data is UTC, indicating that the time zone of the caption data packet is the East 5 zone, the start time of the caption in the time zone where the caption is located is 0 o'clock, and the time zone of the local end of the receiving end is In the East 8th district, the revised subtitles start at 3 o'clock in the local time zone.
字幕数据包除了包含上述记载的信息外, 根据不同的应用需要, 所述字 幕数据包还可包含其他信息, 如, 为了明显地与音频子帧相区分, 在所述字 幕数据包中增加表示本数据包为字幕的信息; 为了使终端选用正确字符集, 在所述字幕数据包中增加字幕字符串编码方式; 为了终端能识别字幕展示持 续时间并在合适的时间结束字幕展示, 在所述字幕数据包中增加字幕持续时 间。  In addition to the information described above, the subtitle data packet may further include other information according to different application requirements, for example, in order to clearly distinguish from the audio sub-frame, add a representation in the subtitle data packet. The data packet is information of the subtitle; in order to enable the terminal to select the correct character set, the subtitle string encoding mode is added in the subtitle data packet; in order for the terminal to recognize the subtitle display duration and end the subtitle display at an appropriate time, the subtitle Increase the duration of subtitles in the packet.
S104确定字幕相对于音频开始播放时间的时间偏移;  S104 determines a time offset of the subtitle relative to the start time of the audio playing time;
具体为: 从包含所述字幕数据包的数据流中获取字幕与音频子帧关系的信息; 才艮据所述字幕与音频子帧关系的信息确定与字幕对应的音频子帧; 根据该字幕在本地时区的开始时间及所述与字幕对应的音频子帧的时间 戳设置字幕与该音频子帧的同步标记; 其中, 字幕在本地时区的开始时间可 从所述字幕数据包中获取; Specifically: Obtaining information about a relationship between a subtitle and an audio sub-frame from a data stream including the subtitle data packet; determining an audio sub-frame corresponding to the subtitle according to the information of the subtitle and the audio sub-frame relationship; according to the subtitle in a local time zone a start time and a time stamp of the audio sub-frame corresponding to the subtitle setting a synchronization mark of the subtitle and the audio sub-frame; wherein a start time of the sub-title in the local time zone is obtainable from the subtitle data packet;
根据该同步标记确定字幕相对于音频开始播放时间的时间偏移;  Determining, according to the synchronization mark, a time offset of the subtitle relative to the start time of playing of the audio;
S105在封装时间到达时, 将所述字幕的字符串、 音频开始播放时间、 字 幕相对于音频开始播放时间的时间偏移封装到与所述字幕对应的音频子帧的 数据段;  S105, when the encapsulation time arrives, encapsulating a character string of the subtitle, an audio start playing time, and a time offset of the subtitle relative to the audio start playing time into a data segment of the audio sub-frame corresponding to the subtitle;
所述封装时间根据所述字幕在本地时区的开始时间确定,确定步骤包括: 设字幕在本地时区的开始时间为 M, 本地环球定位系统(GPS )提供的 当前时间 TOD ( Time of Day )为 N, 从接收字幕数据包到发送数据段的收发 时差为 R,封装时间为 S; M、 N、 R和 S的单位为秒;  The encapsulation time is determined according to a start time of the subtitle in a local time zone, and the determining step includes: setting a start time of the subtitle in the local time zone to be M, and a current time TOD (Time of Day) provided by the local global positioning system (GPS) is N The transmission time difference from receiving the subtitle data packet to the transmission data segment is R, the encapsulation time is S; the units of M, N, R, and S are seconds;
设所述 M与 N的时间差为 / = floor(\M - N|) , floor )表示取整, 卜|表示取 绝对值;  Let the time difference between M and N be / = floor(\M - N|) , floor ) denote rounding, and b| denote absolute value;
J = floor ;  J = floor ;
则, S=I+J。  Then, S=I+J.
S106将所述数据段发送至移动多媒体广播终端。  S106 sends the data segment to the mobile multimedia broadcast terminal.
上述从所述字幕数据包中解析出的字幕字符串还可由多个字幕片组成以 方便较长字幕数据传输或者应用于多种语言字幕, 此时, 可根据同步标记确 定所述字幕片相对于音频开始播放时间的时间偏移;在所述封装时间到达时 , 将音频的开始播放时间、 字幕片相对于音频开始播放时间的时间偏移、 字幕 片的字符串封装到与所述字幕对应的音频子帧的数据段。  The caption string parsed from the caption data packet may also be composed of a plurality of captions to facilitate long caption data transmission or to be applied to multi-lingual subtitles. At this time, the caption may be determined according to the synchronization mark. a time offset of the audio start playing time; when the encapsulation time arrives, the start play time of the audio, the time offset of the subtitle piece relative to the audio start play time, and the character string of the subtitle piece are encapsulated to correspond to the subtitle The data segment of the audio sub-frame.
移动多媒体广播终端接收到上述音频子帧的数据段后, 根据数据段中包 含的音频的开始播放时间、 字幕相对于音频开始播放时间的时间偏移, 进行 播放字幕的字符串的操作; 如果数据段中封装的是字幕片信息, 根据数据段 中包含的音频的开始播放时间、 字幕片相对于音频开始播放时间的时间偏移 来播放字幕片的字符串。 下面以一个具体的应用示例, 对上述实施例的移动多媒体广播字幕同步 方法进行进一步说明。 该应用示例涉及字幕服务器、 音频编码器以及复用器, 其中字幕服务器和复用器之间传输的数据流釆用 UDP封装, 封装格式如图 2 所示。 After receiving the data segment of the audio sub-frame, the mobile multimedia broadcast terminal performs an operation of playing a character string of the subtitle according to a start time of the audio included in the data segment and a time offset of the subtitle relative to the start time of the audio; Encapsulated in the segment is the subtitle piece information, and the character string of the subtitle piece is played according to the start play time of the audio contained in the data segment and the time offset of the subtitle piece relative to the start time of the audio start time. The mobile multimedia broadcast caption synchronization method of the above embodiment is further described below with a specific application example. The application example relates to a subtitle server, an audio encoder and a multiplexer, wherein the data stream transmitted between the subtitle server and the multiplexer is encapsulated in UDP, and the encapsulation format is as shown in FIG. 2.
本应用实例的字幕同步方法包括以下步骤:  The subtitle synchronization method of this application example includes the following steps:
步骤 1 , 字幕服务器向复用器发送 UDP封装的数据流, 其中每个 UDP 的消息体部分用于组成字幕数据包; 音频编码器向复用器发送音频子帧; 所述字幕数据包包括指示字幕数据包所处时区的信息、 字幕更新序号、 字幕在其所处时区的开始时间、 编码方式、 字幕片数、 字幕片 1参数、 字幕 片 2参数 字幕片 n参数以及字幕内容, 其中,  Step 1 : The subtitle server sends a UDP encapsulated data stream to the multiplexer, where each UDP message body part is used to form a subtitle data packet; the audio encoder sends an audio sub-frame to the multiplexer; the subtitle data packet includes an indication The time zone information of the subtitle data packet, the subtitle update sequence number, the start time of the subtitle in the time zone in which it is located, the encoding mode, the number of subtitles, the subtitle slice 1 parameter, the subtitle slice 2 parameter subtitle slice n parameter, and the subtitle content, wherein
指示字幕数据包所处时区的信息 (4bit );  Information indicating the time zone in which the subtitle packet is located (4bit);
字幕更新序号(4bit ) , 当字幕更新时该序号加 1 , 复用器可通过比较接 收到的字幕数据包中携带该序号和已接收的字幕数据包中携带的该序号是否 一致, 决定是否重新同步字幕在本地时区的开始时间;  The subtitle update sequence number (4bit), when the subtitle is updated, the sequence number is incremented by 1. The multiplexer can compare whether the received sequence number is carried in the subtitle data packet and whether the serial number carried in the received subtitle data packet is consistent, and whether the re-determination is re-determined. The start time of the synchronized subtitles in the local time zone;
字幕在其所处时区的开始时间 (32bit ) ;  The start time of the subtitle in its time zone (32bit);
字幕编码方式(bit ) ;  Subtitle coding method (bit);
字幕片数 ( 8bit ) ;  Number of subtitles ( 8bit ) ;
字幕片 n参数(80bit ) , 其中又包含 3个字段, 分别是: 字幕片 n播放 时间 ( 32bit ) 、 字幕片 n结束时间 ( 32bit )和字幕片 n长度( 16bit ) ;  The subtitle piece n parameter (80bit), which further contains three fields, respectively: subtitle piece n play time (32bit), subtitle piece n end time (32bit) and subtitle piece n length (16bit);
字幕内容, 根据字幕数据包中包含的字幕片数和字幕片 n长度可以从字 幕内容中提取相应的字幕片内容。  Subtitle content, according to the number of subtitles included in the subtitle data packet and the length of the subtitle piece n, the corresponding subtitle piece content can be extracted from the subtitle content.
步骤 2, 复用器接收到 UDP封装的数据流后, 从所述 UDP中提取消息 体组成上述字幕数据包; 复用器接收到音频子帧后, 从音频子帧中提取音频 开始播放时间;  Step 2: After receiving the UDP encapsulated data stream, the multiplexer extracts the message body from the UDP to form the subtitle data packet; after receiving the audio sub-frame, the multiplexer extracts the audio starting time from the audio sub-frame;
步骤 3 , 复用器从 UDP封装的数据流中解析出标识字幕与子帧关系的信 息, 根据该信息确定与字幕对应的子帧; 步骤 4, 复用器从所述字幕数据包中获取指示字幕数据包所处时区的信 息以及字幕在其所处时区的开始时间, 复用器将所述指示字幕数据包所处时 区的信息与复用器所在的时区 (即本地时区)进行比较, 如果一致, 则字幕 数据包中包含的字幕在其所处时区的开始时间即为字幕在本地时区的开始时 间; 如果不一致, 则将字幕在其所处时区的开始时间修正为字幕在本地时区 的开始时间; Step 3: The multiplexer parses the information identifying the relationship between the subtitle and the subframe from the UDP encapsulated data stream, and determines a subframe corresponding to the subtitle according to the information; Step 4: The multiplexer obtains, from the subtitle data packet, information indicating a time zone in which the subtitle data packet is located and a start time of the subtitle in a time zone in which the subtitle is located, and the multiplexer compares information about the time zone in which the subtitle data packet is located The time zone in which the multiplexer is located (ie, the local time zone) is compared. If they are consistent, the start time of the subtitle contained in the subtitle packet is the start time of the subtitle in the local time zone; if not, the subtitle is The start time of the time zone in which it is located is corrected to the start time of the subtitle in the local time zone;
步骤 5 , 复用器根据该字幕在本地时区的开始时间及所述与字幕对应的 音频子帧的时间戳设置字幕与该音频子帧的同步标记;  Step 5: The multiplexer sets a synchronization mark of the subtitle and the audio sub-frame according to the start time of the subtitle in the local time zone and the time stamp of the audio sub-frame corresponding to the subtitle;
步骤 6, 复用器根据该同步标记确定所述字幕片相对于音频开始播放时 间的时间偏移;  Step 6, the multiplexer determines, according to the synchronization mark, a time offset of the time when the subtitle piece starts playing with respect to the audio;
步骤 7 , 复用器从本地 GPS获得当前时间 TOD为 N, 复用器根据调试统 计获取其收发数据时差为 R, N和 R单位为秒;  Step 7: The multiplexer obtains the current time TOD from the local GPS as N, and the multiplexer obtains the time difference of the received and sent data according to the debugging statistics as R, and the units of N and R are seconds;
步骤 8, 复用器启动一定时器, 当定时时间到达 S= S=I+J时, 将字幕信 息封装到所述与字幕对应的音频子帧的数据段,该数据段的格式如图 3所示; 其中, / = _ ¾or(|M- N|) , J = floor(R) , ΟΟΓ(·)表示取整, |·|表示取绝对值, Μ 表示字幕在本地时区的开始时间, 单位为秒;  Step 8. The multiplexer starts a timer. When the timing time reaches S=S=I+J, the subtitle information is encapsulated into the data segment of the audio sub-frame corresponding to the subtitle. The format of the data segment is as shown in FIG. 3. Where; / = _ 3⁄4or(|M- N|) , J = floor(R) , ΟΟΓ(·) means round, |·| means absolute value, Μ means the start time of the local time zone of the subtitle, The unit is seconds;
该数据段由数据段头、 数据单元 1、 数据单元 2 数据单元 η组成; 其中,数据段头又由数据单元数、数据单元 1参数、数据单元 2参数、 ...、 数据单元 η参数、 CRC组成; 数据单元 η参数包括数据单元类型和数据单元 长度这两个字段;  The data segment is composed of a data segment header, a data unit 1, and a data unit 2 data unit η; wherein, the data segment header is further composed of a data unit number, a data unit 1 parameter, a data unit 2 parameter, ..., a data unit η parameter, CRC composition; the data unit η parameter includes two fields of data unit type and data unit length;
数据单元 η依次由业务 ID( 16bit )、保留字段( 16bit )、编码方式( 32bit )、 保留字段、 音频开始播放时间 (32bit ) 、 字幕片 n相对于音频开始播放时间 的时间偏移( 16bit )、字幕片 n持续播放时间( 32bit )、字幕片 n长度( 16bit ) 以及字幕内容组成;  The data unit n is sequentially divided by the service ID (16bit), the reserved field (16bit), the encoding mode (32bit), the reserved field, the audio start playing time (32bit), and the time offset of the subtitle piece n relative to the audio start playing time (16bit). , subtitle piece n continuous play time (32bit), subtitle piece n length (16bit) and subtitle content;
开始封装的第 1 秒第 1 片字幕的开始播放时间=音频开始播放时间 + - N\ -I )+ ( R _J ) +字幕片 1相对于音频开始播放时间的时间偏移] *22.5; 第 1 秒第 n 片字幕的开始播放时间 =音频开始播放时间 +
Figure imgf000010_0001
- N\ -I )+
Start time of the first subtitle of the first package to be packaged = audio start playback time + - N\ -I ) + ( R _J ) + time offset of the subtitle slice 1 relative to the start time of the audio] *22.5; 1 second n-th subtitle start time = audio start time +
Figure imgf000010_0001
- N\ -I )+
( R _J ) +字幕片 n相对于音频开始播放时间的时间偏移 *1000]*22.5; 第 H秒第 n片字幕的开始播放时间 =音频开始播放时间 + [( \M - N\ -I )+ ( R _ J ) + (字幕片 n相对于音频开始播放时间的时间偏移 -H ) *1000]*22.5; 步骤 9, 复用器将该子帧封装到复帧, 并将该复帧转换为 PMS流发送给 移动多媒体广播终端。 ( R _J ) + time offset of the subtitle piece n relative to the start time of the audio *1000] * 22.5; Start time of the nth subtitle of the Hth second = audio start time + [( \M - N\ -I ) + ( R _ J ) + (time offset of the subtitle n relative to the audio start time -H *1000]*22.5; Step 9. The multiplexer encapsulates the subframe into a multiframe, and converts the multiframe into a PMS stream and sends it to the mobile multimedia broadcast terminal.
图 4为本实施例的移动多媒体广播字幕同步系统组成模块图。 FIG. 4 is a block diagram showing the components of the mobile multimedia broadcast caption synchronization system of the embodiment.
该系统包括:  The system includes:
接收模块, 设置为接收字幕服务器发送的字幕数据包和音频编码器发送 的音频子帧;  a receiving module, configured to receive a subtitle data packet sent by the subtitle server and an audio sub-frame sent by the audio encoder;
获取模块, 设置为根据所述字幕数据包获取字幕, 根据所述音频子帧获 取音频开始播放时间;  Obtaining a module, configured to acquire a subtitle according to the subtitle data packet, and obtain an audio start playback time according to the audio sub-frame;
时间偏移确定模块, 设置为确定所述字幕相对于音频开始播放时间的时 间偏移;  a time offset determining module, configured to determine a time offset of the subtitle relative to an audio start playing time;
所述时间偏移确定模块, 可设置为从包含所述字幕数据包的数据流中获 取字幕与音频子帧关系的信息; 根据所述字幕与音频子帧关系的信息确定与 字幕对应的音频子帧; 根据该字幕在本地时区的开始时间及所述与字幕对应 的音频子帧的时间戳设置字幕与该音频子帧的同步标记; 才艮据该同步标记确 定字幕相对于音频开始播放时间的时间偏移;  The time offset determining module may be configured to: obtain information about a relationship between a subtitle and an audio sub-frame from a data stream that includes the subtitle data packet; and determine an audio sub-subtitle corresponding to the subtitle according to the information of the subtitle and the audio sub-frame relationship a frame; setting a synchronization flag of the subtitle and the audio sub-frame according to a start time of the subtitle in a local time zone and a time stamp of the audio sub-frame corresponding to the subtitle; determining, according to the synchronization flag, a subtitle relative to an audio start playing time Time offset
封装模块, 设置为在所述封装时间到达时, 将所述字幕的字符串、 音频 开始播放时间、 字幕相对于音频开始播放时间的时间偏移封装到所述与字幕 对应的音频子帧的数据段;  The encapsulating module is configured to, when the encapsulation time arrives, encapsulate a character string of the subtitle, an audio start playing time, and a time offset of the subtitle relative to the audio start playing time to the data of the audio sub-frame corresponding to the subtitle Paragraph
设字幕在本地时区的开始时间为 M, 本地 GPS提供的当前时间 TOD为 N, 从接收字幕数据包到发送数据段的收发时差为 R,封装时间为 S; M、 N、 R和 S的单位为秒;  The start time of the subtitle in the local time zone is M, the current time TOD provided by the local GPS is N, the transmission time difference from receiving the subtitle data packet to the transmission data segment is R, and the encapsulation time is S; units of M, N, R and S In seconds;
设所述 M与 N的时间差为 / = floor(\M - N|) , floor )表示取整, 卜|表示取 绝对值;  Let the time difference between M and N be / = floor(\M - N|) , floor ) denote rounding, and b| denote absolute value;
J = floor(R); 则, S=I+J。 J = floor(R); Then, S=I+J.
发送模块, 设置为将所述数据段发送至移动多媒体广播终端。  And a sending module, configured to send the data segment to the mobile multimedia broadcast terminal.
上述实施例中获取模块根据所述字幕数据包获取的字幕字符串可由多个 字幕片组成;  The subtitle string obtained by the obtaining module according to the subtitle data packet in the foregoing embodiment may be composed of a plurality of subtitle chips;
此时, 时间偏移确定模块, 设置为根据该同步标记确定所述字幕片相对 于音频开始播放时间的时间偏移;  At this time, the time offset determining module is configured to determine a time offset of the subtitle piece relative to the audio start playing time according to the synchronization mark;
时间偏移确定模块可开启一定时器, 设置该定时器的定时长度与同步标 记等值; 当达到所述定时长度时, 计算所述字幕片相对于音频开始播放时间 的时间偏移。  The time offset determining module can start a timer, set a timing length of the timer and a synchronization mark equivalent; when the timing length is reached, calculate a time offset of the subtitle piece relative to the audio start playing time.
封装模块, 用于在所述封装时间到达时, 将音频的开始播放时间、 字幕 片相对于音频开始播放时间的时间偏移、 字幕片的字符串封装到所述与字幕 对应的音频子帧的数据段。  a packaging module, configured to: when the encapsulation time arrives, time start playback time of the audio, time offset of the subtitle piece relative to the audio start play time, and a character string of the subtitle piece to the audio sub-frame corresponding to the subtitle Data segment.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件完成, 所述程序可以存储于计算机可读存储介质中, 如只读 存储器、 磁盘或光盘等。 可选地, 上述实施例的全部或部分步骤也可以使用 一个或多个集成电路来实现, 相应地, 上述实施例中的各模块 /单元可以釆用 硬件的形式实现, 也可以釆用软件功能模块的形式实现。 本发明不限制于任 何特定形式的硬件和软件的结合。 One of ordinary skill in the art will appreciate that all or a portion of the above steps may be accomplished by a program instructing the associated hardware, such as a read-only memory, a magnetic disk, or an optical disk. Optionally, all or part of the steps of the foregoing embodiments may also be implemented by using one or more integrated circuits. Accordingly, each module/unit in the foregoing embodiment may be implemented in the form of hardware, or may use software functions. The form of the module is implemented. The invention is not limited to any specific form of combination of hardware and software.
需要说明的是, 本发明还可有其他多种实施例, 在不背离本发明精神及 和变形, 但这些相应的改变和变形都应属于本发明所附的权利要求的保护范 围。  It is to be understood that the invention may be embodied in other forms and modifications without departing from the spirit and scope of the invention.
工业实用性 上述技术方案, 封装后的音频子帧的数据段中包含了音频开始播放时间 和字幕相对于音频开始播放时间的时间偏移, 使得接收到该音频子帧的移动 多媒体广播终端能够根据字幕相对于音频开始播放时间的时间偏移确定字幕 的播放时间, 达到与音频同步的技术效果。 INDUSTRIAL APPLICABILITY In the above technical solution, the data segment of the encapsulated audio sub-frame includes a time start of audio start time and a time offset of the subtitle relative to the audio start play time, so that the mobile multimedia broadcast terminal receiving the audio sub-frame can The time offset of the subtitle relative to the start time of the audio determines the playback time of the subtitle, achieving the technical effect of synchronizing with the audio.

Claims

权 利 要 求 书 Claim
1、 一种移动多媒体广播字幕同步的方法, 所述方法包括:  A method for synchronizing mobile multimedia broadcast captions, the method comprising:
接收字幕服务器发送的字幕数据包和音频编码器发送的音频子帧; 从所述音频子帧中获取音频开始播放时间;  Receiving a subtitle data packet sent by the subtitle server and an audio sub-frame sent by the audio encoder; acquiring audio from the audio sub-frame to start playing time;
从所述字幕数据包中获取字幕;  Obtaining a subtitle from the subtitle data packet;
确定字幕相对于音频开始播放时间的时间偏移;  Determining the time offset of the subtitle relative to the start time of the audio;
在封装时间到达时, 将所述字幕的字符串、 音频开始播放时间、 字幕相 对于音频开始播放时间的时间偏移封装到与所述字幕对应的音频子帧的数据 段; 以及  When the encapsulation time arrives, the character string of the subtitle, the audio start playing time, and the time offset of the subtitle relative to the audio start playing time are encapsulated into the data segment of the audio sub-frame corresponding to the subtitle;
将所述数据段发送至移动多媒体广播终端。  The data segment is transmitted to a mobile multimedia broadcast terminal.
2、 如权利要求 1所述的方法, 其中,  2. The method of claim 1 wherein
确定所述字幕相对于音频开始播放时间的时间偏移的步骤包括: 从包含所述字幕数据包的数据流中获取字幕与音频子帧关系的信息; 才艮据所述字幕与音频子帧关系的信息确定与字幕对应的音频子帧; 根据该字幕在本地时区的开始时间及所述与字幕对应的音频子帧的时间 戳设置字幕与该音频子帧的同步标记; 以及  Determining, by the data stream containing the subtitle data packet, information about a relationship between the subtitle and the audio sub-frame; and determining the relationship between the subtitle and the audio sub-frame The information determines an audio sub-frame corresponding to the subtitle; and sets a synchronization mark of the subtitle and the audio sub-frame according to a start time of the subtitle in the local time zone and a time stamp of the audio sub-frame corresponding to the subtitle;
根据该同步标记确定字幕相对于音频开始播放时间的时间偏移。  A time offset of the subtitle relative to the start time of the audio playback is determined based on the synchronization flag.
3、 如权利要求 2所述的方法, 其还包括:  3. The method of claim 2, further comprising:
根据所述字幕在本地时区的开始时间确定所述封装时间, 其中: 设字幕在本地时区的开始时间为 M, 本地环球定位系统(GPS )提供的 当前时间 (TOD )为 N, 从接收字幕数据包到发送所述数据段的收发时差为 R,封装时间为 S; M、 N、 R和 S的单位为秒;  Determining the encapsulation time according to the start time of the subtitle in the local time zone, wherein: the start time of the subtitle in the local time zone is M, and the current time (TOD) provided by the local global positioning system (GPS) is N, and the subtitle data is received from the subtitle data. The time difference between the packet transmission and the transmission of the data segment is R, and the encapsulation time is S; the units of M, N, R, and S are seconds;
所述 M与 N的时间差为 / = floor(\M - N|) , floor )表示取整, 卜|表示取绝 对值;  The time difference between M and N is / = floor(\M - N|) , floor ) means rounding, and 卜| means taking the absolute value;
J = floor (K);  J = floor (K);
则, S=I+J。 Then, S=I+J.
4、 如权利要求 3所述的方法, 其中, 4. The method of claim 3, wherein
在所述从所述字幕数据包中获取字幕的步骤中, 根据所述字幕数据包获 取的字幕由多个字幕片组成;  In the step of acquiring a subtitle from the subtitle data packet, the subtitle obtained according to the subtitle data packet is composed of a plurality of subtitle sheets;
在所述确定字幕相对于音频开始播放时间的时间偏移的步骤中, 根据所 述同步标记确定所述字幕片相对于音频开始播放时间的时间偏移;  In the step of determining a time offset of the subtitle relative to the audio start playing time, determining, according to the synchronization flag, a time offset of the subtitle piece relative to the audio start playing time;
在所述封装的步骤中, 将所述字幕片的字符串、 音频的开始播放时间、 字幕片相对于音频开始播放时间的时间偏移封装到与所述字幕对应的音频子 帧的数据段。  In the step of encapsulating, a character string of the subtitle piece, a start playing time of the audio, and a time offset of the subtitle piece with respect to the audio start playing time are encapsulated into a data segment of the audio sub-frame corresponding to the subtitle.
5、 如权利要求 4所述的方法, 其中,  5. The method of claim 4, wherein
所述根据该同步标记确定所述字幕片相对于音频开始播放时间的时间偏 移的步骤包括:  The step of determining, according to the synchronization mark, a time offset of the subtitle piece relative to an audio start playing time includes:
开启一定时器, 设置该定时器的定时长度与同步标记等值;  Turn on a timer, set the timing length of the timer and the value of the synchronization flag;
当达到所述定时长度时, 计算所述字幕片相对于音频开始播放时间的时 间偏移。  When the timing length is reached, the time offset of the subtitle piece relative to the audio start playing time is calculated.
6、 一种移动多媒体广播字幕同步的系统, 所述系统包括:  6. A system for synchronizing mobile multimedia broadcast captions, the system comprising:
接收模块, 其设置为: 接收字幕服务器发送的字幕数据包和音频编码器 发送的音频子帧;  a receiving module, configured to: receive a subtitle data packet sent by the subtitle server and an audio sub-frame sent by the audio encoder;
获取模块, 其设置为: 从所述字幕数据包中获取字幕, 从所述音频子帧 中获取音频开始播放时间;  An obtaining module, configured to: acquire a subtitle from the subtitle data packet, and obtain an audio start time from the audio sub-frame;
时间偏移确定模块, 其设置为: 确定所述字幕相对于音频开始播放时间 的时间偏移;  a time offset determining module, configured to: determine a time offset of the subtitle relative to an audio start playing time;
封装模块, 其设置为: 在所述封装时间到达时, 将所述字幕的字符串、 音频开始播放时间、 字幕相对于音频开始播放时间的时间偏移封装到与所述 字幕对应的音频子帧的数据段; 以及  a packaging module, configured to: when the encapsulation time arrives, encapsulate a character string of the subtitle, an audio start playing time, and a time offset of the subtitle relative to an audio start playing time into an audio sub-frame corresponding to the subtitle Data segment; and
发送模块, 其设置为: 将所述数据段发送至移动多媒体广播终端。  And a sending module, configured to: send the data segment to a mobile multimedia broadcast terminal.
7、 如权利要求 6所述的系统, 其中, 所述时间偏移确定模块是设置为以 如下方式确定所述字幕相对于音频开始播放时间的时间偏移: 从包含所述字幕数据包的数据流中获取字幕与音频子帧关系的信息; 根 据所述字幕与音频子帧关系的信息确定与字幕对应的音频子帧; 根据该字幕 在本地时区的开始时间及所述与字幕对应的音频子帧的时间戳设置字幕与该 音频子帧的同步标记; 根据该同步标记确定字幕相对于音频开始播放时间的 时间偏移。 7. The system according to claim 6, wherein the time offset determining module is configured to determine a time offset of the subtitle relative to an audio start playing time in the following manner: Acquiring information of a relationship between a subtitle and an audio sub-frame from a data stream that includes the subtitle data packet; determining an audio sub-frame corresponding to the subtitle according to the information of the subtitle and the audio sub-frame relationship; according to the start time of the subtitle in the local time zone And the time stamp of the audio sub-frame corresponding to the subtitle sets a synchronization mark of the subtitle and the audio sub-frame; and determining, according to the synchronization mark, a time offset of the sub-title relative to the audio start playing time.
8、 如权利要求 7所述的系统, 其中,  8. The system of claim 7, wherein
所述封装模块还设置为以如下方式根据所述字幕在本地时区的开始时间 确定所述封装时间:  The encapsulating module is further configured to determine the encapsulation time according to a start time of the subtitle in a local time zone in the following manner:
设字幕在本地时区的开始时间为 M, 本地环球定位系统(GPS )提供的 当前时间 (TOD )为 N, 从接收字幕数据包到发送所述数据段的收发时差为 R,封装时间为 S; M、 N、 R和 S的单位为秒;  The start time of the local time zone is M, the current time (TOD) provided by the local global positioning system (GPS) is N, and the time difference from receiving the subtitle data packet to transmitting the data segment is R, and the encapsulation time is S; The units of M, N, R, and S are seconds;
设所述 M与 N的时间差为 / = floor(\M - N|) , floor )表示取整, 卜|表示取 绝对值;  Let the time difference between M and N be / = floor(\M - N|) , floor ) denote rounding, and b| denote absolute value;
J = floor{R); 则, S=I+J。  J = floor{R); Then, S=I+J.
9、 如权利要求 8所述的方法, 其中,  9. The method of claim 8 wherein
所述获取模块是设置为从所述字幕数据包中获取由多个字幕片组成的字 眷;  The obtaining module is configured to acquire a word composed of a plurality of subtitle sheets from the subtitle data packet;
所述时间偏移确定模块是设置为才艮据所述同步标记确定所述字幕片相对 于音频开始播放时间的时间偏移;  The time offset determining module is configured to determine, according to the synchronization flag, a time offset of the title film relative to the audio start playing time;
所述封装模块是设置为: 在所述封装时间到达时, 将字幕片的字符串、 音频的开始播放时间、 字幕片相对于音频开始播放时间的时间偏移封装到与 所述字幕对应的音频子帧的数据段。  The encapsulating module is configured to: when the encapsulation time arrives, encapsulate a character string of the subtitle piece, a start playing time of the audio, and a time offset of the subtitle piece relative to the audio start playing time to the audio corresponding to the subtitle The data segment of the sub-frame.
10、 如权利要求 9所述的系统, 其中,  10. The system of claim 9, wherein
所述时间偏移确定模块是设置为以如下方式才艮据该同步标记确定所述字 幕片相对于音频开始播放时间的时间偏移:  The time offset determination module is configured to determine a time offset of the slide show relative to the start time of the audio according to the synchronization flag in the following manner:
开启一定时器, 设置该定时器的定时长度与同步标记等值;  Turn on a timer, set the timing length of the timer and the value of the synchronization flag;
当达到所述定时长度时, 计算所述字幕片相对于音频开始播放时间的时 间偏移。  When the timing length is reached, the time offset of the subtitle piece relative to the audio start playing time is calculated.
PCT/CN2012/077420 2012-04-10 2012-06-25 Method and system for synchronizing mobile multimedia broadcasting and subtitles WO2013152562A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210104688.9 2012-04-10
CN201210104688.9A CN102630017B (en) 2012-04-10 2012-04-10 Method and system for synchronizing mobile multi-media broadcasting and subtitles

Publications (1)

Publication Number Publication Date
WO2013152562A1 true WO2013152562A1 (en) 2013-10-17

Family

ID=46588162

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/077420 WO2013152562A1 (en) 2012-04-10 2012-06-25 Method and system for synchronizing mobile multimedia broadcasting and subtitles

Country Status (2)

Country Link
CN (1) CN102630017B (en)
WO (1) WO2013152562A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259776A (en) * 2021-04-14 2021-08-13 北京达佳互联信息技术有限公司 Binding method and device of caption and sound source

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104142989B (en) * 2014-07-28 2017-10-17 广州酷狗计算机科技有限公司 A kind of matching detection method and device
CN104506957A (en) * 2014-12-08 2015-04-08 广东欧珀移动通信有限公司 Method and device for displaying subtitles
CN108206966B (en) * 2016-12-16 2020-07-03 杭州海康威视数字技术股份有限公司 Video file synchronous playing method and device
CN109413475A (en) * 2017-05-09 2019-03-01 北京嘀嘀无限科技发展有限公司 Method of adjustment, device and the server of subtitle in a kind of video
CN108174264B (en) * 2018-01-09 2020-12-15 武汉斗鱼网络科技有限公司 Synchronous lyric display method, system, device, medium and equipment
CN113992638B (en) * 2018-05-02 2023-07-14 腾讯科技(上海)有限公司 Synchronous playing method and device for multimedia resources, storage position and electronic device
CN108924664B (en) * 2018-07-26 2021-06-08 海信视像科技股份有限公司 Synchronous display method and terminal for program subtitles
CN113766342B (en) * 2021-08-10 2023-07-18 安徽听见科技有限公司 Subtitle synthesizing method and related device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060000172A (en) * 2004-04-27 2006-01-06 우종식 The device and the method of synchronization generation and regeneration of a caption, a stop display and a dynamic display use of a location information
CN101378356A (en) * 2008-06-10 2009-03-04 中兴通讯股份有限公司 Method for playing real time stream medium
CN102196319A (en) * 2010-03-17 2011-09-21 中兴通讯股份有限公司 Live streaming service system and realization method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060000172A (en) * 2004-04-27 2006-01-06 우종식 The device and the method of synchronization generation and regeneration of a caption, a stop display and a dynamic display use of a location information
CN101378356A (en) * 2008-06-10 2009-03-04 中兴通讯股份有限公司 Method for playing real time stream medium
CN102196319A (en) * 2010-03-17 2011-09-21 中兴通讯股份有限公司 Live streaming service system and realization method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259776A (en) * 2021-04-14 2021-08-13 北京达佳互联信息技术有限公司 Binding method and device of caption and sound source
CN113259776B (en) * 2021-04-14 2022-11-22 北京达佳互联信息技术有限公司 Binding method and device of caption and sound source

Also Published As

Publication number Publication date
CN102630017B (en) 2014-03-19
CN102630017A (en) 2012-08-08

Similar Documents

Publication Publication Date Title
WO2013152562A1 (en) Method and system for synchronizing mobile multimedia broadcasting and subtitles
JP7386463B2 (en) Transmission method, reception method, transmission device and reception device
JP6877603B2 (en) Transmission method, reception method, transmission device, and reception device
US9998773B2 (en) Transmission device, transmission method of transmission stream, and processing device
JP7068526B2 (en) Transmission method, reception method, transmission device, and reception device
JP2020065295A (en) Transmission method, reception method, transmission device, and reception device
CN105493509B (en) Transmission device, transmission method, reception device, and reception method
JP2019110554A (en) Transmission method, reception method, transmission device, and reception device
US10305617B2 (en) Transmission apparatus, transmission method, reception apparatus, and reception method
US11343559B2 (en) Method and apparatus for receiving, sending and data processing information related to time such as leap second and daylight saving time (DST)
KR102675843B1 (en) Transmitting devices, receiving devices and data processing methods
JP2024051039A (en) Transmitting device and transmitting method
KR101620776B1 (en) Encoding device and decoding device and program for same
JP2018182677A (en) Information processing apparatus, information processing method, program, and recording medium manufacturing method
JP7512471B2 (en) Transmission method and transmission device
WO2015045362A1 (en) Transmission method, reception method, transmitter apparatus, and receiver apparatus
WO2013040996A1 (en) Sending end, terminal, system and method for hierarchical coding multiplexing
JP2008245061A (en) Pcr reproduction system in ip stream transmission
EP3280147A1 (en) Method and apparatus for transmitting and receiving broadcast signal

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: 12874235

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: 12874235

Country of ref document: EP

Kind code of ref document: A1