Skip to content

Instantly share code, notes, and snippets.

@nicobrevin
Created July 13, 2010 16:23
Show Gist options
  • Save nicobrevin/474122 to your computer and use it in GitHub Desktop.
Save nicobrevin/474122 to your computer and use it in GitHub Desktop.
profile = 'lc'
bitrates = [96, 128, 160]
files = Dir['*.wav']
prog = '~/lib/nero/linux/neroAacEnc'
bitrate_control = ['br', 'cbr']
files.each do |fname|
bitrates.each do |rate|
bitrate_control.each do |bc|
file_front = fname[0...-(File.extname(fname).length)]
two_pass = bc == 'br' ? "-2pass" : ""
outfile = file_front + "-#{bc}-#{rate}#{two_pass}-aac.mp4"
command = "#{prog} -lc -#{bc} #{rate * 1024} #{two_pass} -if #{fname} -of #{outfile}"
puts command
`#{command}`
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment