[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN109672919A - Caption presentation method, device and user terminal - Google Patents

Caption presentation method, device and user terminal Download PDF

Info

Publication number
CN109672919A
CN109672919A CN201811602071.3A CN201811602071A CN109672919A CN 109672919 A CN109672919 A CN 109672919A CN 201811602071 A CN201811602071 A CN 201811602071A CN 109672919 A CN109672919 A CN 109672919A
Authority
CN
China
Prior art keywords
file
information
target
caption
script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811602071.3A
Other languages
Chinese (zh)
Inventor
张烨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd Hefei Branch
Original Assignee
New H3C Technologies Co Ltd Hefei Branch
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 New H3C Technologies Co Ltd Hefei Branch filed Critical New H3C Technologies Co Ltd Hefei Branch
Priority to CN201811602071.3A priority Critical patent/CN109672919A/en
Publication of CN109672919A publication Critical patent/CN109672919A/en
Pending legal-status Critical Current

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/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/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • 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/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • 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/8543Content authoring using a description language, e.g. Multimedia and Hypermedia information coding Expert Group [MHEG], eXtensible Markup Language [XML]

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the present application provides a kind of caption presentation method, device and user terminal.The html page file that user terminal reception content server provides includes multimedia element and script information corresponding with the source file of multimedia element in the html page file;For each time point of source file setting, when source file was played to the time point, the target time section including the time point is determined from script file, and the corresponding target caption information of the target time section is searched from least one caption information, then the target caption information found is shown in the canvas element of html page file.Wherein, multimedia element includes audio element or video elementary, and source file includes video file or audio file.In this way, can be convenient the change quickly realized to caption content or subtitle effect.

Description

Caption presentation method, device and user terminal
Technical field
This application involves subtitle processing technology fields, whole in particular to a kind of caption presentation method, device and user End.
Background technique
Currently, generalling use third party software is that the voice in audio or video makes subtitle, specific manufacturing process is such as Under: during playing audio or video, for every voice in the audio or the video, finished in this voice When, the corresponding captioned test of this voice is added in video;Alternatively, disposably adding the audio or all words of the video Curtain text, the position of each captioned test is adjusted further according to the corresponding relationship of voice and subtitle in the audio or the video.
Above-mentioned production method existing defects: the interior perhaps display effect of a certain captioned test can not be individually changed, that is, such as Fruit needs to modify the interior perhaps display effect of a certain captioned test, then repeats above-mentioned manufacturing process, operating process is cumbersome and inconvenient.
Summary of the invention
In view of this, the purpose of the embodiment of the present application includes providing a kind of caption presentation method, device and user terminal, with At least partly improve to modify to the subtitle produced and needs the problem of carrying out a large amount of troublesome operations.
In order to achieve the above object, the embodiment of the present application adopts the following technical scheme that
In a first aspect, the embodiment of the present application provides a kind of caption presentation method, comprising:
The html page file that reception content server provides, include in the html page file multimedia element and with The source file of the multimedia element corresponding script information is provided with multiple time points, the script letter in the source file Cease includes at least one caption information and each caption information corresponding period in corresponding script file;
For each time point that the source file includes, when the source file was played to the time point, from described The target time section including the time point is determined in the corresponding script file of script information, and is believed from least one described subtitle Target caption information corresponding with the target time section is searched in breath;
The target caption information found is shown in the canvas element of the html page file;
Wherein, the multimedia element includes audio element or video elementary, and the source file includes video file or sound Frequency file.
Second aspect, the embodiment of the present application provide a kind of subtitling display equipment, and described device includes:
Receiving module, for the html page file that reception content server provides, the html page file includes more Media elements and script information corresponding with the source file of the multimedia element are provided with multiple times in the source file Point includes at least one caption information and each caption information corresponding time in the corresponding script file of the script information Section;
Searching module, each time point for including for the source file, when the source file play to it is described when Between when putting, determined from the corresponding script file of the script information include the time point target time section, and from described Target caption information corresponding with the target time section is searched at least one caption information;
The target caption information found is shown in the canvas element of the html page file;
Wherein, the multimedia element includes audio element or video elementary, and the source file includes video file or sound Frequency file.
The third aspect, the embodiment of the present application provide a kind of user terminal, including processor and machine readable storage medium, institute It states machine readable storage medium and is stored with the machine-executable instruction that can be executed by the processor, the processor is described Machine-executable instruction promotes: realizing caption presentation method provided by the embodiments of the present application.
In terms of existing technologies, the embodiment of the present application has the advantages that
A kind of caption presentation method, device and user terminal provided by the embodiments of the present application, user terminal reception content clothes It is engaged in the html page file that device provides, includes multimedia element and the source file pair with multimedia element in the html page file The script information answered is provided with multiple time points in the source file, includes at least one in the corresponding script file of script information Caption information and each caption information corresponding period;For each time point that source file includes, when the source file play to When the time point, from the corresponding script file of script information determine include the time point target time section, from it is above-mentioned to Target caption information corresponding with the target time section is searched in a few caption information.In the canvas element of html page file It is upper to show the target caption information found.Wherein, multimedia element includes audio element or video elementary, and source file includes view Frequency file or audio file.In this way, when perhaps display effect in the caption information for needing to change source file, it can be in script Change the interior perhaps display effect of the caption information in file, then by the script file importing content server after change When playing source file automatically according to change after in perhaps display effect show the caption information, without to entire source document The subtitle of part is reset, so that the process of change subtitle is more simple and efficient.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is a kind of interaction schematic diagram of user terminal and content server provided by the embodiments of the present application;
Fig. 2 is a kind of hardware structural diagram of user terminal provided by the embodiments of the present application;
Fig. 3 is a kind of flow diagram of caption presentation method provided by the embodiments of the present application;
Fig. 4 is the sub-step schematic diagram of step S33 shown in Fig. 3;
Fig. 5 is the sub-step schematic diagram of step S42 shown in Fig. 4;
Fig. 6 is a kind of the functional block diagram of subtitling display equipment provided by the embodiments of the present application.
Icon: 100- user terminal;110- subtitling display equipment;111- receiving module;112- searching module;113- is shown Module;114- painting canvas display module;120- client;130- machine readable storage medium;140- processor;150- communication unit Member;160- display unit;200- content server.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is Some embodiments of the present application, instead of all the embodiments.The application being usually described and illustrated herein in the accompanying drawings is implemented The component of example can be arranged and be designed with a variety of different configurations.
Therefore, the detailed description of the embodiments herein provided in the accompanying drawings is not intended to limit below claimed Scope of the present application, but be merely representative of the selected embodiment of the application.Based on the embodiment in the application, this field is common Technical staff's every other embodiment obtained without creative efforts belongs to the model of the application protection It encloses.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.
As shown in Figure 1, being that the interaction of a kind of user terminal 100 and content server 200 provided by the embodiments of the present application is shown It is intended to.User terminal 100 can be communicated by network with content server 200, to realize data interaction or communication.
Wherein, the content server 200 is used to provide HTML to user terminal 100 (HyperTextMarkupLanguage, hypertext markup language) page file is equipped with for receiving in user terminal 100 With the client 120 for loading the html page, the client 120 can be browser or have WebView (network video Figure) control APP (Application, application program), the present embodiment is without limitation.
The user terminal 100 may be, but not limited to, smart phone, personal computer (PersonalComputer, PC), tablet computer, personal digital assistant (PersonalDigital Assistant, PDA), mobile internet surfing equipment (MobileInternetDevice, MID) etc. is arbitrarily with the electronic equipment of data processing function and communication function.
As shown in Fig. 2, being a kind of hardware structural diagram of user terminal 100 provided by the embodiments of the present application.The use Family terminal 100 includes subtitling display equipment 110, client 120, machine readable storage medium 130, processor 140, communication unit 150 and display unit 160.
The machine readable storage medium 130, processor 140, communication unit 150 and each element of display unit 160 are mutual Between be directly or indirectly electrically connected, to realize the transmission or interaction of data.For example, these elements can pass through one between each other Item or a plurality of communication bus or signal wire, which are realized, to be electrically connected.Being stored with machine in the machine readable storage medium 130 can hold Row instruction, by reading and executing machine-executable instruction corresponding with Subtitle Demonstration logic in machine readable storage medium 130, Caption presentation method described below can be performed in processor 140.It can be held in the machine of the machine readable storage medium 130 storage In row instruction, including instruction corresponding with the subtitling display equipment 110, the instruction can be executed by processor 140.In addition, objective The corresponding machine-executable instruction in family end 120 also can store in the machine readable storage medium 130.
It is worth noting that the subtitling display equipment 110 can be a sub-device of client 120, it is also possible to Independently of client 120 and the device that can communicate with client 120, the present embodiment is not limited system.
The communication unit 150 is for establishing between user terminal 100 and external equipment (for example, content server 200) Communication connection, to realize data interaction.The display unit 160 for show information to be displayed (for example, caption information) or It is the interaction realized with user.
Optionally, machine readable storage medium 130 described herein can be any electronics, magnetism, optics or other objects Storage device is managed, may include or store information, such as executable instruction, data, etc..For example, machine readable storage medium 130 It may is that RAM (Radom Access Memory, random access memory), volatile memory, nonvolatile memory, sudden strain of a muscle It deposits, memory driver (such as hard disk drive), solid state hard disk, any kind of storage dish (such as CD, dvd) or similar Storage medium or their combination.
It should be appreciated that structure shown in Fig. 2 is merely illustrative, user terminal 100 can also include more more or less than shown in Fig. 2 Component, or with configuration entirely different shown in Fig. 2.Fig. 2 shows each component can with software, hardware or its combination It realizes, the present embodiment is without limitation.
As shown in figure 3, being a kind of flow diagram of caption presentation method provided by the embodiments of the present application, the subtitle is aobvious Show that method can be applied to user terminal 100 shown in Figure 2.The caption presentation method is done below with reference to Fig. 3 and is explained in detail It states.
Step S31, the html page file that reception content server 200 provides include more in the html page file Media elements and script information corresponding with the source file in the multimedia element are provided with multiple times in the source file Point includes at least one caption information and each caption information corresponding period in the corresponding script file of the script information.
Wherein, the multimedia element includes audio element or video elementary, and the source file includes audio file or view Frequency file.
In the present embodiment, audio element can refer to<audio>element, be used to define sound on html page file Sound object, so as to be played out to the audio file in insertion html page file.<audio>element has src attribute, The address URL for the audio file that the corresponding value of src attribute usually needs to play, the audio file are<audio>element Source file.
Video elementary can refer to<video>element, be used to define the video object on html page file, so as to To be played out to the video file in insertion html page file.<video>element has src attribute, and the src attribute is corresponding The value address URL of video file that usually needs to play, which is the source file of<video>element.Herein It should be noted that the address URL of the corresponding value of the src attribute of<video>element or audio file, in other words,< Video>element source file is also possible to audio file, and in the case, what is played in<video>element is no picture Audio-frequency information.
In the present embodiment, the source file includes at least one sound bite, and a sound bite can be for table Up to the voice messaging of at least one semantic complete sentence, each sound bite has corresponding caption information.The voice For the corresponding caption information configuration of segment in a script file, the script file can be JSON file or XML file.
It optionally, in one implementation, may include the URL of the script file in the html page file Location, in the case, the script information are the address URL of the script file.It is described in another implementation Html page file can directly include the script file, and in the case, described script file itself is the script letter Breath.
Step S32, for each time point that the source file includes, from the corresponding script file of the script information It determines the target time section including the time point, and is searched and the target time section from least one described caption information Corresponding target caption information.
In the present embodiment, the multimedia element such as<audio>element and<video>element are provided with for controlling The instruction set (also known as " method ") for making the broadcasting of its source file, pause, stopping etc., when the play instruction for calling the multimedia element When collection plays out source file, broadcast event can be triggered;When the pause instruction collection pause broadcasting source document for calling multimedia element When part, suspending event can be triggered;When calling the halt instruction collection of multimedia element to stop playing source file, stopping thing being triggered Part.It,, can be true when user terminal 100 detects that the broadcast event of multimedia element is triggered in implementation process based on this The fixed source file is played, and can be monitored to the playback progress of the source file, such as: monitoring the source file is Any time point of no broadcasting extremely setting.
In the present embodiment, the time point can carry out according to the play position of each sound bite in the source file Setting.For example, time point can be arranged in the following way:, can be at this for each sound bite for including in source file A time point is arranged in the initial time of sound bite.In a specific example: assuming that the source file is 2 minutes view Frequency file, wherein there are a sound bite between the 1st minute to the 1st point and 30 seconds, at the 1st point between 40 seconds to the 2nd minute There are another sound bites, then time point can be arranged at 40 seconds in the 1st minute, the 1st point respectively.
It should be appreciated that time point can also be arranged otherwise, as long as set time point energy in implementation process Enough identify the play position of the sound bite in the source file.For example, can be in the starting of a sound bite Time point is set at the several seconds before or after quarter, as long as not influencing user's viewing effect.
It optionally, may include each caption information corresponding period in the script file.Wherein, the word The curtain information corresponding period refers to sound bite corresponding with the caption information period locating in the source file. In one embodiment, the period can by the corresponding sound bite of the caption information in the source file institute The initial time at place and finish time indicate;In yet another embodiment, the time point can pass through the caption information The duration of corresponding sound bite initial time locating in the source file and the sound bite indicates.
In implementation process, time point extremely currently playing for the source file, from least one described caption information It will include period at the time point being determined as target time section in the corresponding period, then from least one described caption information In caption information corresponding with the target time section is determined as target caption information.Below by an example to step S32 It is illustrated.
By taking above-mentioned 2 minutes video files as an example, time point is respectively arranged at 40 seconds in the 1st minute, the 1st point.It is false If being configured in the script file, initial time is the 1st minute, finish time is the 1st point of 30 seconds caption information S1 and is risen Begin the moment be the 1st point 40 seconds, the caption information S2 that finish time is the 2nd minute.Then, it plays in the video file to the 1st minute When this time point, it can determine that the target time section in each period of script file record including the time point is the 1st point Zhong Zhi 1 divides 30 seconds this periods, and the period is corresponding with caption information S1, so when can by caption information S1 determine For target caption information.
When the video file was played to the 1st point of 40 seconds this time point, each time of script file record can be determined The target time section in section including the time point is the 1st point of 40 seconds to the 2nd minute this period, the period and caption information S2 is corresponding, so when caption information S2 can be determined as to target caption information.
Step S33 shows the target caption information found in the canvas element of the html page file.
In the present embodiment, canvas element refers to<canvas>element on html page file,<canvas>element phase When in a graphical container being defined on html page file,<canvas>element is provided with can be on<canvas>element The API (ApplicationProgrammingInterface, application programming interface) of graphing, by calling the API In instruction set can directly on<canvas>graphing.When implementing, instruction set getContext () can be passed through A context object is obtained, which is commonly referred to as rendering context (or G context), in the rendering Hereinafter include can directly on<canvas>element graphing a variety of instruction set, the rendering context is above-mentioned API。
In step s 32, when finding the target caption information from the script file, HTML page can be passed through The instruction set that the rendering context of canvas element in the file of face provides draws the target subtitle letter in the canvas element Breath.
Optionally, in an embodiment of the present embodiment, the html page file of the offer of content server 200 In may include the canvas element.In another embodiment of the present embodiment, it can received by user terminal 100 When the html page file that the content server 200 provides, the canvas element is created on the html page file.? In this case, caption presentation method provided in this embodiment can with the following steps are included:
When receiving html page file, the canvas element is created on the html page file.
By above-mentioned design, can source file play during, on<canvas>element automatically draw and source The corresponding caption information of the playback progress of file.When perhaps display effect in any caption information for need to change source file When, perhaps display effect in the caption information can be adjusted in above-mentioned script file, then by foot adjusted This document importing content server 200 can be opened up according to interior perhaps display effect adjusted automatically when playing source file Show the caption information.In compared to the prior art when any single subtitle of source file needs to adjust, need to reset whole All subtitles of a source file, the present embodiment provides the adjustment that caption presentation method can easily realize subtitle very much.
Optionally, in the present embodiment, when provided between when putting, can be in previous language for two neighboring sound bite A time point is set between at the beginning of the finish time of tablet section and next sound bite.Still with above-mentioned duration for 2 minutes Video file for, can be set in the 1st point of 30 seconds and the 1st point of any moment between 40 seconds one time point, such as can be with The 1st point of 31 seconds one time point of setting.When the source file is played to the 1st point and 31 seconds, will be unable in the script file Corresponding target caption information is found, at this point it is possible to remove the content shown in the canvas element.In this way, can make Caption information sound bite corresponding with its more precisely matches in time.
It optionally, in the present embodiment, include the captioned test of different subtitle types, such as Chinese in the caption information The captioned test of the captioned test of type and English type, can also be set as needed the text of other subtitle types certainly, Such as Russian type, Korean type, the present embodiment are without limitation.Target word curtain-like type is provided in the script file, The target word curtain-like type typically user wishes at least one subtitle type of display.Based on this, step S33 may include Step shown in Fig. 4.
Step S41 obtains the subtitle of the target word curtain-like type from the captioned test that the target subtitle information includes Text.
Step S42 shows the captioned test of the target word curtain-like type in the canvas element.
By above-mentioned design, being switched fast for subtitle type on the one hand may be implemented, on the other hand can make a source The captioned test of multiple caption type is shown in file.
It optionally, in the present embodiment, further include the part effect of at least one caption information in the script file Fruit information.In the case, step S42 may include step as shown in Figure 5.
Step S51 searches whether that there are the partial result information of the target caption information in the script file.If It is to then follow the steps S52, if it is not, can then execute step S53.
Step S52 shows the word of the target word curtain-like type in the canvas element according to the partial result information Curtain text.
Wherein, the partial result information is used to limit a variety of display effects of the target caption information, such as font, Whether uniline is shown, whether font has whether linear gradient effect, font have radial direction for font size, font color, font Fade effect, the background color of canvas element, background picture of canvas element etc..
Optionally, for any caption information be arranged partial result information when, can be arranged in the script file and Associated " style (the pattern) " field of the caption information, and by should the value of " style " field be arranged to the part of the caption information Effect information.In this way, in implementation process, if detected in the script file and the target subtitle information association " style " field can then determine that there are the partial result information of the target caption information in the script file, and by institute State partial result information of the value for being somebody's turn to do " style " field of target caption information as the target caption information.
Step S53 shows the target word curtain-like type according to the first global effect information in the canvas element Captioned test.
It optionally, can also include the first global effect information, the first global effect information in the script file For limiting a variety of display effects of any captioned test shown in the canvas element, for example, font, font size, word Whether uniline is shown, whether font has whether linear gradient effect, font have radial gradual effect etc. for body color, font. Optionally, the partial result information and the first global effect information may be the same or different, and the present embodiment is to this With no restrictions.
Optionally, in the present embodiment, in the script file can also include the second global effect information, described second Global effect information is used to limit the display effect of the canvas element, such as may include the display position of the canvas element It sets, the background color of the canvas element and the background image of the canvas element etc..In one example, as more matchmakers When element of volume is audio element, the canvas element can be located at the lower section of the audio element;When the multimedia element is When video elementary, the canvas element can be located at the bottom of the video elementary region.
It is global to the first global effect information configured in the script file and second below by a specific example Effect information is described.
Can be set in the script file not with associated " style " field of any caption information, for convenient for retouching It states, this is not set to the first style field about with associated " style " field of any caption information herein.First style field Value include the first global effect information and the second global effect information.For example, can be carried out as follows Configuration:
Wherein, " font " field indicates that font, " color " field indicate font color, and " bgColor " field indicates painting canvas The background color of element, " bgImage " field indicate the background picture of canvas element, and " position " field indicates canvas element Display position relative to the multimedia element;" isFullText " field indicates whether uniline is shown font, if its value is True indicates that uniline is shown, if its value is false, then it represents that multirow is shown;" isLinearGradient " field indicates font Whether there is linear gradient effect, if its value is true, then it represents that have that effect, otherwise do not have the effect; " isRadialGradient " field indicates whether font has radial gradual effect, if its value is true, has the effect, Otherwise do not have the effect.
In above-mentioned each field, the field of the effect for limiting font is the first global effect information, such as " font " Field, " color " field, " isFullText " field, " isLinearGradient " field, " isRadialGradient " word Section;The field of effect for limiting canvas element is the second global effect information, such as " bgColor " field, " bgImage " field, " position " field.
In the present embodiment, it is shown for realizing uniline, the code of linear gradient effect and radial gradual effect can match The predeterminated position in the script file is set, or configuration, in the default script file for being different from the script file, this is pre- If the address URL of script file or the default script file can be embedded in the html page file.When implementing, when upper The value of " isFullText " field, " isLinearGradient " field or " isRadialGradient " field for stating is true When, then corresponding code can be obtained from the predeterminated position of the default script file or the script file execute.
Below by way of a specific example, the caption information configured in the script file is described in detail.Institute State in script file, caption information can be indicated with " lrc " field, should the value of " lrc " field can be array, it is described Array includes at least one data object, may include corresponding with a voice unit in source file in the data object Caption information and the caption information corresponding period.In addition, the data object can also include the office of the caption information Portion's effect information.By taking the script file is JSON file as an example, it is referred to the caption information of following manner configuration source file:
Wherein, " cn " field indicates that subtitle type is the captioned test of Chinese type, and " en " field indicates that subtitle type is The captioned test of English type.It should be appreciated that the captioned test of other subtitle types can also be arranged as needed.
It is worth noting that, in JSON file, " [] ", " { } " was for limiting a number for limiting an array herein According to object.The value that " lrc " field is shown in above-mentioned example is the array for only including a data object.In the data object In, the captioned test of two kinds of subtitle types provided with a caption information, the respectively value of " cn " field and " en " field Value, wherein the value of " cn " field is the captioned test of Chinese type, and the value of " en " field is the captioned test of English type.
In the data object, the value of " beginTime " field is the initial time that the caption information occurs, and corresponding Initial time of the sound bite in source file it is identical, the value of " endTime " field is at the end of showing the caption information It carves, it is identical as finish time of the corresponding sound bite in source file.Wherein, " beginTime " field and " endTime " The unit of the value of field can be with self-setting, such as can be the second (s).
The data object includes " style " field, wherein belongs to the caption information and " style " of same data object Field is interrelated.For ease of description, " style " field associated with caption information is about set to the second style field.It is described The value of second style field indicates the partial result information of caption information associated by second style field.
Below with reference to above-mentioned two example, caption presentation method provided in this embodiment is provided in a specific example Detailed applications process.
Assuming that once-existing a length of 1 minute video file to be played, which includes being in the 5th second extremely 10th second sound bite X1, in the 25th second to the 35th second sound bite X2 and in the 45th second to the 60th second voice Segment X3.User can be according to the location of each sound bite in the video file to be played in the 5th second (t1), the 11st Time point is respectively arranged at second (t2), the 25th second (t3), the 36th second (t4) and the 45th second (t5).
The pre-configured JSON file A of user, JSON file A includes following content:
And the corresponding caption information Y1 of sound bite X1, caption information Y2 corresponding with sound bite X2 and and voice sheet The corresponding caption information Y3 of section X3;
The initial time of caption information Y1 corresponding period, i.e. sound bite X1 in the video file to be played (that is, the 5th second) and finish time (that is, the 10th second);
The initial time of caption information Y2 corresponding period, i.e. sound bite X2 in the video file to be played (that is, the 25th second) and finish time (that is, the 35th second);
The initial time of caption information Y3 corresponding period, i.e. sound bite X3 in the video file to be played (that is, the 45th second) and finish time (that is, the 60th second);
First global effect information, the second global effect information and target word curtain-like type, wherein the target word curtain-like type For Chinese type.
It in addition, the caption information Y2 of sound bite X2 needs to carry out Special display, therefore is described in the JSON file A Caption information Y2 is provided with one and associated " style " field of caption information Y2, and the value for being somebody's turn to do " style " field is caption information The partial result information of Y2.
Configured JSON file A is imported into content server 200 by user, so that content server 200 is described The JSON file A is quoted on html page file where video file to be played, also i.e. by the URL of the JSON file A Address is embedded on the html page file where the video file to be played.
In detail, caption presentation method may include steps of.
First, the html page file that 100 reception content server 200 of user terminal provides, in the html page file It carries the address URL of JSON file A, the video elementary for playing the video file to be played and one is pre-created Canvas element, the value of the src attribute of the video elementary is the address URL of the video file to be played.
Wherein, the video file to be played is the source file in the embodiment of the present application.
Second, user terminal 100 reads second in the JSON file A when receiving the html page file Global effect information, and show according to the second global effect information the canvas element on the html page file.
If user is after the completion of html page file loads, play control on click html page file, described in control Video file to be played plays out, then can trigger the broadcast event of the video elementary.
Third determines that the video file to be played is played when detecting the broadcast event of the video elementary, right The playback progress of the video file to be played is monitored, such as: whether the monitoring video file to be played plays to pre- Each time point being first arranged.
4th, when the video file to be played is played to time point t1, each time that can be recorded from JSON file A Determine that the target time section including time point t1 is the 0th second to the 5th second this period, the period and caption information Y1 in section It is corresponding, therefore caption information Y1 can be determined as to target caption information corresponding with time point t1.
5th, the captioned test of the Chinese type (that is, target word curtain-like type) of acquisition from caption information Y1, and by searching for It determines that there is no partial result information corresponding with caption information Y1 in JSON file A, therefore exists according to the first global effect information The captioned test of the Chinese type in caption information Y1 is drawn in canvas element.
6th, when the video file to be played is played to time point t2, do not find corresponding target subtitle letter Breath, can remove the content in canvas element.
7th, when the video file to be played is played to time point t3, each time that can be recorded from JSON file A Determine that the target time section including time point t3 is the 25th second to the 35th second this period, the period and caption information in section Y2 is corresponding, therefore caption information Y2 can be determined as to target caption information corresponding with time point t3.
8th, the captioned test of Chinese type is obtained from caption information Y2, and deposit by searching for determining in JSON file A In partial result information corresponding with caption information Y2, therefore caption information is drawn in canvas element according to the partial result information The captioned test of Chinese type in Y2.
9th, when the video file to be played is played to time point t4, do not find corresponding target subtitle letter Breath, can remove the content in canvas element.
Tenth, when the video file to be played is played to time point t5, each time that can be recorded from JSON file A Determine that the target time section including time point t5 is the 45th second to the 60th second this period, the period and caption information in section Y3 is corresponding, so as to which caption information Y3 is determined as target caption information corresponding with time point t5.
11st, the captioned test of Chinese type is obtained, and from caption information Y3 by searching in determining JSON file A There is no partial result information corresponding with caption information Y3, therefore word is drawn in canvas element according to the first global effect information The captioned test of Chinese type in curtain information Y3.
12nd, the video file broadcasting to be played terminates.
It, then can be in JSON file A if necessary to which Special Effect Show is arranged to sound bite X3 in implementation process Newly-increased and associated " style " field of caption information Y3 is somebody's turn to do the partial result information that " style " field is caption information Y3, To obtain updated JSON file A.Again by updated JSON file A importing content server 200.
When playing the video file to be played next time, above-mentioned step will be repeated based on updated JSON file A Rapid one to step 12.Wherein, operating procedure ten for the moment, can be by searching for existing in the updated JSON file A of determination Partial result information (that is: above-mentioned newly-increased " style " field) corresponding with caption information Y3, therefore according to the partial result information The captioned test of the Chinese type of caption information Y3 is drawn in canvas element.
It, then can be in script file if necessary to be adjusted to the content of caption information Y2 corresponding to sound bite X2 The captioned test that middle change caption information Y2 includes, then by the script file importing content server 200 after change.So, exist When playing the video file to be played next time, one will be repeated the above steps to step 10 based on the JSON file A after change Two, but in operation to step 8, the captioned test after changing will be drawn in canvas element.
Similarly, when need to perhaps effect is adjusted in other caption informations when, be referred to the above process into Row adjustment, details are not described herein.
As shown in fig. 6, being a kind of subtitling display equipment 110 provided by the embodiments of the present application, the subtitling display equipment 110 packet Include at least one functional module that can be stored in a software form in the machine readable storage medium 130.Functionally draw Point, the subtitling display equipment 110 may include receiving module 111, searching module 112 and display module 113.
Wherein, the receiving module 111 is used for the html page file that reception content server 200 provides, the HTML Page file includes multimedia element and script information corresponding with the source file of the multimedia element, is set in the source file It is equipped with multiple time points, includes at least one caption information and each subtitle letter in the corresponding script file of the script information Cease the corresponding period.
In the present embodiment, the multimedia element includes audio element or video elementary, and the source file includes video File or audio file.The receiving module 111 can be used for executing step S31, and description has as described in the receiving module 111 Body can be with the detailed description of reference pair step S31.
The searching module 112 is used for for the source file each time point for including, when the source file play to When the time point, the target time section including the time point is determined from the corresponding script file of the script information, and Target caption information corresponding with the target time section is searched from least one described caption information.
In the present embodiment, the searching module 112 can be used for executing step S32, about the searching module 112 Description is specifically referred to the detailed description to step S32.
Display module 113 in the canvas element of the html page file for showing the target subtitle found Information.
In the present embodiment, the display module 113 can be used for executing step S33, about the display module 113 Description specifically can be with the detailed description of reference pair step S33.
Optionally, include the captioned test of different subtitle types in the caption information, also set up in the script file There is target word curtain-like type.Based on this, the display module 113 specifically can be used for: the word for including from the target subtitle information The captioned test of the target word curtain-like type is obtained in curtain text;The target word curtain-like type is shown in the canvas element Captioned test.
It optionally, further include the partial result information of at least one caption information in the script file.Based on this, The display module 113 shows the captioned test of the target word curtain-like type in the canvas element of the html page file Concrete mode may include:
Search whether that there are the partial result information of the target caption information in the script file;If the script There are the partial result information of the target caption information in file, then believe in the canvas element according to the partial result Breath shows the captioned test of the target word curtain-like type.
It optionally, further include the first global effect information in the script file.Based on this, the display module 113 exists The canvas element of the html page file shows the concrete mode of the captioned test of the target word curtain-like type, can also wrap It includes:
If the partial result information of the target caption information is not present in the script file, in the canvas element On the captioned test of the target word curtain-like type is shown according to the first global effect information.
Optionally, the script file can also include the second global effect information.Based on this, the subtitling display equipment 110 can also include painting canvas display module 114.
The painting canvas display module 114 is used for aobvious according to the second global effect information on the html page file Show the canvas element.
In conclusion the embodiment of the present application provides a kind of caption presentation method, device and user terminal, user terminal is received The html page file that content server provides includes multimedia element and the source with multimedia element in the html page file File corresponding script information is provided with multiple time points in the source file, includes extremely in the corresponding script file of script information A few caption information and each caption information corresponding period;For each time point that source file includes, when the source file When playing to the time point, determined from the corresponding script file of script information include the time point target time section, from upper Target caption information corresponding with the target time section is searched at least one caption information stated, and in html page file The target caption information found is shown in canvas element.Wherein, multimedia element includes audio element or video elementary, source document Part includes video file or audio file.In this way, can be convenient the change quickly realized to caption content or subtitle effect.
In embodiment provided herein, it should be understood that disclosed device and method, it can also be by other Mode realize.The apparatus embodiments described above are merely exemplary, for example, the flow chart and block diagram in attached drawing are shown According to device, the architectural framework in the cards of method and computer program product, function of multiple embodiments of the application And operation.In this regard, each box in flowchart or block diagram can represent one of a module, section or code Point, a part of the module, section or code includes one or more for implementing the specified logical function executable Instruction.It should also be noted that function marked in the box can also be attached to be different from some implementations as replacement The sequence marked in figure occurs.For example, two continuous boxes can actually be basically executed in parallel, they sometimes may be used To execute in the opposite order, this depends on the function involved.It is also noted that each of block diagram and or flow chart The combination of box in box and block diagram and or flow chart can be based on the defined function of execution or the dedicated of movement The system of hardware is realized, or can be realized using a combination of dedicated hardware and computer instructions.
In addition, each functional module in each embodiment of the application can integrate one independent portion of formation together Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) execute each embodiment the method for the application all or part of the steps. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
The above, the only specific embodiment of the application, but the protection scope of the application is not limited thereto, it is any Those familiar with the art within the technical scope of the present application, can easily think of the change or the replacement, and should all contain Lid is within the scope of protection of this application.Therefore, the protection scope of the application shall be subject to the protection scope of the claim.

Claims (11)

1. a kind of caption presentation method, which is characterized in that the described method includes:
The hypertext markup language html page file that reception content server provides includes more matchmakers in the html page file Element of volume and script information corresponding with the source file of the multimedia element are provided with multiple time points in the source file, It include at least one caption information and each caption information corresponding period in the corresponding script file of the script information;
For each time point that the source file includes, when the source file was played to the time point, from the script The target time section including the time point is determined in the corresponding script file of information, and from least one described caption information Search target caption information corresponding with the target time section;
The target caption information found is shown in the canvas canvas element of the html page file;
Wherein, the multimedia element includes audio element or video elementary, and the source file includes video file or audio text Part.
2. caption presentation method according to claim 1, which is characterized in that include different subtitle classes in the caption information The captioned test of type is additionally provided with target word curtain-like type in the script file;
The target caption information found is shown in the canvas element of the html page file, comprising:
The captioned test of the target word curtain-like type is obtained from the captioned test that the target subtitle information includes;
The captioned test of the target word curtain-like type is shown in the canvas element.
3. caption presentation method according to claim 2, which is characterized in that further include at least one in the script file The partial result information of the caption information;The target word curtain-like type is shown in the canvas element of the html page file Captioned test, comprising:
Search whether that there are the partial result information of the target caption information in the script file;
If there are the partial result information of the target caption information in the script file, in the canvas element according to The partial result information shows the captioned test of the target word curtain-like type.
4. caption presentation method according to claim 3, which is characterized in that further include first overall situation in the script file Effect information;The captioned test of the target word curtain-like type is shown in the canvas element of the html page file, further includes:
If the partial result information of the target caption information is not present in the script file, pressed in the canvas element The captioned test of the target word curtain-like type is shown according to the first global effect information.
5. caption presentation method described in any one of -4 according to claim 1, which is characterized in that also wrapped in the script file Include the second global effect information;The method also includes:
The canvas element is shown according to the second global effect information on the html page file.
6. a kind of subtitling display equipment, which is characterized in that described device includes:
Receiving module, for the html page file that reception content server provides, the html page file includes multimedia Element and script information corresponding with the source file of the multimedia element are provided with multiple time points, institute in the source file State includes at least one caption information and each caption information corresponding period in the corresponding script file of script information;
Searching module, each time point for including for the source file, when the source file was played to the time point When, from the corresponding script file of the script information determine include the time point target time section, and from it is described at least Target caption information corresponding with the target time section is searched in one caption information;
Display module, for showing the target caption information found in the canvas element of the html page file;
Wherein, the multimedia element includes audio element or video elementary, and the source file includes video file or audio text Part.
7. subtitling display equipment according to claim 6, which is characterized in that include different subtitle classes in the caption information The captioned test of type is additionally provided with target word curtain-like type in the script file;The Subtitle Demonstration submodule, is specifically used for:
The captioned test of the target word curtain-like type is obtained from the captioned test that the target subtitle information includes;In the picture The captioned test of the target word curtain-like type is shown on cloth element.
8. subtitling display equipment according to claim 7, which is characterized in that further include at least one in the script file The partial result information of the caption information;The Subtitle Demonstration submodule is shown in the canvas element of the html page file The concrete mode for showing the captioned test of the target word curtain-like type includes:
Search whether that there are the partial result information of the target caption information in the script file;If the script file Middle there are the partial result information of the target caption information, then aobvious according to the partial result information in the canvas element Show the captioned test of the target word curtain-like type.
9. subtitling display equipment according to claim 8, which is characterized in that further include first overall situation in the script file Effect information;The Subtitle Demonstration submodule shows the target word curtain-like type in the canvas element of the html page file The concrete mode of captioned test further include:
If the partial result information of the target caption information is not present in the script file, pressed in the canvas element The captioned test of the target word curtain-like type is shown according to the first global effect information.
10. the subtitling display equipment according to any one of claim 6-9, which is characterized in that the script file also wraps Include the second global effect information;Described device further include:
Painting canvas display module, for showing the painting canvas according to the second global effect information on the html page file Element.
11. a kind of user terminal, which is characterized in that including processor and machine readable storage medium, the machine readable storage Media storage has the machine-executable instruction that can be executed by the processor, and the processor is by the machine-executable instruction Promote: realizing method of any of claims 1-5.
CN201811602071.3A 2018-12-26 2018-12-26 Caption presentation method, device and user terminal Pending CN109672919A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811602071.3A CN109672919A (en) 2018-12-26 2018-12-26 Caption presentation method, device and user terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811602071.3A CN109672919A (en) 2018-12-26 2018-12-26 Caption presentation method, device and user terminal

