Using FFMPEG to generate video in Plint

Short summary

"Hardsubbing" / adding burnt-in subtitles to video

Plint can combine a source video file from a project with the translations/subtitles created in the system to create deliverables; videos with burnt-in subtitles. This is done from the "Generate video copies" page or as an automatic job. In both cases, a FFMPEG preset is needed. These are handled under Tools & Data.

Here are some pointers on the available variables. 

-vf scale=w=1334:h=-1,"{SUBTITLE}" -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 320k -y

Advanced font settings

FontSize=32,OutlineColour=&H66000000,BorderStyle=3,PrimaryColour=&H000000FF

(Please note that the syntax is different when using the ASS subtitle format, which yields additional options.)

Font size

Setting the font size will specify a relative size. The subtitles will be scaled based on the resolution of the video. Values around 20 are fairly "normal". 

Changing the default font

The fallback font for rendering videos with burnt-in subtitles is "Arial Unicode MS". You can upload any TTF through Plint and use that instead. This is how:

Interlace / progressive output

If video should not be deinterlaced (for television, for example), additional flags can prevent this. See example below

-vf "{SUBTITLE}" -c:v libx264 -flags +ildct+ilme 

Complex filters / adding logo

Using "filter_complex", multiple inputs can be combined. This will overlay a logo in the top left corner (with 20 pixels margin) plus burnt-in subtitles.

-i path-to-logo/logo.png -filter_complex "{SUBTITLE},overlay=20:20"

Work copies with timecode

FFMPEG can also be used to generate work copies, for example MP4 files suitable for the online editor. These presets need to be tagged as "Work copy" under "Usage". This will make them available for automatic use for "Media upload" jobs. All you need to do is select a media for upload and select a preset in the conversion dropdown. The system will create the work copy and tag it for use in the online editor. 

The following parameters will generate a lo-res file with visible timecode. Audio is set to AAC, 128k.

-vf scale=w=480:h=-2,"drawtext=fontfile={FONT}: timecode=\\'00:00:00:00\\': r={FRAMERATE}: x=(w-tw)/2: y=10: fontsize=20: fontcolor=white: box=1: boxcolor=0x00000099" -keyint_min 1 -bf 16 -c:v libx264 -preset slow -crf 25 -c:a aac -b:a 128k -y

Some explanations

Documentation and examples of FFMPEG settings



Revision #15
Created 2020-06-17 12:44:10 UTC by Plint
Updated 2022-08-18 15:39:11 UTC by Plint