test_julia_scripts/ffmpeg.jl

23 lines
682 B
Julia
Raw Normal View History

2020-07-21 16:07:19 +00:00
currentdir = pwd()
#videosinfolder = readdir(currentdir)
reextension = r"(\.[^.]+)$"
for (_,_,filesinfolders) in walkdir(currentdir)
for files in filesinfolders
extension = match(reextension,files)
if extension == nothing
println("Not a valid extension")
else
if extension.match == ".mkv" || extension.match == ".avi"
newfiles = replace(files, reextension => s".mp4")
run(`ffmpeg -i $files $newfiles`)
sleep(3)
run(`rm $files`)
else
println("No processing done file of type: $(extension.match)")
end
end
end
end