Why does Plex Media Scanner update the timestamp of mp4 files when scanning?

Server Version#: Plex Media Scanner v1.27.2.5929-a806c5905

Why does Plex Media Scanner updating the date/time of TV shows that are stored as mp4 files when scanning the media library?

I noticed this every time I go to backup my media library files, only the date/time is changed for mp4 files only (it does not do it with mkv files). I can see in “Plex Media Server.log” that the corresponding directory was scanned by Plex Media Scanner the exact date/time the mp4 timestamp gets changed because in the log it will have the full name of each mp4 file and log:

“File ‘<episode-file-name>.mp4’ changed write time, can’t skip.”

Is there any way to turn off this behavior, or is this a possible bug? Every week when I backup my media files, all my mp4s get unnecessarily backed up again even though only the file timestamp was changed by Plex Media Server.

Thank You In Advance.

I dont think that is a plex issue, plex doesnt edit anything it is only a reader.

Well, Plex is the only program scanning my media files and it logs that the time is being “written” for every media file I find that has its time stamp changed.

This message tells you that ,

  1. Since PMS last looked at the file (where it saved the last-modified-time)
  2. That timestamp has changed.

The only ‘timestamp’ PMS alters, because of how Linux works, is the Time-Last-Accessed (read)

@ChuckPa

Why would the timestamp on my mp4 files be set to the exact hour/minute/second that Plex Media Scanner is scanning the directory?

For example, for my Plex copy of my Billions TV Series DVD collection…

.
.
.
 E:\Downloads\Plex Media Server Logs_2022-07-04_22-02-15\Plex Media Server.log (9 hits)
	Line  1830: Jul 04, 2022 20:16:41.979 [0x7fe990090b38] INFO - Library section 1 (TV Shows) will be updated because of a change in "/volume1/media/TV/Billions/Billions.S01E01.Pilot.mp4"
	Line 16929: Jul 04, 2022 20:20:37.041 [0x7fe98b3e6b38] DEBUG - File '/volume1/media/TV/Billions/Billions.S01E01.Pilot.mp4' changed write time, can't skip.
	Line 16935: Jul 04, 2022 20:20:37.109 [0x7fe98b385b38] DEBUG - Scanner [Plex TV Series]: found cloud match for file '/volume1/media/TV/Billions/Billions.S01E01.Pilot.mp4': 'Billions'
	Line 16937: Jul 04, 2022 20:20:37.111 [0x7fe98b385b38] DEBUG - Looking for path match for [/volume1/media/TV/Billions/Billions.S01E01.Pilot.mp4]
	Line 16944: Jul 04, 2022 20:20:37.164 [0x7fe98b385b38] DEBUG - Turbo analysis on modified item 124989 [/volume1/media/TV/Billions/Billions.S01E01.Pilot.mp4]
	Line 16946: Jul 04, 2022 20:20:37.165 [0x7fe98b385b38] DEBUG - Updating part with ID=132428 [/volume1/media/TV/Billions/Billions.S01E01.Pilot.mp4]
	Line 24669: Jul 04, 2022 20:24:03.069 [0x7fe98b004b38] DEBUG - IntroDetector: Initializing for "/volume1/media/TV/Billions/Billions.S01E01.Pilot.mp4" (67348)
	Line 24680: Jul 04, 2022 20:24:03.087 [0x7fe98b004b38] DEBUG - [Universal] Using local file path instead of URL: /volume1/media/TV/Billions/Billions.S01E01.Pilot.mp4
	Line 24682: Jul 04, 2022 20:24:03.088 [0x7fe98b004b38] DEBUG - [JobRunner] Job running: FFMPEG_EXTERNAL_LIBS='/var/packages/PlexMediaServer/shares/PlexMediaServer/AppData/Plex\ Media\ Server/Codecs/d53cb63-4323-linux-x86_64/' X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxx "/volume1/@appstore/PlexMediaServer/Plex Transcoder" "-codec:#0x02" aac -analyzeduration 20000000 -probesize 20000000 -i /volume1/media/TV/Billions/Billions.S01E01.Pilot.mp4 -filter_complex "[0:#0x02] aresample=async=1:ocl='5.1':rematrix_maxval=0.000000dB:osr=96000[0]" -map "[0]" -metadata:s:0 language=eng -codec:0 flac -b:0 4096k -f flac -map_metadata -1 -map_chapters -1 -t 1785.9300000000001 "/var/packages/PlexMediaServer/shares/PlexMediaServer/AppData/Plex Media Server/Cache/Transcode/Detection/7d561aff-c1ba-4d44-9176-5c8862af3f23" -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://127.0.0.1:32400/video/:/transcode/session/72a8e838-3e15-41da-9f4c-d2b00cbb615c/4307cf32-51a4-48bc-a851-68c4dd11bb64/progress
.
.
.

You can see below what Plex Scanner did to all the files within /volume1/media/TV/Billions on Jul 04 20:16:41 and that is exactly when the timestamp every file was changed to. It has to be Plex that is doing the timestamp change because all the date/times match up perfectly. It is almost as if Plex is doing a “touch” on every file in that directly at the time it logs this “will be updated” message…

root@NAS:/volume1/media/TV/Billions# ll
total 67162928
drwx------+ 1        PlexMediaServer PlexMediaServer        5560 Jul  5 11:41 .
drwx------+ 1        PlexMediaServer PlexMediaServer        71928 Jul  4 17:00 ..
-rwx------+ 1        PlexMediaServer PlexMediaServer         996665605 Jul  4 20:16 Billions.S01E01.Pilot.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         910650745 Jul  4 20:16 Billions.S01E02.Naming.Rights.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         939726786 Jul  4 20:16 Billions.S01E03.YumTime.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         942376630 Jul  4 20:16 Billions.S01E04.Short.Squeeze.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         990069243 Jul  4 20:16 Billions.S01E05.The.Good.Life.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         989225668 Jul  4 20:16 Billions.S01E06.The.Deal.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         966031553 Jul  4 20:16 Billions.S01E07.The.Punch.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         951802842 Jul  4 20:16 Billions.S01E08.Boasts.and.Rails.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         939081170 Jul  4 20:16 Billions.S01E09.Where.the.F-ck.is.Donnie.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         969492504 Jul  4 20:16 Billions.S01E10.Quality.of.Life.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         960709357 Jul  4 20:16 Billions.S01E11.Magical.Thinking.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         953722609 Jul  4 20:16 Billions.S01E12.The.Conversation.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         941180296 Jul  4 20:16 Billions.S02E01.Risk.Management.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         962537503 Jul  4 20:16 Billions.S02E02.Dead.Cat.Bounce.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         976133176 Jul  4 20:16 Billions.S02E03.Optimal.Play.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         982827283 Jul  4 20:16 Billions.S02E04.The.Oath.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         958804066 Jul  4 20:16 Billions.S02E05.Currency.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         990213022 Jul  4 20:16 Billions.S02E06.Indian.Four.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         959983342 Jul  4 20:16 Billions.S02E07.Victory.Lap.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         974318553 Jul  4 20:16 Billions.S02E08.The.Kingmaker.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         977361330 Jul  4 20:16 Billions.S02E09.Sic.Transit.Imperium.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         935119496 Jul  4 20:16 Billions.S02E10.With.or.Without.You.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         975389226 Jul  4 20:16 Billions.S02E11.Golden.Frog.Time.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer        1007416513 Jul  4 20:16 Billions.S02E12.Ball.in.Hand.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         987684108 Jul  4 20:16 Billions.S03E01.Tie.Goes.to.the.Runner.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         936477876 Jul  4 20:16 Billions.S03E02.The.Wrong.Maria.Gonzalez.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         960482115 Jul  4 20:16 Billions.S03E03.A.Generation.Too.Late.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         959280237 Jul  4 20:16 Billions.S03E04.Hell.of.a.Ride.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         934447084 Jul  4 20:16 Billions.S03E05.Flaw.in.the.Death.Star.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer        1006352852 Jul  4 20:16 Billions.S03E06.The.Third.Ortolan.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         978104395 Jul  4 20:16 Billions.S03E07.Not.You.Mr.Dake.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         972295860 Jul  4 20:16 Billions.S03E08.All.the.Wilburys.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         866916909 Jul  4 20:16 Billions.S03E09.Icebreaker.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         978931218 Jul  4 20:16 Billions.S03E10.Redemption.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         978978372 Jul  4 20:16 Billions.S03E11.Kompenso.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         929145163 Jul  4 20:16 Billions.S03E12.Elmsley.Count.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         910952847 Jul  4 20:16 Billions.S04E01.Chucky.Rhoadess.Greatest.Game.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         970197935 Jul  4 20:16 Billions.S04E02.Arousal.Template.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         925646983 Jul  4 20:16 Billions.S04E03.Chickentown.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         994115529 Jul  4 20:16 Billions.S04E04.Overton.Window.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         977017771 Jul  4 20:16 Billions.S04E05.A.Proper.Sendoff.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         995152029 Jul  4 20:16 Billions.S04E06.Maximum.Recreational.Depth.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         983301988 Jul  4 20:16 Billions.S04E07.Infinite.Game.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         931726441 Jul  4 20:16 Billions.S04E08.Fight.Night.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         973149431 Jul  4 20:16 Billions.S04E09.American.Champion.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         986742334 Jul  4 20:16 Billions.S04E10.New.Years.Day.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer        1000857683 Jul  4 20:16 Billions.S04E11.Lamster.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         996224064 Jul  4 20:16 Billions.S04E12.Extreme.Sandbox.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         988914242 Jul  4 20:16 Billions.S05E01.The.New.Decas.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         993056214 Jul  4 20:16 Billions.S05E02.The.Chris.Rock.Test.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         971499279 Jul  4 20:16 Billions.S05E03.Beg.Bribe.Bully.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         994401455 Jul  4 20:16 Billions.S05E04.Opportunity.Zone.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         996920620 Jul  4 20:16 Billions.S05E05.Contract.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         983691872 Jul  4 20:16 Billions.S05E06.The.Nordic.Model.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         907183378 Jul  4 20:16 Billions.S05E07.The.Limitless.Sh-t.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         995998888 Jul  4 20:16 Billions.S05E08.Copenhagen.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         919086231 Jul  4 20:16 Billions.S05E09.Implosion.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         883859111 Jul  4 20:16 Billions.S05E10.Liberty.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer        1005275267 Jul  4 20:16 Billions.S05E11.Victory.Smoke.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer        1021767073 Jul  4 20:16 Billions.S05E12.No.Direction.Home.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         882002242 Jul  4 20:16 Billions.S06E01.Cannonade.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         810074761 Jul  4 20:16 Billions.S06E02.Lyin.Eyes.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         811769896 Jul  4 20:16 Billions.S06E03.STD.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         808933606 Jul  4 20:16 Billions.S06E04.Burn.Rate.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         987767411 Jul  4 20:16 Billions.S06E05.Rock.of.Eye.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         876126612 Jul  4 20:16 Billions.S06E06.Hostis.Humani.Generis.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         938238990 Jul  4 20:16 Billions.S06E07.Napoleons.Hat.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         824587380 Jul  4 20:16 Billions.S06E08.The.Big.Ugly.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         915264099 Jul  4 20:16 Billions.S06E09.Hindenburg.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         998025566 Jul  4 20:16 Billions.S06E10.Johnny.Favorite.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         973423459 Jul  4 20:16 Billions.S06E11.Succession.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer         998790360 Jul  4 20:16 Billions.S06E12.Cold.Storage.mp4
-rwx------+ 1        PlexMediaServer PlexMediaServer        8129 Jun 16 15:08 tvshow.nfo

@TekGamer

Why have you make user PlexMediaServer the owner of your media?

  1. This is dangerous
  2. This is not required.

In all the documentation, I’ve written to grant “READ-ONLY” or “Read/Write” (if needed) to System Internal User PlexMediaServer.

At no point have I stated to change the ownership (which WILL change the modified time)

You do present an interesting challenge. I will investigate it but have never seen PMS modify media timestamps when scanning even when it owns the media.

1 Like

@ChuckPa

I thought PlexMediaServer had to have Full Control to the media file system for Synology DSM7. I read that in your post here where you say “You want to make certain that user PlexMediaServer has Full Control of all files and folders in the Plex share” Plex Media Server - Synology DSM 7 Preview - Issues ( Archive ) - Plex Media Server / NAS & Devices - Plex Forum. I must have mistakenly assumed it also needed Full Control to the share the media files were on (my bad).

If I can change PlexMediaServer’s permissions to Read/Write to the media share and see if the behavior for MP4 files go away, I am willing to try that. I can also change the ownership to admin:users if that will suffice. I do not have “Allow media deletion” enabled in the Plex Media Server settings, so I can probably change PlexMediaServer to Read-Only if Read-Write doesn’t fix the behavior for MP4 files, right?

Do you have your NAS configured to track file access time for that filesystem/share?

In that post, I am referring to the Plex shared folder (where all the METADATA is stored). No media is involved in the migration from DSM 6 → DSM 7

The purpose of that action is to give the new username PlexMediaServer full control over all the metadata files (Plex shared folder) so it can then convert them to DSM 7 format.

For your media, which is how I have mine,

  1. I own all my media (chuck:users)
  2. In Control Panel - Shared Folder - Movies (EDIT), I grant “PlexMediaServer” permission to “Read-only” and "Apply to this folder, sub-folders, and files,

This provides a lot of capability:

  1. From any computer on my LAN, I have full access and control of my media.
  2. At no point in time can Plex change anything.
  3. Linux provides all the security to prevent media from being deleted (even if I’ve accidentally enabled ‘Allow media deletion’ in my settings.
1 Like

@pshanew , I don’t think so, do you have any idea how to do that on Synology DSM7.1? I do have “Enable File Station Log” check boxed for my media share and I do have Log Center installed, but it doesn’t look like it tracks access time (or I do not know how to config it to do so)

@ChuckPa , ok thanks! It is good to know that PlexMediaServer doesn’t even need read-write if you have “Allow media deletion” disabled.

The ONLY time I use read-write is when I have DVR content that I want to be able to delete from the TV app after watching an episode.

When I do this:

  1. DVR recordings go in their own shared folder – with Read/Write permission
  2. PMS “Allow media deletion is enabled”.

In this configuration, all other shared folders are still protected by the underlying Linux permission which is set to ‘Read-Only’.

If I try to delete a movie (from my main library instead of the DVR library), I get an error telling me it’s not allowed.

1 Like

@ChuckPa

Thank you for your help… I have changed my media library folder and subfolders to read-only for PlexMediaServer… but that still begs the question on why Plex Scanner was changing the timestamp on on my mp4 files, and not touching my mkv files. :man_shrugging:

It shouldn’t. In all my time with Plex, I’ve never seen that happen which is why I stated -

I will try to recreate this. If there’s a problem, I’ll submit it.

Either way, I’ll report my findings.

1 Like

@ChuckPa - any luck finding if Plex Scanner is doing this?

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