Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Pongalo
Channel Surfer

Re: Trickplay and BIF Files

@destruk Is it possible to run your batch file on an entire folder? Or create a batch file that invokes your script for x number of files?

I tried the latter and the process ends after only one file.
0 Kudos
destruk
Streaming Star

Re: Trickplay and BIF Files

We never tried that - instead we would create a batch file to call makebif.bat for each filename we needed bif files for.
Something like
Call makebif.bat "file1"
Call makebif.bat "file2"
Call makebif.bat "file3"
Call makebif.bat "file4"
Call makebif.bat "file5"

Save that as a batch file and run it.
0 Kudos
Pongalo
Channel Surfer

Re: Trickplay and BIF Files

@destruk apologies for not getting back to you sooner. First off, thanks for all the help! Second, I have to agree that this approach is orders of magnitude faster than ffmpeg.

Unfortunately, the files I've generated so far are out of sync with the video. Thoughts on what I should tweak?
0 Kudos
destruk
Streaming Star

Re: Trickplay and BIF Files

Ours are all in sync, so I don't know.
0 Kudos
destruk
Streaming Star

Re: Trickplay and BIF Files

It's probably related to your inability to specify the exact framerate as an integer.  If you're saying it's 30fps and it's 24fps then it would be out of sync.  If you create the bif file by hand instead of relying on the batch file to make it for you, and it's in sync, then that might be the big problem for your solution.

Open virtualdub ( veedub64.exe )
Open your video file
Cllick Video/Filters
Add Resize
Click Absolute
Click disabled Aspect Ratio
Set the image to 320 x 240
Click OK
Click OK
Click Video/Framerate
It tells you the current framerate, but go to the bottom for "Decimate by" and enter the framerate *10 as an integer/round if necessary to 240 for 23.976 etc etc
Click OK
Select File and Export / Image Sequence
select the directory to save the images and click OK.

When it's done, run biftool.exe from a command line, -t 10000 means it will set it for one image every 10 seconds, which matches your decimate by 10* framerate
biftool -t 10000 c:\foldername

That's all the batch file does.  With proper operation if you rounded up from 23.97 to 24, then 
23.97 * 60 seconds * 60 minutes * 2 hours = 172584
24 * 60 seconds * 60 minutes * 2 hours = 172800

If you do the math then your very last frame for the bif file in the rounded result will be 216 frames later than where it should be, which is within 8 seconds of film, but since the interval is 10 seconds it's barely even an issue.
0 Kudos
dhof
Visitor

Re: Trickplay and BIF Files

Any ideas for creating bifs on a linux server? I currently use FFMPEG and it takes a VERY long time, though to be fair, the system resources are super low, 2 cores and 2GB of RAM. I've been trying to research if increasing the system resources would help but the answers are all for converting/trans-coding so i'm not sure if it would apply to chopping images and generating a bif. 

If I should keep using FFMPEG, does anybody have an idea on boosting speed. Or is there a recommendation for other tools to creating the bifs on a linux system?
0 Kudos
destruk
Streaming Star

Re: Trickplay and BIF Files

You might look at Emby -- https://github.com/MediaBrowser/roku-bif
The current recommended BIF image size for FHD should be 480x270 -- the wiki specifies sizing for SD/HD variations but the FHD is missing here https://developer.roku.com/docs/developer-program/media-playback/trick-mode.md -- but if your sizing is a little different, roku will automatically resize the images for you.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.