Created
June 9, 2017 13:35
-
-
Save justinledwards/27d6f89c615177bd6133f31363c3ca49 to your computer and use it in GitHub Desktop.
Advice required for first crystal app
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
# Recorded OTA Conversion App | |
files = [] of String | |
Dir.cd "/mnt/MediaArchive/TV-Optimized/" | |
directory = Dir.glob("**/*") | |
directory.each do |file| | |
# TODO, filter files listed to a new array for things that need converting | |
files << file if /\.ts$/ =~ file | |
end | |
# TODO make each file convert using ffmpeg, but plan for killing ffmpeg if it's been running for over an hour \ | |
# TODO possibly spawn this into a new thread | |
files.each do |file| | |
io = IO::Memory.new | |
args = [] of String | |
args << "-n -i #{file} -metadata title=\"\" -vf scale=-1:720 -c:v libx264 -preset fast -c:a:0 libfaac -b:a:1 128k -c:a:1 copy -movflags +faststart #{file}.mp4" | |
test = Process.run "ffmpeg", args, output: io | |
puts io | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment