-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathmainConvert.bat
85 lines (64 loc) · 1.86 KB
/
mainConvert.bat
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@echo off
rem used in both CapMyFreeCamsNodeJS and CapChaturbate!
rem just change "inputfiletype" and "output" ("output", not just "outputfiletype"!)
set inputfiletype=*.ts
set outputfiletype=mkv
rem ============================================================================
set savedir=%1
set arg1=%~2
set arg2=%~3
rem 10mb 10485760
rem 50mb 52428800
rem 100mb 104857600
set minimumsize=52428800
for %%a in (%savedir%\%inputfiletype%) do (
call :fix "%%a"
)
rem need exit here to exit command prompt
exit
rem ----------------------------------------------------------------------------
:fix
call :setsize %1
rem delete if less than size in bytes
if %size% lss %minimumsize% (
del %1
goto :eof
)
set output=%1
rem -4 for *.xxx, -3 for *.xx
set output=%output:~0,-3%%outputfiletype%
echo.
echo ==================================================
echo Converting %~nx1 to %outputfiletype%, copying video and audio stream directly, no transcoding!...
echo ==================================================
rem -y overwite output without asking
rem less verbose: ffmpeg.exe -loglevel warning -y -i %1 -c:v copy -c:a copy %output%
if "%arg2%" == "ffmpeg32" (
ffmpeg32.exe -y -i %1 -c:v copy -c:a copy %output%
)
if "%arg2%" == "ffmpeg64" (
ffmpeg64.exe -y -i %1 -c:v copy -c:a copy %output%
)
if "%arg1%" == "deleteyes" (
call :setsize %output%
if %size% lss %minimumsize% (
del %output%
) else (
echo "DELETING ORIGINAL FLV" & del %1
)
)
if "%arg1%" == "deleteno" (
call :setsize %output%
if %size% lss %minimumsize% (
del %output%
) else (
echo "NOT DELETING ORIGINAL FLV"
)
)
goto :eof
rem ----------------------------------------------------------------------------
:setsize
set size=%~z1
goto :eof
rem ----------------------------------------------------------------------------
rem ============================================================================