<< Rain at Last? | Home | Happy 4th of July! >>

Movies

I'm slowly working towards upgrading all of the video on this site from Windows Media format to the more universal flash video. Flash video has pretty much become the standard on the Internet these days since 98% of computers have some form of Adobe flash player installed already.

I have so far converted the daily webcam motion detector videos. Of course, as of today, only Monday and Tuesday are working since we haven't made it through a complete week yet. I have also converted some of the movies in the Video section which also means they are bigger at twice the previous resolution.


Re: Movies

Do you have unix on your server?  You can do all the conversions automatically, even create a thumbnail.  I do not know how much you've researched, but here is the script I use:
...........................

#!/bin/bash

PATH=$PATH:/usr/local/bin

function video
{
while read line
do

dest_name=`basename $line`
dest="${current}/flash/"${dest_name%.wmv}".flv"
thumb="${current}/flash/thumbs/"${dest_name%.wmv}".jpg"

# For Best Quality WMV to FLV

mencoder $line -o $dest -of lavf -oac mp3lame -lameopts abr:br=96 -ovc lavc -lavcopts vcodec=flv:vqscale=5:mbd=2:mv0:trell:v4mv:keyint=50:cbp:last_pred=3 -srate 44100 -lavfopts 'i_certify_that_my_video_stream_does_not_use_b_frames' -ofps 25000/1001

# Add Metadata

flvtool2 -UP $dest

# Create Thumbnail

ffmpeg -i $dest -vcodec mjpeg -vframes 1 -an -t 00:00:01 -f rawvideo -s 640x480 $thumb < /dev/null

wait

# For Logfile

echo $line

done << EOF
$(/usr/local/bin/php $current/createflash.php)
EOF
}

current=`pwd`
video
...................................

The PHP script I have basically finds all the wmv movies on the server, though it can be anything supported by mencoder, which is a lot of formats.  It spits them out with the full path on the server, one file per line... i.e.

/home/phil/html/wmv/vacation0001.wmv

The mencoder creates the flash, then the flvtools2 adds an xml file for keyframe, so I can stream the whole movie and people can click on the timeline for any point in the movie without having to download the entire thing.  The last step makes a thumbnail.  I put this script on a cron every morning at 6AM to catch any movies anyone in my family wanted to FTP the previous day.

I call it like this (crontab):

0 6 * * * /home/phil/scripts/createflash.sh 2>&1 >> /home/phil/logfiles/createflash`date +\%d\%b\%Y`.log
Avatar: Neal Card

Re: Movies

Yes, I have a similar script that creates the daily motion detection videos at 8pm each day. The movies in the Video section are taking longer to do because I'm ripping them from the original source DVDs to provide better resolution than the old wmv files.
Avatar: Anonymous

Re: Movies

Flash > Windows by far...

Re: Movies

I'm sorry to see the cameras require Flash now. It tries to install itself and fails on computers using IE6. Since Microcra...uh..soft won't make a version of IE7 or 8 for Windows 98se or 2000 many of us have to pass and can't veiw your cams and hear the sounds.

There are wmv settings that combine video quality and reduced file size I'd put over Flash any day. The artifacts in Flash video stand out too much and the motion is very jerky on the best systems and high speed connections.

The only thing you have gained is one can't save what they see on your site. Flash not withstanding, that shuttle launch was great. Thanks for all your work to share this. No thanks to Flash.

Doc

Avatar: Neal Card

Re: Movies

Thanks for the feedback, but Windows 2000 and Windows 98? Really? Adobe Flash is supported on IE6 and can be downloaded from Adobe.com. But I would seriously consider installing Firefox. IE6 has many security issues. The stream is actually using H.264 encoding which is rapidly becoming the web standard, but I will look into providing a legacy option.

Add a comment Send a TrackBack