Jump to content

BIF File viewer?


Recommended Posts

Posted

Does anyone know of a BIF file viewer? Windows/linux/android/source code??

If its just an "index + images" what the format is?

TIA

Scott

Happy2Play
Posted

Only thing I have seen that can view bif files is a tool posted here in the forum.

 

  • Like 1
Posted

I'm curious why you would want to ?

I created a HDR>SDR bif generator from the above Roku tools, so I'm reasonably familiar with it.

In summary, you extract the thumbnail and resize every X seconds and then simply tell the biftool where these are images are and the time peroid (X milliseconds). 

I'm not aware of any indexing within the BIF itself - I think it's up to the client (Roku Hardware or Emby etc) to read the BIF file in it's entirety and then work out the suitable thumbnail image.

Posted
1 hour ago, rbjtech said:

I'm curious why you would want to ?

I created a HDR>SDR bif generator from the above Roku tools, so I'm reasonably familiar with it.

In summary, you extract the thumbnail and resize every X seconds and then simply tell the biftool where these are images are and the time peroid (X milliseconds). 

I'm not aware of any indexing within the BIF itself - I think it's up to the client (Roku Hardware or Emby etc) to read the BIF file in it's entirety and then work out the suitable thumbnail image.

Two reasons.  first is purely intellectual curiosity :) 

Second, I have ripped a bunch of TV shows recently off my DVD/BluRay.   I have an application I wrote, that automatically names the files appropriately for emby (and plex), ie Show/Season/Show - SXXEXX - Episode Title.mkv, where it looks up using themoviedb.com the information. More than once, the TV show has an "extra episode" that doesnt exist in the DB, being able to "quickly view the BIF" over a network path, would allow me to scan the files and see whats wrong.  Often its a 2 part episode, that the db has as one part, other times its the otherway around, the db has 2 parts but the dvd had it as one.


Clearly I can do this with the MKV but the BIF may be faster

Posted
17 hours ago, Happy2Play said:

Only thing I have seen that can view bif files is a tool posted here in the forum.

 

Looks like the "view" in that tool is during generation.. not view an existing.. thanks for the pointer though

Posted
13 minutes ago, HawkXP71 said:

Two reasons.  first is purely intellectual curiosity :) 

Second, I have ripped a bunch of TV shows recently off my DVD/BluRay.   I have an application I wrote, that automatically names the files appropriately for emby (and plex), ie Show/Season/Show - SXXEXX - Episode Title.mkv, where it looks up using themoviedb.com the information. More than once, the TV show has an "extra episode" that doesnt exist in the DB, being able to "quickly view the BIF" over a network path, would allow me to scan the files and see whats wrong.  Often its a 2 part episode, that the db has as one part, other times its the otherway around, the db has 2 parts but the dvd had it as one.


Clearly I can do this with the MKV but the BIF may be faster

Curiosity is good 👍

If you don't want to view the MKV but want to see some example thumbnails of the show, then you can use ffmpeg to grab frames at say 1 minute intervals and then use those to see what's what - access is pretty fast but it's key to do the seek BEFORE you grab the frame.  We are using this in the Introskip plugin to get exact frame accurate thumbnails of the intro's.

Let me know if that may help and I'll happily share the syntax.

Posted
2 minutes ago, rbjtech said:

Curiosity is good 👍

If you don't want to view the MKV but want to see some example thumbnails of the show, then you can use ffmpeg to grab frames at say 1 minute intervals and then use those to see what's what - access is pretty fast but it's key to do the seek BEFORE you grab the frame.  We are using this in the Introskip plugin to get exact frame accurate thumbnails of the intro's.

Let me know if that may help and I'll happily share the syntax.

Thanks.. To be honest, if the BIF file doesnt exist, meh :) ill look at the MKV :)

But I would definately love to know the recipe as to how the BIFs are generated by emby.  The bif generator posted, is really cool, but hasnt been updated.

Posted
Just now, HawkXP71 said:

Thanks.. To be honest, if the BIF file doesnt exist, meh :) ill look at the MKV :)

But I would definately love to know the recipe as to how the BIFs are generated by emby.  The bif generator posted, is really cool, but hasnt been updated.

The ffmpeg line is actually in the emby log ;) - look for "quick-extract-imageseries" - to force it, delete a BIF, and then run 'Thumbail Image Extraction' in the scheduler.

The bif creation tools, then uses the jpg files created from the line below.

Example :-

