.bat file command

marlon241982

Established
Mga master... ano kaya mali dito? mag kahiwalay na bat yan pang video at yung isa pang merge ng music. tapos ginawa ko pinaayos ko kay pareng gpt eto ang binigay nya kaso ayaw tumalab.

command

echo off
setlocal

set "INPUT=input.mp4"
set "MUSIC=music.mp3"
set "OUTPUT=output.mp4"

:: Get video duration
for /f %%a in ('
ffprobe -v error -show_entries format^=duration ^
-of default^=nokey^=1:noprint_wrappers^=1 "%INPUT%"
') do set DURATION=%%a

:: Calculate music start time (45 seconds before end)
for /f %%a in ('
powershell -NoProfile -Command "[math]::Max(0,[double]('%DURATION%')-45)"
') do set START=%%a

echo Video Duration: %DURATION%
echo Background Music Starts At: %START% seconds

ffmpeg -i "%INPUT%" -i "%MUSIC%" ^
-filter_complex ^
"[0:v]scale=iw*0.98:ih*0.98,scale=iw:ih,eq=contrast=0.92:brightness=-0.01:saturation=0.78,noise=alls=10:allf=t+u,gblur=sigma=0.4,curves=vintage[v]; ^
[0:a]highpass=f=80,lowpass=f=7000,volume=0.95[main]; ^
[1:a]volume=0.30,adelay=%START%s:all=1[music]; ^
[main][music]amix=inputs=2:duration=first:dropout_transition=2[a]" ^
-map "[v]" ^
-map "[a]" ^
-c:v libx264 ^
-crf 22 ^
-preset slow ^
-c:a aac ^
-b:a 160k ^
-map_metadata -1 ^
-map_chapters -1 ^
-shortest ^
"%OUTPUT%"

echo.
echo Done!
pause

Eto naman ang error

[AVFormatContext @ 000001e9a921ecc0] Unable to choose an output format for '^'; use a standard extension for the filename or specify the format manually.
[out#0 @ 000001e9a70b8ec0] Error initializing the muxer for ^: Invalid argument
Error opening output file ^.
Error opening output files: Invalid argument
'-map' is not recognized as an internal or external command,
operable program or batch file.


sana may makatulong para isang execute na lang ako salamat po...
 

About this Thread

  • 0
    Replies
  • 28
    Views
  • 1
    Participants
Last reply from:
marlon241982

Trending Topics

Online now

Members online
1,172
Guests online
1,200
Total visitors
2,372

Forum statistics

Threads
2,288,280
Posts
29,050,314
Members
1,214,989
Latest member
bgyyyyyy
Back
Top