up
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
const { mkdirSync } = require('node:fs')
|
||||
const { spawnSync } = require('node:child_process')
|
||||
mkdirSync('fixtures', { recursive: true })
|
||||
const jobs = [
|
||||
[
|
||||
'-f',
|
||||
'lavfi',
|
||||
'-i',
|
||||
'sine=frequency=1000:sample_rate=48000:duration=60',
|
||||
'-af',
|
||||
'volume=0.1',
|
||||
'-c:a',
|
||||
'pcm_s16le',
|
||||
'fixtures/audio.wav',
|
||||
],
|
||||
[
|
||||
'-f',
|
||||
'lavfi',
|
||||
'-i',
|
||||
'testsrc2=size=1280x720:rate=30:duration=60',
|
||||
'-f',
|
||||
'lavfi',
|
||||
'-i',
|
||||
'sine=frequency=1000:sample_rate=48000:duration=60',
|
||||
'-af',
|
||||
'volume=0.1',
|
||||
'-c:v',
|
||||
'libx264',
|
||||
'-preset',
|
||||
'fast',
|
||||
'-pix_fmt',
|
||||
'yuv420p',
|
||||
'-c:a',
|
||||
'aac',
|
||||
'-movflags',
|
||||
'+faststart',
|
||||
'-shortest',
|
||||
'fixtures/video.mp4',
|
||||
],
|
||||
]
|
||||
for (const args of jobs) {
|
||||
const result = spawnSync('ffmpeg', ['-hide_banner', '-loglevel', 'error', '-y', ...args], {
|
||||
stdio: 'inherit',
|
||||
})
|
||||
if (result.error)
|
||||
console.error('Установите ffmpeg с libx264 и добавьте в PATH:', result.error.message)
|
||||
if (result.error || result.status !== 0) process.exit(1)
|
||||
}
|
||||
Reference in New Issue
Block a user