Skip to content

Instantly share code, notes, and snippets.

@jegade
Created April 7, 2017 09:41
Show Gist options
  • Save jegade/3852369bd71a30265d915c38b0fcc9c4 to your computer and use it in GitHub Desktop.
Save jegade/3852369bd71a30265d915c38b0fcc9c4 to your computer and use it in GitHub Desktop.
my $default_arguments = "-hide_banner -loglevel panic -y -pix_fmt yuv420p ";
my $formats = {
ogv => { mimetype => "video/ogv", arguments => qq| $default_arguments -c:v libtheora -b:v 600k -acodec libvorbis -b:a 96k -vf scale=720:-2 |, ext => 'ogv' },
mp4 => { mimetype => "video/mp4", arguments => qq| $default_arguments -c:v libx264 -b:v 1000k -movflags +faststart -acodec libfaac -profile:v baseline -b:a 128k -vf scale=-2:720 |, ext => 'base.mp4' },
png => { mimetype => "image/png", arguments => qq| $default_arguments -vframes 1 |, ext => 'png' },
vp8 => { mimetype => "video/webm", arguments => qq| $default_arguments -c:v libvpx -b:v 1500k -acodec libvorbis -vf scale=-2:720|, ext => 'vp8.webm' },
vp9 => { mimetype => "video/webm", arguments => qq| $default_arguments -c:v libvpx-vp9 -b:v 1000k -acodec libvorbis -speed 1 -vf scale=-2:720|, ext => 'vp9.webm' },
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment