Hello, recently decided to do it, but also could not find a way to do it via interface. So I searched a little and compiled a script based on the one posted by VLC themselves.
Open the terminal, just
CMD+SPACE shortcut and start typing "terminal".
You will be in your user directory when you open it, lets go to the Downloads folder like so
cd Downloads.
Lets create a file called "convert.sh", I am not very good at life, so I still use NANO program (dont hate), like so:
nano convert.sh
Afterwards you can copy this code into it, just
CMD+V:
Code: Select all
#!/bin/sh
######################## Transcode the files using ... ########################
#vcodec="mp4v"
vcodec="h264"
acodec="mp4a"
vb="1024"
ab="128"
mux="mp4"
#mux="ts"
channels="2"
###############################################################################
# Store path to VLC in $vlc
if command -pv vlc >/dev/null 2>&1; then
# Linux should find "vlc" when searching PATH
vlc="vlc"
else
# macOS seems to need an alias
#vlc="/Applications/Utilities/VLC.app/Contents/MacOS/VLC"
vlc="$(which vlc)"
fi
# Sanity check
if ! command -pv "$vlc" >/dev/null 2>&1; then
printf '%s\n' "Cannot find path to VLC. Abort." >&2
exit 1
fi
index=1
for filename in *.mov; do
printf '%s\n' "=> Transcoding '$filename'... "
"$vlc" -I dummy -q "$filename" \
--sout="#transcode {vcodec='${vcodec}',vb='${vb}',acodec='${acodec}',ab='${ab}',channels='${channels}',deinterlace}:standard {access=file,mux='${mux}',dst='${index}-${filename}'}" \
vlc://quit
ls -lh "$filename" "${index}-${filename}"
index=$((index + 1))
printf '\n'
done
Now save the file,
CTRL+O &
ENTER, afterwards
CTRL+X to exit.
Now allow the script to be runnable by the current user by typing
chmod u+x convert.sh
---
Once you are done with creating the script file you can move it to any folder you like and run it via command line.
After you run the script all the *.mov files in the current folder as the script (e.g. Downloads) will be converted.
Running the script is easy, just go to the folder via CMD line & run
./convert.sh
P.S. The script has some commented out lines, play around with the codecs to align with your own needs!
ref 1:
https://wiki.videolan.org/VLC_HowTo/Tra ... le_videos/
ref 2:
https://stackoverflow.com/questions/309 ... -batch-cli