CN113766149A - Splicing method and device for subtitle spliced pictures, electronic equipment and storage medium - Google Patents
Splicing method and device for subtitle spliced pictures, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN113766149A CN113766149A CN202010885873.0A CN202010885873A CN113766149A CN 113766149 A CN113766149 A CN 113766149A CN 202010885873 A CN202010885873 A CN 202010885873A CN 113766149 A CN113766149 A CN 113766149A
- Authority
- CN
- China
- Prior art keywords
- subtitle
- target
- target video
- picture
- playing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000001960 triggered effect Effects 0.000 claims abstract description 30
- 238000012544 monitoring process Methods 0.000 claims abstract description 13
- 238000004590 computer program Methods 0.000 claims description 9
- 238000012545 processing Methods 0.000 claims description 7
- 230000004044 response Effects 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 20
- 230000008569 process Effects 0.000 description 15
- 238000004891 communication Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 4
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/222—Studio circuitry; Studio devices; Studio equipment
- H04N5/262—Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
- H04N5/278—Subtitling
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/435—Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/44008—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/488—Data services, e.g. news ticker
- H04N21/4884—Data services, e.g. news ticker for displaying subtitles
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/222—Studio circuitry; Studio devices; Studio equipment
- H04N5/262—Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
- H04N5/265—Mixing
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Circuits (AREA)
Abstract
The invention discloses a splicing method and device of subtitle spliced pictures, electronic equipment and a storage medium, and relates to the technical field of computers. One embodiment of the method comprises: acquiring a subtitle file corresponding to a target video, wherein the subtitle file comprises subtitles of the target video and playing time corresponding to each subtitle; reading target playing time corresponding to each target subtitle from the subtitle file; playing a target video and monitoring whether a screen capture instruction is triggered, wherein the screen capture instruction is triggered when the target video is played to the target playing time; intercepting a current playing picture of the target video in response to the screen interception instruction to obtain a subtitle picture of each target subtitle; and splicing the subtitle pictures to obtain the subtitle spliced pictures. The embodiment can solve the problems of complex operation, long time consumption and low efficiency in the mode of splicing the subtitle and the spliced pictures.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for splicing subtitle spliced pictures, electronic equipment and a storage medium.
Background
The subtitle splicing picture is a picture which splices some subtitles in a video together in a screenshot and overlapping mode and only displays the subtitle part, and the subtitle is taken as the key point. The splicing mode of the existing subtitle splicing picture is as follows: in the video playing process, when a video picture including a subtitle required by the subtitle splicing picture appears, the video playing is paused and the screen capture is carried out, then the captured pictures are spliced, and the subtitle splicing picture is determined.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
when a video picture is intercepted in the existing mode of splicing subtitle and splicing pictures, the video needs to be paused first, the operation is complex, the time spent is long, and the efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a system and a storage medium for splicing a subtitle splicing picture, which can solve the problems of complicated operation, long time consumption and low efficiency in a method for splicing a subtitle splicing picture.
In order to achieve the above object, according to an aspect of the embodiments of the present invention, a method for splicing a subtitle splicing picture is provided.
The splicing of the subtitle spliced picture comprises the following steps: acquiring a subtitle file corresponding to a target video, wherein the subtitle file comprises subtitles of the target video and playing time corresponding to each subtitle; reading target playing time corresponding to each target subtitle from the subtitle file; playing the target video and monitoring whether a screen capture instruction is triggered or not, wherein the screen capture instruction is triggered when the target video is played to the target playing time; responding to the screen capture instruction, capturing a current playing picture of the target video to obtain a subtitle picture of each target subtitle; and splicing the subtitle pictures to obtain subtitle spliced pictures.
In one embodiment, the intercepting the current playing screen of the target video includes:
acquiring position information of a preset subtitle area;
and according to the position information, intercepting a picture corresponding to the preset subtitle area from a current playing picture of the target video.
In another embodiment, before the obtaining the position information of the preset subtitle region, the method further includes:
acquiring the display position and size of the target subtitle in the target video;
and determining the position information of the preset subtitle area according to the display position and the size of the target subtitle in the target video.
In another embodiment, the obtaining the size of the target subtitle in the target video includes:
reading the font and/or the font size of the target subtitle from the subtitle file;
and determining the size of the target caption according to the font and/or the font size of the target caption.
In another embodiment, the playing the target video and monitoring whether a screen capture instruction is triggered includes:
according to the time sequence, sequentially determining the target playing time as the trigger time;
playing the target video and judging whether the target video is played to the triggering time; if yes, triggering the screen capture instruction; if not, continuing to play the target video until the target video is played.
In another embodiment, the intercepting the currently playing screen of the target video includes:
judging whether the screen capturing instruction is triggered for the first time;
if so, intercepting a currently played complete picture of the target video;
if not, capturing a picture corresponding to the subtitle area in the current playing picture of the target video.
In order to achieve the above object, according to another aspect of the embodiments of the present invention, an apparatus for splicing a subtitle splicing picture is provided.
The splicing device for splicing the subtitle pictures comprises the following components: the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a subtitle file corresponding to a target video, and the subtitle file comprises subtitles of the target video and video playing time corresponding to each subtitle; the reading unit is used for reading target playing time corresponding to each target subtitle from the subtitle file; the monitoring unit is used for playing the target video and triggering a screen capture instruction, wherein the screen capture instruction is triggered when the target video is played to the target playing time; the intercepting unit is used for responding to the screen intercepting instruction, intercepting the current playing picture of the target video and obtaining the subtitle picture of each target subtitle; and the splicing unit is used for splicing the subtitle pictures to obtain subtitle spliced pictures.
In an embodiment, the intercepting unit is specifically configured to:
acquiring position information of a preset subtitle area;
and according to the position information, intercepting a picture corresponding to the preset subtitle area from a current playing picture of the target video.
In another embodiment, the obtaining unit is further configured to obtain a display position and a size of the target subtitle in the target video;
the device further comprises:
and the determining unit is used for determining the position information of the preset subtitle area according to the display position and the size of the target subtitle in the target video.
In another embodiment, the obtaining unit is specifically configured to:
reading the font and/or the font size of the target subtitle from the subtitle file;
and determining the size of the target caption according to the font and/or the font size of the target caption.
In another embodiment, the monitoring unit is specifically configured to:
according to the time sequence, sequentially determining the target playing time as the trigger time;
playing the target video and judging whether the target video is played to the triggering time; if yes, triggering the screen capture instruction; if not, continuing to play the target video until the target video is played.
In another embodiment, the intercepting unit is specifically configured to:
judging whether the screen capturing instruction is triggered for the first time;
if so, intercepting a currently played complete picture of the target video;
if not, capturing a picture corresponding to the subtitle area in the current playing picture of the target video.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the splicing method for the spliced subtitle pictures provided by the embodiment of the invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium.
The computer readable medium of the embodiment of the present invention stores a computer program thereon, and the program, when executed by a processor, implements the method for splicing subtitle spliced pictures provided by the embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the invention, the target video playing time corresponding to each target subtitle can be obtained based on the subtitle file corresponding to the target video, the screen capture instruction is triggered when the target video is played to the target playing time, the screen capture instruction can be responded in the target video playing process, the subtitle picture of the target subtitle is automatically captured, and then the subtitle splicing picture is obtained by splicing, so that the subtitle picture is not required to be captured by pausing the video, the operation is simple and convenient, the time spent is saved, and the efficiency is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a video screenshot 1 according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a video screenshot 2 according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a video screenshot 3 according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a video screenshot splicing approach according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a subtitle splicing picture according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a main flow of a splicing method of subtitle spliced pictures according to an embodiment of the present invention;
fig. 7 is a schematic diagram of srt subtitle files according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of an ass subtitle file according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a subtitle picture according to an embodiment of the present invention;
fig. 10 is a schematic diagram of a main flow of a subtitle picture intercepting method according to an embodiment of the present invention;
fig. 11 is a schematic diagram of main units of a splicing apparatus for splicing subtitle according to an embodiment of the present invention;
FIG. 12 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 13 is a schematic block diagram of a computer system suitable for use in implementing embodiments of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The subtitle splicing picture is generally generated by splicing pictures including subtitles intercepted in the video. For example, for obtaining a subtitle splicing picture including a subtitle 1, a subtitle 2, and a subtitle 3 for a video file, a video screenshot including the subtitle 1, the subtitle 2, and the subtitle 3 needs to be respectively intercepted from the video file, where the subtitle 1, the subtitle 2, and the subtitle 3 are target subtitles. Specifically, as shown in fig. 1, a video screenshot 1 including a subtitle 1 is captured from a video, as shown in fig. 2, a video screenshot 2 including a subtitle 2 is captured from a video, as shown in fig. 3, and a video screenshot 3 including a subtitle 3 is captured from a video. After the video screenshots of the target subtitles are captured, the video screenshot 1, the video screenshot 2 and the video screenshot 3 can be spliced. Taking the example of sequentially splicing the video screenshot 1, the video screenshot 2 and the video screenshot 3 to obtain the subtitle splicing picture, since the key point of the subtitle splicing picture is the subtitle, the video screenshot 2 and the video screenshot 3 can only keep the subtitle part during splicing, and specifically, as shown in fig. 4, the method is a mode for splicing the video screenshots. After the video screenshot 1, the video screenshot 2 and the video screenshot 3 are spliced in the manner shown in fig. 4, a subtitle splicing picture can be obtained, and fig. 5 is a schematic diagram of the subtitle splicing picture.
Because the video screenshot needs to be intercepted by manually pausing the video playing when the subtitle splicing picture is spliced in the prior art, and then the subtitle splicing picture is obtained by splicing the video screenshot, the operation is complex, the time consumption is long, and the efficiency is low. In the embodiment of the invention, the time for displaying each target subtitle in the video file, namely the target playing time, can be determined based on the subtitle file, and then the video screenshot is automatically intercepted based on each target playing time, so that the operation is simple and convenient, the time for obtaining the subtitle splicing picture is saved, and the efficiency is improved.
An embodiment of the present invention provides a method for splicing a subtitle spliced picture, where the method may be executed by a terminal device, as shown in fig. 6, and the method includes the following steps.
S601: and acquiring a subtitle file corresponding to the target video.
The target video is a video corresponding to the subtitle splicing picture and comprises subtitles in the subtitle splicing picture. The subtitle file corresponding to the target video comprises each sentence of subtitle in the target video and the playing time corresponding to each sentence of subtitle. The playing time corresponding to the subtitle includes a time when the subtitle is displayed in the video when the target video is played, and specifically may be a timestamp when the subtitle starts to be displayed in the target video, and a timestamp when the subtitle finishes being displayed.
In the embodiment of the present invention, the format of the subtitle file may include multiple formats, for example, srt format, ass format, and the like. Fig. 7 is a schematic diagram of an srt-format subtitle file, as shown in fig. 7, in which the video playing time of each subtitle is recorded, including a time stamp for starting display and a time stamp for ending display in the video. Fig. 8 is a schematic diagram of an ass-format subtitle file, as shown in fig. 8, in which the video playing time of each subtitle is recorded, including a time stamp for starting display and a time stamp for ending display in a video.
S602: and reading the target playing time corresponding to each target subtitle from the subtitle file.
And the target subtitle is a subtitle included in the subtitle splicing picture. Since the subtitle file includes each subtitle in the target video and the playing time corresponding to each subtitle, in this step, the target playing time corresponding to each subtitle can be read from the subtitle file based on the target subtitle.
It should be noted that, since the subtitle splicing picture is usually a splicing of pictures corresponding to multiple subtitles, the target subtitle usually includes multiple subtitles.
The target subtitle can be determined according to the time period of the subtitle splicing picture to be obtained displayed in the target video. For example, a subtitle splicing picture needs to be generated from subtitles displayed in a target time period in a target video, and since a subtitle file includes a playing time corresponding to each subtitle in the target video, subtitles, that is, target subtitles, displayed in the target video in the target time period can be read from the subtitle file according to the target time period, and a target playing time corresponding to each target subtitle can be read from the subtitle file.
It should be noted that the target playing time may be stored in a time array.
S603: and playing the target video and monitoring whether a screen capture instruction is triggered.
And triggering a screen capture instruction when the target video is played to the target playing time. The screen capturing instruction comprises an instruction for capturing a current playing picture, and the screen capturing instruction can be triggered when the target video is played to the target playing time in the embodiment of the invention.
After the target playing time corresponding to each target subtitle is read in step S602, the target video can be played, and whether a screen capture instruction is triggered is monitored in the target video playing process. In the process of playing the target video, the playing progress of the target video can be determined according to the current playing time stamp of the target video, so that whether the target video is played to each target playing time can be judged based on the current playing time stamp of the target video, and then when the target video is played to the target playing time, a screen capture instruction is triggered.
Since the target video is usually played at the video start time, and the earlier the target video is played, in this step, each target play time can be sequentially determined as the trigger time according to the time sequence, and then the target video is played until each trigger time. In the process of playing the target video, whether the target video is played to the triggering time can be judged; if yes, triggering a screen capture instruction; if not, continuing to play the target video until all target playing time of the target video is triggered to capture the screen, and ending the playing of the target video.
And judging whether the target video is played to the triggering time or not, wherein the judgment can be carried out according to whether the current playing time stamp of the target video is consistent with the triggering time or not. If the current playing time stamp of the target video is consistent with the triggering time, determining that the target video is played to the triggering time; and if the current playing time stamp of the target video is inconsistent with the trigger time, determining that the target video is not played to the trigger time.
S604: and responding to the screen capture instruction, capturing the current playing picture of the target video, and obtaining the subtitle picture of each target subtitle.
After the screen capture instruction is triggered, the step can respond to the screen capture instruction and execute the operation of capturing the current playing picture of the target video, so that the subtitle picture of each target subtitle is obtained. Specifically, as shown in fig. 1, 2 and 3, the subtitle pictures correspond to the subtitle 1, the subtitle 2 and the subtitle 3, respectively.
In the embodiment of the invention, because the caption in the caption splicing picture is the key point, when the caption picture is intercepted, only a part of area including the target caption, namely the caption area, can be intercepted from the current playing picture of the target video, and then the intercepted caption area is used as the caption picture. Therefore, in this step, capturing the current playing picture of the target video can be specifically performed as: acquiring position information of a preset subtitle area; and according to the position information, intercepting a picture corresponding to a preset subtitle area from a current playing picture of the target video.
The position information of the preset subtitle region may be predetermined, and may specifically be determined based on a display position and a size of a target subtitle in the target video, where the preset subtitle region is a region in the target video that includes the target subtitle.
The display position and size of the target subtitle in the target video are generally fixed, so that the position information of the preset subtitle area can be determined based on the display position and size of the target subtitle in the target video. The position information may include position coordinates of the subtitle region. For example, as shown in fig. 1, fig. 2, and fig. 3, the subtitles are all displayed below the video, and the size of the subtitles is fixed, so the subtitle region may be a quadrangle located directly below the target video, the length of the subtitle region may be the length of the target video when playing, and the height of the subtitle region is a value greater than the height of the subtitles, so that the position information of the subtitle region may be determined, specifically, if the subtitle picture of the subtitle 1 is cut according to the preset subtitle region, the subtitle picture corresponding to the cut subtitle 1 may be as shown in fig. 9.
It should be noted that if the size of the target subtitle is not fixed, the height of the preset subtitle region may be determined with reference to the size of the largest target subtitle among the target subtitles.
The size of the target caption can be determined according to the font and/or the font size of the target caption in the embodiment of the invention, and the style of the target caption is stored in the caption files with some formats, so the font and/or the font size of the target caption can be determined according to the caption files. As shown in fig. 8, since the caption file records a corresponding font size, fs13, indicating that the font size is 13 for each caption, the font size of the caption can be determined based on the caption file.
It should be noted that, in the embodiment of the present invention, the size of the target subtitle may also be determined empirically, for example, the size of the target subtitle is set to a default value larger than the size of each target subtitle according to experience.
In order to make the target subtitles in the subtitle splicing picture have continuity, the subtitle splicing picture is obtained by splicing the subtitle pictures according to the time sequence of target subtitle display, so that the first subtitle picture of the subtitle splicing picture is usually the subtitle picture of the target subtitle displayed first in the target video. As shown in the subtitle splicing picture shown in fig. 5, the video screenshot 1 corresponding to the subtitle 1 is a complete video screenshot in the subtitle splicing picture, that is, not only the subtitle 1 is included, but also a complete playing picture in which the subtitle 1 is located is included. Therefore, for such a subtitle splicing picture, the first subtitle picture thereof needs to include a finished playing picture corresponding to the target subtitle.
Therefore, for the subtitle splicing picture shown in fig. 5, when the first subtitle picture is captured, a complete playing picture needs to be captured. Since the first subtitle picture is the subtitle picture of the first displayed target subtitle in the target video, that is, in the playing process of the target video, the subtitle picture captured when the screen capturing instruction is triggered for the first time is the first subtitle picture, this step can be specifically executed as: judging whether the screen capturing instruction is triggered for the first time; if so, intercepting a currently played complete picture of the target video; if not, capturing the picture corresponding to the subtitle area in the current playing picture of the target video.
Therefore, in the embodiment of the present invention, when the current playing picture in the target video is captured in the executing step, it is further necessary to first determine whether the screen capturing instruction is triggered for the first time. If the current subtitle picture is the first subtitle picture of the subtitle splicing pictures intercepted at this time, namely the subtitle picture comprising the complete picture needs to be intercepted, the currently played complete picture of the target video needs to be intercepted at this time to be used as the subtitle picture; if not, the first caption picture which is not the caption splicing picture is intercepted, namely only the caption area in the current playing picture needs to be intercepted, and the picture corresponding to the caption area in the current playing picture of the target video is intercepted.
Note that, the subtitle region may be determined in the same manner as the preset subtitle region.
S605: and splicing the subtitle pictures to obtain the subtitle spliced pictures.
In order to maintain the continuity of the subtitles in the subtitle splicing pictures, the subtitle pictures are usually spliced in sequence according to the display time sequence, so in the step, the subtitle pictures of the target subtitles are spliced according to the sequence of the display time of the target subtitles to obtain the subtitle splicing pictures.
It should be noted that, in the embodiment of the present invention, since the subtitle pictures are captured according to the preset subtitle region, that is, unnecessary playing pictures in the subtitle splicing pictures are already omitted during capturing, in this step, the subtitle pictures may be sequentially connected according to the sequence of the target video playing time corresponding to the target subtitle, so that the subtitle splicing pictures may be obtained.
According to the embodiment of the invention, based on the subtitle file corresponding to the target video, the target video playing time corresponding to each target subtitle can be obtained, the screen capture instruction is triggered when the target video is played to the target playing time, the screen capture instruction can be responded in the target video playing process, the subtitle picture of the target subtitle is automatically captured, and then the subtitle splicing picture is obtained by splicing, so that the subtitle picture is not required to be captured by pausing the video, the operation is simple and convenient, the time spent is saved, and the efficiency is improved.
The following describes the implementation of steps S603 and S604 in detail with reference to the embodiment shown in fig. 6. An embodiment of the present invention provides a method for capturing a subtitle picture, as shown in fig. 10, the method includes the following steps.
S1001: and sequencing the target playing time corresponding to each target subtitle according to the time sequence to obtain a time sequence.
Wherein the time series may be stored by a time array. The embodiment of the present invention takes the target playing time as an example of the timestamp of the target subtitle starting to be displayed in the target video. Assuming that the target subtitles are subtitles displayed from 00:43:55 to 00:44.16 in the video corresponding to the subtitle file shown in fig. 7, the target subtitles included in the subtitle file in the time period and the target video playing time corresponding to each target subtitle may be determined as follows: 00:43:55, 00:43:57, 00:44:00, 00:44.03, 00:44: 16. In this step, the playing time of each target video is sorted and then stored into a time array tAlay.
S1002: the target playing time located at the first position of the time sequence is determined as the trigger time.
Since the target video is played from the beginning, the target playing times in the time sequence are played in sequence, and the target playing time at the first position in the time sequence is determined as the trigger time and processed.
S1003: playing the target video, and judging whether the current timestamp of playing the target video is consistent with the trigger time, if so, executing a step S1004; if not, step S1003 is executed.
Since the target playing time corresponding to the target subtitle is determined, only one section of target video including each target playing time in the time sequence can be played. When the target video is played, the playing progress of the target video can be determined by monitoring the current timestamp of the target video, and whether the current timestamp of the target video is consistent with the trigger time or not is judged. If the timestamp of the target video playing is consistent with the trigger time, which indicates that the target caption corresponding to the trigger time is already displayed, the caption picture can be intercepted; and if the current timestamp of the target video playing is not consistent with the trigger time, indicating that the target caption corresponding to the trigger time is not displayed, executing the step and continuing to play the target video.
S1004: triggering a screen capturing instruction, judging whether the triggering instruction is triggered for the first time, if so, executing a step S1005; if not, go to step S1006.
In the embodiment of the present invention, the subtitle splicing picture is taken as the style shown in fig. 5 as an example, and the first subtitle picture of the subtitle splicing picture needs to be a complete playing picture, so that it is determined in this step whether the trigger instruction is triggered for the first time. If yes, the complete playing picture needs to be captured in response to the screen capture instruction, and step S1005 is executed; if not, the current response screen capture instruction is to capture the subtitle area included in the playing picture, and step S1006 is executed.
It should be noted that, in the playing process of the target video, the triggering times of the screen capture instruction may be recorded, so as to determine whether the triggering instruction is triggered for the first time in this step.
S1005: and intercepting a currently played complete picture of the target video.
In this step, the currently played complete picture of the target video is captured and determined as a subtitle picture, which may be specifically shown in fig. 1. Step S1007 is executed after the present step is executed.
S1006: and intercepting a picture corresponding to the preset subtitle area in the current playing picture of the target video according to the position information of the preset subtitle area.
The position information of the preset subtitle region is predetermined, and in this step, the subtitle region in the currently played picture may be directly captured based on the position information of the preset subtitle region to be used as a subtitle picture, which may be specifically shown in fig. 9.
S1007: judging whether the trigger time is the target playing time at the last bit of the time sequence, if so, ending the process; if not, go to step S1008.
In this step, whether the subtitle pictures of all the target subtitles are intercepted is determined by judging whether the trigger time is the target playing time located at the last bit of the time sequence. If the triggering time is the target playing time at the last bit of the time sequence, which indicates that the subtitle pictures of all the target subtitles are intercepted, the process is ended; if the trigger time is not the target playing time located at the last bit of the time sequence, which indicates that the subtitle picture of the target subtitle is not intercepted, step S1008 is executed.
After the embodiment of the present invention is executed, the subtitle picture of each target subtitle is obtained, and then step S605 is executed, and the obtained subtitle splicing picture style may be as shown in fig. 5.
S1008: and updating the target playing time one bit after the trigger time in the time sequence to be the new target time.
In this step, the target playing time one bit after the trigger time in the time sequence is updated to a new target time, and then step S1003 is executed to intercept the subtitle picture of the target subtitle corresponding to the new target time.
In the embodiment of the invention, in the process of playing the target video, the time for displaying the target subtitles in the target video is sequentially determined based on the playing time of the target video in the time sequence, and the subtitle pictures of each target subtitle are automatically intercepted without intercepting the subtitle pictures by pausing the video, so that the operation is simple and convenient, the time spent is saved, and the efficiency is improved.
In order to solve the problems in the prior art, an embodiment of the present invention provides an apparatus 1100 for splicing a subtitle splicing picture, as shown in fig. 11, the apparatus 1100 includes:
an obtaining unit 1101, configured to obtain a subtitle file corresponding to a target video, where the subtitle file includes subtitles of the target video and video playing time corresponding to each sentence of the subtitles;
a reading unit 1102, configured to read target playing time corresponding to each target subtitle from the subtitle file;
the monitoring unit 1103 is configured to play the target video and trigger a screen capture instruction, where the screen capture instruction is triggered when the target video is played for the target playing time;
an intercepting unit 1104, configured to intercept a currently played picture of the target video in response to the screen capturing instruction, so as to obtain a subtitle picture of each target subtitle;
and a splicing unit 1105, configured to splice the subtitle pictures to obtain subtitle spliced pictures.
It should be understood that the manner of implementing the embodiment of the present invention is the same as the manner of implementing the embodiment shown in fig. 6, and the description thereof is omitted.
In an implementation manner of the embodiment of the present invention, the intercepting unit 1104 is specifically configured to:
acquiring position information of a preset subtitle area;
and according to the position information, intercepting a picture corresponding to the preset subtitle area from a current playing picture of the target video.
In another implementation manner of the embodiment of the present invention, the obtaining unit 1101 is further configured to obtain a display position and a size of the target subtitle in the target video;
the apparatus 1100 further comprises:
and the determining unit is used for determining the position information of the preset subtitle area according to the display position and the size of the target subtitle in the target video.
In another implementation manner of the embodiment of the present invention, the obtaining unit 1101 is specifically configured to:
reading the font and/or the font size of the target subtitle from the subtitle file;
and determining the size of the target caption according to the font and/or the font size of the target caption.
In another implementation manner of the embodiment of the present invention, the monitoring unit 1103 is specifically configured to:
according to the time sequence, sequentially determining the target playing time as the trigger time;
playing the target video and judging whether the target video is played to the triggering time; if yes, triggering the screen capture instruction; if not, continuing to play the target video until the target video is played.
In another implementation manner of the embodiment of the present invention, the intercepting unit 1104 is specifically configured to:
judging whether the screen capturing instruction is triggered for the first time;
if so, intercepting a currently played complete picture of the target video;
if not, capturing a picture corresponding to the subtitle area in the current playing picture of the target video.
It should be understood that the embodiment of the present invention is implemented in the same manner as the embodiment shown in fig. 6 or fig. 10, and is not repeated herein.
According to the embodiment of the invention, based on the subtitle file corresponding to the target video, the target video playing time corresponding to each target subtitle can be obtained, the screen capture instruction is triggered when the target video is played to the target playing time, the screen capture instruction can be responded in the target video playing process, the subtitle picture of the target subtitle is automatically captured, and then the subtitle splicing picture is obtained by splicing, so that the subtitle picture is not required to be captured by pausing the video, the operation is simple and convenient, the time spent is saved, and the efficiency is improved.
The invention also provides an electronic device and a readable storage medium according to the embodiment of the invention.
The electronic device of the present invention includes: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the processor, and the instructions are executed by the at least one processor to cause the at least one processor to execute the splicing method for splicing the subtitle splicing picture provided by the embodiment of the invention.
Fig. 12 shows an exemplary system architecture 1200 of a splicing method for subtitle splicing pictures or a splicing apparatus for subtitle splicing pictures, to which an embodiment of the present invention may be applied.
As shown in fig. 12, the system architecture 1200 may include terminal devices 1201, 1202, 1203, a network 1204 and a server 1205. Network 1204 is the medium used to provide communication links between terminal devices 1201, 1202, 1203 and server 1205. Network 1204 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 1201, 1202, 1203 to interact with a server 1205 through a network 1204 to receive or send messages, etc. Various client applications may be installed on the terminal devices 1201, 1202, 1203.
The terminal devices 1201, 1202, 1203 may be smartphones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 1205 may be a server that provides various services, and the server may analyze and perform other processing on data such as a received information acquisition request, and feed back a processing result (for example, a subtitle file — just an example) to the terminal device.
It should be noted that the splicing method for the subtitle spliced picture provided by the embodiment of the present invention is generally executed by the terminal devices 1201, 1202, and 1203, and accordingly, the splicing device for the subtitle spliced picture is generally disposed in the terminal devices 1201, 1202, and 1203.
It should be understood that the number of terminal devices, networks, and servers in fig. 12 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 13, shown is a pictorial representation of a suitable configuration of computer system 1300 in which embodiments of the present invention may be implemented. The computer system illustrated in FIG. 13 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the invention.
As shown in fig. 13, the computer system 1300 includes a Central Processing Unit (CPU)1301 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)1302 or a program loaded from a storage section 1308 into a Random Access Memory (RAM) 1303. In the RAM 1303, various programs and data necessary for the operation of the system 1300 are also stored. The CPU 1301, the ROM 1302, and the RAM 1303 are connected to each other via a bus 1304. An input/output (I/O) interface 1305 is also connected to bus 1304.
The following components are connected to the I/O interface 1305: an input portion 1306 including a keyboard, a mouse, and the like; an output section 1307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 1308 including a hard disk and the like; and a communication section 1309 including a network interface card such as a LAN card, a modem, or the like. The communication section 1309 performs communication processing via a network such as the internet. A drive 1310 is also connected to the I/O interface 1305 as needed. A removable medium 1311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1310 as necessary, so that a computer program read out therefrom is mounted into the storage portion 1308 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communications component 1309 and/or installed from removable media 1311. The computer program executes the above-described functions defined in the system of the present invention when executed by a Central Processing Unit (CPU) 1301.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a reading unit, a monitoring unit, an interception unit, and a stitching unit. Where the names of these units do not in some cases constitute a limitation of the unit itself, for example, an acquisition unit may also be described as a "unit of the function of the acquisition unit".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs, and when the one or more programs are executed by the apparatus, the apparatus is caused to execute the splicing method for splicing the subtitle and the spliced pictures provided by the present invention.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A splicing method of subtitle spliced pictures is characterized by comprising the following steps:
acquiring a subtitle file corresponding to a target video, wherein the subtitle file comprises subtitles of the target video and playing time corresponding to each subtitle;
reading target playing time corresponding to each target subtitle from the subtitle file;
playing the target video and monitoring whether a screen capture instruction is triggered or not, wherein the screen capture instruction is triggered when the target video is played to the target playing time;
responding to the screen capture instruction, capturing a current playing picture of the target video to obtain a subtitle picture of each target subtitle;
and splicing the subtitle pictures to obtain subtitle spliced pictures.
2. The method of claim 1, wherein said intercepting a currently playing picture of the target video comprises:
acquiring position information of a preset subtitle area;
and according to the position information, intercepting a picture corresponding to the preset subtitle area from a current playing picture of the target video.
3. The method according to claim 2, further comprising, before the obtaining the position information of the preset subtitle region:
acquiring the display position and size of the target subtitle in the target video;
and determining the position information of the preset subtitle area according to the display position and the size of the target subtitle in the target video.
4. The method of claim 3, wherein the obtaining the size of the target caption in the target video comprises:
reading the font and/or the font size of the target subtitle from the subtitle file;
and determining the size of the target caption according to the font and/or the font size of the target caption.
5. The method of claim 1, wherein the playing the target video and monitoring whether a screen capture instruction is triggered comprises:
according to the time sequence, sequentially determining the target playing time as the trigger time;
playing the target video and judging whether the target video is played to the triggering time; if yes, triggering the screen capture instruction; if not, continuing to play the target video until the target video is played.
6. The method of claim 1, wherein said intercepting a currently playing picture of the target video comprises:
judging whether the screen capturing instruction is triggered for the first time;
if so, intercepting a currently played complete picture of the target video;
if not, capturing a picture corresponding to the subtitle area in the current playing picture of the target video.
7. A splicing device for splicing subtitles is characterized by comprising:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a subtitle file corresponding to a target video, and the subtitle file comprises subtitles of the target video and video playing time corresponding to each subtitle;
the reading unit is used for reading target playing time corresponding to each target subtitle from the subtitle file;
the monitoring unit is used for playing the target video and triggering a screen capture instruction, wherein the screen capture instruction is triggered when the target video is played to the target playing time;
the intercepting unit is used for responding to the screen intercepting instruction, intercepting the current playing picture of the target video and obtaining the subtitle picture of each target subtitle;
and the splicing unit is used for splicing the subtitle pictures to obtain subtitle spliced pictures.
8. The apparatus according to claim 7, wherein the intercepting unit is specifically configured to:
acquiring position information of a preset subtitle area;
and according to the position information, intercepting a picture corresponding to the preset subtitle area from a current playing picture of the target video.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010885873.0A CN113766149A (en) | 2020-08-28 | 2020-08-28 | Splicing method and device for subtitle spliced pictures, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010885873.0A CN113766149A (en) | 2020-08-28 | 2020-08-28 | Splicing method and device for subtitle spliced pictures, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113766149A true CN113766149A (en) | 2021-12-07 |
Family
ID=78785766
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010885873.0A Pending CN113766149A (en) | 2020-08-28 | 2020-08-28 | Splicing method and device for subtitle spliced pictures, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113766149A (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101770701A (en) * | 2008-12-30 | 2010-07-07 | 北京新学堂网络科技有限公司 | Movie comic book manufacturing method for foreign language learning |
CN103634605A (en) * | 2013-12-04 | 2014-03-12 | 百度在线网络技术(北京)有限公司 | Processing method and device for video images |
CN104093083A (en) * | 2014-07-23 | 2014-10-08 | 上海天脉聚源文化传媒有限公司 | Video intercepting method and device |
CN105872810A (en) * | 2016-05-26 | 2016-08-17 | 网易传媒科技(北京)有限公司 | Media content sharing method and device |
CN106454151A (en) * | 2016-10-18 | 2017-02-22 | 珠海市魅族科技有限公司 | Video image stitching method and device |
CN107682650A (en) * | 2017-09-30 | 2018-02-09 | 咪咕动漫有限公司 | A kind of image processing method and device and storage medium |
CN107959894A (en) * | 2016-10-17 | 2018-04-24 | 北京奇虎科技有限公司 | Video pictures processing method and processing device |
CN108347643A (en) * | 2018-03-05 | 2018-07-31 | 成都索贝数码科技股份有限公司 | A kind of implementation method of the subtitle superposition sectional drawing based on deep learning |
CN109803180A (en) * | 2019-03-08 | 2019-05-24 | 腾讯科技(深圳)有限公司 | Video preview drawing generating method, device, computer equipment and storage medium |
CN110490101A (en) * | 2019-07-30 | 2019-11-22 | 平安科技(深圳)有限公司 | A kind of picture intercept method, device and computer storage medium |
CN110968391A (en) * | 2019-11-28 | 2020-04-07 | 珠海格力电器股份有限公司 | Screenshot method, screenshot device, terminal equipment and storage medium |
-
2020
- 2020-08-28 CN CN202010885873.0A patent/CN113766149A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101770701A (en) * | 2008-12-30 | 2010-07-07 | 北京新学堂网络科技有限公司 | Movie comic book manufacturing method for foreign language learning |
CN103634605A (en) * | 2013-12-04 | 2014-03-12 | 百度在线网络技术(北京)有限公司 | Processing method and device for video images |
CN104093083A (en) * | 2014-07-23 | 2014-10-08 | 上海天脉聚源文化传媒有限公司 | Video intercepting method and device |
CN105872810A (en) * | 2016-05-26 | 2016-08-17 | 网易传媒科技(北京)有限公司 | Media content sharing method and device |
CN107959894A (en) * | 2016-10-17 | 2018-04-24 | 北京奇虎科技有限公司 | Video pictures processing method and processing device |
CN106454151A (en) * | 2016-10-18 | 2017-02-22 | 珠海市魅族科技有限公司 | Video image stitching method and device |
CN107682650A (en) * | 2017-09-30 | 2018-02-09 | 咪咕动漫有限公司 | A kind of image processing method and device and storage medium |
CN108347643A (en) * | 2018-03-05 | 2018-07-31 | 成都索贝数码科技股份有限公司 | A kind of implementation method of the subtitle superposition sectional drawing based on deep learning |
CN109803180A (en) * | 2019-03-08 | 2019-05-24 | 腾讯科技(深圳)有限公司 | Video preview drawing generating method, device, computer equipment and storage medium |
CN110490101A (en) * | 2019-07-30 | 2019-11-22 | 平安科技(深圳)有限公司 | A kind of picture intercept method, device and computer storage medium |
CN110968391A (en) * | 2019-11-28 | 2020-04-07 | 珠海格力电器股份有限公司 | Screenshot method, screenshot device, terminal equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR20200022329A (en) | Method and device for determining response time | |
CN110061909B (en) | Method and apparatus for processing information | |
CN110046021B (en) | Page display method, device, system, equipment and storage medium | |
US20150331882A1 (en) | Redundant file deletion method, apparatus and storage medium | |
US20220206994A1 (en) | Method and Apparatus for Generating Multimedia File | |
CN110213614B (en) | Method and device for extracting key frame from video file | |
CN107342083B (en) | Method and apparatus for providing voice service | |
CN110209315B (en) | Method and device for displaying characters in user interface, electronic equipment and storage medium | |
CN111427647B (en) | Page display method and device of application program, storage medium and electronic equipment | |
CN109753332B (en) | Method and device for displaying information | |
CN109168012B (en) | Information processing method and device for terminal equipment | |
CN112532998B (en) | Method, device and equipment for extracting video frame and readable storage medium | |
KR20180111981A (en) | Edit real-time content with limited interaction | |
WO2023065749A1 (en) | Distributed database embedding method and apparatus, and device and storage medium | |
US20240220081A1 (en) | Template selection method, electronic device and non-transitory computer-readable storage medium | |
CN110673886B (en) | Method and device for generating thermodynamic diagrams | |
CN115996179A (en) | Service node testing method and device, readable medium and electronic equipment | |
CN110324432B (en) | Data processing method, device and medium applied to terminal and computing equipment | |
CN111813685A (en) | Automatic testing method and device | |
CN109947528B (en) | Information processing method and device | |
CN113766149A (en) | Splicing method and device for subtitle spliced pictures, electronic equipment and storage medium | |
CN113411627B (en) | Data pushing method and device, readable storage medium and electronic equipment | |
CN113885741A (en) | Multimedia processing method, device, equipment and medium | |
CN108228829B (en) | Method and apparatus for generating information | |
CN112861612A (en) | Method and device for shooting image, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |