Adding Hindi Text to MP4 Video File using FFmpeg
In this article, we will discuss how to add Hindi text to an MP4 video file using FFmpeg, a powerful and highly flexible software that can record, convert, and stream audio and video. We will cover key concepts such as FFmpeg commands, filter complex, and subtitles.
FFmpeg Command
The FFmpeg command to add Hindi text to an MP4 video file looks like this:
ffmpeg -i template_video.mp4 -filter_complex "drawtext=text=नमस्कारजीमैंहूँ:fontfile=/path/to/font.ttf" output.mp4In the above command, -i flag is used to specify the input file, which is template_video.mp4. The -filter_complex flag is used to specify the filter graph, which is used to add the Hindi text to the video.
The drawtext filter is used to add text to the video. The text option is used to specify the text that needs to be added, which is नमस्कारजीमैंहूँ in this case. The fontfile option is used to specify the path to the font file that needs to be used for rendering the text. You can download a free Hindi font from the internet and use it in this command.
Subtitles
If you want to add subtitles to the video instead of hardcoding the text, you can use the subtitles filter in FFmpeg. The command to add subtitles to an MP4 video file looks like this:
ffmpeg -i template_video.mp4 -vf "subtitles=hindi.srt" output.mp4In the above command, -vf flag is used to specify the video filter, which is subtitles in this case. The subtitles filter is used to add subtitles to the video. The path to the subtitle file is specified using the subtitles option, which is hindi.srt in this case.
Make sure that the subtitle file is in the same format as the video file. FFmpeg supports various subtitle formats such as SRT, ASS, and SSA.
In this article, we have discussed how to add Hindi text to an MP4 video file using FFmpeg. We have covered key concepts such as FFmpeg commands, filter complex, and subtitles. We hope that this article has helped you in adding Hindi text to your video files.