I am new to ffmpeg and my first post here. what i have and what i want to do is below:
- I have video, transparent image and .srt file
- Video with dimension width:1280 Height:720.
- Transparent image with dimension width:1024 Height:122.
- .srt file with font sytle stored in html tags.
My goal is to overlay the image with srt text exactly in center and the overlayed image to be exactly in center video.
I started by subtracting the dimension of video with transparent image to position it exactly at center.
ImageX = (video.width - image.width)/2 ImageY = (video.Height - Image.height) * 0.9 (to bottom of video).
After researching i got this code:
ffmpeg.exe -i "C:\Projects\Video Phase 3\Horse\horse.mp4" -i "C:\Projects\Video Phase 3\Horse\Transparent.png" -threads 0 -c:v libx264 -crf 28 -preset veryslow -filter_complex "[0:v][1:v]overlay=128:538:enable='between(t,0,1)', subtitles=C\\:\\\\Projects\\\\Video Phase 3\\\\Horse\\\\ImportedTrack1_0.srt[out]" -map "[out]" -map 0:a "C:\Projects\Video Phase 3\Horse\newout.mp4"
i am able to put the transparent image exactly at center,bottom. But i am not able to position the srt text in image. even if i put the image in Top center, i need to put the text in center of image. Please help me guys