{#if x > 10}
{x} is too large!
{:else if 5 > x}
{x} is perfect
{:else}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adds subtitles.srt to video.mp4 as solid black background, and saves as subbed_video.mp4 | |
# via: https://stackoverflow.com/questions/25870169/how-to-set-background-to-subtitle-in-ffmpeg | |
# Options: | |
# OutlineContour=&AARRGGBB - [Alpha, Red, Green, Blue], Change Alpha value for semi-transparent background | |
# Outline=3 - Specifies the padding for the background rectangle. | |
ffmpeg -i video.mp4 -filter_complex "subtitles=subtitles.srt:force_style='OutlineColour=&000000000,BorderStyle=3,Outline=3,Shadow=0,MarginV=20'" subbed_video.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function lerp($min, $max, $value) { return $min*(1-$value)+$max*$value; } | |
function mixColors($colorA, $colorB, $factor){ | |
// Assign R, G and B values for each color | |
list($aR, $aG, $aB) = sscanf($colorA, "#%02x%02x%02x"); | |
list($bR, $bG, $bB) = sscanf($colorB, "#%02x%02x%02x"); | |
// put the colors back together in hex color format with the mixed value | |
return sprintf("#%02x%02x%02x", |