We need a creative solution to burn captions into a video with the following style: http://prntscr.com/cyqig3. If this project is a success, we may be able to use you for an ongoing need for similar scripting and/or sysadmin tasks.
- Font: Open Sans
- Size: 50
- Background: black with 75% opacity
- The background box must "fit" the size of the text on each line, plus padding (ie. not extend far left or right of the text).
- The background boxes for each line may not overlap
- path to 1 video (mp4)
- path to 1 caption / subtitle file (.srt, .ass, etc. - whatever you need, we can generate most common formats)
- 1 video (mp4 with same resolution as input)
- Must use readily available binaries in Ubuntu 16.04
- Must run from the command line with no GUI
- Must make AT MOST one encoding pass
- You may provide a shell script or PHP, Python or Node wrapper to simplify the command line interface.
Note ffmpeg can get close, but we can't seem to get rid of the overlap as described here: https://superuser.com/questions/1126553/ffmpeg-subtitle-burning-make-them-look-like-youtube-captions?newreg=964896a356b74e66b458bed77978f757
I have some other ideas how to achieve this. In order of preference:
1. Maybe ffmpeg has some option to add proper line height or vertical line spacing to remove the overlap. This would be ideal, but based on my research I'm not finding an answer.
2. Parse the caption file and use drawbox and drawtext repeatedly (see answer on http://video.stackexchange.com/questions/14924/ffmpeg-drawtext-clipping-to-a-bounding-box). This may help, but I'm not sure how to keep the box at the proper dimensions relative to the text.
3. Use something like imagemagick to create PNGs containing the text and background box for each caption group, then use ffmpeg's overlay option repeatedly to add the images at the right time and position. This may provide the best control for sizing the background box, but is the most cumbersome.
Other than that, I don't want to add too many constraints. We're just looking for a solution with a relatively clean interface that we can automate from the command line.
Please bid if you are confident you can arrive at a solution meeting our requirements. Only bids that include a summary of your approach to solve this will be considered.