Running qtfaststart in a folder containing multiple .mp4's

1

I have a library of videos, all of which need to be adjusted for web-streaming by putting the moov atom ahead of the rest of the video with qtfaststart. This allows playback to begin before the client has completely downloaded the video.

How can I do this? Should I run a .sh script directed to that folder to run qtfaststart? If so, how would such a script look like?

punktilend

Posted 2014-02-13T15:15:38.367

Reputation: 13

Best and easiest according to what criteria? – Kevin Panko – 2014-02-13T15:35:33.477

Answers

1

All you have to do is:

for f in *.mp4; do qtfaststart "$f"; done

This works because qtfaststart will overwrite the input file automatically.

If you want this done recursively, you could use find:

find . -type f -name '*.mp4' -exec qtfaststart {} \;

Or with shell globs (e.g. in Bash 4):

shopt -s globstar
for f in **/*.mp4; do qtfaststart "$f"; done

slhck

Posted 2014-02-13T15:15:38.367

Reputation: 182 472

is there a way of making this recursive for subfolders? – punktilend – 2014-02-14T15:14:29.493

See my updated answer. – slhck – 2014-02-14T15:47:32.783