ProcessRun 'quick-extract-imageseries' Execute: C:\Emby-Server\system\ffmpeg.exe -f matroska -threads 1 -skip_interval 10 -copyts -i file:"\\media\Films\Le Mans (1971)\Le Mans (1971).mkv" -an -sn -vf "scale=w=320:h=180" -vsync cfr -r 0.1 -f image2 "C:\Emby-Server\programdata\cache\temp\50f8d58699894c3ab31ab504ee5d5e2e\img_%05d.jpg"

My script(batch file..) do generate the SDR bif's from an HDR source is below.

@echo off
setlocal EnableDelayedExpansion

set Tone_Map=mobius
set SourceDir=\\media\Films 4K
set InstallDrive=D:
set InstallDir=\bif
set ffmpegLocation=C:\Emby-Server\system

if not exist %InstallDrive%%InstallDir%\temp mkdir %InstallDrive%%InstallDir%\temp

cls
echo SDR Bif Generator (ToneMapped) from HDR Source
echo ----------------------------------------------
echo.
echo BIF Interval : 10 Seconds
echo Tone Map : %ToneMap%
echo Temp BIF Dir : %InstallDrive%%InstallDir%\temp
echo.

if not exist %InstallDrive%%InstallDir%\temp mkdir %InstallDrive%%InstallDir%\temp

%InstallDrive%
cd %InstallDir%

if exist hdrbif.log del hdrbif.log

rem search for MKV and MP4 file ...

for /F "delims=" %%i in ('dir "%SourceDir%\*.m??" /b/s') do (

	if exist "%InstallDrive%%InstallDir%\temp\*.jpg" del "%InstallDrive%%InstallDir%\temp\*.jpg"
	if exist "%InstallDrive%%InstallDir%\temp\temp.bif" del "%InstallDrive%%InstallDir%\temp\temp.bif"
	
	rem create a new SDR bif if a HDR bif does not exist
	
	if not exist "%%~di%%~pi%%~ni-320-10.bif" (
		echo [!date! !time:~0,8!] Creating temp .jpg files for %%~ni - Please Wait ...
		%ffmpegLocation%\ffmpeg.exe -hide_banner -loglevel panic -threads 1 -skip_interval 10 -copyts -i file:"%%i" -an -sn -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=%Tone_Map%:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p,scale=w=320:h=180" -vsync cfr -r 0.1 -f image2 "%InstallDrive%%InstallDir%\temp\%%08d.jpg"

		rem Need to re-order the .jpg files starting @ 0.jpg or the bif will be out by 10 seconds...

		echo [!date! !time:~0,8!] Temp bif files completed - re-ordering ..	

		cd %InstallDrive%%InstallDir%\temp

		set j=00000000.jpg

			for /F %%k in ('dir "*.jpg" /b') do (
			rename %%k !j!
			set j=%%k
			)

		cd %InstallDrive%%InstallDir%

		echo [!date! !time:~0,8!] Creating bif file ..
	
		biftool.exe -v -t 10000 temp

		echo [!date! !time:~0,8!] Created %%~ni.bif
		echo [!date! !time:~0,8!] Created : %%~ni.bif >> hdrbif.log
		echo [!date! !time:~0,8!] Copying bif ..
		copy "%InstallDrive%%InstallDir%\temp.bif" "%%~di%%~pi%%~ni-320-10.bif" /Y > nul
		echo [!date! !time:~0,8!] Complete.
		) else (
		echo [!date! !time:~0,8!] SDR bif already exists for : %%~ni
		echo [!date! !time:~0,8!] SDR bif already exists for : %%~ni >> hdrbif.log
		)
	)

rem *clean up*

del "%InstallDrive%%InstallDir%\temp\*.jpg"
del "%InstallDrive%%InstallDir%\temp.bif"

pause

 

Posted
Just now, rbjtech said:

The ffmpeg line is actually in the emby log ;) - look for "quick-extract-imageseries" - to force it, delete a BIF, and then run 'Thumbail Image Extraction' in the scheduler.

The bif creation tools, then uses the jpg files created from the line below.

Example :-

ProcessRun 'quick-extract-imageseries' Execute: C:\Emby-Server\system\ffmpeg.exe -f matroska -threads 1 -skip_interval 10 -copyts -i file:"\\media\Films\Le Mans (1971)\Le Mans (1971).mkv" -an -sn -vf "scale=w=320:h=180" -vsync cfr -r 0.1 -f image2 "C:\Emby-Server\programdata\cache\temp\50f8d58699894c3ab31ab504ee5d5e2e\img_%05d.jpg"

My script(batch file..) do generate the SDR bif's from an HDR source is below.

@echo off
setlocal EnableDelayedExpansion

set Tone_Map=mobius
set SourceDir=\\media\Films 4K
set InstallDrive=D:
set InstallDir=\bif
set ffmpegLocation=C:\Emby-Server\system

if not exist %InstallDrive%%InstallDir%\temp mkdir %InstallDrive%%InstallDir%\temp

cls
echo SDR Bif Generator (ToneMapped) from HDR Source
echo ----------------------------------------------
echo.
echo BIF Interval : 10 Seconds
echo Tone Map : %ToneMap%
echo Temp BIF Dir : %InstallDrive%%InstallDir%\temp
echo.

if not exist %InstallDrive%%InstallDir%\temp mkdir %InstallDrive%%InstallDir%\temp

%InstallDrive%
cd %InstallDir%

if exist hdrbif.log del hdrbif.log

rem search for MKV and MP4 file ...

for /F "delims=" %%i in ('dir "%SourceDir%\*.m??" /b/s') do (

	if exist "%InstallDrive%%InstallDir%\temp\*.jpg" del "%InstallDrive%%InstallDir%\temp\*.jpg"
	if exist "%InstallDrive%%InstallDir%\temp\temp.bif" del "%InstallDrive%%InstallDir%\temp\temp.bif"
	
	rem create a new SDR bif if a HDR bif does not exist
	
	if not exist "%%~di%%~pi%%~ni-320-10.bif" (
		echo [!date! !time:~0,8!] Creating temp .jpg files for %%~ni - Please Wait ...
		%ffmpegLocation%\ffmpeg.exe -hide_banner -loglevel panic -threads 1 -skip_interval 10 -copyts -i file:"%%i" -an -sn -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=%Tone_Map%:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p,scale=w=320:h=180" -vsync cfr -r 0.1 -f image2 "%InstallDrive%%InstallDir%\temp\%%08d.jpg"

		rem Need to re-order the .jpg files starting @ 0.jpg or the bif will be out by 10 seconds...

		echo [!date! !time:~0,8!] Temp bif files completed - re-ordering ..	

		cd %InstallDrive%%InstallDir%\temp

		set j=00000000.jpg

			for /F %%k in ('dir "*.jpg" /b') do (
			rename %%k !j!
			set j=%%k
			)

		cd %InstallDrive%%InstallDir%

		echo [!date! !time:~0,8!] Creating bif file ..
	
		biftool.exe -v -t 10000 temp

		echo [!date! !time:~0,8!] Created %%~ni.bif
		echo [!date! !time:~0,8!] Created : %%~ni.bif >> hdrbif.log
		echo [!date! !time:~0,8!] Copying bif ..
		copy "%InstallDrive%%InstallDir%\temp.bif" "%%~di%%~pi%%~ni-320-10.bif" /Y > nul
		echo [!date! !time:~0,8!] Complete.
		) else (
		echo [!date! !time:~0,8!] SDR bif already exists for : %%~ni
		echo [!date! !time:~0,8!] SDR bif already exists for : %%~ni >> hdrbif.log
		)
	)

rem *clean up*

del "%InstallDrive%%InstallDir%\temp\*.jpg"
del "%InstallDrive%%InstallDir%\temp.bif"

pause

 

Good old batch files :)  I appreciate the info!

Happy2Play
Posted
4 hours ago, HawkXP71 said:

Looks like the "view" in that tool is during generation.. not view an existing.. thanks for the pointer though

I can open any bif file.  Open the exe, click view, then click file and navigate wherever the bif file you want to open.

  • Like 2
Posted
3 minutes ago, Happy2Play said:

I can open any bif file.  Open the exe, click view, then click file and navigate wherever the bif file you want to open.

I totally missed the "view menu"

Thanks!

mickle026
Posted
On 06/12/2021 at 17:33, HawkXP71 said:

Thanks.. To be honest, if the BIF file doesnt exist, meh :) ill look at the MKV :)

But I would definately love to know the recipe as to how the BIFs are generated by emby.  The bif generator posted, is really cool, but hasnt been updated.

What do you want updating?

Posted

We just follow the spec that Roku documents on their developer website.

Posted
5 hours ago, mickle026 said:

What do you want updating?

There was an issue posted, and a "ill fix and update it later" that I couldnt find.

However, after spending some time, I now have a class that reads each frame, and allows playing as if it were a GIF file, and actually lets you save it as a GIF.

I also noticed the posted player was missing a number of frames at the end.

Posted
3 hours ago, Luke said:

We just follow the spec that Roku documents on their developer website.

Yes, once I found the spec, it was a pretty straight forward format to read in

  • Thanks 1
Posted

Thanks for the feedback.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...