-
Notifications
You must be signed in to change notification settings - Fork 1
/
ffmpeg_script.cmd
69 lines (60 loc) · 1.95 KB
/
ffmpeg_script.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@echo off
setlocal enabledelayedexpansion
:input_filename_selection
cls
set /p "input_file=Enter the input filename (without extension): "
rem Check if the input file exists
if not exist "!input_file!.mkv" (
echo Input file does not exist.
timeout /t 2 >nul
goto input_filename_selection
)
:channel_selection
cls
echo Select the number of audio channels:
echo 1. Stereo (2 channels)
echo 2. 5.1 Surround (6 channels)
set /p "channel_choice=Enter your choice (1 or 2): "
if "!channel_choice!"=="1" (
set "audio_channels=2"
) else if "!channel_choice!"=="2" (
set "audio_channels=6"
) else (
echo Invalid choice. Please try again.
timeout /t 2 >nul
goto channel_selection
)
:output_filename_selection
cls
echo Select the output filename (with suffix if it's the same as input name):
echo 1. Same as input name
echo 2. Fixed name: output
echo 3. Custom name
set /p "output_option=Enter your choice (1, 2, or 3): "
if "!output_option!"=="1" (
set "output_filename=!input_file!"
if "!output_filename!"=="!input_file!" (
set "output_filename=!input_file!_modified"
)
set "output_filename=!output_filename!.mkv"
) else if "!output_option!"=="2" (
set "output_filename=output"
if "!output_filename!"=="!input_file!" (
set "output_filename=!input_file!_modified"
)
set "output_filename=!output_filename!.mkv"
) else if "!output_option!"=="3" (
set /p "output_filename=Enter the custom output filename (without extension): "
if "!output_filename!"=="!input_file!" (
set "output_filename=!input_file!_modified"
)
set "output_filename=!output_filename!.mkv"
) else (
echo Invalid choice. Please try again.
timeout /t 2 >nul
goto output_filename_selection
)
rem Run ffmpeg command
ffmpeg -i "!input_file!.mkv" -map 0:v -map 0:a -c:v copy -c:a aac -ac !audio_channels! -b:a 384k "!output_filename!"
endlocal
pause