Update
This commit is contained in:
@@ -127,9 +127,22 @@ const useVideoExport = ({ timelineElements, dimensions, totalDuration }) => {
|
|||||||
|
|
||||||
if (videos.length === 0 && images.length === 0) {
|
if (videos.length === 0 && images.length === 0) {
|
||||||
if (is_string) {
|
if (is_string) {
|
||||||
return 'ffmpeg -f lavfi -i color=black:size=450x800:duration=1 -c:v libvpx-vp9 -t 1 output.mp4';
|
return 'ffmpeg -y -c:v libvpx-vp9 -f lavfi -i color=black:size=450x800:duration=1 -t 1 -vcodec libx264 output.mp4';
|
||||||
} else {
|
} else {
|
||||||
return ['-f', 'lavfi', '-i', 'color=black:size=450x800:duration=1', '-c:v', 'libvpx-vp9', '-t', '1', 'output.mp4'];
|
return [
|
||||||
|
'-y',
|
||||||
|
'-c:v',
|
||||||
|
'libvpx-vp9',
|
||||||
|
'-f',
|
||||||
|
'lavfi',
|
||||||
|
'-i',
|
||||||
|
'color=black:size=450x800:duration=1',
|
||||||
|
'-t',
|
||||||
|
'1',
|
||||||
|
'-vcodec',
|
||||||
|
'libx264',
|
||||||
|
'output.mp4',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,20 +327,23 @@ const useVideoExport = ({ timelineElements, dimensions, totalDuration }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const finalArgs = [
|
const finalArgs = [
|
||||||
|
'-y',
|
||||||
|
'-c:v',
|
||||||
|
'libvpx-vp9',
|
||||||
...inputArgs,
|
...inputArgs,
|
||||||
'-filter_complex',
|
'-filter_complex',
|
||||||
filterComplex,
|
filterComplex,
|
||||||
'-map',
|
'-map',
|
||||||
`[${videoLayer}]`,
|
`[${videoLayer}]`,
|
||||||
...audioArgs,
|
...audioArgs,
|
||||||
'-c:v',
|
'-c:a',
|
||||||
'libvpx-vp9',
|
'aac',
|
||||||
'-pix_fmt',
|
|
||||||
'yuv420p',
|
|
||||||
'-r',
|
'-r',
|
||||||
'30',
|
'30',
|
||||||
'-t',
|
'-t',
|
||||||
totalDuration.toString(),
|
totalDuration.toString(),
|
||||||
|
'-vcodec',
|
||||||
|
'libx264',
|
||||||
'output.mp4',
|
'output.mp4',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -344,7 +360,7 @@ const useVideoExport = ({ timelineElements, dimensions, totalDuration }) => {
|
|||||||
|
|
||||||
const inputs = inputStrings.join(' ');
|
const inputs = inputStrings.join(' ');
|
||||||
const audioMap = audioArgs.length > 0 ? ` ${audioArgs.map((arg) => escapeShellArg(arg)).join(' ')}` : '';
|
const audioMap = audioArgs.length > 0 ? ` ${audioArgs.map((arg) => escapeShellArg(arg)).join(' ')}` : '';
|
||||||
const command = `ffmpeg ${inputs} -filter_complex ${escapeShellArg(filterComplex)} -map ${escapeShellArg(`[${videoLayer}]`)}${audioMap} -c:v libvpx-vp9 -pix_fmt yuv420p -r 30 -t ${totalDuration} output.mp4`;
|
const command = `ffmpeg -y -c:v libvpx-vp9 ${inputs} -filter_complex ${escapeShellArg(filterComplex)} -map ${escapeShellArg(`[${videoLayer}]`)}${audioMap} -c:a aac -r 30 -t ${totalDuration} -vcodec libx264 output.mp4`;
|
||||||
|
|
||||||
showConsoleLogs && console.log('🎵 FINAL COMMAND HAS AUDIO:', command.includes('atrim') && command.includes('audio_final'));
|
showConsoleLogs && console.log('🎵 FINAL COMMAND HAS AUDIO:', command.includes('atrim') && command.includes('audio_final'));
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
"y": 200,
|
"y": 200,
|
||||||
"fontSize": 40,
|
"fontSize": 40,
|
||||||
"fontWeight": "bold",
|
"fontWeight": "bold",
|
||||||
"fontFamily": "Montserrat",
|
"fontFamily": "Arial",
|
||||||
"fontStyle": "normal",
|
"fontStyle": "normal",
|
||||||
"fill": "#ffffff",
|
"fill": "#ffffff",
|
||||||
"stroke": "#000000",
|
"stroke": "#000000",
|
||||||
|
|||||||
Reference in New Issue
Block a user