Test files for ffmpeg

This commit is contained in:
Eduardo Cueto Mendoza 2020-07-21 10:07:19 -06:00
parent 8dab247c53
commit 389f3386a8
3 changed files with 64 additions and 0 deletions

22
ffmpeg.jl Normal file
View File

@ -0,0 +1,22 @@
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

24
remconf.jl Normal file
View File

@ -0,0 +1,24 @@
currentdir = pwd()
renotvalid = r"(^\._).+(\.[^.]+)$"
reextension = r"(\.[^.]+)$"
for (root,_,filesinfolders) in walkdir(currentdir)
for files in filesinfolders
notvalid = match(renotvalid,files)
if notvalid != nothing
maybenotvalid = notvalid.captures
if any(x -> x=="._",maybenotvalid) && (any(x -> x==".mkv",maybenotvalid) || any(x -> x==".avi",maybenotvalid))
println("File: $root/$files is not valid, removing")
sleep(2)
run(`rm $root/$files`)
end
end
extension = match(reextension,files)
if extension.match == ".rar"
println("this is a $files file removing")
sleep(2)
run(`rm $root/$files`)
end
end
end

18
testing_ffmpeg.jl Normal file
View File

@ -0,0 +1,18 @@
currentdir = pwd()
#videosinfolder = readdir(currentdir)
reextension = r"(\.[^.]+)$"
for (root,foldersinfolders,filesinfolders) in walkdir(currentdir)
if !isempty(foldersinfolders)
for folder in foldersinfolders
println(root * "/" * folder * "/")
println(foldersinfolders)
println(filesinfolders)
#for file in filesinfolders
# pathtofiles = root * "/" * folder * "/" * file
# println(pathtofiles)
#end
end
end
end