Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
@ECHO OFF SETLOCAL EnableExtensions EnableDelayedExpansion CHCP 65001 ::v0.01 Initial Release ::v0.02 A few minutes after that, two missing quotes made it shit itself. You can now drag/drop multiple files at once. ::v0.03 2021-11-04 VP9! Hallelujah! ::v0.0? 2022-07-06 I forgor ::v0.04 2023-01-16 Rudimentary constrained bitrate mode :: Now won't overwrite input WEBMs, lol :: Resample obnoxiously using libsoxr to 48k if needed, convert to 128k opus using libopus for any non-MP3/AAC/OGG/OPUS sources :: Yes, that means you need ffmpeg compiled with --enable-libopus and --enable-libsoxr :: But you already compiled it with both, and --disable-encoder=opus/--disable-decoder=opus, amongst many other such substitutions... :: Right? ::For batch converting any FFMPEG compatible inputs to a VP9 WEBM that can be posted on 4chinz. ::Done - Implement bit-rate calculation using FFProbe to determine input length and required bitrate to meet 3MB limit. ::Done - Check for audio in input, demux to original format in appropriate container per FFProbe without re-encoding, without requiring user to determine appropriate container. Automatically transcode to opus for any formats other than m4a/mp3/ogg/opus ::Done: Fix non-ASCII UTF-8 filename parsing, using "CHCP 65001" to change codepage. ::To-Do: Prompt user if they want a soundpost. ::To-Do: Call catbox.moe API using pwsh.exe Invoke-WebRequest, upload sound ::Note: Probably requires userhash/registered account. ::To-Do: /wsg/ prompt -> adjust to 6 MB, allow direct audio copy if input is Vorbis, else re-encode and include. ECHO [97;46mnigger [93;46m:D [97;46mv0.04 :AGAIN ECHO [97;45mCalculating Duration and Bitrate for Input:[96;45m "%~dpnx1" [0m ::Determines input duration using ffprobe, stores seconds value to duration variable. FOR /F %%I IN ('ffprobe.exe -v error -show_entries format^=duration -of default^=noprint_wrappers^=1:nokey^=1 "%~1"') do SET "DURATION=%%I" ::Determines required bitrate using [3 MiB * 1024 KiB/MiB * 8 kb/KiB] = 24576 kbit SET /A BITRATE = 24576 / DURATION SET /A MINBITS = BITRATE / 10 SET /A MAXBITS = 11 * BITRATE / 10 ECHO [97;45mDuration is:[96;45m %DURATION%[97;45m seconds -[96;45m %BITRATE%[97;45m kbps required to meet 3 MB limit. Min: [96;45m %MINBITS%[97;45m kbps - Max: [96;45m %MAXBITS%[97;45m kbps ECHO [97;44mConverting[95;44m %~1 [97;44mto[95;44m %BITRATE%[97;44m kbps 10-bit VP9, 1st Pass[0m ffmpeg.exe -i "%~1" -c:v libvpx-vp9 -pix_fmt yuv420p10le -colorspace bt709 -color_primaries bt709 -color_trc bt709 -quality good -auto-alt-ref 1 -arnr-maxframes 12 -lag-in-frames 24 -tile-rows 0 -tile-columns 1 -tune-content film -enable-tpl 1 -row-mt 1 -qcomp 0.80 -keyint_min 24 -g 240 -pass 1 -b:v %BITRATE%k -minrate %MINBITS%k -maxrate %MAXBITS%k -f rawvideo -passlogfile "%TMP%/%~n1_2pass" -an -sn -y -hide_banner NUL ECHO [97;42m1st Pass [93;42mSuccess[0m ECHO [97;44mConverting[95;44m %~1 [97;44mto 10-bit VP9, 2nd Pass[0m ffmpeg.exe -i "%~1" -c:v libvpx-vp9 -pix_fmt yuv420p10le -colorspace bt709 -color_primaries bt709 -color_trc bt709 -quality good -auto-alt-ref 1 -arnr-maxframes 12 -lag-in-frames 24 -tile-rows 0 -tile-columns 1 -tune-content film -enable-tpl 1 -row-mt 1 -qcomp 0.80 -keyint_min 24 -g 240 -pass 2 -b:v %BITRATE%k -minrate %MINBITS%k -maxrate %MAXBITS%k -passlogfile "%TMP%/%~n1_2pass" -an -sn -hide_banner "%~pn1.out.webm" ECHO [97;42m2nd Pass [93;42mSuccess[0m ECHO [91;44mDeleting[97;44m 2-Pass Log File[0m DEL "%TMP%\%~n1_2pass-0.log" ECHO [97;42mFinished Converting[93;42m %~1 FOR /F "tokens=*" %%S IN ("%~pn1.out.webm") DO SET SIZE=%%~zS SET /A SIZEK=SIZE/1024 ECHO [97;42m10-bit VP9 WEBM:[93;42m %~dpn1.out.webm [97;42mSize:[93;42m %SIZE%[97;42m bytes /[93;42m %SIZEK%[97;42m KiB[0m SET MAX=3145728 IF %SIZE% LSS %MAX% (ECHO [97;46m%~n1.out.webm is[93;46m under 3 MiB[97;46m, libvpx obeyed.[93;46m Please shitpost responsibly.[0m) ELSE (ECHO [97;41m%~n1.out.webm is [93;41mover 3 MiB[97;41m, fuck libvpx-vp9, fuck hiroshimoot, give us AV1 you wanker.[0m) ECHO [97;45mProbing Default Audio Track...[0m FOR /F %%X IN ('ffprobe.exe -v error -select_streams a:0 -show_entries stream^=codec_name -of default^=noprint_wrappers^=1:nokey^=1 "%~1"') do SET "AF=%%X" SET AEXT= IF "%AF%" == "vorbis" SET "AEXT=.ogg" IF "%AF%" == "opus" SET "AEXT=.ogg" IF "%AF%" == "aac" SET "AEXT=.m4a" IF "%AF%" == "mp3" SET "AEXT=.mp3" IF [%AEXT%]==[] GOTO:TRANSCODEAUDIO ECHO [97;44mExtracting[93;44m %AF% [97;44maudio to[93;44m %~n1.audio%AEXT%[0m ffmpeg.exe -i "%~1" -map 0:a -c:a copy -hide_banner "%~pn1.audio%AEXT%" ECHO [93;42m%AF% [97;42maudio extracted to:[93;42m %~dpn1.audio%AEXT% [97;42mSize:[93;42m who cares?[0m SHIFT IF "%~1" == "" GOTO:FINISH GOTO:AGAIN :TRANSCODEAUDIO ECHO [97;43m ;_; [36;43m%AF% [97;43maudio detected. Transcoding using [36;43mlibopus[97;43m using obnoxious autismo settings.[0m ffmpeg.exe -i "%~1" -map 0:a -af aresample=resampler=soxr:dither_method=low_shibata:precision=33:cutoff=0.95:cheby=1 -ar 48000 -b:a 128k -c:a libopus -hide_banner "%~pn1-opus.ogg" ECHO [93;42m%AF% [97;42maudio converted to:[93;42m %~dpn1-opus.ogg [97;42mSize:[93;42m who cares?[0m SHIFT IF "%~1" == "" GOTO:FINISH GOTO:AGAIN :FINISH ECHO [93;46m :) [97;46mNo additional files selected for conversion, please check the console for errors, if any.[0m PAUSE
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
December smells like money
CSS | 11 min ago | 0.26 KB
✅ Changelly.com Exploit
24 min ago | 0.26 KB
Trading method
CSS | 38 min ago | 0.26 KB
Google Docs - Exploit
51 min ago | 0.26 KB
biplas v40 - Colonies apart from home
8 hours ago | 0.68 KB
Untitled
18 hours ago | 0.30 KB
December smells like money
18 hours ago | 0.15 KB
Untitled
18 hours ago | 0.11 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!