« Possible new designs for freeFormed | Main | Grouper.com (kinda what we what to do...done by someone else) »

More fun with ffmpeg

After many hours of trying to figure out exactly what was wrong with ffmpeg, I was finally enlightened today by Shawn Van Every. So as a result, I have some corrections to make to my previous post. First, in order to initiate ffmpeg from perl you have to use system function not exec (oops..thanks Shawn).

Also to make jpeg thumbnails, the original code was wrong. You actually have to say:

ffmpeg -i inputfile -t 0.001 -ss 1 -vframes 1 -f mjpeg -s 320x240 outputfile.jpg

Where inputfile is the name of the video file, -t is the duration of the image, -ss is the timecode of the frame, -vframes is the number of frames, -f mjpeg is motion jpeg (duh), -s is the size of the resulting image and outputfile is the name of the output file. See Shawn's original post.

And you have to add this to your perl code because perl does not know about the changes made to the .bash_profile and therefor needs the path:

$ENV{'PATH'} = $ENV{'PATH'} .':.:/home/catmindeye//bin:/home/vanevery/lame/include:/home/vanevery/bin';
$ENV{'LD_LIBRARY_PATH'} = $ENV{'LD_LIBRARY_PATH'} .':/home/catmindeye/lame/lib';
$ENV{'RUBYLIB'} = $ENV{'RUBYLIB'} . ':/home/catmindeye/lib/ruby';

Also, in slightly related news, I was having considerable trouble trying to figure out how to get the duration of an .flv file loaded into a swf dynamically using the NetStream object. (this is needed in order to create a timeline bar and to calculate the current frame when a user stops the video to comment for our flash project). I looked at the onMetaData function but it wasn't working. After speaking with Shawn, I found out that the reason it wasn't working is because I had to install the flvtool2 in order to calculate the meta data. See Shawn's post. Now perhaps, we are in a better position to finish this project.

TrackBack

TrackBack URL for this entry:
http://www.catmindeye.com/mt/mt-tb.cgi/340

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)