BIF/index file detection during scanning

I would like to request a feature that I would hope would not be hard to implement but would give a lot of power to many of the bigger systems especially those running multiple Plex servers.  This would/could also be very useful to those with small systems also.

 

The feature request is this.  During scanning of the media libraries the scanner looks for any BIF files.  If it find these files it updates the database accordingly to use these BIF files and not to generate them in the standard meta-directories.  It should be "loose" enough to not require specific file names but can determine the resolution based on looking for ".sd.bif", ".hd.bif" and extension of .bif with either 240 or 320 in the "extension".

 

Valid names for SD

Top Gun (1986).mp4.sd.bif

Top Gun (1986).sd.bif

Top Gun (1986).mp4.240.bif

Top Gun (1986).240.bif

Top Gun (1986)mp4.240x180.bif

Top Gun (1986).240x180.bif

etc

 

Valid names for HD

Top Gun (1986).mp4.hd.bif
Top Gun (1986).hd.bif
Top Gun (1986).mp4.320.bif

Top Gun (1986).320.bif
Top Gun (1986).mp4.320x240.bif

Top Gun (1986).320x240.bif
etc

 

It would need to have "some" smarts because as you can see 240 could be used in both SD vs HD 240x180 and 320x240 but this should be pretty trivial.

 

1 - Plex would never create the bif files in the media directory but would only scan for them and use them if found. This allows Plex to "hold-true" to not touching the media files.

2 - This could allow people to more easily switch from the competition to Plex as some of the competition allows storing the BIF files this way.

3 - Would allow Plex operators to create the BIF files on another computer as part of the pre-processing freeing up CPU use on the Plex server. Lots of 3rd party programs and scripts to do this.

4 - Would allow people running multiple Plex servers to generate the BIF files one time and have multiple servers pick them up during scanning of media.

5 - Would drastically help those with big libraries reload libraries if ever needed since the index creation could be skipped.

6 - Could aid those people wanting to put their meta-directories on a smaller SSD drive for performance reasons.  Since the BIF/Index files are so big they take up a large portion of the overall meta-data.  By having the ability to manually create these files elsewhere it would reduce the overall size of the SSD needed for pure meta-data sans the BIF files.

 

Carlo

 

Thanks for posting this as a formal request, Carlo. Definitely hoping for this for exactly the reasons you cited.

In preparation/anticipation of this, does anyone have any suggestions on how to create BIF files outside of Plex on a Mac? (I'm sure a quick google search would net a few results, but would love some expert/experienced advice.)

@cayars said:
1 - Plex would never create the bif files in the media directory but would only scan for them and use them if found. This allows Plex to “hold-true” to not touching the media files.

Since this appears to no longer be the case (see the new media optimizer), any chance we might be able to have an option to have the bif files created in the corresponding media directory?

I know this technically isn’t the request Carlo made above, so happy to make a new request if it might gain some traction (most of the interested parties never got around to it previously due to #1 Carlo cited above).

I’ve finally upgraded my SSD where Plex data sits, so I should have space for bif files there. But, I still think this would be a great option that would enable quite a few people to take advantage of media index files.

While we’re at it, if we’re going to put the bif files in the original media’s folders, let’s put the subtitles there too, with the same naming conventions as the media has.

This makes more sense to have all of the items related to the specific media in the same place, self-contained, so everything related to that media can be moved, deleted or manipulated all at the same time. Instead of scattered in obscure and cryptic folders, hidden from the user…

Let’s don’t pollute our media stores with Plex files. Plex is not the only platform I use to watch videos and I sure as crap don’t want to populate
as\movies\ folder with bif files for every media file in that directory. How about being able to choose a directory to put the bif files separate from the plex data directory instead.

@drinehart said:
Let’s don’t pollute our media stores with Plex files. Plex is not the only platform I use to watch videos and I sure as crap don’t want to populate
as\movies\ folder with bif files for every media file in that directory. How about being able to choose a directory to put the bif files separate from the plex data directory instead.

I created a Plex folder in my video folder. In there I created a Movies and TV Shows folder. I added those to my library sections and then set that as the folder for the optimized versions. That way my Kodi setup doesn’t see the optimized versions.

So this is how it looks.

Media > Videos
TV Shows
Movies
Plex Optimized > TV Shows and Movies subfolders

@rlobbins - @AnEightiesGuy indicated the desire for the BIF files to be stored with the movies and I would not agree with that. A separate directory structure would be better (one that could store all of the bifs, srts, etc.). I just do not want my Movies dir to be cluttered with anything other than video files. Some day I might change my directorys to be Movies\Movie Title (year)\Movie Title (year).ext but not that bored yet :).

I completely understand the desire to keep your directories clean and uncluttered. This would certainly be an opt-in type of thing. And, since you can choose a directory for Plex Optimized files, I think it would make sense that Plex take the same route were they to entertain this request.

My main motivation for this request is that my app data was stored on an SSD that does not have space for bif files. And, since Plex would already be accessing the drive housing the media I’m playing, there wouldn’t be much lag accessing the bif located adjacent (i.e., don’t have to spin up a different drive). But again, if we could specify the directory ourselves (similar to Media Optimizer), then I think we would be set.

And, I think srt files are fair game as well. Not because they are impacted by the same space constraints, but because it would be easier for folks to manage if they needed to. Plus, if they need to take something on the go outside of Plex, the srt file would be handy right in the same directory.

I’ve got to disagree here. I want everything related to the media stored with the media. That way if I want to move my plex server I don’t need to regenerate a rediculious amount of BIF’s, re-download artwork etc. Put it in a folder by all means, but the gobbly gook file names mixed with metadata as things are today, don’t work.

I have separate folders for each movie. And if I find trailers or srt files for them I also put them into that folder with the movie. Since I also use an alpha sorting for movies, the only movie folders in each alpha are those movies that start with the letter of the alphabet.

So, if I want to put together a server that has only new released and ripped movies and another server that maintains the older files, I can just drag/drop the folder from one server to the other as easy as that. All of the index files, subtitles, etc. are all in the new location, and the media is moved complete.

Doing something like this, though, I still can’t find a reliable way to move watched status. At least something that doesn’t require a third party app like Trakt.

I personally love the idea of all of the information for a specific movie stored in the same folder as the movie itself.

I’m 100% with MikeG6.5 but this is no surprise as we agree 99.9% of the time anyway. :slight_smile:

I really despise the GUID directory layout for meta-data but can live with it. BUT as anyone who has a large library that has had to rebuild their plex database (for whatever reason) can testify the BIF files don’t belong here. If anything happens to your database or drive holding your meta-data you are pretty much screwed on time. Sure you can re-setup the libs and scan everything back in relatively quickly but it can easily take over 3 months to regenerate the BIF files and this is a complete waste of time and electricity.

This could be setup in a way that could work for everyone.

  1. Scan media folder for MediaName.bif and use it if it exists
  2. Allow a new path to be setup just for BIF storage. Whenever new BIFs are created it would store them here. If the op wanted they could move them to the media folder (manually) and step 1 above would find them during the next scan.
  3. If person didn’t have the BIF stored in the media directory and didn’t set a new path for them, then they would get stored in the default place as it does now.

This really should not be hard to implement at all!

Carlo

I’ll add, maybe this isn’t as “far off” as I would have thought. Previously Plex would never touch your media directories but now with the new OPTIMIZE feature they give us the option of saving it to the local media directory. So maybe sometime soon they will allow us to save BIFs there also.

One can hope!

@cayars said:
I’ll add, maybe this isn’t as “far off” as I would have thought. Previously Plex would never touch your media directories but now with the new OPTIMIZE feature they give us the option of saving it to the local media directory. So maybe sometime soon they will allow us to save BIFs there also.

One can hope!

Exactly why I revisited it! Hopefully not too far off indeed.

I wrote a scanner for index-sd.bif files, but it looks only for index-sd.bif files in the movie folder at the moment, if needed i can upgrade that. You found it in my signature if anyone want to try it out.

@Skycryer,

It’s not super clear what these two set of scripts do. Can you give us a quick overview of how you use them on your system?

Very interested,
Carlo

Plexmediaindexfile is a Windows php Script to make a backup of your index files to the movie folder. If have a Windows server and no time at the moment to prepare it for Linux or Mac.

The other one copies the index file file scanning to the plex metadata folder and add it to the database of plex.

That is kind of what I thought. However, you are just coping the BIF file correct? It still resides in the meta-data directory hogging up space?

Early 2021 clean-up: duplicate