-fv
между тегами [in] и [out] и -filter_complex
несколько значений указываются через запятую.ffmpeg -i video_f0.webm -i audio_f1.opus -i logo_f2.png ^
-filter_complex "[0:v]drawtext=fontfile='C\:\\Windows\\fonts\\Arial.ttf':textfile='text.txt':y=h-line_h-50:x='if(gt(x,-tw),w-mod(2*n,w+tw),w)':fontcolor=red@0.80:fontsize=H/12[a]; [2:v]scale=200:-1[b]; [a][b]overlay=W-w-40:H-h-20[outv]" -map "[outv]" -map 1:a ^
-metadata:s:a language=rus -shortest -y "Output.mp4"
-vf "scale=-1:720, drawtext=fontfile='C\:\\Windows\\fonts\\Arial.ttf':timecode='00\:00\:50\;00':rate=30:text='TCR\:':y=h-(2*lh):x=(w-tw)/2:fontcolor=white@1:fontsize=28:box=1:boxborderw=8:boxcolor=black@0.50"
function intervals($arr) {
$start = -1;
$end = -1;
$result = [];
foreach ($arr as $val) {
if ($start === -1) {
$start = $val;
$end = $val;
} elseif ($val === $end + 1) {
$end = $val;
} else {
$result[] = ['start' => $start, 'end' => $end];
$start = $val;
$end = $val;
}
}
if ($start !== -1) {
$result[] = ['start' => $start, 'end' => $end];
}
return $result;
}
print_r(intervals([0,1,2,3,6,7,8,9,12,13,14,15]));
// Array (
// [0] => Array (
// [start] => 0
// [end] => 3
// )
// [1] => Array (
// [start] => 6
// [end] => 9
// )
// [2] => Array (
// [start] => 12
// [end] => 15
// )
// )