HawkXP71 112 Posted December 5, 2021 Posted December 5, 2021 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
roaku 842 Posted December 5, 2021 Posted December 5, 2021 Here are details on the format from Roku, who originated it: https://developer.roku.com/docs/developer-program/media-playback/trick-mode/bif-file-creation.md They provide a tool for generating the bifs, but I don't see anything about viewing an existing one. 1
Happy2Play 9780 Posted December 6, 2021 Posted December 6, 2021 Only thing I have seen that can view bif files is a tool posted here in the forum. 1
rbjtech 5284 Posted December 6, 2021 Posted December 6, 2021 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.
HawkXP71 112 Posted December 6, 2021 Author Posted December 6, 2021 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
HawkXP71 112 Posted December 6, 2021 Author Posted December 6, 2021 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
rbjtech 5284 Posted December 6, 2021 Posted December 6, 2021 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.
HawkXP71 112 Posted December 6, 2021 Author Posted December 6, 2021 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.
rbjtech 5284 Posted December 6, 2021 Posted December 6, 2021 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
HawkXP71 112 Posted December 6, 2021 Author Posted December 6, 2021 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 9780 Posted December 6, 2021 Posted December 6, 2021 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. 2
HawkXP71 112 Posted December 6, 2021 Author Posted December 6, 2021 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 650 Posted December 12, 2021 Posted December 12, 2021 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?
Luke 42078 Posted December 12, 2021 Posted December 12, 2021 We just follow the spec that Roku documents on their developer website.
HawkXP71 112 Posted December 12, 2021 Author Posted December 12, 2021 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.
HawkXP71 112 Posted December 12, 2021 Author Posted December 12, 2021 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 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now