0

How can I make the output format of a video the same as the input format for general case?

avconv -i source -vcodec copy -acodec copy -movflags empty_moov -f ??? output

I would not like to use -f with a specific value and how to prevent avconv from whatever extension to deduce format.

llogan
  • 59,497

1 Answers1

0

Use:

for file in *
do
avconv -i $file -vcodec copy -acodec copy -movflags empty_moov \
-f "${file##*.}" output
done

You could also use ${file#*.} if the path need not be stripped.

Rajib
  • 3,106