How to stack home videos (play multiple files in one sequence/movie)

I’m been debugging how stacked home videos work but I really don’t understand it all. Stacked videos is when you have multiple parts of the same movie but want Plex to list and play the multiple files as one file.

File name convention

I am using the name convention: identical file names except for the ending “- pt1, pt2, etc”. This works for both files residing in a big main directory and if the files are placed in a sub-directory containing all parts.

Meta-data title

If you place your agent Local Media Assets first, Plex will use the meta-data Title when naming the files. I’ve used this since I want colon (:slight_smile: in the titles.

This has worked for mp4 files (the title can be edited using Properties=>Details in File Explorer.
I have also changed the meta-data Title for mkv files but then I use mkvpropedit.exe, example:
mkvpropedit.exe "my testfile.mkv" -e info -s title="The meta-data title"

The meta-data Title needs to follow the same name conventions as the file names, i.e. same name except for the pt1/pt2/pt3/etc suffix.

Results

The naming convention is required to get this to work but some of my files works and other don’t. If I start from scratch the result might be different, meaning that some of the files that didn’t work last time now works, while other that worked last time doesn’t work know.

I can even have to libraries setup for the same physical directory and with the same settings, but they manage to stack different files.

Agents and Scanners

I’ve tried toggling with:
Settings=>Server=>Agents
and found that:
Movies=>Personal Media
works best when Local Media Assets are placed first.

Library Type

The library type that works best is Other Videos with the scanner set to Plex Video Files Scanner and the agent set to Personal Media.

Conclusion / Database content

Since different files work different times I am pretty sure the problem lies in Plex and I would very much look inside its database. But I don’t know what type it is or how to connect to it and view/manipulate its data. I found old links (from 2010) mentioning a tool named PlexDb-editor (and the db type was also mentioned) but this tool does not exist anymore.

Does an equivalent tool exists today? If not, does someone know which db engine Plex uses and can tip me of a tool I can use to connect to the database? Is there a description of the database anywhere? I have not managed to find any.

Any other findings regarding stacked home videos is much appreciated.

Thanks,
Jonas

The only reliable/painless way to deal with multi-part items is to join them into a single file. That is done in moments with MKVToolNix:


Note: This will NOT alter the quality of your videos in any way, but you may want to keep original backups outside The Plexiverse, for obvious reasons.

I agree that joining the files is the only reliable way to achieve this but joining files comes with it own sets of problems, for example clips with different resolutions that is less suitable to combine. I’ve also encountered numerous of occasions where mkvtoolnix (or mp4joiner) cannot combine the videos I’ve downloaded because the codecs private data don’t march. When the first appended files is suppose to play, the remaining files is corrupted.

I guess I could dig deep and try to fins out why it’s not possible to join the files but I don’t have any interest in education myself in codecs, and hey: the functionality do exist in Plex, so why not try to use it :smile:

I have no Idea where or how the Plex database is constructed, but in a successfully stacked movie one value differs from the non-successfully stacked movie. If I could open the database I feel confident I could find where it differs.

On the other hand: if a merged mkv could handle different clips with different framerates and resolutions, and none of the files it creates becomes corrupted (when all the individual files play fine) so you do indded have a point :smile:

—can be removed—

The database used by Plex is SQLite. I downloaded SQLite Studio from:
sqlitestudio.pl
and opened my Plex database %LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db

  1. Expand the table media_parts
  2. Click the Data tab
  3. Filter the data you want, I for example entered “discgolf” in the filter text box since all files I wanted to stack are located in this directory.
  4. Locate the rows you want to stack. If the file name is to long to show in the file column, double click the file name on the row to expand it.
  5. Locate the row with the first part in your movie and note the value in the second column (media_item_id).
  6. Update all other parts to the same value of media_item_id
  7. Commit the changes when done.

This made stacking work for me. The column media_item_id does not seem to be a key in any other table and I have not seen any negative/corrupt consequences so far, but of course directly manipulation the database could turn out to have undesired effects later on, but it seems to work for now. I can stack whatever I want B)
You can always backup the database to be safe (it’s only one file).

—can be removed—

Be sure to let us know how that works out for you when you actually start to watch these things.

Evalutation / Proof of Concept

I changed four cases in the database where I manually stacked the files and they’re all playing fine.
I’ve edited metadata in Plex Media Server afterwards for these (ie changed dates, directors, description, tex) and the stacking is unaffected so from my point of view this now works very well.

Here’s an example to demonstrate:
I added three completely different files in a directory named test, these files were:
2010 Skien Open; Camilla Jernberg (2010) - pt2.mp4 (clip from sports event)
Att angöra en brygga [swedish, 1965, xvid].mkv (old Swedish movie)
IMG_9648.MOV (clip from my phone)

Then I created the Plex library forums.plex.tv with the following properties:

  • Library type: Other Videos
  • Folder: F: est
  • Scanner: Plex Video Files Scanner
  • Agent: Personal Media

Before any changes

After editing the column media_item_id (setting the same value for all three files)

All playing beautifully stacked in sequence in Plex, no naming conventions were required.

I have now used this solution for 1½ years and it works like a charm, no problems encountered at all.

1 Like