L0Lock / FFmpeg-bat-collection

A collection of .bat files for some usefull ffmpeg conversions.
https://l0lock.github.io/FFmpeg-bat-collection/
GNU General Public License v3.0
37 stars 5 forks source link

ffmpeg simple .bat question #3

Closed geextahslex closed 8 months ago

geextahslex commented 8 months ago

Hi, sorry for bothering you. I'm new to .bat and ffmpeg in general. I recently found out a ffmpeg command I would like to use as a .bat script.

  1. dragn n drop xyz.mkv on .bat
  2. take xyz.mkv as input and output filename
  3. run ffmpeg script: ffmpeg -i xyz.mkv -af "pan=stereo|c0=c2+0.6*c0+0.6*c4+c3|c1=c2+0.6*c1+0.6*c5+c3" -c:v copy -codec:a ac3 -b:a 160k -ar 44100 -sn -dn xyz.mkv
  4. output location G: drive

Any help would be appreciated :)

okay this is working, but I don't know how to change the output location. I want to ouput to my usb drive which is G:

@echo off
:again

ffmpeg ^
    -i "%~1" ^
    -af "pan=stereo|c0=c2+0.6*c0+0.6*c4+c3|c1=c2+0.6*c1+0.6*c5+c3" -c:v copy -codec:a ac3 -b:a 160k -ar 44100 -sn -dn ^
    "%~p1%~n1.mkv"
if NOT ["%errorlevel%"]==["0"] goto:error
echo %~n1 Done!

I guess this has something to do with %~1 - expands %1 removing any surrounding quotes (") %~f1 - expands %1 to a fully qualified path name %~d1 - expands %1 to a drive letter only %~p1 - expands %1 to a path only %~n1 - expands %1 to a file name only %~x1 - expands %1 to a file extension only %~s1 - expanded path contains short names only %~a1 - expands %1 to file attributes %~t1 - expands %1 to date/time of file %~z1 - expands %1 to size of file

geextahslex commented 8 months ago

solution: "G:\%~n1.mkv"