Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: WebM converter/watermarker script
- :: Requirements:
- :: an ffmpeg installation and path (you need to be able to type ffmpeg into the command line)
- ::
- :: Configuration:
- :: Edit the Options below to your needs. Important ones are outdir, wmark, and threadcount.
- :: Don't put any spaces after your options, it breaks things.
- ::
- :: How to run:
- :: Either run the program and input the file location through text, or
- :: drag a video file onto the batch script and continue operation.
- :: Once you have a video file, just input the start time and duration.
- :: Then, enter the output name (without the .webm) and let ffmpeg do its work.
- ::
- :: Notes:
- :: This is kinda slow to get good video quality.
- :: This does NOT rescale the output, so the resolution will be the same as your input file.
- ::::::: OPTIONS :::::::
- :: outdir : Output directory for the WebMs
- :: wmark : Path to the watermark
- :: bitrate : Bitrate (5M=5000kbps, use what you like)
- :: audio : Audio flag, 1: enable 0: disable
- :: watermark : Watermark flag, 0: disable, 1: bottom right, 2: bottom left, 3: top left, 4:top right
- :: wmarkxpad : Watermark X Padding in pixels, I like 5
- :: wmarkypad : Watermark Y Padding in pixels, I like 5
- :: threadcount : Thread count, reccomend to set to the max number of threads
- SET outdir=K:\Videos\webms\
- SET wmark=K:\Videos\webms\wmark.png
- SET bitrate=5M
- SET audio=0
- SET watermark=1
- SET wmarkxpad=5
- SET wmarkypad=5
- SET threadcount=7
- SET ddrop="%~1"
- IF %ddrop%=="" (
- SET /p infile="Enter Path to Input File: "
- ) ELSE (
- SET infile=%ddrop%
- )
- IF %audio%==1 (
- SET la=-c:a libvorbis
- ) ELSE (
- SET la=-an
- )
- IF %watermark%==1 (
- SET filterarg=-i %wmark% -filter_complex "overlay=(main_w-overlay_w-%wmarkxpad%):(main_h-overlay_h-%wmarkypad%)"
- )
- IF %watermark%==2 (
- SET filterarg=-i %wmark% -filter_complex "overlay=%wmarkxpad%:(main_h-overlay_h-%wmarkypad%)"
- )
- IF %watermark%==3 (
- SET filterarg=-i %wmark% -filter_complex "overlay=%wmarkxpad%:%wmarkypad%"
- )
- IF %watermark%==4 (
- SET filterarg=-i %wmark% -filter_complex "overlay=(main_w-overlay_w-%wmarkxpad%):%wmarkypad%"
- )
- IF %watermark%==0 (
- SET filterarg=
- )
- IF NOT EXIST %infile% (
- ECHO Err: file not found - %infile% >&2
- pause
- EXIT /B 1
- )
- SET /p stime="Start Time (mm:ss) or ss : "
- SET /p length="Video Length: (mm:ss) or ss : "
- SET /p outname="Output filename: "
- ffmpeg -ss %stime% -i %infile% %filterarg% -t %length% -c:v libvpx -b:v %bitrate% %la% -threads 7 %outdir%%outname%.webm
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement