jonesints
May 15th, 2016, 03:35 PM
After hunting for hours through forums, I'm stuck from just achieving basics with ffmpeg with my limited bash knowledge.
What I'm trying to achieve:
6TB of video files of different codecs on my headless server (of mainly wrappers .mov & mp4) in several directories. I would like to extract the audio from them as .wav, and save the audio in a separate location KEEPING the folder structures in this new location. (I don't mind if re-encoding audio but if just extracting the right audio codec is faster, and less processing, then better!)
#!/bin/bash
for filename in *.mp4;
do
stub="${filename%.*}"
/usr/local/bin/ffmpeg -i "${stub}.mp4" -vn -acodec copy "Someotherpath/FolderStructureRecreated/${stub}.wav"
sleep 0.1
done
Would I need to use "find" instead, if names are more complex with characters/spaces?
What I'm trying to achieve:
6TB of video files of different codecs on my headless server (of mainly wrappers .mov & mp4) in several directories. I would like to extract the audio from them as .wav, and save the audio in a separate location KEEPING the folder structures in this new location. (I don't mind if re-encoding audio but if just extracting the right audio codec is faster, and less processing, then better!)
#!/bin/bash
for filename in *.mp4;
do
stub="${filename%.*}"
/usr/local/bin/ffmpeg -i "${stub}.mp4" -vn -acodec copy "Someotherpath/FolderStructureRecreated/${stub}.wav"
sleep 0.1
done
Would I need to use "find" instead, if names are more complex with characters/spaces?