Skip to content

Instantly share code, notes, and snippets.

@antespi
Last active June 3, 2018 10:30
Show Gist options
  • Save antespi/4de4a6337bdfdd7396c40914ed4de320 to your computer and use it in GitHub Desktop.
Save antespi/4de4a6337bdfdd7396c40914ed4de320 to your computer and use it in GitHub Desktop.
Transcoding using VLC : H264 & MP3
#!/bin/bash
VIDEO_BIT_RATE=1500
AUDIO_BIT_RATE=128
# vlc --no-repeat --no-loop -I dummy __input_file__.mov --sout "#transcode{vcodec=h264,vb=1500,acodec=mp3,ab=128,channels=2,samplerate=44100}:standard{access=file,mux=mp4,dst='__output_file__.mp4'}"
transcode() {
local fin=$1
local fout=$2
if [ ! -f "fout" ]; then
vlc --no-repeat --no-loop -I dummy "$fin" --sout "#transcode{vcodec=h264,vb=1500,acodec=mp3,ab=128,channels=2,samplerate=44100}:standard{access=file,mux=mp4,dst='$fout'}" vlc://quit
else
echo "'$fout' already transcoded"
fi
}
# transcode FILE01.MOV 01_filename.mp4
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment