Skip to content

Instantly share code, notes, and snippets.

@adekbadek
Last active February 1, 2018 15:48
Show Gist options
  • Save adekbadek/a85dca6220f25fbf6ddcfa4745c702cf to your computer and use it in GitHub Desktop.
Save adekbadek/a85dca6220f25fbf6ddcfa4745c702cf to your computer and use it in GitHub Desktop.
some useful assets conversions for websites
# convert video to webm
# https://thethemefoundry.com/blog/convert-mp4-to-webm/
ffmpeg -i myvideo.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis myvideo.webm
# convert between image formats
convert myimg.png myimg.jpg
# convert images to webp
# https://www.npmjs.com/package/webp-converter-cli
# to convert all in current directory:
webpc -r
# get first frame of a video (useful for video posters)
# https://stackoverflow.com/a/44073745
ffmpeg -i inputfile.mp4 -vf "select=eq(n\,0)" -q:v 3 outputimage.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment