Skip to content

Instantly share code, notes, and snippets.

@stigok
Created July 30, 2017 17:18
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 stigok/27a4a289905344d77ccdfeb577696067 to your computer and use it in GitHub Desktop.
Save stigok/27a4a289905344d77ccdfeb577696067 to your computer and use it in GitHub Desktop.
Convert a video file to a cross-browser HTML5 video compatible file format
#!/bin/bash
# Convert a video file to a cross-browser HTML5 video compatible file format
#
# Usage: vid2html5 <infile> [<outdir>]
#
# stigok jul 2017
infile="$1"
timestamp=`date +'%Y-%m-%d-%H%M%S'`
outdir=${2:-.}
outfile=$outdir/$timestamp.mp4
ffmpeg -loglevel warning -i "$infile" -an -vcodec libx264 -pix_fmt yuv420p -preset fast -profile:v baseline -movflags faststart $outfile
echo $outfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment