Summary of the invention
The technical problem that the present invention mainly solves is to provide a kind of manufacture method and device of dynamic three-dimensional floating caption, effectively solve the cumbersome shortcoming that is difficult for left-hand seat and general setting that cannot compatible program picture of prior art setting process, in order to high definition pictures are converted to the unsteady captions effect of dynamic stereoscopic three-dimensional, provide possibility for processing the unified conversion of large batch of video file.
For solving the problems of the technologies described above, the technical scheme that the present invention adopts is: a kind of manufacture method of dynamic three-dimensional floating caption is provided, comprises the following steps,
Utilize the captions video file of a 2D transparent effect of source word curtain image making, and described 2D captions video file is transformed into two identical video files;
Calculate the picture parallax of two each pixel scales of described video file according to depth of field index;
According to described picture parallax, two side-play amounts between video file are set;
Two described video files are all done to compression and process, and compressed two described video files after treatment are played up and merged processing.
Wherein, the described step that 2D captions video file is transformed into two identical video files is specially, and described 2D captions video file longitudinal compression is become to two identical video files.
Wherein, described picture parallax is specially left and right picture parallax, and according to described picture parallax, two side-play amounts between video file horizontal level is set.
Wherein, the described step that 2D captions video file is transformed into two identical video files is specially, and described 2D captions video file is copied into two identical video files.
Wherein, described picture parallax is specially upper and lower picture parallax, and according to described picture parallax, two side-play amounts between video file upright position is set.
For solving the problems of the technologies described above, another technical solution used in the present invention is: a kind of producing device of dynamic three-dimensional floating caption is provided, comprises
Make module, for utilizing the captions video file of a 2D transparent effect of source word curtain image making, and described 2D captions video file is transformed into two identical video files;
Computing module, for calculating the picture parallax of two each pixel scales of described video file according to depth of field index;
Module is set, for two side-play amounts between video file being set according to described picture parallax;
Rendering module, processes for two described video files all being done to compression, and compressed two described video files after treatment is played up and merged processing.
Wherein, described making module comprises the first production unit, for described 2D captions video file longitudinal compression is become to two identical video files.
Wherein, described picture parallax is specially left and right picture parallax, and the described module that arranges arranges two side-play amounts between video file horizontal level according to described picture parallax.
Wherein, described making module comprises the second production unit, for described 2D captions video file is copied into two identical video files.
Wherein, described picture parallax is specially upper and lower picture parallax, and the described module that arranges arranges two side-play amounts between video file upright position according to described picture parallax.
The invention has the beneficial effects as follows: be different from prior art 3D subtitle fabricating method and conventionally use the 3D caption function of ffdshow to solve left and right form to be written into plug-in SRT captions, setting process is cumbersome is difficult for left-hand seat and general setting that cannot compatible program picture, the invention provides a kind of manufacture method and device of dynamic three-dimensional floating caption, effectively solve the cumbersome shortcoming that is difficult for left-hand seat and general setting that cannot compatible program picture of prior art setting process, by the synthetic 3D video source of picture parallax of figure film source being carried out to compression processing and calculate according to depth of field index, realize and converted pictures to dynamic stereoscopic three-dimensional unsteady captions effect, provide possibility for processing the unified conversion of large batch of video file, can be widely used in KTV amusement, advertisement, the video processing and fabricating industries such as broadcasting media.
Embodiment
By describing technology contents of the present invention, structural feature in detail, being realized object and effect, below in conjunction with execution mode and coordinate accompanying drawing to be explained in detail.
Refer to Fig. 1, the invention provides a kind of manufacture method of dynamic three-dimensional floating caption, comprise the following steps,
Utilize the captions video file of a 2D transparent effect of source word curtain image making, and described 2D captions video file is transformed into two identical video files;
Calculate the picture parallax of two each pixel scales of described video file according to depth of field index;
According to described picture parallax, two side-play amounts between video file are set;
Two described video files are all done to compression and process, and compressed two described video files after treatment are played up and merged processing.
By the description of above-mentioned steps, be not difficult to find out: the present invention is by the synthetic 3D captions video source of picture parallax of figure film source being carried out to compression processing and calculate according to depth of field index, realize and converted pictures to dynamic stereoscopic three-dimensional unsteady captions effect, provide possibility for processing the unified conversion of large batch of video file.
In certain embodiments, the described step that described 2D captions video file is transformed into two identical video files is specially, and described 2D captions video file longitudinal compression is become to two identical video files.Further, described picture parallax is specially left and right picture parallax.A specific embodiment just as shown in Figure 2, the manufacture method of dynamic three-dimensional floating caption of the present invention comprises the following steps,
The first step: (note: figure length of a film is as x, x=1920 take the high definition cover figure of 1920*1080 pixel as source; Be y if wide, y=1080, other pixel map film source is by that analogy).Make the captions video file of a 2D transparent effect as the video elementary source of the transparent stack of 3D.
Second step: by 2D captions video file longitudinal compression become two 960*1080 pixels same video file (x1=x/2 formula is:: 1920/2=960), as the basic video source that produces 3D left and right form.
The 3rd step: extract and need to embed the track parameter of video file, being converted to according to parameters such as music rhythm, volume, regular movements the left and right picture parallax that depth of field index calculates the each pixel scale of video file is coordinate difference.
The D3 formula adopting is: depth of field value=tone color value/tone color fiducial value+port number/passage fiducial value+volume/volume fiducial value; Coordinate difference=t (tx): (x, y) → (x+tx, y).
The 4th step: keep the along slope coordinate of two video files that compress the 960*1080 pixel forming consistent.Such as: the horizontal origin coordinates of first video file is 0 pixel, and the horizontal origin coordinates of second video file is 960; If the horizontal origin coordinates of first video file is 1 pixel, the horizontal origin coordinates of second video file is 961.
The 5th step: the different scale zones that the coordinate difference that the 3rd step D3 formula calculates is video file arrange the X-axis offset deviation of two video file place calibration points.The 1st rail subtitle layer is set to reference point (being that horizontal origin coordinates is first video file of 1), and the relative abscissa (being that horizontal origin coordinates is second video file of 961) of the 2nd rail subtitle layer is set.Such as: if coordinate difference is 23, make the 2nd rail subtitle layer be moved to the left 23 pixels.
The 6th step: two compression 960*1080 video files after treatment are played up and merged processing, just can form the 3D captions source of left and right form.In the present embodiment, described picture parallax is specially left and right picture parallax, and according to described picture parallax, two side-play amounts between video file horizontal level is set.
Again that the source video file of 3D captions source and 1920*1080 pixel is synthetic, produce and follow effect video file with the 3D captions of interactive music melody effect.
Above manufacture method be figure film source take 1920*1080 as embodiment, the manufacture method of other figure film source (as: 1920*2160,1280*720, etc. resolution) can be applied mechanically equally above-mentioned manufacture method and be utilized the synthetic 3D of D3 formula left and right form music to follow the video file of effect.The method is by the synthetic 3D video source of picture parallax of figure film source being carried out to compression processing and calculate according to depth of field index, realize and converted pictures to dynamic stereoscopic three-dimensional unsteady captions effect, convenient, flexible, for process the unified conversion of large batch of video file provide may, solved the cumbersome shortcoming that is difficult for left-hand seat and general setting that cannot compatible program picture of the setting process existing in prior art.
In some embodiment as shown in Figure 3, also can the 2nd rail subtitle layer be set to reference point (being that horizontal origin coordinates is second video file of 961), the relative abscissa (being that horizontal origin coordinates is first video file of 1) of the 1st rail subtitle layer is set, such as: if coordinate difference is 23, make the 1st rail subtitle layer 23 pixels that move right.Equally also can produce the video file that there is 3D left and right form music and follow effect.
In certain embodiments, the described step that described 2D captions video file is transformed into two identical video files is specially, and described 2D captions video file is copied into two identical video files.Further, described picture parallax is specially upper and lower picture parallax.A specific embodiment just as shown in FIG. 4, the manufacture method of dynamic three-dimensional floating caption of the present invention comprises the following steps,
The first step: (note: figure length of a film is as x, x=1920 take the high definition cover figure of 1920*1080 pixel as source; Be y if wide, y=1080, other pixel map film source is by that analogy).Make the captions video file of a 2D transparent effect as the video elementary source of the transparent stack of 3D.
Second step: (1920*1080) 2D captions video file distribution generating is copied into identical two video files (being all the form of pixel 1920*1080), as the basic video source that produces the upper and lower form of 3D;
The 3rd step: calculating upper and lower picture parallax according to depth of field index is Y-axis coordinate difference.
D3 formula is: depth of field value (ty)=y/2 (that is: 1080/2=540);
Coordinate difference=t (ty): (x, y) → (x, y+ty).
The 4th step: the lateral coordinates of two video files of maintenance 1920*1080 pixel is consistent.Such as: longitudinal origin coordinates of first video file is 0 pixel, and longitudinal origin coordinates of second video file is 1080; If longitudinal origin coordinates of first video file is 1 pixel, longitudinal origin coordinates of second video file is 1081.
The 5th step: the different scale zones that the coordinate difference that the 3rd step D3 formula calculates is frequency file arrange the Y-axis skew of two video file place calibration points, the 1st rail subtitle layer is set to reference point (being that longitudinal origin coordinates is first video file of 1), and the relative ordinate (being that longitudinal origin coordinates is second video file of 1081) of the 2nd rail subtitle layer is set.Such as: if coordinate difference is 23, make subtitle layer 23 pixels that move up.
The 6th step: two compression 1920*1080 video files after treatment are played up and merged processing, just can form the 3D captions video source of upper and lower form.In the present embodiment, described picture parallax is specially upper and lower picture parallax, and according to described picture parallax, two side-play amounts between video file upright position is set.
Again that the source video of 3D captions video source and 1920*2160 is synthetic, produce and be with upper and lower form 3D suspension captions video file.
Above manufacture method be figure film source take 1920*1080 as example, the manufacture method of other figure film source (as: resolution such as 1920*2160,1280*720) can be applied mechanically above-mentioned manufacture method and utilize the video file of the upper and lower form suspension of D3 formula anamorphic zone 3D captions equally.The method is by the synthetic 3D video source of picture parallax of figure film source being carried out to compression processing and calculate according to depth of field index, realize and converted pictures to dynamic stereoscopic three-dimensional unsteady captions effect, convenient, flexible, for process the unified conversion of large batch of video file provide may, solved the cumbersome shortcoming that is difficult for left-hand seat and general setting that cannot compatible program picture of the setting process existing in prior art.
In some embodiment as shown in Figure 5, also can the 2nd rail subtitle layer be set to reference point (being that longitudinal origin coordinates is first video file of 1081), the relative ordinate (being that longitudinal origin coordinates is second video file of 1) of the 1st rail subtitle layer is set.Such as: if coordinate difference is 23, make subtitle layer move down 23 pixels.Can produce equally the video file with the upper and lower form suspension of 3D captions.
Refer to Fig. 6, for solving technical problem of the present invention, corresponding with preceding method, another technical solution used in the present invention is: a kind of producing device of dynamic three-dimensional floating caption is provided, comprises
Make module, for utilizing the captions video file of a 2D transparent effect of source word curtain image making, and described 2D captions video file is transformed into two identical video files;
Computing module, for calculating the picture parallax of two each pixel scales of described video file according to depth of field index;
Module is set, for two side-play amounts between video file being set according to described picture parallax;
Rendering module, processes for two described video files all being done to compression, and compressed two described video files after treatment is played up and merged processing.
Corresponding with preceding method, in certain embodiments, described making module comprises the first production unit, for described 2D captions video file longitudinal compression is become to two identical video files.Described picture parallax is specially left and right picture parallax, and the described module that arranges arranges two side-play amounts between video file horizontal level according to described picture parallax.Utilize this device to produce to there is 3D left and right form music the video file of following effect.
Corresponding with preceding method, described making module comprises the second production unit, for described 2D captions video file is copied into two identical video files.Described picture parallax is specially upper and lower picture parallax, and the described module that arranges arranges two side-play amounts between video file upright position according to described picture parallax.Utilize this device can produce the video file with the upper and lower form suspension of 3D captions.
In sum, being different from prior art 3D subtitle fabricating method uses the 3D caption function of ffdshow to solve left and right form to be written into plug-in SRT captions conventionally, setting process is cumbersome is difficult for left-hand seat and general setting that cannot compatible program picture, the invention provides a kind of manufacture method and device of dynamic three-dimensional floating caption, effectively solve the cumbersome shortcoming that is difficult for left-hand seat and general setting that cannot compatible program picture of prior art setting process, by the synthetic 3D video source of picture parallax of figure film source being carried out to compression processing and calculate according to depth of field index, realize and converted pictures to dynamic stereoscopic three-dimensional unsteady captions effect, provide possibility for processing the unified conversion of large batch of video file, can be widely used in KTV amusement, advertisement, the video processing and fabricating industries such as broadcasting media.
The foregoing is only embodiments of the invention; not thereby limit the scope of the claims of the present invention; every equivalent structure transformation that utilizes specification of the present invention and accompanying drawing content to do, or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.