Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartyLake/ebccfabcc2c115527b16b848ed7f87b1 to your computer and use it in GitHub Desktop.
Save MartyLake/ebccfabcc2c115527b16b848ed7f87b1 to your computer and use it in GitHub Desktop.
Create an album: Normalize all wav volume and convert all wav to mp3
# dont normalize here if songs have different intensity, for example quiet intro song followed by loud pop song
# from http://normalize.nongnu.org/README.html
# normalize -bv *.wav
# from https://gist.github.com/championofblocks/3982727
for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done
# from https://askubuntu.com/questions/65331/how-to-convert-a-m4a-sound-file-to-mp3
# + https://askubuntu.com/questions/385636/what-is-the-proper-way-to-convert-flac-files-to-320-kbit-sec-mp3
find . -type f -name '*.m4a' -exec bash -c 'avconv -i "$0" -qscale:a 0 "${0/%m4a/mp3}"' '{}' \;
# m4a -> flac
# from https://askubuntu.com/questions/65331/how-to-convert-a-m4a-sound-file-to-mp3
# So I eventually settled for :
find . -type f -name '*.m4a' -exec bash -c 'avconv -i "$0" "${0/%m4a/flac}"' '{}' \;
#Then deleted the original files :
find . -type f -name '*.m4a' -exec bash -c 'rm "$0"' '{}' \;
# extract part of a video file, with audio from https://www.arj.no/2018/05/18/trimvideo/
ffmpeg -i input.mp4 -ss 01:10:27 -to 02:18:51 -c:v copy -c:a copy output.mp4
# create a proxy video for scoring films on Ableton live
ffmpeg -i input.mp4 -vcodec libx264 -force_key_frames source -x264-params keyint=1:scenecut=0 out.mp4
# create a proxy video, of smaller size (faster transcoding, faster using)
# from https://unix.stackexchange.com/questions/28803/how-can-i-reduce-a-videos-size-with-ffmpeg
ffmpeg -i input.mp4 -vcodec libx264 -force_key_frames source -x264-params keyint=1:scenecut=0 -vf "scale=trunc(iw/8)*2:trunc(ih/8)*2" out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment