0

I successfully outputted the desired effect for my FFMPEG command. I had been removing the audio from my videos with this line of code:

 for i in *.mov; do ffmpeg -i $i -c:v copy -an $i-noaudio.mp4; done

The output results as "myInputvideo.mov-noaudio.mp4"

How might I get this to output without the ".mov" in the title? And how might I move all these outputs into a new directory entitled "no-audio"

Thank you!

kesh
  • 4,515
  • 2
  • 12
  • 20
Gio
  • 41
  • 2

1 Answers1

0

Use Parameter/Variable Expansion. instead of $i, use ${i%.mov} as follows:

Note: I replaced the variable i with file, for clarity.

#!/bin/bash

for file in *.mov; do
  ffmpeg -i ${file} -c:v copy -an ${file%.mov}-noaudio.mp4
done

Here is a good reference for Variable Expansion: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html

Andrew Vickers
  • 2,504
  • 2
  • 10
  • 16