Last active
September 29, 2023 05:02
-
-
Save kasimte/d3c708b993816c05599fd1a3d9dc438d to your computer and use it in GitHub Desktop.
Ruby script to convert MOV files to mp4.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# | |
# 1) cd <my-directory-with-mov-files> | |
# 2) ruby convert-mov-to-mp4.rb | |
# | |
mov_files = Dir[Dir.pwd() + "/*.MOV"] | |
mov_files.each do |file| | |
puts "Processing file: #{ file }" | |
# extract the basename for renaming | |
basename = File.basename(file, File.extname(file)) | |
# run the conversion in the shell | |
command = "ffmpeg -i #{ file } -vcodec copy -acodec copy #{ basename }.mp4" | |
puts "Run: #{ command }" | |
wasGood = system( command ) | |
puts wasGood | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment