Skip to content

Instantly share code, notes, and snippets.

@stsimb
Created January 18, 2017 22:29
Show Gist options
  • Select an option

  • Save stsimb/90766a6c22ff683e80c4c1df92da67e8 to your computer and use it in GitHub Desktop.

Select an option

Save stsimb/90766a6c22ff683e80c4c1df92da67e8 to your computer and use it in GitHub Desktop.
#!/bin/bash
PARAM=$1
NEWNAME=${PARAM%.*}.mp4
# youtube params https://www.virag.si/2015/06/encoding-videos-for-youtube-with-ffmpeg/
ffmpeg -i "${PARAM}" -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac \
-strict -2 -b:a 384k -r:a 48000 -movflags faststart "${NEWNAME}" && \
touch -r "${PARAM}" "${NEWNAME}" && \
rm -f "${PARAM}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment