Skip to content

Instantly share code, notes, and snippets.

@richardpeng
Created October 7, 2010 15:46
Show Gist options
  • Save richardpeng/615322 to your computer and use it in GitHub Desktop.
Save richardpeng/615322 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Convert videos from Canon S90 to flash-playable streaming format
for file in "$@"
do
filename=$(basename $file)
filename=${filename%.*}
# Convert the audio stream to AAC
ffmpeg -i $file -vcodec copy -acodec libfaac temp_vid.mp4
# Move the H.264 MOOV atom to the beginning of the file for progressive streaming
qt-faststart temp_vid.mp4 $filename.mp4
rm temp_vid.mp4
# Create a screenshot
ffmpeg -i $filename.mp4 -f image2 -vframes 1 $filename.jpg
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment