Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- set ztmp_ffmpeg=C:\bin\ffmpeg64.exe
- setlocal EnableExtensions
- setlocal EnableDelayedExpansion
- set ztmp_res=%~dp0
- set ztmp_font=%ztmp_res:\=\\%segoesc.ttf
- set ztmp_font=%ztmp_font::=\:%
- set ztmp_src=%1
- set ztmp_dest=%~n1.mp4
- set ztmp_fps=60
- set ztmp_text=%2
- set ztmp_text=%ztmp_text:"=%
- set ztmp_fontsize=48
- set ztmp_filter="[0:a]showwaves=s=1920x220:mode=line:r=%ztmp_fps%:colors=0x6441A4|0x6441A4|0x6441A4|0x6441A4:scale=lin:split_channels=1,colorkey=black,fps=%ztmp_fps%[sw]; "
- set ztmp_filter="%ztmp_filter:"=%[0:a]showcqt=text=0:s=1920x820:r=%ztmp_fps%:cscheme=0.390625|0.25390625|0.640625|0.390625|0.25390625|0.640625:bar_t=0.5:bar_h=200:bar_v=5:sono_v=8:axis_h=2,colorkey=black,fps=%ztmp_fps%[sc]; "
- set ztmp_filter="%ztmp_filter:"=%[0:a]showvolume=r=60:w=1920:f=0.5:c=0xFFA44164[sv]; "
- set ztmp_filter="%ztmp_filter:"=%[sv][sw]vstack,fps=%ztmp_fps%[fs]; "
- set ztmp_filter="%ztmp_filter:"=%[fs][sc]vstack,fps=%ztmp_fps%[fo]; "
- set ztmp_filter="%ztmp_filter:"=%[3:v]alphaextract[a]; "
- set ztmp_filter="%ztmp_filter:"=%[2:v][a]alphamerge[bg]; "
- set ztmp_filter="%ztmp_filter:"=%[1:v][bg]overlay,fps=60[bgo]; "
- set ztmp_filter="%ztmp_filter:"=%[bgo][fo]overlay,fps=%ztmp_fps%"
- set ztmp_extrafilter="[vo]; "
- set ztmp_extrafilter="%ztmp_extrafilter:"=%[vo][4:v]overlay,fps=%ztmp_fps%[vo2]; "
- set ztmp_extrafilter="%ztmp_extrafilter:"=%[vo2]drawtext=fontcolor=white@0.8:fontsize=%ztmp_fontsize%:box=0:x=(w-text_w)/2:y=(h-text_h)-14:fontfile='%ztmp_font%':text='%ztmp_text%'"
- set ztmp_images=-f lavfi -i color=c=black:s=1920x1080:r=60:d=0.5
- set ztmp_images=%ztmp_images% -f lavfi -i color=c=0x0F0C1B:s=1920x1080:r=60:d=0.5
- set ztmp_images=%ztmp_images% -i "%ztmp_res%bg_alpha.png"
- if not [%2]==[] (
- set ztmp_images=%ztmp_images% -i "%ztmp_res%overlay.png"
- set ztmp_filter="%ztmp_filter:"=%%ztmp_extrafilter:"=%"
- q)
- if exist "%ztmp_src%" (
- %ztmp_ffmpeg% -i "%ztmp_src%" %ztmp_images% -filter_complex "%ztmp_filter:"=%[out]" -map "[out]" -map 0:a -c:v libx264 -b:v 10240k -b:a 192k -g 15 -r %ztmp_fps% -c:a aac -f mp4 "%ztmp_dest%"
- ) else (
- echo Could not find file %ztmp_src%
- goto :failed
- )
- goto :cleanup
- :cleanup
- set "ztmp_res="
- set "ztmp_font="
- set "ztmp_fontsize="
- set "ztmp_src="
- set "ztmp_dest="
- set "ztmp_fps="
- set "ztmp_text="
- set "ztmp_filter="
- set "ztmp_images="
- goto :eof
- :failed
- echo This stage of the encoding has failed...
- goto :cleanup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement