Created
January 6, 2015 14:09
-
-
Save TheRusskiy/aa314f6548da41945a07 to your computer and use it in GitHub Desktop.
Embed subtitles for all videos in a folder
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
require 'awesome_print' | |
folder = "/media/media_nas_drive/Train/Video/Biology/Consumer Neuroscience/" | |
folder_for_cd = folder.gsub(' ', '\ ') | |
files = Dir[folder+'*.mp4'].map{|f| f.gsub(folder, '').gsub('.mp4', '')} | |
files.each_with_index do |f, i| | |
ap "!!!!!!!!!" | |
ap "#{i+1}/#{files.length}" | |
ap "!!!!!!!!!" | |
system "cd #{folder_for_cd} && ffmpeg -i \"#{f}.mp4\" -f srt -i \"#{f}.srt\" -c:v copy -c:a copy \ | |
-c:s mov_text \"new_video/#{f}.mp4\"" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment