Difference between revisions of "Make a movie from JPEG images using gstreamer"
From ElphelWiki
(No difference)
|
Latest revision as of 07:23, 15 June 2007
#!/bin/sh # Capture a frame every SLEEP_TIME seconds from URL and rename it PREFIX-nnnnnn.jpg: PREFIX=img SLEEP_TIME=1 URL="http://192.168.0.90/admin-bin/ccam.cgi?opt=vhcxy-" num=0 while true ; do img=$PREFIX-`printf %06d $num`.jpg if [ -s $img ] ; then echo exists: $img else wget -q "$URL" -O $img && sleep $SLEEP_TIME && ln -sf $img $PREFIX.jpg echo $img fi num=`expr $num + 1` done ----------------------------------------------------------------------- <html> <!-- To watch the frames while capturing them without disturbing the camera, put this html page in a file located in the same folder, replace 'content="1"' with the number of seconds you want between updates, and open it with your browser: --> <head> <meta http-equiv="refresh" content="1"> </head> <body> <img src=img.jpg> </body> </html> ----------------------------------------------------------------------- #!/bin/sh # Create an ogg/theora movie using the JPEG files generated with the first script on this page: PREFIX=img FRAMERATE=30 WIDTH=768 HEIGHT=576 QUALITY=63 OUTFILE=out.ogg if [ -s "$OUTFILE" ] ; then echo file exists: $OUTFILE 1>&2 exit 1 fi time gst-launch-0.10 \ multifilesrc \ location="$PREFIX-%06d.jpg" ! image/jpeg,framerate=$FRAMERATE/1 \ ! decodebin \ ! videoscale \ ! video/x-raw-yuv,width=$WIDTH,height=$HEIGHT \ ! progressreport \ name=progress \ ! theoraenc \ quality=$QUALITY \ ! oggmux \ ! filesink \ location="$OUTFILE"