Daniel Peters
Daniel Peters

Reputation: 3

Search/Find All .mkv in directories and sub directories

Hi I've got a script that i want to scan all sub directories 1/2/3/4/ etc deep but when i've placed an mkv sample file here for example;

/home/storage/movies/folder1/folder2/folder3/sample.mkv but it doesnt find the .mkv

and it get the error **/*.mkv: No such file or directory

shopt -s globstar
while true; do
for f in **/*.mkv; do 
ffmpeg -i "$f" -c:v libx264 -preset ultrafast -minrate 4.5M -maxrate 4.5M -bufsize 9M -c:a ac3 "${f%mkv}mp4";
rm "$f";
done
sleep 60
done

Can anyone see what is wrong or have any other suggestions

Upvotes: 0

Views: 551

Answers (1)

user5914598
user5914598

Reputation:

Daniel, it has been 2 months, and I hope you found the solution. If you did not you may try this as quick workaround,

for f in `find . -name *.mkv`; do

You can have a look find's exec option as well

Upvotes: 0

Related Questions