Subtitle generation method, server, terminal equipment and system

文档序号:1025767 发布日期:2020-10-27 浏览:18次 中文

阅读说明:本技术 字幕的生成方法、服务器、终端设备及系统 (Subtitle generation method, server, terminal equipment and system ) 是由 潘立祥 张磊 彭俊 于 2019-04-23 设计创作,主要内容包括:本发明公开了一种字幕的生成方法、服务器、终端设备及系统,该方法包括:获取视频的语音流信息;根据所述语音流信息,获得字幕内容、所述字幕内容的起始展示时间和结束展示时间;对所述字幕内容的起始展示时间、结束展示时间对应的时间区间进行均分处理,得到所述字幕内容中各个字的起始展示时间;利用所述字幕内容、所述字幕内容中一个或多个字的起始展示时间和所述字幕内容的结束展示时间生成字幕流,并将所述字幕流发送至终端设备。(The invention discloses a subtitle generating method, a server, terminal equipment and a system, wherein the method comprises the following steps: acquiring voice stream information of a video; acquiring subtitle content, and the initial display time and the end display time of the subtitle content according to the voice stream information; equally dividing time intervals corresponding to the initial display time and the ending display time of the subtitle content to obtain the initial display time of each character in the subtitle content; and generating a subtitle stream by using the subtitle content, the initial display time of one or more words in the subtitle content and the ending display time of the subtitle content, and sending the subtitle stream to terminal equipment.)

1. A subtitle generating method implemented by a server comprises the following steps:

acquiring voice stream information of a video;

acquiring subtitle content, and the initial display time and the end display time of the subtitle content according to the voice stream information;

equally dividing time intervals corresponding to the initial display time and the ending display time of the subtitle content to obtain the initial display time of one or more characters in the subtitle content;

and generating a subtitle stream by using the subtitle content, the initial display time of one or more words in the subtitle content and the ending display time of the subtitle content, and sending the subtitle stream to terminal equipment.

2. The method of claim 1, wherein the method further comprises:

detecting whether the timestamp of the video stream is abnormal or not to obtain a detection result;

and under the condition that the detection result is that the time stamp of the video stream is abnormal, the time stamp of the video stream is obtained again.

3. The method of claim 2, wherein the detecting whether the timestamp of the video stream has an anomaly comprises:

acquiring a timestamp of the current video stream and a timestamp of a previous video stream, and acquiring a time difference value between the timestamp of the current video stream and the timestamp of the previous video stream;

judging whether the time difference value is within a preset time difference value range to obtain a judgment result;

and determining whether the timestamp of the current video stream is abnormal or not according to the judgment result.

4. The method according to claim 1, wherein the voice stream information includes audio data information and timestamp information, wherein the obtaining of the subtitle content, the start presentation time and the end presentation time of the subtitle content according to the voice stream information comprises:

acquiring the data volume of the audio data information, and determining the relative initial display time and the relative end display time of the subtitle content according to the data volume of the audio data information;

and obtaining the initial display time and the ending display time of the subtitle content according to the timestamp information and the relative initial display time and the relative ending display time of the subtitle content.

5. The method of claim 1, wherein the method further comprises:

grouping the subtitle content to obtain a plurality of groups of subtitle content, so that each group of subtitle content is displayed on the terminal equipment in a line of subtitle; wherein the content of the first and second substances,

the generating of the subtitle stream using the subtitle content, the starting presentation time of the one or more words in the subtitle content, and the ending presentation time of the subtitle content includes:

and generating a caption stream according to each group of caption contents, the initial display time of one or more words in each group of caption contents and the ending display time of each group of caption contents.

6. The method of claim 5, wherein the grouping the subtitle content to obtain a plurality of groups of subtitle content, so that each group of subtitle content is presented at the terminal device in the form of one line of subtitles comprises:

grouping the subtitle content corresponding to each voice stream by using the preset word number of each group of subtitle content to obtain a plurality of groups of subtitle content; alternatively, the first and second electrodes may be,

and grouping all the subtitle contents corresponding to the continuous voice streams by using the preset word number of each group of subtitle contents to obtain a plurality of groups of subtitle contents.

7. The method of claim 5, wherein the method further comprises:

based on each group of subtitle content, obtaining the ending display time of the current group of subtitle content and the starting display time of the next group of subtitle content;

and obtaining the delayed ending display time of the current group of subtitle contents according to the ending display time of the current group of subtitle contents and the starting display time of the next group of subtitle contents, and taking the delayed ending display time as the ending display time of the current group of subtitle contents.

8. A subtitle generating method is implemented by a terminal device and comprises the following steps:

receiving a subtitle stream generated according to any one of claims 1-7 and transmitted by a server;

acquiring a video stream corresponding to the subtitle stream;

and overlapping the subtitle stream and the video stream according to the initial display time of one or more words in the subtitle content carried by the subtitle stream, the ending display time of the subtitle content and the time stamp of each picture frame in the video stream to obtain the video stream with the displayed subtitles.

9. The method of claim 8, wherein, in the case that the subtitle content in the subtitle stream is split into a plurality of groups of subtitle content such that each group of subtitle content is presented in the form of a line of subtitles, the method further comprises:

and the caption display is carried out by adopting a double-line display mode, wherein,

the double-line display mode is that the currently displayed subtitle content automatically scrolls to the upper line for display so as to display the next group of subtitle content at the position where the currently displayed subtitle content is located.

10. A server comprising a memory and a processor, the memory for storing executable instructions; the processor is configured to perform the method according to any one of claims 1-7 under control of the instructions.

11. A terminal device comprising a memory and a processor, the memory for storing executable instructions; the processor is configured to perform the method according to claim 8 or 9 according to the control of the instructions.

12. A terminal device, comprising:

a display component for performing a display;

the processing component is configured to receive a subtitle stream generated according to any one of claims 1 to 7 and sent by a server, and superimpose the subtitle stream and the video stream according to a start display time of one or more words in subtitle content carried by the subtitle stream, an end display time of the subtitle content, and a timestamp of each picture frame in a corresponding video stream to obtain a video stream with subtitles, so as to send the video stream with subtitles to the display component for display.

13. The terminal device of claim 12, wherein the display component is further configured to present subtitles in a two-line display, wherein,

the double-line display mode is that the currently displayed caption content automatically scrolls to the upper line for display so as to display the next line of caption content at the position where the currently displayed caption content is located.

14. A system for generating subtitles comprising the server of claim 10 and the terminal device of any one of claims 11 to 13.

26页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:图像传感器

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类