Publications (1)

Publication Number Publication Date
CN109672919A true CN109672919A (en) 2019-04-23

Family

ID=66146252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811602071.3A Pending CN109672919A (en) 2018-12-26 2018-12-26 Caption presentation method, device and user terminal

Country Status (1)

Country Link
CN (1) CN109672919A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111565338A (en) * 2020-05-29 2020-08-21 广州酷狗计算机科技有限公司 Method, device, system, equipment and storage medium for playing video
WO2021018177A1 (en) * 2019-08-01 2021-02-04 北京字节跳动网络技术有限公司 Method and apparatus for text effect processing
CN114092145A (en) * 2021-11-22 2022-02-25 京东方科技集团股份有限公司 Multimedia display control method, device and storage medium
CN114489397A (en) * 2021-12-29 2022-05-13 深圳市创易联合科技有限公司 Electronic canvas processing method, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6571271B1 (en) * 1999-05-03 2003-05-27 Ricoh Company, Ltd. Networked appliance for recording, storing and serving digital images
CN102752664A (en) * 2012-06-29 2012-10-24 奇智软件(北京)有限公司 Display method and device for text subtitle information in webpage
CN105704582A (en) * 2015-05-11 2016-06-22 深圳Tcl数字技术有限公司 Browser-based subtitle displaying method and device
CN107767871A (en) * 2017-10-12 2018-03-06 安徽听见科技有限公司 Text display method, terminal and server
CN108156480A (en) * 2017-12-27 2018-06-12 腾讯科技(深圳)有限公司 A kind of method, relevant apparatus and the system of video caption generation
CN108419113A (en) * 2018-05-24 2018-08-17 广州酷狗计算机科技有限公司 Caption presentation method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6571271B1 (en) * 1999-05-03 2003-05-27 Ricoh Company, Ltd. Networked appliance for recording, storing and serving digital images
CN102752664A (en) * 2012-06-29 2012-10-24 奇智软件(北京)有限公司 Display method and device for text subtitle information in webpage
CN105704582A (en) * 2015-05-11 2016-06-22 深圳Tcl数字技术有限公司 Browser-based subtitle displaying method and device
CN107767871A (en) * 2017-10-12 2018-03-06 安徽听见科技有限公司 Text display method, terminal and server
CN108156480A (en) * 2017-12-27 2018-06-12 腾讯科技(深圳)有限公司 A kind of method, relevant apparatus and the system of video caption generation
CN108419113A (en) * 2018-05-24 2018-08-17 广州酷狗计算机科技有限公司 Caption presentation method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
清宏计算机工作室: "《C++Builder 多媒体开发》", 31 January 2000 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021018177A1 (en) * 2019-08-01 2021-02-04 北京字节跳动网络技术有限公司 Method and apparatus for text effect processing
CN112395825A (en) * 2019-08-01 2021-02-23 北京字节跳动网络技术有限公司 Method and device for processing special effects of characters
CN111565338A (en) * 2020-05-29 2020-08-21 广州酷狗计算机科技有限公司 Method, device, system, equipment and storage medium for playing video
CN114092145A (en) * 2021-11-22 2022-02-25 京东方科技集团股份有限公司 Multimedia display control method, device and storage medium
CN114489397A (en) * 2021-12-29 2022-05-13 深圳市创易联合科技有限公司 Electronic canvas processing method, equipment and storage medium
CN114489397B (en) * 2021-12-29 2024-06-28 深圳市创易联合科技有限公司 Electronic canvas processing method, electronic canvas processing equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109672919A (en) Caption presentation method, device and user terminal
US9262548B2 (en) Multiple screen size render-engine
RU2434263C2 (en) Apparatus and methods for providing motion responsive output modifications in electronic device
CN113365134B (en) Audio sharing method, device, equipment and medium
CN104902333B (en) Video comments processing method and video comments processing means
CN110297996A (en) Cartoon display method, device, equipment and storage medium based on the H5 page
CN105096363A (en) Picture editing method and picture editing device
JP2007520110A (en) Content processing system, method, and computer program product for monitoring viewer mood
US20200249745A1 (en) Interface For Displaying Supplemental Dynamic Timeline Content
CN105657558B (en) A kind of information providing method, methods of exhibiting, device and smart television
CN108419141A (en) Subtitle position adjusting method and device, storage medium and electronic equipment
CN107277601A (en) Video broadcasting method and device
CN103686335A (en) Information processing method and electronic equipment
CN107450874B (en) Multimedia data double-screen playing method and system
AU2022338752A1 (en) Information reply method and apparatus, and electronic device, readable storage medium and program product
CN115297272A (en) Video processing method, device, equipment and storage medium
CN107592486A (en) A kind of video generation method and device
CN109819340A (en) Network address analysis method, device and readable storage medium storing program for executing in video display process
KR20240127482A (en) Video processing method and device, and nonvolatile computer-readable storage medium
CN113938619A (en) Video synthesis method, system and storage device based on browser
KR20040076649A (en) Apparatus and method for displaying browser graphic by aspect ratio
US20240295950A1 (en) Video collection presentation method and apparatus, electronic device, and readable storage medium
CN110087120A (en) The same window switching method and calculating equipment of online list and local list
CN104240736A (en) Variable audio-visual playing method
CN109327731A (en) A kind of real-time synthetic method of DIY video and system based on Karaoke

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190423