Roku Biftool Perl

I don’t remember if I wrote this or snagged it off a forum post or what. It’ll create the trickmode bif file for a Roku DVP using the biftool bin in the SDK. I put biftool in /usr/local/bin/ on my system.

Contents of:

use File::Basename;
use File::Copy;
use File::Path;

if ($#ARGV != 1 ) {
print "Scriptname Path File";


unless (-e $directory."/".$file) {
print "File Doesn’t Exist!n";

# create the directories that we’ll put the sequential images
mkdir "/tmp/".$file;

# for 4:3 SD Only
system ("ffmpeg -i ".$directory."/".$file." -r .1 -s 240×180 "."/tmp/".$file."/%08d.jpg >> /tmp/".$file."-bif.log 2>&1");

# 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, "/tmp/".$file);
@bifs = grep(/.jpg$/,readdir(DIR));

# Number of created frames to drop
$dropnum = 0;
for ($image_num = 0; $image_num < ($#bifs + 1) – $dropnum; $image_num++) {
$oldnum = sprintf("%08d",($image_num+1) + $dropnum);
$newnum = sprintf("%08d",$image_num);

# now use biftool to create the bif files
system("biftool -t 10000 "."/tmp/".$file);

# delete the directories and the files in them


One thought on “Roku Biftool Perl

  1. Could you kindly provide a syntax example? I am sadly unable to interpret “Scriptname Path File” into anything meaningful.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: