Created
September 16, 2015 19:20
-
-
Save cdesch/c2bef6becc696034c290 to your computer and use it in GitHub Desktop.
Shorten all videos in a directory to a specified time using ffmpeg
This file contains hidden or 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
puts 'Converting FLV files' | |
basedir = '.' | |
Dir.glob("*.mp4") do |my_text_file| | |
puts ' --> converting: ' + my_text_file | |
puts "ffmpeg -i #{my_text_file.gsub(/ /, '\ ')} -ss 00:00:00.0 -c copy -t 00:00:10.0 new.#{my_text_file.gsub(/ /, '\ ')}" | |
`ffmpeg -i #{my_text_file.gsub(/ /, '\ ')} -ss 00:00:00.0 -c copy -t 00:00:10.0 new.#{my_text_file.gsub(/ /, '\ ')}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment