Your Digital Media Has Never Looked So Good

 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: Trickplay and BIF Files

Mon Mar 18, 2019 4:19 pm

Yeah, if your video framerate is something 'special' then you correct it in makebif.bat as the frame decimation only works if the framerate in the routine is set to an integer.
if "%myvar%"=="23.894" (set myvar=24)
if "%myvar%"=="23.976" (set myvar=24)
if "%myvar%"=="29.970" (set myvar=30)

What funky framerate are you trying to use?
 
Pongalo
Posts: 5
Joined: Sun Mar 17, 2019 4:32 pm

Re: Trickplay and BIF Files

Mon Mar 18, 2019 8:09 pm

My video frame rate is 29.97.
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: Trickplay and BIF Files

Mon Mar 18, 2019 8:27 pm

That is in the batch file already - you have mediainfo in your path creating the file to set the variable? You can still create bif files with virtualdub manually if you can't seem to get the batch file to work on your system anyway.
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: Trickplay and BIF Files

Mon Mar 18, 2019 8:52 pm

What if you, on your system, add a line after the 
if "%myvar%"=="23.894" (set myvar=24)
if "%myvar%"=="23.976" (set myvar=24)
if "%myvar%"=="29.970" (set myvar=30)



set myvar=30

To force it to 30, and see if that works, or maybe add [font=-apple-system, Helvetica Neue, Helvetica, sans-serif]if "%myvar%"=="29.97" (set myvar=30) to account for a slightly different handling on your install? I don't think I'll be able to go over every single thing that could be wrong, but those were just ideas.[/font]
 
Pongalo
Posts: 5
Joined: Sun Mar 17, 2019 4:32 pm

Re: Trickplay and BIF Files

Tue Mar 19, 2019 5:49 am

I think that did the trick! Thanks for your help.
 
Pongalo
Posts: 5
Joined: Sun Mar 17, 2019 4:32 pm

Re: Trickplay and BIF Files

Wed Mar 20, 2019 8:56 am

@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.
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: Trickplay and BIF Files

Wed Mar 20, 2019 12:32 pm

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.
 
Pongalo
Posts: 5
Joined: Sun Mar 17, 2019 4:32 pm

Re: Trickplay and BIF Files

Sat Mar 30, 2019 12:32 pm

@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?
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: Trickplay and BIF Files

Sat Mar 30, 2019 1:48 pm

Ours are all in sync, so I don't know.
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: Trickplay and BIF Files

Sat Mar 30, 2019 2:09 pm

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.
 
dhof
Posts: 4
Joined: Fri Apr 27, 2018 11:07 am

Re: Trickplay and BIF Files

Wed May 29, 2019 4:43 pm

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?
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: Trickplay and BIF Files

Fri May 31, 2019 8:34 am

You might look at Emby -- https://emby.media/linux-server.html -- they have a plugin for creating roku bif files here: 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.

Who is online

Users browsing this forum: No registered users and 5 guests