Скрипт для кодирования видео для устройств на ОС Android (или других, если профиль подходит...)

 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
@echo off
set ffmpeg_path="путь\до\ffmpeg.exe"
set hqpreset_path=путь\до\libx264-hqa.ffpreset
echo Using ffmpeg: %ffmpeg_path%
echo.
:input
set INPUT=
set /P INPUT=Full file path: %=%
if "%INPUT%"=="" goto input
echo.
:codecs
echo Codec:
echo 1) MP4 x264 HQ
echo 2) MP4 mpeg4 Fast
echo 0) break
set CODEC=
set /P CODEC=Input number: %=%
echo.
if "%CODEC%"=="1" (
set vcodec_name=libx264 -fpre "%hqpreset_path%"
) else if "%CODEC%"=="2" (
set vcodec_name=mpeg4
) else if "%CODEC%"=="0" (
goto end0
) else goto codecs
:bitrate
echo Bitrate:
echo 1) 512k
echo 2) 768k
echo 3) 1024k
echo 4) 1536k
echo 0) break
set BITRATE=
set /P BITRATE=Input number: %=%
echo.
if "%BITRATE%"=="1" (
set b_value=512k
) else if "%BITRATE%"=="2" (
set b_value=768k
) else if "%BITRATE%"=="3" (
set b_value=1024k
) else if "%BITRATE%"=="4" (
set b_value=1536k
) else if "%BITRATE%"=="0" (
goto end0
) else goto bitrate
:command
set start_time=%date% %time%
set STRING=%ffmpeg_path% -y -i "%INPUT%" -vcodec %vcodec_name% -b %b_value% -minrate 200k -maxrate 3000k -bufsize 3670k -acodec aac -ac 2 -ab 128k "%INPUT%.mp4"
echo.
echo %STRING%
echo.
%STRING%
set end_time=%date% %time%
:end0
echo.
echo Started: %start_time%
echo Finished: %end_time%
pause