-i "concat:1.ogg|2.ogg"
) наиболее строг: требует файлы с идентичными кодеками и контейнерами.cat
в Linux. В вашем примере без перекодирования, наверное, можно вообще обойтись без ffmpeg
и просто склеить файлы один за другим:copy 1.ogg + 2.ogg a.ogg
force_original_aspect_ratio
пропорции;ffmpeg -framerate 1/10 -i img%3d.png -i audio.wav \
-vf 'scale=3840:2880:force_original_aspect_ratio=decrease,pad=3840:2880:(ow-iw)/2:(oh-ih)/2,setsar=1' \
-c:v libx264 -crf 14 -r 25 -pix_fmt yuv420p -shortest output.mp4
via enable()
в Timeline editingffmpeg \
-i input.mp4 \
-i mask.png \
-filter_complex \
"[0:v][1:v] overlay=enable='between(t,33*60,34*60)'" \
output.mp4
model
необходимо передать одну из готовых моделей. Поиском нашлись, например, модели richardpl/arnndn-modelssmartblur = enable='between(t,10,3*60)',
curves = enable='gte(t,3)' : preset=cross_process
Выражения типа between()
и gte()
описаны в Expression evaluationffmpeg -filters
покажет, какие из фильтров подерживают timeline (буква "T").colorchannelmixer
и eq
из вашей команды — поддерживают:Filters:
T.. = Timeline support
.S. = Slice threading
..C = Command support
A = Audio input/output
V = Video input/output
N = Dynamic number and/or type of input/output
| = Source or sink filter
TSC colorchannelmixer V->V Adjust colors by mixing color channels.
T.C eq V->V Adjust brightness, contrast, gamma, and saturation.
[-][HH:]MM:SS[.m...]
— ваш вариант, вполне легитимный.-ss 2208ms
ffmpeg \
-i head-1920.jpg \
-vf rgbashift=rh=20:bh=-20 \
-hide_banner -y \
test-result.jpg
-r 30
идёт уже после -i имяфайла
и поэтому к нему не относится. Ко входу в результате применяется дефолтная частота 25.The following methods enable passing input-related options to ffmpeg. Each of these methods apply on the last input added (including the one passed to the constructor, if any). You must add an input before calling those, or an error will be thrown.
.inputFPS(30)
сразу за .input(`${tmpDir.path}/frame-%d.jpeg`)
scale
использовать похожий фильр scale2ref – он позволяет брать размеры одного входа, для масштабирования другого.ffmpeg -i "$file" -i "$wm" \
-filter_complex "[1][0:v]scale2ref=w='min(347, iw * 9/10)':h=ow/main_dar[logo][vid];
[vid][logo]overlay=x=(W-w) / 2:y=H - 2 * h[v]" \
-map [v]:v -map 0:a \
-y "$file-out.mp4"
if(gte(t,9)*lte(t,29)
if(gte(t,20)*lte(t,25)
ffmpeg \
-y \
-i "$file" \
-vcodec libx264 \
-movflags +faststart \
-threads 0 \
-r 25 \
-g 50 \
-crf 25 \
-me_method hex \
-trellis 0 \
-bf 8 \
-acodec aac \
-strict \
-2 \
-ar 44100 \
-ab 128k \
-f mp4 \
-vf "movie=watermark.png [wm];[in][wm] overlay='if(gte(t,9)*lte(t,29), W-((W+w)/20)*mod(t-9,20), -w-1000)':'0' [out]" \
"out/$file"
-t ???
:ffmpeg -i SOURCE
// найти duration
ffmpeg \
-i SOURCE \
-t XXX \
-codec copy \
DESTINATION
При отсутствии перекодирования , т.к. кодеки те же, процесс должен быть очень быстрым.-i "concat:video1.ts|video2.ts" -c copy
очень быстра.сначала перевожу в mp4, потом в tsэти два действия должны быть одним (см. по ссылке выше):