Skip to content

Instantly share code, notes, and snippets.

@zpmorgan
Created February 10, 2012 09:12
Show Gist options
  • Save zpmorgan/1787955 to your computer and use it in GitHub Desktop.
Save zpmorgan/1787955 to your computer and use it in GitHub Desktop.
gst-launch -- take a bunch of png files, flip them vertically, and stuff them into a theora file.
#!/bin/bash
rm -r /tmp/frames
mkdir /tmp/frames
ln /home/zach/projects/Desulfurize/screenshots/*png /tmp/frames/
COUNTER=0
for FILE in `ls /tmp/frames`; do
mv /tmp/frames/$FILE /tmp/frames/`printf "%04d" $COUNTER`.png
COUNTER=$(($COUNTER+1))
done
gst-launch multifilesrc location="/tmp/frames/%04d.png" index=0 \
! image/png,framerate=\(fraction\)5/1 ! \
pngdec ! videorate ! videoflip method=5 ! ffmpegcolorspace ! \
theoraenc quality=63 ! oggmux ! \
filesink location="images.ogg"
# videorate after pngdec, or else only one frame makes it to filesink for some reason.
# theoraenc quality=63: maximum quality, hopefully lossless,
# videoflip method=5: vertical flip. PDL::IO::Pic saves images flipped vertically for some reason.
# ffmpegcolorspace: I don't actually know what this does. converts from YUV to RGB perhaps?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment