In case it's of any use to others, a Perl script below to run ffmeg, reindex files and then run biftool for a directory of mov files (don't use it unless you know what you are doing; use it at your own risk!). In Windows, ffmpeg seems to generate an extra blank frame at index #1. I must be missing something because whatever I do the frames are exactly 20 seconds behind where they should be when testing on the Roku player. Any ideas? Really wish you guys would compile biftool for Mac (or release source code to do same) since I'm currently using VMWare to host Windows just for the biftool. Is biftool working properly on Windows?
Greg
############################################
#!/bin/perl
use File::Basename;
use File::Copy;
use File::Path;
#################################################################
# bif_maker.pl - a script to generate bif files from video file images
# Greg Quinn, December 2009
####################################################################################
#
# PLEASE NOTE:
# This script may be freely used, distributed, and modified.
# It's intended for use by an experienced programmer/developer
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE and it is used at the user's own risk. The user
# assumes all liability for its use and the author assumes no liability for
# its use
#
#####################################################################################
#
# Script to find quicktime files in a directory (.mov) files and
# create the HD and SD bif files required for scene tricking support in the Roku
# Player. Requires PERL (free frrom ActiveState for Windows, already installed on
# most other operating systems) the free ffmpeg and Roku's biftool to be in the path
#
# USAGE: drop script in the directory with .mov video files and run script. Assumes
# that base file names for movie files (appended with "_hd" and "_sd") don't clash
# with any pre-existing dir's in that directory otherwise it will nuke them
#
#####################################################################################
# create a list of all *.mov files in
# the current directory - change to desired file type
# if different
opendir(DIR, ".");
@files = grep(/\.mov$/,readdir(DIR));
closedir(DIR);
# Process each of the file names
foreach $file (@files) {
# grab the base name of the .mov file
($basename,undef,$ext) = fileparse($file,qr{\..*});
# create the directories that we'll put the sequential images
mkdir $basename."_sd";
mkdir $basename."_hd";
# now create the sequential images at 10 sec intervals - assumes 16:9 format
system ("ffmpeg -i ".$file." -r .1 -s 320x180 ".$basename."_hd/%08d.jpg");
system ("ffmpeg -i ".$file." -r .1 -s 240x136 ".$basename."_sd/%08d.jpg");
# for 4:3 format, comment above and uncomment below
#system ("ffmpeg -i ".$file." -r .1 -s 320x240 ".$basename."_hd/%08d.jpg");
#system ("ffmpeg -i ".$file." -r .1 -s 240x180 ".$basename."_sd/%08d.jpg");
# Renumber images in directories to a zero-based index, required because
# ffmpeg number starting from #1 which would put timing out by 10 secs
opendir(DIR, $basename."_hd");
@hd_bifs = grep(/\.jpg$/,readdir(DIR));
closedir(DIR);
# Number of created frames to drop
$dropnum = 0;
for ($image_num = 0; $image_num < ($#hd_bifs + 1) - $dropnum; $image_num++) {
$oldnum = sprintf("%08d",($image_num+1) + $dropnum);
$newnum = sprintf("%08d",$image_num);
move($basename."_hd/".$oldnum.".jpg",$basename."_hd/".$newnum.".jpg");
move($basename."_sd/".$oldnum.".jpg",$basename."_sd/".$newnum.".jpg");
}
# now use biftool to create the bif files
system("biftool -t 10000 ".$basename."_hd");
system("biftool -t 10000 ".$basename."_sd");
# delete the directories and the files in them
rmtree([$basename."_hd",$basename."_sd"]);
}