0

I'm new to linux. I need some help. I want to compress all files present in a directory with same extension. The output should be with same name and extension. I want to run a shell loop to do this. Here is the command to compress one file.

ffmpeg -i inputfilename.mp4 outputfilename.mp4

I am stuck here. How can I run a loop that to take files from one directory to compress and place in other directory?

1 Answer 1

1

Short answer:

for file in *.mp4; do ffmpeg -i "$file" "out/$file" ; done

Long answer is "it depends", but as things don't work and you provide more detail we'll refine it.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.