WO2023015416A1 - Subtitle processing method and apparatus, and storage medium - Google Patents

Subtitle processing method and apparatus, and storage medium Download PDF

Info

Publication number
WO2023015416A1
WO2023015416A1 PCT/CN2021/111597 CN2021111597W WO2023015416A1 WO 2023015416 A1 WO2023015416 A1 WO 2023015416A1 CN 2021111597 W CN2021111597 W CN 2021111597W WO 2023015416 A1 WO2023015416 A1 WO 2023015416A1
Authority
WO
WIPO (PCT)
Prior art keywords
subtitle
original
type
queue
target
Prior art date
Application number
PCT/CN2021/111597
Other languages
French (fr)
Chinese (zh)
Inventor
伍洋
张艳苹
郑炳委
Original Assignee
深圳Tcl新技术有限公司
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 深圳Tcl新技术有限公司 filed Critical 深圳Tcl新技术有限公司
Priority to PCT/CN2021/111597 priority Critical patent/WO2023015416A1/en
Publication of WO2023015416A1 publication Critical patent/WO2023015416A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting

Definitions

  • the present application relates to the technical field of subtitles, in particular to a subtitle processing method, device and storage medium.
  • each subtitle actually does not need an end time or even a start time (called super subtitle in some specifications).
  • super subtitle in some specifications.
  • ordinary subtitles should require at least one start time time. Therefore, whether the subtitles have an end time or not, the traditional way is to implement two sets of logic, interleave subtitles with an end time and subtitles without an end time, and process them in two processing logics respectively, which makes the control logic relatively complicated.
  • the embodiment of the present application provides a subtitle processing method, device and storage medium to effectively solve the problem that subtitles with an end time and subtitles without an end time are intertwined and processed in two processing logics respectively, which leads to relatively complicated control logic. question.
  • the present application provides a subtitle processing method, the method includes the steps of: obtaining an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle has an end time subtitles; performing a split operation on the first original subtitles to obtain first type subtitles and second type subtitles, wherein the start time of the first type subtitles is the start time of the first original subtitles , the start time of the second type of subtitle is the end time of the first original subtitle, the first type of subtitle and the second type of subtitle are subtitles without end time, and the first type is used for Instructing to render the subtitle content corresponding to the first original subtitle included in the subtitle of the type as a picture, and the second type is used to instruct the subtitle of the second type to perform canvas cleaning; based on the subtitle of the first type and the The second type of subtitles is used to generate a target subtitle queue corresponding to the original subtitle queue.
  • the operation of splitting the first subtitle further includes: converting the first subtitle with an end time into a second subtitle with
  • the splitting operation on the first original subtitle it also includes: judging whether the first original subtitle satisfies the splitting condition; correspondingly, performing the splitting operation on the first original subtitle , including: performing the splitting operation on the first original subtitle when it is satisfied.
  • the split condition includes: the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, or, the split condition includes: the first The original subtitle is the last subtitle in the original subtitle queue.
  • the splitting condition includes: the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, the judging whether the first original subtitle satisfies After splitting the condition, it also includes: when not satisfied, adjusting the end time of the first original subtitle to obtain the first target subtitle, the end time of the first target subtitle being the start of the next subtitle or, when not satisfied, adjust the start time of the next subtitle to obtain a second target subtitle, and the start time of the second target subtitle is the end time of the first original subtitle.
  • the target subtitle queue corresponding to the original subtitle queue based on the first type of subtitle and the second type of subtitle it also includes: judging the subtitle type of the currently dequeued subtitle, and the current dequeue The subtitle is any subtitle in the target subtitle queue; according to the subtitle type of the currently dequeued subtitle, render the currently dequeued subtitle to obtain the target canvas, wherein, when the subtitle of the currently dequeued subtitle When the subtitle type is the first type, the target canvas is the canvas obtained by rendering the subtitle content of the current out-of-line subtitle, and when the subtitle type of the current out-of-line subtitle is the second type, the The target canvas is the canvas obtained by performing the canvas cleanup operation.
  • the current out-of-line subtitle after rendering the current out-of-line subtitle according to the subtitle type of the current out-of-line subtitle to obtain the target canvas, it further includes: comparing whether the current playback progress time is greater than the starting time of the current out-of-line subtitle. start time; if so, display the target canvas.
  • the original subtitle queue further includes at least one second original subtitle, and the second original subtitle is a subtitle without an end time.
  • the present application provides a subtitle processing device, the device comprising: an acquisition module configured to acquire an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle The subtitles are subtitles with an end time; the splitting module is configured to perform a splitting operation on the first original subtitles acquired by the acquisition module to obtain subtitles of the first type and subtitles of the second type, wherein the first The start time of the type subtitle is the start time of the first original subtitle, the start time of the second type subtitle is the end time of the first original subtitle, the first type subtitle and the second Type subtitles are all subtitles with no end time, the first type is used to indicate that the subtitle content corresponding to the first original subtitle included in the type subtitle is rendered as a picture, and the second type is used to indicate the Perform canvas cleaning for the second type of subtitles; a generating module configured to generate a target subtitle queue corresponding to the original subtitle queue based on the first type of subtitle and the second type of subtitle obtained by performing a split operation by the splitting module
  • the device further includes: a judging module, configured to judge whether the first original subtitle satisfies the splitting condition before the splitting module performs the splitting operation on the first original subtitle; correspondingly, the The splitting module is configured to execute the splitting operation on the first original subtitle when the judging module judges that the first original subtitle meets the splitting condition.
  • the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, or the split condition includes: the first original subtitle is the original subtitle The last subtitle in the queue.
  • the device further includes: an adjustment module configured to After the judging module judges that the first original subtitle does not satisfy the splitting condition, the end time of the first original subtitle is adjusted to obtain a first target subtitle, and the end time of the first target subtitle is The start time of the next subtitle; or, adjust the start time of the next subtitle to obtain a second target subtitle, and the start time of the second target subtitle is the end of the first original subtitle time.
  • the judging module is further configured to judge the current out-of-queue subtitle queue after the generation module generates the target subtitle queue corresponding to the original subtitle queue based on the first type subtitle and the second type subtitle.
  • Subtitle type the current dequeue subtitle is any subtitle in the target subtitle queue;
  • the device also includes: a rendering module, used for determining the subtitle type of the current dequeue subtitle determined after judging by the judging module , rendering the currently out-of-line subtitles to obtain a target canvas, wherein, when the subtitle type of the current out-of-line subtitles is the first type, the target canvas is to perform subtitles on the current out-of-line subtitles
  • the device further includes: a comparison module, configured to compare whether the current playback progress time is greater than the start time of the current out-of-line subtitle; a display module, used for displaying the target canvas when the comparison module compares and determines that the current playback progress time is greater than the start time of the current out-of-line subtitle.
  • the present application provides a device, which includes: a processor and a memory; program instructions are stored in the memory; and the processor is configured to execute the program instructions stored in the memory, so that the The device implements the method described in any embodiment of the present application.
  • the present application provides a storage medium in which a plurality of instructions are stored, and the instructions are adapted to be loaded by a processor to perform the subtitle processing described in any embodiment of the present application. method.
  • the advantage of the present application is that, by parsing the first original subtitle with an end time from the original subtitle queue, performing a split operation on the first original subtitle with an end time, the first original subtitle is split to obtain the second One type of subtitle and the second type of subtitle, and generate a target subtitle queue, so that only the subtitles with the start time in the target subtitle queue need to be processed in one processing logic.
  • FIG. 1 is a flowchart of steps of a subtitle processing method provided in Embodiment 1 of the present application.
  • FIG. 2 is a flowchart of steps of a subtitle processing method provided in Embodiment 2 of the present application.
  • FIG. 3 is a flowchart of steps of a subtitle processing method provided in Embodiment 3 of the present application.
  • FIG. 4 is a schematic structural diagram of a subtitle processing apparatus provided in Embodiment 4 of the present application.
  • FIG. 5 is a schematic structural diagram of a storage medium applied to a device provided in Embodiment 5 of the present application.
  • Connected, or integrally connected it can be mechanically connected, or electrically connected, or can communicate with each other; it can be directly connected, or indirectly connected through an intermediary, and it can be the internal communication of two components or the interaction of two components relation.
  • FIG. 1 it is a flow chart of the steps of the subtitle processing method provided in Embodiment 1 of the present application.
  • the method comprises the steps of:
  • Step S101 the terminal obtains an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time.
  • the original subtitle queue includes one or more original subtitles, and each original subtitle has a start time.
  • the one or more original subtitles include at least one first original subtitle.
  • the first original subtitle refers to a subtitle with an end time.
  • the multiple subtitles may include at least one second original subtitle in addition to at least one first original subtitle.
  • the second original subtitle refers to a subtitle without an end time.
  • the multiple original subtitles are arranged in order of start time, thereby forming the original subtitle queue.
  • the first original subtitles and the second original subtitles may be arranged alternately, which is not limited in this embodiment of the present application.
  • Step S102 the terminal performs a split operation on the first original subtitle in the original subtitle queue to obtain the first type subtitle and the second type subtitle.
  • the terminal after acquiring the original subtitle queue, the terminal performs a split operation on the first original subtitle included in the original subtitle queue. It should be noted that, in the embodiment of the present application, when the original subtitle queue includes multiple first original subtitles, the terminal may perform a split operation on each of all the first original subtitles included in the original subtitle queue, or may The splitting operation is only performed on part of the first original subtitles in all the first original subtitles, which is not limited in this embodiment of the present application.
  • the terminal performs a split operation on the first original subtitle to obtain the first type subtitle and the second type subtitle.
  • both the first type subtitle and the second type subtitle are subtitles without end time;
  • the start time of the first type subtitle is the start time of the first original subtitle, and the subtitle type of the first type subtitle is the first type , the first type is used to indicate that the first type of subtitle contains the subtitle content of the first original subtitle, and the first type of subtitle is used to render the subtitle content into an image;
  • the start time of the second type of subtitle is the first An end time of the original time, and the subtitle type of the second type of subtitle is the second type, and the second type is used to indicate that no subtitle content is rendered for the second type of subtitle, and a canvas cleaning operation is performed.
  • the first original subtitle is played for 5s-10s and named Sub[5,10], that is, the start time of the first original subtitle Sub[5,10] is the 5th s, and the end time is the 10th s.
  • the subtitle type of the first type of subtitle Sub1[5, *] is the first type, and the first type can be identified by content;
  • Type II subtitle Sub1[10, *] subtitle type is the second type, and the second type can be identified by cleanup.
  • Table 1 it is a definition table of a subtitle type provided by the embodiment of the present application. It should be noted that what is shown in this table is only an illustration of the first type and the second type. In practical applications, other types and numbers of subtitle types may also be included, which is not limited in this embodiment of the present application.
  • subtitle type (subtitle) definition
  • first type (content) Render subtitle content as image
  • second type (cleanup) Render without content, immediately clear screen content
  • Step S103 the terminal generates a target subtitle queue according to the first type of subtitle and the second type of subtitle.
  • the terminal performs a split operation on each of the first original subtitles in all or part of the first original subtitles included in the original subtitle queue to obtain the first type of subtitles corresponding to each first original subtitle
  • a target subtitle queue corresponding to the original subtitle queue is generated according to the first type subtitle and the second type subtitle corresponding to each of the first original subtitles in all or part of the first original subtitles.
  • the target subtitle queue when the terminal performs a split operation on each first original subtitle in all the first original subtitles included in the original subtitle queue, contains all the first original subtitles The first type subtitle and the second type subtitle corresponding to each first original subtitle in .
  • the target subtitle queue still contains the one or more second original queues, and each first original subtitle in all the first original subtitles corresponds to The subtitles of the first type and the subtitles of the second type, and the one or more second original queues are arranged according to the starting time.
  • the target subtitle queue when the terminal performs a split operation on each of the first original subtitles in the part of the first original subtitles included in the original subtitle queue, contains the part of the first original subtitles The first type subtitle and the second type subtitle corresponding to each first original subtitle in .
  • the target subtitle queue also includes another part of the first original subtitles for which the split operation has not been performed, and each first original subtitle in the target subtitle queue for which the split operation has been performed corresponds to The subtitles of the first type, the subtitles of the second type, and the other part of the first original subtitles for which no splitting operation has been performed are arranged in sequence according to the start time of each subtitle.
  • the target subtitle queue still contains the one or more second original queues, and the first original subtitles that have been split
  • the subtitles of the first type and the subtitles of the second type corresponding to each first original subtitle, the other part of the first original subtitles for which the split operation has not been performed, and the one or more second original subtitles Time is arranged.
  • Embodiment 1 By parsing the first original subtitle with an end time from the original subtitle queue, performing a split operation on the first original subtitle to obtain the first type of subtitle and the second type of subtitle without an end time, thereby finally generating the original subtitle queue Corresponding to the target subtitle queue, since all subtitles in the target subtitle queue only have the start time, the control logic of subtitles can be simplified.
  • FIG. 2 it is a flowchart of the steps of the subtitle processing method provided by Embodiment 2 of the present application.
  • the method comprises the steps of:
  • Step S201 the terminal obtains an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time.
  • step S201 can be understood by referring to the relevant content of step S101 in the first embodiment, and will not be repeated here.
  • Step S202 judging whether the first original subtitle satisfies the splitting condition.
  • the terminal after acquiring the original subtitle queue, the terminal first judges each of the one or more first original subtitles included in the original subtitle queue, and judges whether each first original subtitle The split condition is met.
  • the splitting condition in this embodiment of the present application may include: the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time. That is, when the time interval between the end time of a certain first original subtitle and the start time of the next subtitle is greater than a preset time, it is determined that the first original subtitle satisfies the splitting condition.
  • the preset time may be any one of 30 milliseconds to 50 milliseconds. Assuming that the preset time is set to 40 ms, if the time interval between the end time of a certain first original subtitle and the start time of the next subtitle is greater than 40 ms, it is determined that the first original subtitle meets the splitting condition.
  • the splitting condition in this embodiment of the present application may include: the first original subtitle is the last subtitle in the original subtitle queue. That is, when a certain first original subtitle is the last subtitle in the original subtitle queue, the first original subtitle meets the splitting condition.
  • Step S203 When the splitting condition is met, perform a splitting operation on the first original subtitle to obtain the first type subtitle and the second type subtitle.
  • the terminal executes the splitting condition on each first original subtitle satisfying the splitting condition, so as to obtain the first type subtitle and the second type subtitle respectively corresponding to each first original subtitle.
  • step S230 can be understood by referring to the relevant content of step S102 in the first embodiment, and will not be repeated here.
  • Step S204 When not satisfied, adjust the end time of the first original subtitle to obtain the first target subtitle, and the end time of the first target subtitle is the start time of the next subtitle; or, when not satisfied, adjust the next subtitle
  • the start time of a subtitle is adjusted to obtain a second target subtitle, and the start time of the second target subtitle is the end time of the first original subtitle.
  • the first original subtitle when the first original subtitle does not meet the splitting condition, for example, the time interval between the end time of the first original subtitle mentioned in step S202 and the start time of the next subtitle is less than or equal to the preset time, the first original subtitle is not split, but the first original subtitle is adjusted to obtain the first target subtitle, that is, the end time of the first original subtitle that does not meet the split condition is adjusted to the end time of the next subtitle start time.
  • the first original subtitle does not meet the splitting condition
  • the first original subtitle is not split, but the next subtitle is adjusted to obtain the second target subtitle, that is, the start time of the next subtitle is adjusted to the The end time of the first raw subtitle.
  • the screen that performs canvas cleaning is likely to generate a splash screen. Therefore, for this first original subtitle that does not meet the splitting condition, splitting is not performed, but by adjusting the end time of the first original subtitle with an end time to be the same as the start time of the adjacent subtitle, that is, when the first original subtitle When a subtitle ends, an adjacent subtitle begins. Therefore, in terms of the time axis, connecting the first subtitle and the adjacent subtitle without time difference can prevent flickering of the screen.
  • Step S205 Based on the first type of subtitles and the second type of subtitles, generate a target subtitle queue corresponding to the original subtitle queue.
  • step S205 can be understood by referring to the relevant content of step S103 in the first embodiment, and will not be repeated here.
  • Embodiment 2 By parsing the first original subtitle with an end time from the original subtitle queue, performing a split operation on the first original subtitle to obtain the first type of subtitle and the second type of subtitle without an end time, thereby finally generating the original subtitle queue Corresponding to the target subtitle queue, since all subtitles in the target subtitle queue only have the start time, the control logic of subtitles can be simplified. Different from the first embodiment, the second embodiment can also realize the advantage of preventing the splash screen.
  • FIG. 3 it is a flowchart of the steps of the subtitle processing method provided by the third embodiment of the present application.
  • the method comprises the steps of:
  • Step S301 the terminal obtains an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time.
  • Step S302 performing a split operation on the first original subtitle to obtain a first type subtitle and a second type subtitle.
  • Step S303 Based on the first type of subtitles and the second type of subtitles, generate a target subtitle queue corresponding to the original subtitle queue.
  • steps S301 to S303 can be understood by referring to the relevant content of steps S101 to S103 in the first embodiment, and will not be repeated here.
  • Step S304 Determine the subtitle type of the currently dequeued subtitle, the currently dequeued subtitle is any subtitle in the target subtitle queue.
  • Step S305 According to the subtitle type of the currently dequeued subtitle, render the currently dequeued subtitle to obtain a target canvas.
  • the target canvas is the canvas obtained by rendering the subtitle content of the currently dequeued subtitle
  • the target canvas is a canvas obtained by performing a canvas cleaning operation
  • Step S306 Compare whether the current playback progress time is greater than the start time of the current out-of-queue subtitle.
  • Step S307 If yes, display the target canvas.
  • Embodiment 2 By parsing the first original subtitle with an end time from the original subtitle queue, performing a split operation on the first original subtitle to obtain the first type of subtitle and the second type of subtitle without an end time, thereby finally generating the original subtitle queue Corresponding to the target subtitle queue, since all subtitles in the target subtitle queue only have the start time, the control logic of subtitles can be simplified. Different from the first embodiment, the second embodiment can also realize the advantage of preventing the splash screen.
  • FIG. 4 it is a schematic structural diagram of a subtitle processing apparatus provided in Embodiment 4 of the present application.
  • the subtitle processing device includes: an acquisition module 10 , a split module 20 and a generation module 30 .
  • the acquiring module 10 is configured to acquire an original subtitle queue, where the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time.
  • the original subtitle queue includes one or more original subtitles, and each original subtitle has a start time.
  • the one or more original subtitles include at least one first original subtitle.
  • the first original subtitle refers to a subtitle with an end time.
  • the multiple subtitles may include at least one second original subtitle in addition to at least one first original subtitle.
  • the second original subtitle refers to a subtitle without an end time.
  • the multiple original subtitles are arranged in order of start time, thereby forming the original subtitle queue.
  • the first original subtitles and the second original subtitles may be arranged alternately, which is not limited in this embodiment of the present application.
  • the splitting module 20 is configured to perform a splitting operation on the first original subtitles acquired by the acquiring module, so as to obtain subtitles of the first type and subtitles of the second type.
  • the subtitle processing apparatus after acquiring the original subtitle queue, performs a split operation on the first original subtitle included in the original subtitle queue.
  • the terminal may perform a split operation on each of all the first original subtitles included in the original subtitle queue, or may The splitting operation is only performed on part of the first original subtitles in all the first original subtitles, which is not limited in this embodiment of the present application.
  • the terminal performs a split operation on the first original subtitle to obtain the first type subtitle and the second type subtitle.
  • both the first type subtitle and the second type subtitle are subtitles without end time;
  • the start time of the first type subtitle is the start time of the first original subtitle, and the subtitle type of the first type subtitle is the first type , the first type is used to indicate that the first type of subtitle contains the subtitle content of the first original subtitle, and the first type of subtitle is used to render the subtitle content into an image;
  • the start time of the second type of subtitle is the first An end time of the original time, and the subtitle type of the second type of subtitle is the second type, and the second type is used to indicate that no subtitle content is rendered for the second type of subtitle, and a canvas cleaning operation is performed.
  • the first original subtitle is played for 5s-10s and named Sub[5,10], that is, the start time of the first original subtitle Sub[5,10] is the 5th s, and the end time is the 10th s.
  • the subtitle type of the first type of subtitle Sub1[5, *] is the first type, and the first type can be identified by content;
  • Type II subtitle Sub1[10, *] subtitle type is the second type, and the second type can be identified by cleanup.
  • Table 1 it is a definition table of a subtitle type provided by the embodiment of the present application. It should be noted that what is shown in this table is only an illustration of the first type and the second type. In practical applications, other types and numbers of subtitle types may also be included, which is not limited in this embodiment of the present application.
  • subtitle type (subtitle) definition
  • first type (content) Render subtitle content as image
  • second type (cleanup) Render without content, immediately clear screen content
  • the generating module 30 is configured to generate a target subtitle queue corresponding to the original subtitle queue based on the first type of subtitle and the second type of subtitle obtained by the splitting operation performed by the splitting module.
  • the terminal performs a split operation on each of the first original subtitles in all or part of the first original subtitles included in the original subtitle queue to obtain the first type of subtitles corresponding to each first original subtitle
  • a target subtitle queue corresponding to the original subtitle queue is generated according to the first type subtitle and the second type subtitle corresponding to each of the first original subtitles in all or part of the first original subtitles.
  • the target subtitle queue when the terminal performs a split operation on each first original subtitle in all the first original subtitles included in the original subtitle queue, contains all the first original subtitles The first type subtitle and the second type subtitle corresponding to each first original subtitle in .
  • the target subtitle queue still contains the one or more second original queues, and each first original subtitle in all the first original subtitles corresponds to The subtitles of the first type and the subtitles of the second type, and the one or more second original queues are arranged according to the starting time.
  • the target subtitle queue when the terminal performs a split operation on each of the first original subtitles in the part of the first original subtitles included in the original subtitle queue, contains the part of the first original subtitles The first type subtitle and the second type subtitle corresponding to each first original subtitle in .
  • the target subtitle queue also includes another part of the first original subtitles for which the split operation has not been performed, and each first original subtitle in the target subtitle queue for which the split operation has been performed corresponds to The subtitles of the first type, the subtitles of the second type, and the other part of the first original subtitles for which no splitting operation has been performed are arranged in sequence according to the start time of each subtitle.
  • the target subtitle queue still contains the one or more second original queues, and the first original subtitles that have been split
  • the subtitles of the first type and the subtitles of the second type corresponding to each first original subtitle, the other part of the first original subtitles for which the split operation has not been performed, and the one or more second original subtitles Time is arranged.
  • the subtitle processing device may also include a judgment module, an adjustment module, a rendering module, a comparison module and a display module.
  • the functions of the above-mentioned modules are the same as their corresponding steps, and will not be repeated here.
  • a device 1000 is provided, and its internal structure diagram may be as shown in FIG. 5 .
  • the device 1000 includes a processor, a storage medium, a network interface, a display screen and an input device connected through a system bus.
  • the processor of the device 1000 is used to provide calculation and control capabilities.
  • the storage medium of the device 1000 includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and computer programs.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the network interface of the computer device is used to communicate with external computer devices via a network connection. When the computer program is executed by the processor, a subtitle processing method is realized.
  • the display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen
  • the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touch pad provided on the casing of the computer device , and can also be an external keyboard, touchpad, or mouse.
  • FIG. 5 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation to the computer equipment on which the solution of this application is applied.
  • the specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
  • a device 1000 which includes a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
  • the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time;
  • the start time of the first type subtitle is the start time of the first original subtitle
  • the The start time of the second type of subtitle is the end time of the first original subtitle
  • the first type of subtitle and the second type of subtitle are subtitles without an end time
  • the first type is used to indicate that the The subtitle content corresponding to the first original subtitle contained in the subtitle of the above type is rendered as a picture
  • the second type is used to instruct the subtitle of the second type to perform canvas cleaning
  • a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time;
  • the start time of the first type subtitle is the start time of the first original subtitle
  • the The start time of the second type of subtitle is the end time of the first original subtitle
  • the first type of subtitle and the second type of subtitle are subtitles without an end time
  • the first type is used to indicate that the The subtitle content corresponding to the first original subtitle contained in the subtitle of the above type is rendered as a picture
  • the second type is used to instruct the subtitle of the second type to perform canvas cleaning
  • Nonvolatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • DDRSDRAM Double Data Rate SDRAM
  • ESDRAM Enhanced SDRAM
  • SLDRAM Synchronous Chain Synchlink DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product comprises one or more computer programs or instructions. When the computer program or instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are executed in whole or in part.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer program or instructions may be stored in or transmitted via a computer-readable storage medium.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server integrating one or more available media.
  • the available medium may be a magnetic medium, for example, a floppy disk, a hard disk, or a tape; it may also be an optical medium, for example, a DVD; and it may also be a semiconductor medium, for example, a solid state disk (solid state disk, SSD).
  • a magnetic medium for example, a floppy disk, a hard disk, or a tape
  • it may also be an optical medium, for example, a DVD
  • it may also be a semiconductor medium, for example, a solid state disk (solid state disk, SSD).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Studio Circuits (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

A subtitle processing method and apparatus, and a storage medium. In the method, an original subtitle queue is parsed to obtain a first original subtitle with an end time; a splitting operation is performed on the first original subtitle with the end time, such that the first original subtitle is split into first-type subtitles and second-type subtitles; and a target subtitle queue is generated. In this way, there are only subtitles with starting times in the target subtitle queue, and only one processing logic is required for processing the target subtitle queue.

Description

字幕处理方法、装置及存储介质Subtitle processing method, device and storage medium 技术领域technical field
本申请涉及字幕技术领域,尤其涉及一种字幕处理方法、装置及存储介质。The present application relates to the technical field of subtitles, in particular to a subtitle processing method, device and storage medium.
背景技术Background technique
长久以来,多媒体播放中音视频的编解码技术、数据传输技术等始终是多媒体的技术核心,这往往让人不自觉地忽视了字幕的价值。然而随着软件技术的发展,正如网页技术的道路一样,从纯文本到富文本,承载的内容越来越丰富,透过字幕所传达的内容也越来越多。For a long time, audio and video codec technology and data transmission technology in multimedia playback have always been the core technology of multimedia, which often makes people unconsciously ignore the value of subtitles. However, with the development of software technology, just like the road of web technology, from plain text to rich text, more and more content is carried, and more and more content is conveyed through subtitles.
在字幕的控制逻辑中,每一个字幕实际上是可以不需要结束时间,甚至不需要起始时间的(部分规范中称为超级字幕),相较于超级字幕,普通字幕应至少需要一个起始时间。因此,在字幕有无结束时间上,传统方式是实现两套逻辑,对有结束时间的字幕和无结束时间的字幕交织在一起,分别在两个处理逻辑中处理,这样导致控制逻辑相对复杂。In the subtitle control logic, each subtitle actually does not need an end time or even a start time (called super subtitle in some specifications). Compared with super subtitles, ordinary subtitles should require at least one start time time. Therefore, whether the subtitles have an end time or not, the traditional way is to implement two sets of logic, interleave subtitles with an end time and subtitles without an end time, and process them in two processing logics respectively, which makes the control logic relatively complicated.
技术问题technical problem
本申请实施例提供一种字幕处理方法、装置及存储介质,以有效解决有结束时间的字幕和无结束时间的字幕交织在一起,分别在两个处理逻辑中处理,这样导致控制逻辑相对复杂的问题。The embodiment of the present application provides a subtitle processing method, device and storage medium to effectively solve the problem that subtitles with an end time and subtitles without an end time are intertwined and processed in two processing logics respectively, which leads to relatively complicated control logic. question.
技术解决方案technical solution
根据本申请的一方面,本申请提供一种字幕处理方法,所述方法包括步骤:获取原始字幕队列,所述原始字幕队列包括至少一个第一原始字幕,所述第一原始字幕为有结束时间的字幕;对所述第一原始字幕执行拆分操作,以得到第一类型字幕和第二类型字幕,其中,所述第一类型字幕的起始时间为所述第一原始字幕的起始时间,所述第二类型字幕的起始时间为所述第一原始字幕的结束时间,所述第一类型字幕和所述第二类型字幕均为无结束时间的字幕,所述第一类型用于指示将所述类型字幕所包含的所述第一原始字幕对应的字幕内容渲染为图片,所述第二类型用于指示所述第二类型字幕执行画布清理;基于所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列。进一步地,其中所述拆第一分操作还包括:将有结束时间的第一字幕转为有起始时间的第二字幕,其中所述第二字幕的起始时间等于第一字幕的结束时间。According to one aspect of the present application, the present application provides a subtitle processing method, the method includes the steps of: obtaining an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle has an end time subtitles; performing a split operation on the first original subtitles to obtain first type subtitles and second type subtitles, wherein the start time of the first type subtitles is the start time of the first original subtitles , the start time of the second type of subtitle is the end time of the first original subtitle, the first type of subtitle and the second type of subtitle are subtitles without end time, and the first type is used for Instructing to render the subtitle content corresponding to the first original subtitle included in the subtitle of the type as a picture, and the second type is used to instruct the subtitle of the second type to perform canvas cleaning; based on the subtitle of the first type and the The second type of subtitles is used to generate a target subtitle queue corresponding to the original subtitle queue. Further, the operation of splitting the first subtitle further includes: converting the first subtitle with an end time into a second subtitle with a start time, wherein the start time of the second subtitle is equal to the end time of the first subtitle .
进一步地,所述对所述第一原始字幕执行拆分操作之前,还包括:判断所述第一原始字幕是否满足拆分条件;对应地,所述对所述第一原始字幕执行拆分操作,包括:当满足时,对所述第一原始字幕执行所述拆分操作。Further, before performing the splitting operation on the first original subtitle, it also includes: judging whether the first original subtitle satisfies the splitting condition; correspondingly, performing the splitting operation on the first original subtitle , including: performing the splitting operation on the first original subtitle when it is satisfied.
进一步地,所述拆分条件包括:所述第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于预设时间,或者,所述拆分条件包括:所述第一原始字幕为所述原始字幕队列中的最后一个字幕。Further, the split condition includes: the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, or, the split condition includes: the first The original subtitle is the last subtitle in the original subtitle queue.
进一步地,当所述拆分条件包括:所述第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于预设时间时,所述判断所述第一原始字幕是否满足拆分条件之后,还包括:当不满足时,对所述第一原始字幕的结束时间进行调整以得到第一目标字幕,所述第一目标字幕的结束时间为所述下一字幕的起始时间;或者,当不满足时,对所述下一字幕的起始时间进行调整以得到第二目标字幕,所述第二目标字幕的起始时间为所述第一原始字幕的结束时间。Further, when the splitting condition includes: the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, the judging whether the first original subtitle satisfies After splitting the condition, it also includes: when not satisfied, adjusting the end time of the first original subtitle to obtain the first target subtitle, the end time of the first target subtitle being the start of the next subtitle or, when not satisfied, adjust the start time of the next subtitle to obtain a second target subtitle, and the start time of the second target subtitle is the end time of the first original subtitle.
进一步地,所述基于所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列之后,还包括:判断当前出队字幕的字幕类型,所述当前出队字幕为所述目标字幕队列中的任意一个字幕;根据所述当前出队字幕的字幕类型,对所述当前出队字幕进行渲染,以得到目标画布,其中,当所述当前出队字幕的字幕类型为所述第一类型时,所述目标画布为对所述当前出队字幕进行字幕内容的渲染得到的画布,当所述当前出队字幕的字幕类型为所述第二类型时,所述目标画布为执行画布清理操作得到的画布。Further, after generating the target subtitle queue corresponding to the original subtitle queue based on the first type of subtitle and the second type of subtitle, it also includes: judging the subtitle type of the currently dequeued subtitle, and the current dequeue The subtitle is any subtitle in the target subtitle queue; according to the subtitle type of the currently dequeued subtitle, render the currently dequeued subtitle to obtain the target canvas, wherein, when the subtitle of the currently dequeued subtitle When the subtitle type is the first type, the target canvas is the canvas obtained by rendering the subtitle content of the current out-of-line subtitle, and when the subtitle type of the current out-of-line subtitle is the second type, the The target canvas is the canvas obtained by performing the canvas cleanup operation.
进一步地,所述根据所述当前出队字幕的字幕类型,对所述当前出队字幕进行渲染,以得到目标画布之后,还包括:比较当前播放进度时间是否大于所述当前出队字幕的起始时间;若是,则对所述目标画布进行显示。Further, after rendering the current out-of-line subtitle according to the subtitle type of the current out-of-line subtitle to obtain the target canvas, it further includes: comparing whether the current playback progress time is greater than the starting time of the current out-of-line subtitle. start time; if so, display the target canvas.
进一步地,所述原始字幕队列还包括至少一个第二原始字幕,所述第二原始字幕为不具备结束时间的字幕。Further, the original subtitle queue further includes at least one second original subtitle, and the second original subtitle is a subtitle without an end time.
根据本申请的另一方面,本申请提供一种字幕处理装置,所述装置包括:获取模块,用于获取原始字幕队列,所述原始字幕队列包括至少一个第一原始字幕,所述第一原始字幕为有结束时间的字幕;拆分模块,用于对所述获取模块获取的所述第一原始字幕执行拆分操作,以得到第一类型字幕和第二类型字幕,其中,所述第一类型字幕的起始时间为所述第一原始字幕的起始时间,所述第二类型字幕的起始时间为所述第一原始字幕的结束时间,所述第一类型字幕和所述第二类型字幕均为无结束时间的字幕,所述第一类型用于指示将所述类型字幕所包含的所述第一原始字幕对应的字幕内容渲染为图片,所述第二类型用于指示所述第二类型字幕执行画布清理;生成模块,用于基于所述拆分模块执行拆分操作得到的所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列。According to another aspect of the present application, the present application provides a subtitle processing device, the device comprising: an acquisition module configured to acquire an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle The subtitles are subtitles with an end time; the splitting module is configured to perform a splitting operation on the first original subtitles acquired by the acquisition module to obtain subtitles of the first type and subtitles of the second type, wherein the first The start time of the type subtitle is the start time of the first original subtitle, the start time of the second type subtitle is the end time of the first original subtitle, the first type subtitle and the second Type subtitles are all subtitles with no end time, the first type is used to indicate that the subtitle content corresponding to the first original subtitle included in the type subtitle is rendered as a picture, and the second type is used to indicate the Perform canvas cleaning for the second type of subtitles; a generating module configured to generate a target subtitle queue corresponding to the original subtitle queue based on the first type of subtitle and the second type of subtitle obtained by performing a split operation by the splitting module .
进一步地,所述装置还包括:判断模块,用于在所述拆分模块对所述第一原始字幕执行拆分操作之前,判断所述第一原始字幕是否满足拆分条件;对应地,所述拆分模块,用于在所述判断模块判断所述第一原始字幕满足所述拆分条件时,对所述第一原始字幕执行所述拆分操作。Further, the device further includes: a judging module, configured to judge whether the first original subtitle satisfies the splitting condition before the splitting module performs the splitting operation on the first original subtitle; correspondingly, the The splitting module is configured to execute the splitting operation on the first original subtitle when the judging module judges that the first original subtitle meets the splitting condition.
进一步地,所述第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于预设时间,或者,所述拆分条件包括:所述第一原始字幕为所述原始字幕队列中的最后一个字幕。Further, the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, or the split condition includes: the first original subtitle is the original subtitle The last subtitle in the queue.
进一步地,当所述拆分条件包括:所述第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于预设时间时,所述装置还包括:调整模块,用于在所述判断模块判断所述第一原始字幕不满足所述拆分条件之后,对所述第一原始字幕的结束时间进行调整以得到第一目标字幕,所述第一目标字幕的结束时间为所述下一字幕的起始时间;或者,对所述下一字幕的起始时间进行调整以得到第二目标字幕,所述第二目标字幕的起始时间为所述第一原始字幕的结束时间。Further, when the splitting condition includes: the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, the device further includes: an adjustment module configured to After the judging module judges that the first original subtitle does not satisfy the splitting condition, the end time of the first original subtitle is adjusted to obtain a first target subtitle, and the end time of the first target subtitle is The start time of the next subtitle; or, adjust the start time of the next subtitle to obtain a second target subtitle, and the start time of the second target subtitle is the end of the first original subtitle time.
进一步地,所述判断模块,还用于在所述生成模块基于所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列之后,判断当前出队字幕的字幕类型,所述当前出队字幕为所述目标字幕队列中的任意一个字幕;所述装置还包括:渲染模块,用于根据所述判断模块判断后确定的所述当前出队字幕的字幕类型,对所述当前出队字幕进行渲染,以得到目标画布,其中,当所述当前出队字幕的字幕类型为所述第一类型时,所述目标画布为对所述当前出队字幕进行字幕内容的渲染得到的画布,当所述当前出队字幕的字幕类型为所述第二类型时,所述目标画布为执行画布清理操作得到的画布。Further, the judging module is further configured to judge the current out-of-queue subtitle queue after the generation module generates the target subtitle queue corresponding to the original subtitle queue based on the first type subtitle and the second type subtitle. Subtitle type, the current dequeue subtitle is any subtitle in the target subtitle queue; the device also includes: a rendering module, used for determining the subtitle type of the current dequeue subtitle determined after judging by the judging module , rendering the currently out-of-line subtitles to obtain a target canvas, wherein, when the subtitle type of the current out-of-line subtitles is the first type, the target canvas is to perform subtitles on the current out-of-line subtitles The canvas obtained by rendering the content, when the subtitle type of the currently dequeued subtitle is the second type, the target canvas is the canvas obtained by performing a canvas cleaning operation.
进一步地,所述装置还包括:比较模块,用于在所述渲染模块根据所述当前出队字幕的字幕类型对所述当前出队字幕进行渲染以得到目标画布之后,比较当前播放进度时间是否大于所述当前出队字幕的起始时间;显示模块,用于所述比较模块比较确定所述当前播放进度时间大于所述当前出队字幕的起始时间时,对所述目标画布进行显示。Further, the device further includes: a comparison module, configured to compare whether the current playback progress time is greater than the start time of the current out-of-line subtitle; a display module, used for displaying the target canvas when the comparison module compares and determines that the current playback progress time is greater than the start time of the current out-of-line subtitle.
根据本申请的另一方面,本申请提供一种设备,所述设备包括:处理器和存储器;所述存储器中存储有程序指令;所述处理器用于执行存储器中存储的程序指令,以使得所述设备实现本申请任一实施例所述的方法。According to another aspect of the present application, the present application provides a device, which includes: a processor and a memory; program instructions are stored in the memory; and the processor is configured to execute the program instructions stored in the memory, so that the The device implements the method described in any embodiment of the present application.
根据本申请的另一方面,本申请提供一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行本申请任一实施例所述的字幕的处理方法。According to another aspect of the present application, the present application provides a storage medium in which a plurality of instructions are stored, and the instructions are adapted to be loaded by a processor to perform the subtitle processing described in any embodiment of the present application. method.
有益效果Beneficial effect
本申请的优点在于,通过从所述原始字幕队列中解析出有结束时间的第一原始字幕,对所述有结束时间的第一原始字幕执行拆分操作,将第一原始字幕拆分得到第一类型字幕和第二类型字幕,并生成目标字幕队列,从而实现目标字幕队列中仅有起始时间的字幕,仅需在一种处理逻辑中处理。The advantage of the present application is that, by parsing the first original subtitle with an end time from the original subtitle queue, performing a split operation on the first original subtitle with an end time, the first original subtitle is split to obtain the second One type of subtitle and the second type of subtitle, and generate a target subtitle queue, so that only the subtitles with the start time in the target subtitle queue need to be processed in one processing logic.
附图说明Description of drawings
下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其它有益效果显而易见。The technical solutions and other beneficial effects of the present application will be apparent through the detailed description of the specific embodiments of the present application below in conjunction with the accompanying drawings.
图1为本申请实施例一提供的一种字幕处理方法的步骤流程图。FIG. 1 is a flowchart of steps of a subtitle processing method provided in Embodiment 1 of the present application.
图2为本申请实施例二提供的一种字幕处理方法的步骤流程图。FIG. 2 is a flowchart of steps of a subtitle processing method provided in Embodiment 2 of the present application.
图3为本申请实施例三提供的一种字幕处理方法的步骤流程图。FIG. 3 is a flowchart of steps of a subtitle processing method provided in Embodiment 3 of the present application.
图4为本申请实施例四提供的一种字幕处理装置的结构示意图。FIG. 4 is a schematic structural diagram of a subtitle processing apparatus provided in Embodiment 4 of the present application.
图5为本申请实施例五提供的一种存储介质应用于设备的结构示意图。FIG. 5 is a schematic structural diagram of a storage medium applied to a device provided in Embodiment 5 of the present application.
本发明的实施方式Embodiments of the present invention
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。在本申请的描述中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接或可以相互通讯;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本申请中的具体含义。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Apparently, the described embodiments are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts belong to the scope of protection of this application. In the description of this application, it should be noted that unless otherwise specified and limited, the terms "installation", "connection", and "connection" should be understood in a broad sense, for example, it can be a fixed connection or a detachable connection. Connected, or integrally connected; it can be mechanically connected, or electrically connected, or can communicate with each other; it can be directly connected, or indirectly connected through an intermediary, and it can be the internal communication of two components or the interaction of two components relation. Those of ordinary skill in the art can understand the specific meanings of the above terms in this application according to specific situations.
如图1所示,本申请实施例一提供的字幕处理方法的步骤流程图。所述方法包括步骤:As shown in FIG. 1 , it is a flow chart of the steps of the subtitle processing method provided in Embodiment 1 of the present application. The method comprises the steps of:
步骤S101:终端获取原始字幕队列,该原始字幕队列包括至少一个第一原始字幕,该第一原始字幕为有结束时间的字幕。Step S101: the terminal obtains an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time.
在本申请实施例中,原始字幕队列中包括一个或多个原始字幕,每个原始字幕都具备起始时间。其中,该一个或多个原始字幕包括至少一个第一原始字幕。本申请实施例中,第一原始字幕是指具备结束时间的字幕。当原始字幕队列中包含多个字幕时,该多个字幕除了包含至少一个第一原始字幕,还可以包含至少一个第二原始字幕。本申请实施例中,第二原始字幕是指无结束时间的字幕。In this embodiment of the present application, the original subtitle queue includes one or more original subtitles, and each original subtitle has a start time. Wherein, the one or more original subtitles include at least one first original subtitle. In this embodiment of the present application, the first original subtitle refers to a subtitle with an end time. When the original subtitle queue includes multiple subtitles, the multiple subtitles may include at least one second original subtitle in addition to at least one first original subtitle. In this embodiment of the present application, the second original subtitle refers to a subtitle without an end time.
当原始字幕队列中包含多个原始字幕时,该多个原始字幕按照起始时间的先后顺序依次排列,从而形成该原始字幕队列。其中,第一原始字幕和第二原始字幕可以交错排列,本申请实施例对此不做限定。When the original subtitle queue contains multiple original subtitles, the multiple original subtitles are arranged in order of start time, thereby forming the original subtitle queue. Wherein, the first original subtitles and the second original subtitles may be arranged alternately, which is not limited in this embodiment of the present application.
步骤S102:终端对所述原始字幕队列中的第一原始字幕执行拆分操作,以得到第一类型字幕和第二类型字幕。Step S102: the terminal performs a split operation on the first original subtitle in the original subtitle queue to obtain the first type subtitle and the second type subtitle.
本申请实施例中,终端在获取原始字幕队列之后,对原始字幕队列所包含的第一原始字幕执行拆分操作。需要说明的是,本申请实施例中,当原始字幕队列包括多个第一原始字幕时,终端可以是对原始字幕队列所包含的全部第一原始字幕中的每一个执行拆分操作,也可以仅仅对全部第一原始字幕中的部分第一原始字幕执行拆分操作,本申请实施例对此不作限定。In the embodiment of the present application, after acquiring the original subtitle queue, the terminal performs a split operation on the first original subtitle included in the original subtitle queue. It should be noted that, in the embodiment of the present application, when the original subtitle queue includes multiple first original subtitles, the terminal may perform a split operation on each of all the first original subtitles included in the original subtitle queue, or may The splitting operation is only performed on part of the first original subtitles in all the first original subtitles, which is not limited in this embodiment of the present application.
本申请实施例中,以其中任意一个第一原始字幕为例,终端对第一原始字幕执行拆分操作均得到第一类型字幕和第二类型字幕。其中,第一类型字幕和第二类型字幕均为无结束时间的字幕;第一类型字幕的起始时间为该第一原始字幕的起始时间,且第一类型字幕的字幕类型为第一类型,该第一类型用于指示第一类型字幕包含了该第一原始字幕的字幕内容,且第一类型字幕用于进行将该字幕内容渲染为图像;第二类型字幕的起始时间为该第一原始时间的结束时间,且第二类型字幕的字幕类型为第二类型,该第二类型用于指示对第二类型字幕无字幕内容渲染,执行画布清理操作。In this embodiment of the present application, taking any one of the first original subtitles as an example, the terminal performs a split operation on the first original subtitle to obtain the first type subtitle and the second type subtitle. Wherein, both the first type subtitle and the second type subtitle are subtitles without end time; the start time of the first type subtitle is the start time of the first original subtitle, and the subtitle type of the first type subtitle is the first type , the first type is used to indicate that the first type of subtitle contains the subtitle content of the first original subtitle, and the first type of subtitle is used to render the subtitle content into an image; the start time of the second type of subtitle is the first An end time of the original time, and the subtitle type of the second type of subtitle is the second type, and the second type is used to indicate that no subtitle content is rendered for the second type of subtitle, and a canvas cleaning operation is performed.
例如,假设该第一原始字幕为播放时段为5s-10s,命名为Sub[5,10],即第一原始字幕Sub[5,10]的起始时间为第5s,结束时间为第10s。对该第一原始字幕执行拆分操作,得到第一类型字幕Sub1[5, *]和第二类型字幕Sub2[10, *],其中,*表示无结束时间;第一类型字幕Sub1[5, *]的字幕类型为第一类型,该第一类型可以用content标识;第二类型字幕Sub1[10, *]的字幕类型为第二类型,该第二类型可以用cleanup标识。如表1所示,为本申请实施例提供的一种字幕类型的定义表格。需要说明的是,该表格所示仅为第一类型和第二类型的一种示意,在实际应用中,还可以包含其他类型和其他数量的字幕类型,本申请实施例对此不作限定。For example, assuming that the first original subtitle is played for 5s-10s and named Sub[5,10], that is, the start time of the first original subtitle Sub[5,10] is the 5th s, and the end time is the 10th s. Perform a split operation on the first original subtitle to obtain the first type of subtitle Sub1[5, *] and the second type of subtitle Sub2[10, *], where * means no end time; the subtitle type of the first type of subtitle Sub1[5, *] is the first type, and the first type can be identified by content; Type II subtitle Sub1[10, *] subtitle type is the second type, and the second type can be identified by cleanup. As shown in Table 1, it is a definition table of a subtitle type provided by the embodiment of the present application. It should be noted that what is shown in this table is only an illustration of the first type and the second type. In practical applications, other types and numbers of subtitle types may also be included, which is not limited in this embodiment of the present application.
表1 字幕类型的定义Table 1 Definition of subtitle types
字幕类型(subtitle) subtitle type (subtitle) 定义 definition
第一类型(content) The first type (content) 将字幕内容渲染为图像 Render subtitle content as image
第二类型(cleanup) The second type (cleanup) 无内容渲染,立即清除屏幕内容 Render without content, immediately clear screen content
步骤S103:终端根据第一类型字幕和第二类型字幕,生成目标字幕队列。Step S103: the terminal generates a target subtitle queue according to the first type of subtitle and the second type of subtitle.
本申请实施例中,终端在对原始字幕队列中所包含的全部或部分第一原始字幕中的每个第一原始字幕执行拆分操作,得到每个第一原始字幕分别对应的第一类型字幕和第二类型字幕后,根据该全部或部分第一原始字幕中的每个第一原始字幕所对应的第一类型字幕和第二类型字幕,生成原始字幕队列对应的目标字幕队列。In this embodiment of the present application, the terminal performs a split operation on each of the first original subtitles in all or part of the first original subtitles included in the original subtitle queue to obtain the first type of subtitles corresponding to each first original subtitle After subtitles of the second type are combined, a target subtitle queue corresponding to the original subtitle queue is generated according to the first type subtitle and the second type subtitle corresponding to each of the first original subtitles in all or part of the first original subtitles.
可选地,本申请实施例中,当终端对原始字幕队列中所包含的全部第一原始字幕中的每个第一原始字幕执行拆分操作时,目标字幕队列中包含该全部第一原始字幕中的每个第一原始字幕所对应的第一类型字幕和第二类型字幕。当原始字幕队列中还包含有一个或多个第二原始队列时,目标字幕队列中依然包含该一个或多个第二原始队列,全部第一原始字幕中的每个第一原始字幕所对应的第一类型字幕和第二类型字幕,以及该一个或多个第二原始队列按照起始时间进行排列。Optionally, in this embodiment of the present application, when the terminal performs a split operation on each first original subtitle in all the first original subtitles included in the original subtitle queue, the target subtitle queue contains all the first original subtitles The first type subtitle and the second type subtitle corresponding to each first original subtitle in . When the original subtitle queue also contains one or more second original queues, the target subtitle queue still contains the one or more second original queues, and each first original subtitle in all the first original subtitles corresponds to The subtitles of the first type and the subtitles of the second type, and the one or more second original queues are arranged according to the starting time.
可选地,本申请实施例中,当终端对原始字幕队列中所包含的部分第一原始字幕中的每个第一原始字幕执行拆分操作时,目标字幕队列中包含该部分第一原始字幕中的每个第一原始字幕所对应的第一类型字幕和第二类型字幕。在这种情况下,目标字幕队列中还包含另外一部分未执行拆分操作的第一原始字幕,目标字幕队列中执行了拆分操作的部分第一原始字幕中的每个第一原始字幕对应的第一类型字幕和第二类型字幕,以及该另外一部分未执行拆分操作的第一原始字幕按照每个字幕的起始时间顺序排列。可选地,当原始字幕队列中还包含有一个或多个第二原始队列时,目标字幕队列中依然包含该一个或多个第二原始队列,执行了拆分操作的第一原始字幕中的每个第一原始字幕所对应的第一类型字幕和第二类型字幕、该另外一部分未执行拆分操作的第一原始字幕,以及该一个或多个第二原始队列按照每个字幕的起始时间进行排列。Optionally, in this embodiment of the present application, when the terminal performs a split operation on each of the first original subtitles in the part of the first original subtitles included in the original subtitle queue, the target subtitle queue contains the part of the first original subtitles The first type subtitle and the second type subtitle corresponding to each first original subtitle in . In this case, the target subtitle queue also includes another part of the first original subtitles for which the split operation has not been performed, and each first original subtitle in the target subtitle queue for which the split operation has been performed corresponds to The subtitles of the first type, the subtitles of the second type, and the other part of the first original subtitles for which no splitting operation has been performed are arranged in sequence according to the start time of each subtitle. Optionally, when the original subtitle queue also contains one or more second original queues, the target subtitle queue still contains the one or more second original queues, and the first original subtitles that have been split The subtitles of the first type and the subtitles of the second type corresponding to each first original subtitle, the other part of the first original subtitles for which the split operation has not been performed, and the one or more second original subtitles Time is arranged.
实施例一通过从原始字幕队列中解析出有结束时间的第一原始字幕,对第一原始字幕执行拆分操作得到无结束时间的第一类型字幕和第二类型字幕,从而最终生成原始字幕队列对应目标字幕队列,由于目标字幕队列中所有字幕只有起始时间,从而可以简化字幕的控制逻辑。Embodiment 1 By parsing the first original subtitle with an end time from the original subtitle queue, performing a split operation on the first original subtitle to obtain the first type of subtitle and the second type of subtitle without an end time, thereby finally generating the original subtitle queue Corresponding to the target subtitle queue, since all subtitles in the target subtitle queue only have the start time, the control logic of subtitles can be simplified.
如图2所示,本申请实施例二提供的字幕处理方法的步骤流程图。所述方法包括步骤:As shown in FIG. 2 , it is a flowchart of the steps of the subtitle processing method provided by Embodiment 2 of the present application. The method comprises the steps of:
步骤S201:终端获取原始字幕队列,所述原始字幕队列包括至少一个第一原始字幕,所述第一原始字幕为有结束时间的字幕。Step S201: the terminal obtains an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time.
本申请实施例中,步骤S201可参阅实施例一中步骤S101的相关内容进行理解,此处不再赘述。In the embodiment of the present application, step S201 can be understood by referring to the relevant content of step S101 in the first embodiment, and will not be repeated here.
步骤S202:判断所述第一原始字幕是否满足拆分条件。Step S202: judging whether the first original subtitle satisfies the splitting condition.
本申请实施例中,终端在获取该原始字幕队列之后,首先对原始字幕队列所包含的一个或多个第一原始字幕中的每一个第一原始字幕进行判断,判断每个第一原始字幕是否满足拆分条件。In this embodiment of the present application, after acquiring the original subtitle queue, the terminal first judges each of the one or more first original subtitles included in the original subtitle queue, and judges whether each first original subtitle The split condition is met.
可选地,本申请实施例中的拆分条件可以包括:第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于预设时间。即当某一个第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于预设时间,则确定该第一原始字幕满足拆分条件。例如,预设时间可以为30毫秒至50毫秒中的任意一个取值。假设设定预设时间为40ms,若某一个第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于40ms,则确定该第一原始字幕满足拆分条件。Optionally, the splitting condition in this embodiment of the present application may include: the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time. That is, when the time interval between the end time of a certain first original subtitle and the start time of the next subtitle is greater than a preset time, it is determined that the first original subtitle satisfies the splitting condition. For example, the preset time may be any one of 30 milliseconds to 50 milliseconds. Assuming that the preset time is set to 40 ms, if the time interval between the end time of a certain first original subtitle and the start time of the next subtitle is greater than 40 ms, it is determined that the first original subtitle meets the splitting condition.
可选地,本申请实施例中的拆分条件可以包括:第一原始字幕为原始字幕队列中的最后一个字幕。即当某个第一原始字幕为原始字幕队列中的最后一个字幕时,该第一原始字幕满足拆分条件。Optionally, the splitting condition in this embodiment of the present application may include: the first original subtitle is the last subtitle in the original subtitle queue. That is, when a certain first original subtitle is the last subtitle in the original subtitle queue, the first original subtitle meets the splitting condition.
步骤S203:当满足拆分条件时,对第一原始字幕执行拆分操作,以得到第一类型字幕和第二类型字幕。Step S203: When the splitting condition is met, perform a splitting operation on the first original subtitle to obtain the first type subtitle and the second type subtitle.
本申请实施例中,终端对于满足拆分条件的每个第一原始字幕执行拆分条件,以得到该每个第一原始字幕分别对应的第一类型字幕和第二类型字幕。具体的,步骤S230可参阅实施例一中步骤S102的相关内容进行理解,此处不再赘述。In this embodiment of the present application, the terminal executes the splitting condition on each first original subtitle satisfying the splitting condition, so as to obtain the first type subtitle and the second type subtitle respectively corresponding to each first original subtitle. Specifically, step S230 can be understood by referring to the relevant content of step S102 in the first embodiment, and will not be repeated here.
步骤S204:当不满足时,对第一原始字幕的结束时间进行调整以得到第一目标字幕,第一目标字幕的结束时间为下一字幕的起始时间;或者,当不满足时,对下一字幕的起始时间进行调整以得到第二目标字幕,第二目标字幕的起始时间为第一原始字幕的结束时间。Step S204: When not satisfied, adjust the end time of the first original subtitle to obtain the first target subtitle, and the end time of the first target subtitle is the start time of the next subtitle; or, when not satisfied, adjust the next subtitle The start time of a subtitle is adjusted to obtain a second target subtitle, and the start time of the second target subtitle is the end time of the first original subtitle.
本申请实施例中,当第一原始字幕不满足拆分条件时,例如步骤S202所提到的第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔小于或等于预设时间,则不对第一原始字幕进行拆分,而是对第一原始字幕进行调整,从而得到第一目标字幕,即将该不满足拆分条件的第一原始字幕的结束时间调整为下个字幕的起始时间。或者,当第一原始字幕不满足拆分条件时,不对第一原始字幕进行拆分,而是对下一字幕进行调整,从而得到第二目标字幕,即将下一字幕的起始时间调整为该第一原始字幕的结束时间。In this embodiment of the application, when the first original subtitle does not meet the splitting condition, for example, the time interval between the end time of the first original subtitle mentioned in step S202 and the start time of the next subtitle is less than or equal to the preset time, the first original subtitle is not split, but the first original subtitle is adjusted to obtain the first target subtitle, that is, the end time of the first original subtitle that does not meet the split condition is adjusted to the end time of the next subtitle start time. Or, when the first original subtitle does not meet the splitting condition, the first original subtitle is not split, but the next subtitle is adjusted to obtain the second target subtitle, that is, the start time of the next subtitle is adjusted to the The end time of the first raw subtitle.
在本申请实施例中,由于第二类型字幕为执行画布清理,当第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔较小时,执行画布清理屏幕容易产生闪屏。因此,对于这种不满足拆分条件的第一原始字幕,就不进行拆分,而是通过调整有结束时间的第一原始字幕的结束时间与相邻字幕的起始时间相同,即当第一字幕结束时,相邻字幕开始。因此,从时间轴上来说,将第一字幕与相邻字幕无时间差的衔接在一起,可以防止闪屏。In the embodiment of the present application, since the second type of subtitle is to perform canvas cleaning, when the time interval between the end time of the first original subtitle and the start time of the next subtitle is small, the screen that performs canvas cleaning is likely to generate a splash screen. Therefore, for this first original subtitle that does not meet the splitting condition, splitting is not performed, but by adjusting the end time of the first original subtitle with an end time to be the same as the start time of the adjacent subtitle, that is, when the first original subtitle When a subtitle ends, an adjacent subtitle begins. Therefore, in terms of the time axis, connecting the first subtitle and the adjacent subtitle without time difference can prevent flickering of the screen.
步骤S205:基于所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列。Step S205: Based on the first type of subtitles and the second type of subtitles, generate a target subtitle queue corresponding to the original subtitle queue.
本申请实施例中,步骤S205可参阅实施例一中步骤S103的相关内容进行理解,此处不再赘述。In the embodiment of the present application, step S205 can be understood by referring to the relevant content of step S103 in the first embodiment, and will not be repeated here.
实施例二通过从原始字幕队列中解析出有结束时间的第一原始字幕,对第一原始字幕执行拆分操作得到无结束时间的第一类型字幕和第二类型字幕,从而最终生成原始字幕队列对应目标字幕队列,由于目标字幕队列中所有字幕只有起始时间,从而可以简化字幕的控制逻辑。与实施例一不同的是实施例二还可以实现防止闪屏的优点。Embodiment 2 By parsing the first original subtitle with an end time from the original subtitle queue, performing a split operation on the first original subtitle to obtain the first type of subtitle and the second type of subtitle without an end time, thereby finally generating the original subtitle queue Corresponding to the target subtitle queue, since all subtitles in the target subtitle queue only have the start time, the control logic of subtitles can be simplified. Different from the first embodiment, the second embodiment can also realize the advantage of preventing the splash screen.
如图3所示,本申请实施例三提供的字幕处理方法的步骤流程图。所述方法包括步骤:As shown in FIG. 3 , it is a flowchart of the steps of the subtitle processing method provided by the third embodiment of the present application. The method comprises the steps of:
步骤S301:终端获取原始字幕队列,所述原始字幕队列包括至少一个第一原始字幕,所述第一原始字幕为有结束时间的字幕。Step S301: the terminal obtains an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time.
步骤S302:对所述第一原始字幕执行拆分操作,以得到第一类型字幕和第二类型字幕。Step S302: performing a split operation on the first original subtitle to obtain a first type subtitle and a second type subtitle.
步骤S303:基于所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列。Step S303: Based on the first type of subtitles and the second type of subtitles, generate a target subtitle queue corresponding to the original subtitle queue.
本申请实施例中,步骤S301至S303可参阅实施例一中步骤S101至S103的相关内容进行理解,此处不再赘述。In the embodiment of the present application, steps S301 to S303 can be understood by referring to the relevant content of steps S101 to S103 in the first embodiment, and will not be repeated here.
步骤S304:判断当前出队字幕的字幕类型,所述当前出队字幕为所述目标字幕队列中的任意一个字幕。Step S304: Determine the subtitle type of the currently dequeued subtitle, the currently dequeued subtitle is any subtitle in the target subtitle queue.
步骤S305:根据所述当前出队字幕的字幕类型,对所述当前出队字幕进行渲染,以得到目标画布。Step S305: According to the subtitle type of the currently dequeued subtitle, render the currently dequeued subtitle to obtain a target canvas.
本申请实施例中,,当所述当前出队字幕的字幕类型为所述第一类型时,所述目标画布为对所述当前出队字幕进行字幕内容的渲染得到的画布,当所述当前出队字幕的字幕类型为所述第二类型时,所述目标画布为执行画布清理操作得到的画布。In this embodiment of the present application, when the subtitle type of the currently dequeued subtitle is the first type, the target canvas is the canvas obtained by rendering the subtitle content of the currently dequeued subtitle, and when the current When the subtitle type of the dequeued subtitle is the second type, the target canvas is a canvas obtained by performing a canvas cleaning operation.
步骤S306:比较当前播放进度时间是否大于所述当前出队字幕的起始时间。Step S306: Compare whether the current playback progress time is greater than the start time of the current out-of-queue subtitle.
步骤S307:若是,则对所述目标画布进行显示。Step S307: If yes, display the target canvas.
实施例二通过从原始字幕队列中解析出有结束时间的第一原始字幕,对第一原始字幕执行拆分操作得到无结束时间的第一类型字幕和第二类型字幕,从而最终生成原始字幕队列对应目标字幕队列,由于目标字幕队列中所有字幕只有起始时间,从而可以简化字幕的控制逻辑。与实施例一不同的是实施例二还可以实现防止闪屏的优点。Embodiment 2 By parsing the first original subtitle with an end time from the original subtitle queue, performing a split operation on the first original subtitle to obtain the first type of subtitle and the second type of subtitle without an end time, thereby finally generating the original subtitle queue Corresponding to the target subtitle queue, since all subtitles in the target subtitle queue only have the start time, the control logic of subtitles can be simplified. Different from the first embodiment, the second embodiment can also realize the advantage of preventing the splash screen.
如图4所示,本申请实施例四提供的一种字幕处理装置的结构示意图。所述字幕处理装置包括:获取模块10、拆分模块20和生成模块30。As shown in FIG. 4 , it is a schematic structural diagram of a subtitle processing apparatus provided in Embodiment 4 of the present application. The subtitle processing device includes: an acquisition module 10 , a split module 20 and a generation module 30 .
获取模块10用于获取原始字幕队列,所述原始字幕队列包括至少一个第一原始字幕,所述第一原始字幕为有结束时间的字幕。The acquiring module 10 is configured to acquire an original subtitle queue, where the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time.
在本申请实施例中,原始字幕队列中包括一个或多个原始字幕,每个原始字幕都具备起始时间。其中,该一个或多个原始字幕包括至少一个第一原始字幕。本申请实施例中,第一原始字幕是指具备结束时间的字幕。当原始字幕队列中包含多个字幕时,该多个字幕除了包含至少一个第一原始字幕,还可以包含至少一个第二原始字幕。本申请实施例中,第二原始字幕是指无结束时间的字幕。In this embodiment of the present application, the original subtitle queue includes one or more original subtitles, and each original subtitle has a start time. Wherein, the one or more original subtitles include at least one first original subtitle. In this embodiment of the present application, the first original subtitle refers to a subtitle with an end time. When the original subtitle queue includes multiple subtitles, the multiple subtitles may include at least one second original subtitle in addition to at least one first original subtitle. In this embodiment of the present application, the second original subtitle refers to a subtitle without an end time.
当原始字幕队列中包含多个原始字幕时,该多个原始字幕按照起始时间的先后顺序依次排列,从而形成该原始字幕队列。其中,第一原始字幕和第二原始字幕可以交错排列,本申请实施例对此不做限定。When the original subtitle queue contains multiple original subtitles, the multiple original subtitles are arranged in order of start time, thereby forming the original subtitle queue. Wherein, the first original subtitles and the second original subtitles may be arranged alternately, which is not limited in this embodiment of the present application.
拆分模块20用于对所述获取模块获取的所述第一原始字幕执行拆分操作,以得到第一类型字幕和第二类型字幕。The splitting module 20 is configured to perform a splitting operation on the first original subtitles acquired by the acquiring module, so as to obtain subtitles of the first type and subtitles of the second type.
本申请实施例中,字幕处理装置在获取原始字幕队列之后,对原始字幕队列所包含的第一原始字幕执行拆分操作。需要说明的是,本申请实施例中,当原始字幕队列包括多个第一原始字幕时,终端可以是对原始字幕队列所包含的全部第一原始字幕中的每一个执行拆分操作,也可以仅仅对全部第一原始字幕中的部分第一原始字幕执行拆分操作,本申请实施例对此不作限定。In this embodiment of the present application, after acquiring the original subtitle queue, the subtitle processing apparatus performs a split operation on the first original subtitle included in the original subtitle queue. It should be noted that, in the embodiment of the present application, when the original subtitle queue includes multiple first original subtitles, the terminal may perform a split operation on each of all the first original subtitles included in the original subtitle queue, or may The splitting operation is only performed on part of the first original subtitles in all the first original subtitles, which is not limited in this embodiment of the present application.
本申请实施例中,以其中任意一个第一原始字幕为例,终端对第一原始字幕执行拆分操作均得到第一类型字幕和第二类型字幕。其中,第一类型字幕和第二类型字幕均为无结束时间的字幕;第一类型字幕的起始时间为该第一原始字幕的起始时间,且第一类型字幕的字幕类型为第一类型,该第一类型用于指示第一类型字幕包含了该第一原始字幕的字幕内容,且第一类型字幕用于进行将该字幕内容渲染为图像;第二类型字幕的起始时间为该第一原始时间的结束时间,且第二类型字幕的字幕类型为第二类型,该第二类型用于指示对第二类型字幕无字幕内容渲染,执行画布清理操作。In this embodiment of the present application, taking any one of the first original subtitles as an example, the terminal performs a split operation on the first original subtitle to obtain the first type subtitle and the second type subtitle. Wherein, both the first type subtitle and the second type subtitle are subtitles without end time; the start time of the first type subtitle is the start time of the first original subtitle, and the subtitle type of the first type subtitle is the first type , the first type is used to indicate that the first type of subtitle contains the subtitle content of the first original subtitle, and the first type of subtitle is used to render the subtitle content into an image; the start time of the second type of subtitle is the first An end time of the original time, and the subtitle type of the second type of subtitle is the second type, and the second type is used to indicate that no subtitle content is rendered for the second type of subtitle, and a canvas cleaning operation is performed.
例如,假设该第一原始字幕为播放时段为5s-10s,命名为Sub[5,10],即第一原始字幕Sub[5,10]的起始时间为第5s,结束时间为第10s。对该第一原始字幕执行拆分操作,得到第一类型字幕Sub1[5, *]和第二类型字幕Sub2[10, *],其中,*表示无结束时间;第一类型字幕Sub1[5, *]的字幕类型为第一类型,该第一类型可以用content标识;第二类型字幕Sub1[10, *]的字幕类型为第二类型,该第二类型可以用cleanup标识。如表1所示,为本申请实施例提供的一种字幕类型的定义表格。需要说明的是,该表格所示仅为第一类型和第二类型的一种示意,在实际应用中,还可以包含其他类型和其他数量的字幕类型,本申请实施例对此不作限定。For example, assuming that the first original subtitle is played for 5s-10s and named Sub[5,10], that is, the start time of the first original subtitle Sub[5,10] is the 5th s, and the end time is the 10th s. Perform a split operation on the first original subtitle to obtain the first type of subtitle Sub1[5, *] and the second type of subtitle Sub2[10, *], where * means no end time; the subtitle type of the first type of subtitle Sub1[5, *] is the first type, and the first type can be identified by content; Type II subtitle Sub1[10, *] subtitle type is the second type, and the second type can be identified by cleanup. As shown in Table 1, it is a definition table of a subtitle type provided by the embodiment of the present application. It should be noted that what is shown in this table is only an illustration of the first type and the second type. In practical applications, other types and numbers of subtitle types may also be included, which is not limited in this embodiment of the present application.
表1 字幕类型的定义Table 1 Definition of subtitle types
字幕类型(subtitle) subtitle type (subtitle) 定义 definition
第一类型(content) The first type (content) 将字幕内容渲染为图像 Render subtitle content as image
第二类型(cleanup) The second type (cleanup) 无内容渲染,立即清除屏幕内容 Render without content, immediately clear screen content
生成模块30用于基于所述拆分模块执行拆分操作得到的所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列。The generating module 30 is configured to generate a target subtitle queue corresponding to the original subtitle queue based on the first type of subtitle and the second type of subtitle obtained by the splitting operation performed by the splitting module.
本申请实施例中,终端在对原始字幕队列中所包含的全部或部分第一原始字幕中的每个第一原始字幕执行拆分操作,得到每个第一原始字幕分别对应的第一类型字幕和第二类型字幕后,根据该全部或部分第一原始字幕中的每个第一原始字幕所对应的第一类型字幕和第二类型字幕,生成原始字幕队列对应的目标字幕队列。In this embodiment of the present application, the terminal performs a split operation on each of the first original subtitles in all or part of the first original subtitles included in the original subtitle queue to obtain the first type of subtitles corresponding to each first original subtitle After subtitles of the second type are combined, a target subtitle queue corresponding to the original subtitle queue is generated according to the first type subtitle and the second type subtitle corresponding to each of the first original subtitles in all or part of the first original subtitles.
可选地,本申请实施例中,当终端对原始字幕队列中所包含的全部第一原始字幕中的每个第一原始字幕执行拆分操作时,目标字幕队列中包含该全部第一原始字幕中的每个第一原始字幕所对应的第一类型字幕和第二类型字幕。当原始字幕队列中还包含有一个或多个第二原始队列时,目标字幕队列中依然包含该一个或多个第二原始队列,全部第一原始字幕中的每个第一原始字幕所对应的第一类型字幕和第二类型字幕,以及该一个或多个第二原始队列按照起始时间进行排列。Optionally, in this embodiment of the present application, when the terminal performs a split operation on each first original subtitle in all the first original subtitles included in the original subtitle queue, the target subtitle queue contains all the first original subtitles The first type subtitle and the second type subtitle corresponding to each first original subtitle in . When the original subtitle queue also contains one or more second original queues, the target subtitle queue still contains the one or more second original queues, and each first original subtitle in all the first original subtitles corresponds to The subtitles of the first type and the subtitles of the second type, and the one or more second original queues are arranged according to the starting time.
可选地,本申请实施例中,当终端对原始字幕队列中所包含的部分第一原始字幕中的每个第一原始字幕执行拆分操作时,目标字幕队列中包含该部分第一原始字幕中的每个第一原始字幕所对应的第一类型字幕和第二类型字幕。在这种情况下,目标字幕队列中还包含另外一部分未执行拆分操作的第一原始字幕,目标字幕队列中执行了拆分操作的部分第一原始字幕中的每个第一原始字幕对应的第一类型字幕和第二类型字幕,以及该另外一部分未执行拆分操作的第一原始字幕按照每个字幕的起始时间顺序排列。可选地,当原始字幕队列中还包含有一个或多个第二原始队列时,目标字幕队列中依然包含该一个或多个第二原始队列,执行了拆分操作的第一原始字幕中的每个第一原始字幕所对应的第一类型字幕和第二类型字幕、该另外一部分未执行拆分操作的第一原始字幕,以及该一个或多个第二原始队列按照每个字幕的起始时间进行排列。Optionally, in this embodiment of the present application, when the terminal performs a split operation on each of the first original subtitles in the part of the first original subtitles included in the original subtitle queue, the target subtitle queue contains the part of the first original subtitles The first type subtitle and the second type subtitle corresponding to each first original subtitle in . In this case, the target subtitle queue also includes another part of the first original subtitles for which the split operation has not been performed, and each first original subtitle in the target subtitle queue for which the split operation has been performed corresponds to The subtitles of the first type, the subtitles of the second type, and the other part of the first original subtitles for which no splitting operation has been performed are arranged in sequence according to the start time of each subtitle. Optionally, when the original subtitle queue also contains one or more second original queues, the target subtitle queue still contains the one or more second original queues, and the first original subtitles that have been split The subtitles of the first type and the subtitles of the second type corresponding to each first original subtitle, the other part of the first original subtitles for which the split operation has not been performed, and the one or more second original subtitles Time is arranged.
所述字幕处理装置还可以包括判断模块、调整模块、渲染模块、比较模块和显示模块。上述模块的作用均与其对应的步骤相同,在此不再赘述。The subtitle processing device may also include a judgment module, an adjustment module, a rendering module, a comparison module and a display module. The functions of the above-mentioned modules are the same as their corresponding steps, and will not be repeated here.
在本申请的实施例五中,提供了一种设备1000,其内部结构图可以如图5所示。该设备1000包括通过系统总线连接的处理器、存储介质、网络接口、显示屏和输入设备。其中,该设备1000的处理器用于提供计算和控制能力。该设备1000的存储介质包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的计算机设备通过网络连接通信。该计算机程序被处理器执行时以实现一种字幕的处理方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入设备可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In Embodiment 5 of the present application, a device 1000 is provided, and its internal structure diagram may be as shown in FIG. 5 . The device 1000 includes a processor, a storage medium, a network interface, a display screen and an input device connected through a system bus. Wherein, the processor of the device 1000 is used to provide calculation and control capabilities. The storage medium of the device 1000 includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with external computer devices via a network connection. When the computer program is executed by the processor, a subtitle processing method is realized. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touch pad provided on the casing of the computer device , and can also be an external keyboard, touchpad, or mouse.
本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in Figure 5 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation to the computer equipment on which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
在一个实施例中,提供了一种设备1000,其包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a device 1000 is provided, which includes a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
获取原始字幕队列,所述原始字幕队列包括至少一个第一原始字幕,所述第一原始字幕为有结束时间的字幕;Obtain an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time;
对所述第一原始字幕执行拆分操作,以得到第一类型字幕和第二类型字幕,其中,所述第一类型字幕的起始时间为所述第一原始字幕的起始时间,所述第二类型字幕的起始时间为所述第一原始字幕的结束时间,所述第一类型字幕和所述第二类型字幕均为无结束时间的字幕,所述第一类型用于指示将所述类型字幕所包含的所述第一原始字幕对应的字幕内容渲染为图片,所述第二类型用于指示所述第二类型字幕执行画布清理;performing a split operation on the first original subtitle to obtain a first type subtitle and a second type subtitle, wherein the start time of the first type subtitle is the start time of the first original subtitle, and the The start time of the second type of subtitle is the end time of the first original subtitle, the first type of subtitle and the second type of subtitle are subtitles without an end time, and the first type is used to indicate that the The subtitle content corresponding to the first original subtitle contained in the subtitle of the above type is rendered as a picture, and the second type is used to instruct the subtitle of the second type to perform canvas cleaning;
基于所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列。Based on the first type of subtitles and the second type of subtitles, generate a target subtitle queue corresponding to the original subtitle queue.
在另一个实施例中,提供了一种存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In another embodiment, a storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
获取原始字幕队列,所述原始字幕队列包括至少一个第一原始字幕,所述第一原始字幕为有结束时间的字幕;Obtain an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time;
对所述第一原始字幕执行拆分操作,以得到第一类型字幕和第二类型字幕,其中,所述第一类型字幕的起始时间为所述第一原始字幕的起始时间,所述第二类型字幕的起始时间为所述第一原始字幕的结束时间,所述第一类型字幕和所述第二类型字幕均为无结束时间的字幕,所述第一类型用于指示将所述类型字幕所包含的所述第一原始字幕对应的字幕内容渲染为图片,所述第二类型用于指示所述第二类型字幕执行画布清理;performing a split operation on the first original subtitle to obtain a first type subtitle and a second type subtitle, wherein the start time of the first type subtitle is the start time of the first original subtitle, and the The start time of the second type of subtitle is the end time of the first original subtitle, the first type of subtitle and the second type of subtitle are subtitles without an end time, and the first type is used to indicate that the The subtitle content corresponding to the first original subtitle contained in the subtitle of the above type is rendered as a picture, and the second type is used to instruct the subtitle of the second type to perform canvas cleaning;
基于所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列。Based on the first type of subtitles and the second type of subtitles, generate a target subtitle queue corresponding to the original subtitle queue.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的存储介质、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM (PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM (RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the computer programs can be stored in a non-volatile computer storage medium. When the computer program is executed, it may include the procedures of the embodiments of the above-mentioned methods. Wherein, any references to storage media, storage, databases or other media used in various embodiments provided in this application may include non-volatile and/or volatile memories. Nonvolatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机程序或指令。在计算机上加载和执行所述计算机程序或指令时,全部或部分地执行本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其它可编程设备。所述计算机程序或指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是集成一个或多个可用介质的服务器等数据存储设备。所述可用介质可以是磁性介质,例如,软盘、硬盘、磁带;也可以是光介质,例如,DVD;还可以是半导体介质,例如,固态硬盘(solid state disk,SSD)。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer programs or instructions. When the computer program or instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are executed in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer program or instructions may be stored in or transmitted via a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server integrating one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, or a tape; it may also be an optical medium, for example, a DVD; and it may also be a semiconductor medium, for example, a solid state disk (solid state disk, SSD).
在本申请的各个实施例中,如果没有特殊说明以及逻辑冲突,不同的实施例之间的术语或描述具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。In each embodiment of the present application, if there is no special explanation and logical conflict, the terms or descriptions between different embodiments are consistent and can be referred to each other, and the technical features in different embodiments are based on their inherent logical relationship Can be combined to form new embodiments. In this application, "at least one" means one or more, and "multiple" means two or more.
可以理解的是,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定。It can be understood that the various numbers involved in the embodiments of the present application are only for convenience of description, and are not used to limit the scope of the embodiments of the present application. The size of the serial numbers of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic.
以上对本申请实施例所提供的字幕处理方法进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The subtitle processing method provided by the embodiment of the present application has been described in detail above. The principle and implementation of the present application have been explained by using specific examples in this paper. The description of the above embodiment is only used to help understand the method of the present application and its implementation. core idea; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be construed as limiting the application .
本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。In this paper, specific examples are used to illustrate the principle and implementation of the application. The description of the above embodiments is only used to help understand the method and core idea of the application; meanwhile, for those skilled in the art, according to the application Thoughts, specific implementation methods and application ranges all have changes. In summary, the content of this specification should not be construed as limiting the application.

Claims (16)

  1. 一种字幕处理方法,其特征在于,包括:A subtitle processing method is characterized in that, comprising:
    获取原始字幕队列,所述原始字幕队列包括至少一个第一原始字幕,所述第一原始字幕为有结束时间的字幕;Obtain an original subtitle queue, the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time;
    对所述第一原始字幕执行拆分操作,以得到第一类型字幕和第二类型字幕,其中,所述第一类型字幕的起始时间为所述第一原始字幕的起始时间,所述第二类型字幕的起始时间为所述第一原始字幕的结束时间,所述第一类型字幕和所述第二类型字幕均为无结束时间的字幕,所述第一类型用于指示将所述类型字幕所包含的所述第一原始字幕对应的字幕内容渲染为图片,所述第二类型用于指示所述第二类型字幕执行画布清理;performing a split operation on the first original subtitle to obtain a first type subtitle and a second type subtitle, wherein the start time of the first type subtitle is the start time of the first original subtitle, and the The start time of the second type of subtitle is the end time of the first original subtitle, the first type of subtitle and the second type of subtitle are subtitles without an end time, and the first type is used to indicate that the The subtitle content corresponding to the first original subtitle contained in the subtitle of the above type is rendered as a picture, and the second type is used to instruct the subtitle of the second type to perform canvas cleaning;
    基于所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列。Based on the first type of subtitles and the second type of subtitles, generate a target subtitle queue corresponding to the original subtitle queue.
  2. 根据权利要求1所述的方法,其特征在于,所述对所述第一原始字幕执行拆分操作之前,还包括:The method according to claim 1, wherein before performing the splitting operation on the first original subtitle, further comprising:
    判断所述第一原始字幕是否满足拆分条件;judging whether the first original subtitle satisfies the splitting condition;
    对应地,所述对所述第一原始字幕执行拆分操作,包括:Correspondingly, performing the splitting operation on the first original subtitle includes:
    当满足时,对所述第一原始字幕执行所述拆分操作。When satisfied, perform the splitting operation on the first original subtitle.
  3. 根据权利要求2所述的方法,其特征在于,所述拆分条件包括:所述第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于预设时间,或者,The method according to claim 2, wherein the splitting condition comprises: the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, or,
    所述拆分条件包括:所述第一原始字幕为所述原始字幕队列中的最后一个字幕。The splitting condition includes: the first original subtitle is the last subtitle in the original subtitle queue.
  4. 根据权利要求2所述的方法,其特征在于,当所述拆分条件包括:所述第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于预设时间时,所述判断所述第一原始字幕是否满足拆分条件之后,还包括:The method according to claim 2, wherein when the splitting condition includes: the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, the After determining whether the first original subtitle satisfies the splitting condition, it also includes:
    当不满足时,对所述第一原始字幕的结束时间进行调整以得到第一目标字幕,所述第一目标字幕的结束时间为所述下一字幕的起始时间;或者,When not satisfied, the end time of the first original subtitle is adjusted to obtain the first target subtitle, and the end time of the first target subtitle is the start time of the next subtitle; or,
    当不满足时,对所述下一字幕的起始时间进行调整以得到第二目标字幕,所述第二目标字幕的起始时间为所述第一原始字幕的结束时间。When not satisfied, the start time of the next subtitle is adjusted to obtain a second target subtitle, and the start time of the second target subtitle is the end time of the first original subtitle.
  5. 根据权利要求1-3任一所述的方法,其特征在于,所述基于所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列之后,还包括:The method according to any one of claims 1-3, wherein, after generating the target subtitle queue corresponding to the original subtitle queue based on the first type subtitle and the second type subtitle, further comprising:
    判断当前出队字幕的字幕类型,所述当前出队字幕为所述目标字幕队列中的任意一个字幕;Judging the subtitle type of the current dequeue subtitle, the current dequeue subtitle is any subtitle in the target subtitle queue;
    根据所述当前出队字幕的字幕类型,对所述当前出队字幕进行渲染,以得到目标画布,其中,当所述当前出队字幕的字幕类型为所述第一类型时,所述目标画布为对所述当前出队字幕进行字幕内容的渲染得到的画布,当所述当前出队字幕的字幕类型为所述第二类型时,所述目标画布为执行画布清理操作得到的画布。According to the subtitle type of the currently dequeued subtitle, render the currently dequeued subtitle to obtain a target canvas, wherein, when the subtitle type of the currently dequeued subtitle is the first type, the target canvas is the canvas obtained by rendering the subtitle content of the currently dequeued subtitle, and when the subtitle type of the currently dequeued subtitle is the second type, the target canvas is a canvas obtained by performing a canvas cleaning operation.
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述当前出队字幕的字幕类型,对所述当前出队字幕进行渲染,以得到目标画布之后,还包括:The method according to claim 5, wherein, according to the subtitle type of the currently out-of-team subtitle, rendering the current out-of-team subtitle to obtain the target canvas further includes:
    比较当前播放进度时间是否大于所述当前出队字幕的起始时间;Comparing whether the current playback progress time is greater than the start time of the current out-of-queue subtitle;
    若是,则对所述目标画布进行显示。If yes, display the target canvas.
  7. 根据权利要求1-6任一所述的方法,其特征在于,所述原始字幕队列还包括至少一个第二原始字幕,所述第二原始字幕为不具备结束时间的字幕。The method according to any one of claims 1-6, wherein the original subtitle queue further includes at least one second original subtitle, and the second original subtitle is a subtitle without an end time.
  8. 一种字幕处理装置,其特征在于,包括:A subtitle processing device is characterized in that, comprising:
    获取模块,用于获取原始字幕队列,所述原始字幕队列包括至少一个第一原始字幕,所述第一原始字幕为有结束时间的字幕;An acquisition module, configured to acquire an original subtitle queue, where the original subtitle queue includes at least one first original subtitle, and the first original subtitle is a subtitle with an end time;
    拆分模块,用于对所述获取模块获取的所述第一原始字幕执行拆分操作,以得到第一类型字幕和第二类型字幕,其中,所述第一类型字幕的起始时间为所述第一原始字幕的起始时间,所述第二类型字幕的起始时间为所述第一原始字幕的结束时间,所述第一类型字幕和所述第二类型字幕均为无结束时间的字幕,所述第一类型用于指示将所述类型字幕所包含的所述第一原始字幕对应的字幕内容渲染为图片,所述第二类型用于指示所述第二类型字幕执行画布清理;A splitting module, configured to perform a splitting operation on the first original subtitle acquired by the acquiring module, to obtain a first type of subtitle and a second type of subtitle, wherein the start time of the first type of subtitle is the The start time of the first original subtitle, the start time of the second type of subtitle is the end time of the first original subtitle, the first type of subtitle and the second type of subtitle are without end time Subtitles, the first type is used to indicate that the subtitle content corresponding to the first original subtitle contained in the subtitle of the type is rendered as a picture, and the second type is used to indicate that the subtitle of the second type performs canvas cleaning;
    生成模块,用于基于所述拆分模块执行拆分操作得到的所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列。A generating module, configured to generate a target subtitle queue corresponding to the original subtitle queue based on the first type of subtitle and the second type of subtitle obtained by the splitting operation performed by the splitting module.
  9. 根据权利要求8所述的装置,其特征在于,还包括:The device according to claim 8, further comprising:
    判断模块,用于在所述拆分模块对所述第一原始字幕执行拆分操作之前,判断所述第一原始字幕是否满足拆分条件;A judging module, configured to judge whether the first original subtitle satisfies a splitting condition before the splitting module performs a splitting operation on the first original subtitle;
    对应地,所述拆分模块,用于在所述判断模块判断所述第一原始字幕满足所述拆分条件时,对所述第一原始字幕执行所述拆分操作。Correspondingly, the splitting module is configured to perform the splitting operation on the first original subtitle when the judging module judges that the first original subtitle satisfies the splitting condition.
  10. 根据权利要求9所述的装置,所述拆分条件包括:所述第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于预设时间,或者,The device according to claim 9, the splitting condition includes: the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, or,
    所述拆分条件包括:所述第一原始字幕为所述原始字幕队列中的最后一个字幕。The splitting condition includes: the first original subtitle is the last subtitle in the original subtitle queue.
  11. 根据权利要求9所述的装置,其特征在于,当所述拆分条件包括:所述第一原始字幕的结束时间与下一字幕的起始时间之间的时间间隔大于预设时间时,还包括:The device according to claim 9, wherein when the splitting condition includes: when the time interval between the end time of the first original subtitle and the start time of the next subtitle is greater than a preset time, further include:
    调整模块,用于在所述判断模块判断所述第一原始字幕不满足所述拆分条件之后,对所述第一原始字幕的结束时间进行调整以得到第一目标字幕,所述第一目标字幕的结束时间为所述下一字幕的起始时间;或者,对所述下一字幕的起始时间进行调整以得到第二目标字幕,所述第二目标字幕的起始时间为所述第一原始字幕的结束时间。An adjustment module, configured to adjust the end time of the first original subtitle to obtain a first target subtitle after the judging module judges that the first original subtitle does not satisfy the splitting condition. The end time of the subtitle is the start time of the next subtitle; or, the start time of the next subtitle is adjusted to obtain a second target subtitle, and the start time of the second target subtitle is the first - The end time of the original subtitle.
  12. 根据权利要求8-11任一所述的装置,其特征在于,The device according to any one of claims 8-11, characterized in that,
    所述判断模块,还用于在所述生成模块基于所述第一类型字幕和所述第二类型字幕,生成所述原始字幕队列对应的目标字幕队列之后,判断当前出队字幕的字幕类型,所述当前出队字幕为所述目标字幕队列中的任意一个字幕;The judging module is further configured to judge the subtitle type of the currently dequeued subtitle after the generating module generates the target subtitle queue corresponding to the original subtitle queue based on the first type subtitle and the second type subtitle, The currently dequeued subtitle is any subtitle in the target subtitle queue;
    所述装置还包括:The device also includes:
    渲染模块,用于根据所述判断模块判断后确定的所述当前出队字幕的字幕类型,对所述当前出队字幕进行渲染,以得到目标画布,其中,当所述当前出队字幕的字幕类型为所述第一类型时,所述目标画布为对所述当前出队字幕进行字幕内容的渲染得到的画布,当所述当前出队字幕的字幕类型为所述第二类型时,所述目标画布为执行画布清理操作得到的画布。A rendering module, configured to render the current out-of-line subtitle according to the subtitle type of the current out-of-line subtitle determined after judgment by the judging module, so as to obtain a target canvas, wherein, when the subtitle of the current out-of-line subtitle When the subtitle type is the first type, the target canvas is the canvas obtained by rendering the subtitle content of the current out-of-line subtitle, and when the subtitle type of the current out-of-line subtitle is the second type, the The target canvas is the canvas obtained by performing the canvas cleanup operation.
  13. 根据权利要求12所述的装置,其特征在于,还包括:The device according to claim 12, further comprising:
    比较模块,用于在所述渲染模块根据所述当前出队字幕的字幕类型对所述当前出队字幕进行渲染以得到目标画布之后,比较当前播放进度时间是否大于所述当前出队字幕的起始时间;A comparison module, configured to compare whether the current playback progress time is greater than the starting time of the current out-of-line subtitle after the rendering module renders the current out-of-line subtitle according to the subtitle type of the current out-of-line subtitle to obtain a target canvas. start time;
    显示模块,用于所述比较模块比较确定所述当前播放进度时间大于所述当前出队字幕的起始时间时,对所述目标画布进行显示。The display module is used for displaying the target canvas when the comparison module compares and determines that the current playback progress time is greater than the start time of the current out-of-queue subtitle.
  14. 根据权利要求8-13任一所述的装置,其特征在于,所述原始字幕队列还包括至少一个第二原始字幕,所述第二原始字幕为不具备结束时间的字幕。The device according to any one of claims 8-13, wherein the original subtitle queue further includes at least one second original subtitle, and the second original subtitle is a subtitle without an end time.
  15. 一种设备,其特征在于,所述设备包括:处理器和存储器;A device, characterized in that the device includes: a processor and a memory;
    所述存储器中存储有程序指令;program instructions are stored in the memory;
    所述处理器用于执行存储器中存储的程序指令,以使得所述设备实现如权利要求1-7任意一项中的所述的方法。The processor is configured to execute program instructions stored in the memory, so that the device implements the method described in any one of claims 1-7.
  16. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在设备上运行时,使得所述设备执行如权利要求1-7中任一项所述的方法。A computer-readable storage medium, comprising instructions, wherein when the instructions are run on a device, the device is made to execute the method according to any one of claims 1-7.
PCT/CN2021/111597 2021-08-09 2021-08-09 Subtitle processing method and apparatus, and storage medium WO2023015416A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/111597 WO2023015416A1 (en) 2021-08-09 2021-08-09 Subtitle processing method and apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/111597 WO2023015416A1 (en) 2021-08-09 2021-08-09 Subtitle processing method and apparatus, and storage medium

Publications (1)

Publication Number Publication Date
WO2023015416A1 true WO2023015416A1 (en) 2023-02-16

Family

ID=85200460

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/111597 WO2023015416A1 (en) 2021-08-09 2021-08-09 Subtitle processing method and apparatus, and storage medium

Country Status (1)

Country Link
WO (1) WO2023015416A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100278507A1 (en) * 2009-04-30 2010-11-04 Mitac International Corp. Subtitle Generation System and Method Thereof
CN105898556A (en) * 2015-12-30 2016-08-24 乐视致新电子科技(天津)有限公司 Plug-in subtitle automatic synchronization method and device
CN106792114A (en) * 2016-12-06 2017-05-31 深圳Tcl数字技术有限公司 The changing method and device of captions
CN110781649A (en) * 2019-10-30 2020-02-11 中央电视台 Subtitle editing method and device, computer storage medium and electronic equipment
CN112511910A (en) * 2020-11-23 2021-03-16 浪潮天元通信信息系统有限公司 Real-time subtitle processing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100278507A1 (en) * 2009-04-30 2010-11-04 Mitac International Corp. Subtitle Generation System and Method Thereof
CN105898556A (en) * 2015-12-30 2016-08-24 乐视致新电子科技(天津)有限公司 Plug-in subtitle automatic synchronization method and device
CN106792114A (en) * 2016-12-06 2017-05-31 深圳Tcl数字技术有限公司 The changing method and device of captions
CN110781649A (en) * 2019-10-30 2020-02-11 中央电视台 Subtitle editing method and device, computer storage medium and electronic equipment
CN112511910A (en) * 2020-11-23 2021-03-16 浪潮天元通信信息系统有限公司 Real-time subtitle processing method and device

Similar Documents

Publication Publication Date Title
WO2021008373A1 (en) Display method and apparatus, electronic device, and computer-readable medium
US7890599B2 (en) Pause and replay of media content through bookmarks on a server device
US9473548B1 (en) Latency reduction in streamed content consumption
WO2017080168A1 (en) Video reviewing method and system
US9177009B2 (en) Generation based update system
CN108347648B (en) Dynamic adjustment of video quality
WO2015051690A1 (en) Zookeeper-based information configuration method and device
CN106791953A (en) Many player control methods, server and client
CA2506032A1 (en) Resource manager for clients in an information distribution system
US8751565B1 (en) Components for web-based configurable pipeline media processing
KR101475544B1 (en) Digital data management using shared memory pool
US20170083262A1 (en) System and method for controlling memory frequency using feed-forward compression statistics
US20180359302A1 (en) System and method for encoding image data and other data types into one data format and decoding of same
AU2020408143B2 (en) Watermark-based techniques for change-data-capture
US20140109127A1 (en) Pause and replay of media content through bookmarks on a server device
CN111757180B (en) Video display control device, video display system, video display method and device
US8665281B2 (en) Buffer management for real-time streaming
CN106933523A (en) A kind of multi-screen interaction method and device
US20120072543A1 (en) Pause and replay of media content through bookmarks on a server device
US20200314162A1 (en) Techniques for modifying a rules engine in a highly-scaled computing environment
US11588874B2 (en) Web-based content recording and adaptive streaming
WO2023015416A1 (en) Subtitle processing method and apparatus, and storage medium
WO2018177286A1 (en) Static resource request processing method and device
CN113923472A (en) Video content analysis method and device, electronic equipment and storage medium
US9306995B2 (en) Communicating data in flows between first and second computers connected over a network

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE