Jump to content


Photo

Recursive Batch Create Roku BIF Files

Roku BIF FFMpeg AutoIt Video

  • Please log in to reply
16 replies to this topic

#1 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 06:47 AM

Posted 28 February 2015 - 09:14 PM

What this solves:

1. On demand creating Roku Bif files recursively through sub folders, using Emby Servers naming scheme. (Simple Dialog Interface, Command Line and SendTo {must be compiled}).

2. Scheduled Bif file creation,

3. Allow networked computers to work on shared folders to speed things along. Only limiting factors are the speed of your network & the number of systems connected.

 

Notes:

The Folders this script is to run against must be on ether a local or network mapped drive, as the script isn't setup to handle UNC paths.

Also checkout the concurrent version further down in the thread.

 

Requirements:

AutoIt

FFMpeg

Roku SDK

 

Instructions:

Install AutoIt and set it to execute scripts when double clicked.

 

Create a folder somewhere...lets call it "Creat BIF" just to be unimaginative.

 

Now inside "Create BIF" create a sub folder called "Bin".

 

Now extract the contents of FFMpeg's "Bin" folder into your new "Bin" sub folder.

 

Now extract "biftool.exe" from the Roku SDK into your new "Bin" sub folder.

 

Now going back into "Create  BIF" folder Right Click on it's background and select "New\AutoIt v3 Script" from the context menu, and Rename it "Create BIF.au3"

 

Now Right Click "Create BIF.au3" & select "Edit Script" from the context menu.

 

Now paste the following code into:

Spoiler

 

Now save the script & execute it by double clicking it and then select the folder holding your videos that you wish to process.

 

Now go do something else, this will take a while...maybe a great while depending on the number of videos you have.

 

The script will notify you when it's done...and if you're currious as to if it's still running there should be a icon in your system tray that looks like a blue "A". Past that you can start your Task Manager and you should more than likely see FFMpeg running in the background.

 

By default this will create 320px aspect correct BIF files, if you wish to create 240px or any other size you'll need to edit line 7.

 

Example:

from

$iVideoWidthSize = 320

to

$iVideoWidthSize = 240

 

Update 1:

I decided to let FFMpeg do all the calculations for resize...which result in a massive code reduction.

 

Update 2:

Added passing folders via command line. This is mostly aimed at adding SendTo context menu support.

1. Right Click on "Create BIF.au3" and select "Compile Script (x86)" from the context menu

2. ALT + Left Click on "Create BIF.exe" and Drag to create a shortcut...rename to remove ".exe" from the file name

3. Cut & Paste shortcut to your SendTo folder: %APPDATA%\Microsoft\Windows\SendTo\

Now you don't even need to hunt down the script when you need it.

 

Update 3:

Added very simplistic scheduling based on a 24 hour clock.

Currently you can not start on one day and end on the following.

Only one time block allowed per day.

The script now produces an INI that can be edited "Create Bif.ini"

If you choose to use the scheduling the script needs to be compiled.

Once compiled & the INI edited to your liking, open up a console in the script folder.

Then enter:

"Create Bif.exe" ScheduleNew

Now new tasks have been created in the Windows Task Scheduler.

To remove tasks enter:

"Create Bif.exe" ScheduleDelete

To not have a task scheduled for a day, set the start time and end time to be the same.

 

Update 4:

Command Line now supports both Folders & Files...thus making a SendTo shortcut more useful.

 

Update 5:

Added auto SendTo shortcut creation...only happens if script is compiled.

To trigger this...simply use the executable once...you don't even have to actually process a file.

If you don't want this feature simply delete the code on and between lines 17 & 25 (currently)

 

Update 6:

Now allows only one instance to run at a time, to prevent bogging down your system.

This applies to Command Line and GUI, but not Task Scheduler...as the Task Scheduler should only have one instance anyways.

This allows you to cue up several folders\files to be processed, even though they are in very different locations.

 

Update 7:

Made it easier for the script to clean up after it's self.


Edited by Nologic, 26 February 2016 - 05:39 PM.

  • dnicks and bigjohn like this

#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 139809 posts
  • Local time: 09:47 AM

Posted 28 February 2015 - 09:21 PM

Well done!



#3 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 06:47 AM

Posted 28 February 2015 - 10:15 PM

Thanks :)



#4 dnicks OFFLINE  

dnicks

    Advanced Member

  • Members
  • 96 posts
  • Local time: 10:47 AM

Posted 01 March 2015 - 10:57 PM

great work!



#5 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 06:47 AM

Posted 03 March 2015 - 04:39 PM

Why thank you. :)



#6 Spaceboy OFFLINE  

Spaceboy

    Advanced Member

  • Members
  • 3930 posts
  • Local time: 02:47 PM

Posted 03 March 2015 - 07:36 PM

But the plugin does create bif files for existing videos if you run the scheduled task. I've just spent the last 2 weeks with it running. Or am I missing something?
  • AgileHumor likes this

#7 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 06:47 AM

Posted 03 March 2015 - 10:45 PM

Well if the plugin did it for you...then I'd say I missed something or something was screwy with my config...as I certainly didn't write the script for giggles. :)

 

If that's the case, as it sounds like it is...then the only reason to run my script would be spread the work around, between multiple systems.



#8 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 06:47 AM

Posted 06 March 2015 - 09:14 PM

Updated the script, now has an error log file, for video's it's unable to process for whatever reason.



#9 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 06:47 AM

Posted 27 March 2015 - 08:50 AM

Minor update to correct creating images for files that already have a percent sign in them "%" which was causing the script to fail on some files.



#10 hoxtonia OFFLINE  

hoxtonia

    Advanced Member

  • Members
  • 143 posts
  • Local time: 02:47 PM
  • LocationLondon United Kingdom

Posted 22 May 2015 - 11:20 AM

Thanks for this tool Nologic - has really sped up my processing for BIFs spread around various pcs - essential if you have a roku  :)



#11 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 06:47 AM

Posted 25 May 2015 - 03:25 PM

You are very welcome, and glad to hear it's helpful.

 

I'm thinking of making a modified version that can be used as a scheduled task. Where one just has to edit an INI file for when to start, and end processing, and what folders to do.

 

Granted generally after the bulk of the BIF files are created, the Roku Plug-in should handle things fine unless one is always adding video's in mass...then a scheduled networked BIF setup like I'm suggesting might be useful.


  • hoxtonia likes this

#12 hoxtonia OFFLINE  

hoxtonia

    Advanced Member

  • Members
  • 143 posts
  • Local time: 02:47 PM
  • LocationLondon United Kingdom

Posted 27 May 2015 - 07:38 PM

I think that's a great idea - would be really useful to be able to run as a scheduled task  :)



#13 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 06:47 AM

Posted 28 May 2015 - 05:25 AM

I updated the code...so give it a try and let me know how it works out.


  • hoxtonia likes this

#14 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 06:47 AM

Posted 07 February 2016 - 05:16 PM

Okay took another wack at this, this time looking to run concurrent BIF file creations...to help speed things along.

 

The recommended setting is 1 less the number of physical cores your CPU has...in my case since my Ivy has 4...I set it to 3, to keep the system usable...anything above would hose the system.

 

For me this speeds things up to about 2.5X what is normally done with the original script.

 

This takes two scripts to make this work, I call this "Create Bif Master.au3" & "Create Bif Slave.au3" both need to be compiled, and used the same way as the original.

 

Here is the master script:

Spoiler

 

Now the Slave:

Spoiler

 

Enjoy!


Edited by Nologic, 26 February 2016 - 05:38 PM.


#15 cf23 OFFLINE  

cf23

    Newbie

  • Members
  • 2 posts
  • Local time: 07:47 AM

Posted 12 January 2017 - 03:49 AM

Nologic, thank you very much for creating these scripts.  They'll potentially save me a ton of time.  However, can someone post a link to biftool.exe.  I'm not able to find it on the Roku SDK site anywhere, and they haven't responded to my emails asking about it.

 

Thanks.



#16 Happy2Play OFFLINE  

Happy2Play

    Trial and Error

  • Moderators
  • 16067 posts
  • Local time: 06:47 AM
  • LocationWashington State

Posted 12 January 2017 - 04:07 AM

Nologic, thank you very much for creating these scripts.  They'll potentially save me a ton of time.  However, can someone post a link to biftool.exe.  I'm not able to find it on the Roku SDK site anywhere, and they haven't responded to my emails asking about it.

 

Thanks.

Just googled it.  :)  Here you go.


Edited by Happy2Play, 12 January 2017 - 04:07 AM.


#17 cf23 OFFLINE  

cf23

    Newbie

  • Members
  • 2 posts
  • Local time: 07:47 AM

Posted 18 January 2017 - 02:15 AM

Clearly your Google-Fu is better than mine.  Thanks!







Also tagged with one or more of these keywords: Roku, BIF, FFMpeg, AutoIt, Video

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users