Skip to content

Instantly share code, notes, and snippets.

@zotherstupidguy
Last active August 29, 2015 14:17
Show Gist options
  • Save zotherstupidguy/7c0328b5b928ce5246a9 to your computer and use it in GitHub Desktop.
Save zotherstupidguy/7c0328b5b928ce5246a9 to your computer and use it in GitHub Desktop.
Anime Converting
# First We sort via creation time and rename simply
files = Dir.glob("*.mkv")
count = 0
files.each { |file| File.new(file, "r").ctime}.sort.each do |file|
p File.basename(file, '.mkv').to_s
File.rename(file, (count += 1).to_s + ".mkv")
p count
end
# then we convert
files = Dir.glob("*.mkv")
files.each do |file|
`HandBrakeCLI -i #{file} -o #{File.basename(file, '.mkv').to_s}.mp4 -e x264 -q 20 -B 160 --x264-preset medium --two-pass -O --turbo --subtitle "1" --subtitle-burn "1" --srt-codeset utf8 &`
end
# finally
files.each do |file|
# we remove
`rm #{file}`
end
sudo apt-get install subversion yasm build-essential autoconf libtool zlib1g-dev libbz2-dev libxml2-dev libogg-dev libvorbis-dev libsamplerate-dev libfribidi-dev libfreetype6-dev libfontconfig1-dev libass-dev libmp3lame-dev libx264-dev intltool libglib2.0-dev libdbus-glib-1-dev libgtk-3-dev libgudev-1.0-dev libwebkitgtk-3.0-dev libnotify-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libappindicator-dev libtheora-dev
svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
cd hb-trunk
./configure --disable-gtk --launch
cd build
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment