Method and plug-in for realizing UE to output video with caption head and caption tail
By using FFMPEG and other tools in UE software, automated the picture sequence of UE MRQ mode, adding subtitles, complexing at the end of the film, and adding background music, solving the problem that existing technology cannot directly generate subtitles videos, realized fast, conveniently convenient The video generation process.
Patent Information
- Application Number
- CN202411486506.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-01-24
AI Technical Summary
The prior art cannot directly generate the UE MRQ pattern picture sequence into subtitled videos, and requires manual use of other software to generate videos, which is inconvenient to use.
By using UE software to render the picture sequence, use FFMPEG to synthesize it to the video, add mask, add subtitles, combine the end of the film, and finally add background music to realize the automation generation of the video.
The picture sequence of the UE output is achieved quickly to generate subtitles with subtitles, which avoids the tedious process of manual production by frame, and greatly facilitates users to make videos.
Smart Images

Figure CN119364092A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud rendering technology, and in particular to a method and a plug-in for enabling UE to output a video with a title and an ending of a subtitle. Background Art
[0002] UE MRQ mode can only output image sequences, and cannot directly generate videos. When you need to generate videos, you need to manually use other video generation software to generate them, which is very inconvenient to use.
[0003] Therefore, the prior art has defects and needs to be improved. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and a plug-in for realizing UE output of a video with a subtitle title and an ending, so as to quickly make the UE output into a video for convenient application.
[0005] The technical solution of the present invention is as follows: a method for realizing UE output of video with subtitles, including the following steps.
[0006] S1: Use UE software to render a sequence of images, and then use ffmpeg to synthesize the sequence of images into scene.mp4. Scene.mp4 comes with silent audio.
[0007] S2: Add a mask to scene.mp4 to provide a location for the subtitles, and obtain the video mengban_scene.mp4 with the mask.
[0008] S3: Add subtitles to the mask to obtain the video txt_mengban_scene.mp4 with subtitles.
[0009] S4: merge the title start.mp4 into the video txt_mengban_scene.mp4 carrying the masked subtitles to obtain the video use_start.mp4 with the title.
[0010] S5: merge the ending end.mp4 into the video with the beginning use_start.mp4 to obtain the video with the beginning and ending use_start_end.mp4.
[0011] S6: Add background music to the video use_start_end.mp4 with the opening and ending credits to obtain the final video result.mp4.
[0012] Furthermore, if the start.mp4 and the end.mp4 do not have sound, silent audio needs to be added. Silent audio is added to the start and end to obtain the start_mp3.mp4 with audio and the end_mp3.mp4 with audio. Silent audio is used to provide a blank audio data to facilitate subsequent background music to cover and provide the start and end marks for the background music.
[0013] Furthermore, the command for adding silent audio to the beginning of the film is: ffmpeg.exe-yi start.mp4-flavfi-ianullsrc=r=44100:cl=stereo-c:v copy-map 0-map 1-shortest start_mp3.mp4, and the command for adding silent audio to the end of the film is: ffmpeg.exe-yi end.mp4-flavfi-i anullsrc=r=44100:cl=stereo-c:v copy-map 0-map 1-shortest end_mp3.mp4
[0014] Furthermore, the size of the start.mp4 and the end.mp4 must be consistent with the size of the image rendered by UE.
[0015] Further, in step S2, the command for adding a mask is: ffmpeg.exe -i scene.mp4 -filter_complexcolor=s=1080x400:c=black@.5[vc];[0:v][vc]overlay=Ww:Hh[out]-to14-map[out]-map 0:ac:a copy-y mengban_scene.mp4.
[0016] Further, in step S3, the command for adding subtitles is: ffmpeg.exe -imengban_scene.mp4 -vf "drawtext=text='XXXXXX':x=100:y=1620.0:fontsize=60:fontcolor=white:fontfile=simhei.ttf" -c:a copy txt_mengban_scene.mp4; wherein XXXXXX is the specific subtitle content.
[0017] Further, in step S4, the command for merging the header is: ffmpeg.exe -y-istart_mp3.mp4 -itxt_mengban_scene.mp4 -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:vlibx264 -c:a aac -shortest use_start.mp4.
[0018] Further, in step S5, the command for merging the end of the film is: ffmpeg.exe -y -i use_start.mp4 -iend_mp3.mp4 -filter_complex"[0:v][1:v]concat=n=2:v=1:a=0[v];[0:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[a]"-map"[v]"-map"[a]"use_start_end.mp4.
[0019] Further, in step S6, the command for adding background music is: ffmpeg.exe -i use_start_end.mp4 -i background.mp3 -shortest -filter_complex[0:a][1:a]amix -y result.mp4.
[0020] Furthermore, the present invention also provides a plug-in, which is applied to UE software and generates a video using the above-mentioned method for realizing UE output of a video with a caption title and an ending.
[0021] By adopting the above scheme, the present invention provides a method and plug-in for realizing UE to output videos with subtitles, a sequence of pictures is rendered to synthesize the video, and then a mask for adding subtitles is added, and then subtitles are added to the mask, and then the opening and ending are merged, and finally background music is added to obtain the final video. Since the UE software renders the sequence of pictures to produce the final video directly in the form of commands, there is no need for the user to produce it frame by frame through other software, which greatly facilitates the user to produce videos and facilitates application. Furthermore, the method of realizing UE outputting videos with subtitles, opening and ending is applied to UE software in the form of a plug-in, which can be more convenient for directly generating videos through the plug-in on the UE software, which is convenient for application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1The present invention is a flow chart of the method. DETAILED DESCRIPTION
[0023] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0024] See also Figure 1 The present invention provides a method for realizing UE output of video with subtitles, including the following steps.
[0025] S1: Use UE software to render a sequence of images, and then use ffmpeg to synthesize the sequence of images into scene.mp4.
[0026] S2: Add a mask to scene.mp4 to provide a location for the subtitles, and obtain the video mengban_scene.mp4 with the mask.
[0027] S3: Add subtitles to the mask to obtain the video txt_mengban_scene.mp4 with subtitles.
[0028] S4: merge the title start.mp4 into the video txt_mengban_scene.mp4 carrying the masked subtitles to obtain the video use_start.mp4 with the title.
[0029] S5: merge the ending end.mp4 into the video with the beginning use_start.mp4 to obtain the video with the beginning and ending use_start_end.mp4.
[0030] S6: Add background music to the video use_start_end.mp4 with the opening and ending credits to obtain the final video result.mp4.
[0031] In this embodiment, if the header start.mp4 and the end end.mp4 have no sound and silent audio needs to be added, silent audio is added to the header and the end to obtain the header start_mp3.mp4 carrying audio and the end end_mp3.mp4 carrying audio.
[0032] In this embodiment, the command for adding silent audio to the beginning of the film is: ffmpeg.exe-yi start.mp4-flavfi-i anullsrc=r=44100:cl=stereo-c:v copy-map 0-map 1-shortest start_mp3.mp4, and the command for adding silent audio to the end of the film is: ffmpeg.exe-yi end.mp4-flavfi-i anullsrc=r=44100:cl=stereo-c:v copy-map 0-map 1-shortest end_mp3.mp4
[0033] In this embodiment, the size of the header start.mp4 and the size of the end end.mp4 need to be consistent with the size of the picture rendered by UE.
[0034] In this embodiment, in step S2, the command for adding a mask is: ffmpeg.exe -iscene.mp4 -filter_complex color=s=1080x400:c=black@.5[vc];[0:v][vc]overlay=Ww:Hh[out]-to 14-map[out]-map 0:ac:a copy-y mengban_scene.mp4.
[0035] In this embodiment, in step S3, the command for adding subtitles is: ffmpeg.exe -imengban_scene.mp4 -vf "drawtext=text='XXXXXX':x=100:y=1620.0:fontsize=60:fontcolor=white:fontfile=simhei.ttf" -c:a copy txt_mengban_scene.mp4; wherein XXXXXX is the specific subtitle content.
[0036] In this embodiment, in step S4, the command for merging the header is: ffmpeg.exe -y -istart_mp3.mp4 -i txt_mengban_scene.mp4 -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:vlibx264 -c:a aac -shortest use_start.mp4.
[0037] In this embodiment, in step S5, the command for merging the end of the film is: ffmpeg.exe -y -i use_start.mp4 -i end_mp3.mp4 -filter_complex"[0:v][1:v]concat=n=2:v=1:a=0[v];[0:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[a]"-map"[v]"-map"[a]"use_start_end.mp4.
[0038] In this embodiment, in step S6, the command for adding background music is: ffmpeg.exe -i use_start_end.mp4 -i background.mp3 -shortest -filter_complex[0:a][1:a]amix -y result.mp4.
[0039] The present invention also provides a plug-in, which is applied to UE software and uses the above-mentioned method for realizing UE output of video with subtitles, beginning and ending credits to generate video.
[0040] In summary, the present invention provides a method and plug-in for realizing UE output of videos with subtitles, a sequence of pictures is rendered to synthesize a video, a mask for adding subtitles is added, subtitles are then added to the mask, the opening and ending are merged, and finally background music is added to obtain the final video. Since the UE software renders the sequence of pictures to produce the final video directly in the form of commands, there is no need for the user to produce it frame by frame through other software, which greatly facilitates the user to produce videos and facilitates application. Furthermore, the method of realizing UE output of videos with subtitles, opening and ending is applied to UE software in the form of a plug-in, which can be more convenient for directly generating videos through the plug-in on the UE software, which is convenient for application.
[0041] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for implementing UE to output a video with a subtitle title and a subtitle ending, characterized in that: The following steps are involved: S1: Use UE software to render a sequence of images, and then use ffmpeg to synthesize the sequence of images into scene.mp4; S2: Add a mask to scene.mp4 to provide a location for the subtitles, and obtain the video mengban_scene.mp4 with the mask; S3: Add subtitles to the mask to obtain the video txt_mengban_scene.mp4 with subtitles; S4: merge the title start.mp4 into the video txt_mengban_scene.mp4 carrying the masked subtitles to obtain the video use_start.mp4 with the title; S5: merge the ending end.mp4 into the video with the beginning use_start.mp4 to obtain the video with the beginning and ending use_start_end.mp4; S6: Add background music to the video use_start_end.mp4 with the opening and ending credits to obtain the final video result.mp4.
2. A method for realizing UE output of video with subtitles and title credits according to claim 1, characterized in that: If the beginning start.mp4 and the ending end.mp4 have no sound and silent audio needs to be added, add silent audio to the beginning and the ending to obtain the beginning start_mp3.mp4 with audio and the ending end_mp3.mp4 with audio.
3. A method for realizing UE output of video with subtitles and title credits according to claim 2, characterized in that: The command to add silent audio at the beginning of the film is: ffmpeg.exe-yi start.mp4 -f lavfi -i anullsrc=r=44100:cl=stereo-c:v copy-map 0-map 1-shortest start_mp3.mp4, and the command to add silent audio at the end of the film is: ffmpeg.exe-yi end.mp4 -f lavfi -i anullsrc=r=44100:cl=stereo-c:vcopy-map 0-map 1-shortest end_mp3.mp4.
4. A method for realizing UE output of video with subtitles and title credits according to claim 1, characterized in that: The size of the start.mp4 and the end.mp4 must be consistent with the size of the image rendered by UE.
5. The method for realizing UE outputting a video with a subtitle title and an ending according to claim 1, characterized in that: In step S2, the command to add the mask is: ffmpeg.exe -i scene.mp4 -filter_complex color=s=1080x400:c=black@.5[vc]; [0:v][vc]overlay=Ww:Hh[out]-to 14-map[out]-map 0:ac:a copy-y mengban_scene.mp4.
6. The method for realizing UE outputting a video with a subtitle title and an ending according to claim 1, characterized in that: In step S3, the command for adding subtitles is: ffmpeg.exe -imengban_scene.mp4 -vf "drawtext=text='XXXXXX':x=100:y=1620.0:fontsize=60:fontcolor=white:fontfile=simhei.ttf" -c:a copy txt_mengban_scene.mp4; wherein XXXXXX is the specific subtitle content.
7. The method for realizing UE outputting a video with a subtitle title and an ending according to claim 2, characterized in that: In step S4, the command for merging the header is: ffmpeg.exe -y -istart_mp3.mp4 -i txt_mengban_scene.mp4 -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:vlibx264 -c:a aac -shortest use_start.mp4.
8. The method for realizing UE outputting a video with a subtitle title and a subtitle ending according to claim 2, characterized in that: In step S5, the command for merging the end of the film is: ffmpeg.exe -y -i use_start.mp4 -i end_mp3.mp4 -filter_complex"[0:v][1:v]concat=n=2:v=1:a=0[v];[0:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[a]"-map"[v]"-map"[a]"use_start_end.mp4.
9. The method for realizing UE outputting a video with a subtitle title and a subtitle ending according to claim 1, characterized in that: In step S6, the command for adding background music is: ffmpeg.exe -iuse_start_end.mp4 -ibackground.mp3 -shortest -filter_complex[0:a][1:a]amix -y result.mp4.
10. A plug-in, characterized in that: Applied to UE software, the method for realizing UE outputting video with subtitles, beginning and ending credits as described in any one of claims 1 to 9 is used to generate video.