How does Plex differentiate between a recording and ripped file?

Server Version#: 1.32.0.6873 (Linux)
Player Version#: N/A

As the title states, how does Plex differentiate between recorded files and those downloaded/ripped/copied to a library location? Is there any way I can mark a file as a recording?

I copy files off my TiVo and I would like to mark those as recordings for ad detection. I have other files in the same library that I don’t need ad detection on… So I’d prefer not to enable ad detection for all items.

I know I can create 2 separate libraries… And that is what I do now… But it would be nice to have a single “TV Shows” library.

I can poke at values in the Plex database, but I’m not quite sure what to look for… I’m already updating the Plex database and marking my TiVo files as English language if the language is “Unknown”…

A video file is a video file. There is no way to tag its source in Plex.
Your current strategy is the most logical way to achieve what you want.

1 Like

I understand that a video file is a video file… But Plex tags recording’s differently than everything else… I’m trying to figure out what that is…

Have a look at the media_items table in the Plex database. It contains additional data for items recorded via the DVR function. Something like:

50553|5|25|18815||704|480|888904044|3599772|1975467|mpegts|mpeg2video|ac3|1.77777779102325|29.9700298309326|2|||episode=4&episodic=1&released_at=1997-08-08%2008%3A00%3A00&season=1&show=Stargate%20SG-1|-1|||1682636396|||6||at%3AchannelIdentifier=5fc76bb9104230002d2e8168-5fc705f9a2236e002d69f7bc&at%3AmediaGrabBeginsAt=1682632800&at%3AmediaGrabDevice=device%3A%2F%2Ftv%2Eplex%2Egrabbers%2Ehdhomerun%2F10A4015E&at%3AmediaGrabStatus=complete&at%3Aorigin=dvr&ma%3AvideoProfile=main|||||

In particular, the mediaGrabDevice, mediaGrabStatus, and origin fields in the ‘extra_data’ column should be enough to classify a particular media items as a DVR recording. I’d recommend looking at some existing recordings for examples of the sort of data crammed into ‘extra_data.’

And to be clear, I’m not positive this is what Plex uses to distinguish between “regular” and DVR content. There’s another table, media_grabs, which seems to duplicate some of this as well.

1 Like

Can you give an example for this?

I can do ad detect on the whole library or just recorded items. That seems to indicate that Plex tagged videos it recorded so it can tell the difference.

I don’t actually have a tuner to use the Plex DVR… I DO have a TiVo. I should be able to tell Plex that THESE are recordings.

There is no way to mark files manually as “recordings”.

I’ve performed some testing on my test server. While it does require manually editing the Plex database, I’ve found that you can force Plex to treat files created by an external DVR as recorded items for the purposes of commercial detection.

To do so, the following needs to be appended, URL encoded (as shown), to the media_items.extra_data column for the item(s) in question. This should be added to the the end of the existing ‘extra_data’ data.

&at%3Aorigin=dvr

Plex Media Server should be stopped when this modification is performed. Also note that in order to be able to configure ad detection for a library, you must have a DVR created/configured in Plex.

Having said all that, I’m not sure I’d recommend doing this. It would probably be best just to maintain separate libraries for your rips and your recordings. At the very least when a user accesses content in a library named “DVR TV Shows,” for example, it sets the expectation that the shows were recorded (and therefore may not be of the same quality as a rip).

If you do decide to try this, make sure you make a backup of the database first as things can go south very fast when mucking around in there.

Thank you. I was poking around in the DB and if it’s data in a “exta_data” filed, then that complicates things… Since plex could litter “origin=dvr” in a bunch of places.

I was hoping it was its own field (like language selection)… But that doesn’t appear to be the case. There is a “channel_id” field and that might play a part in this.

I tried the single change and Plex refused to start… So I assume there are further changes required. I have a DVR emulator set up so Plex thinks there is a tuner and I can get ad detection to work… But I don’t have an actual tuner… If I had one. I could make quick work of this.

Nope, that’s really it, as far as the database modifications are concern. I started with a fresh library, and added a single episode of Star Trek: Voyager which I’d recorded with NextPVR. I set it to only perform ad detection for recorded items. I then pulled the string above from a recording in my Plex DVR library on my main server and appended it to the ‘extra_data’ column for that episode (after stopping the server). (The only thing existing in ‘extra_data’ already was ma%3AvideoProfile=main.)

I performed the DB modification using a graphical tool, DB Browser for SQLite. For the test I didn’t want to bother with queries; while I do code, SQL isn’t my first language.

After restarting the server, I performed an “Analyze” on that episode which kicked off the Plex Commercial Skipper process. When it had completed, I checked the XML info for the episode to ensure the commercial markers were present.

If the database modification for the episode on your system is performed correctly, you should end up with “Origin dvr” when you get info on it in the web client. Something like:

image

In my testing, the presence of that flag was enough to tell Plex that this episode was a recording, for the purposes of ad detection, at least. I did test with other data as well, such as ‘mediaGrabStatus’ and ‘mediaGrabDevice’ but those didn’t seem to matter. In the end, only ‘origin’ seemed to matter.

Now, I had a pre-existing DVR configured before starting which was configured in its settings to ‘detect commercials and mark for skip.’

That’s fine, it’s not used as part of the commercial detection process. It just needs to be present and configured to enable the necessary option in the library.

Try using MCEBuddy to manage your TiVo recordings, remove commercials, transcode and place in your Plex TV folder.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.