Updating Movie library from MKV to MP4

Hi,

I would like to convert my existing MKV movies to MP4. I’ll convert the MKV’s by ffmpeg with direct copy of video and audio. I’ll also extract the correct SRT from the MKV (if needed).

I have done some tests, and there seams to be a “problem” updating the video format. If PMS already have knowledge of the movie, it won’t detect the SRT files for the MP4 file, even if i delete the original MKV.

If i make a new “Home movie” library and point it to the movie folder, the SRT is detected with the MP4 file.

I tried to remove the movie folder completely, and done the “Plex Dance”. Plex always use the previous knows movie data - even watch states etc.

Is there any way to remove a movie completely from PMS? or how would i do this correctly? If possible i would like to convert the MKV’s to MP4 and keep the existing data (date added, last watched etc) in PMS.

Example

MKV with subs in MKV container - indexed by PMS

Create a MP4 version of the movie with the same filename, and extract SRT from MKV.

Place these two files in the MKV folder. Subs will be “None” in PlexWeb.

SRT ‘side car’ subtitles are handled by the ‘Local Media Assets’ agent.
So make sure it is active under both
Settings - Server - Agents - Movies - Plex Movie
+
Settings - Server - Agents - Movies - TheMovieDatabase

And on QNAP there is of course very likely a problem with file and folder names which contain non-ASCII characters like ü ô í ß etc pp.
If one such a character appears anywhere within the folder, the Local Media Assets agent ceases to work. As a result the external subtitles are not recognised.

Here is a solution from a QNAP user, though I don’t know if it’s applicable to every QNAP model:

To remove a movie completely from Plex, we call this “The Plex Dance”.

It’s the simple sequence of

  1. move the media away from where Plex can ‘see’ it (see the file(s)).
  2. Update the Library and let it complete
  3. Empty the Trash
  4. Clean the bundles (and let this complete)

At this point, Plex has no prior knowledge of the media.

Now, to the point of switching from MKV -> MP4 you aren’t changing the video format. The ffmpeg options -c:v copy -c:a copy copy the format, as is, without change. All you are doing is changing the container format. As far as Plex is concerned, this has no net gain. Plex reads both container formats (plus others) and sends the audio & video streams to the clients, independent of the file container format.

As for simply changing the container and keeping your data (watched status / date added / etc), the task here becomes to convert the container, deposit the new MP4 next to the MKV and let PMS find it (which it flags as a ‘2’ in the upper right corner to signify it sees two copies). Once this is done, removing the MKV will remove the duplication count indicator.

To make all this updating work in real-time as you convert videos, without having to manually update the library, paying attention to the “Partial Scan” option.

@OttoKerner said:
SRT ‘side car’ subtitles are handled by the ‘Local Media Assets’ agent.
So make sure it is active under both
Settings - Server - Agents - Movies - Plex Movie
+
Settings - Server - Agents - Movies - TheMovieDatabase

And on QNAP there is of course very likely a problem with file and folder names which contain non-ASCII characters like ü ô í ß etc pp.
If one such a character appears anywhere within the folder, the Local Media Assets agent ceases to work. As a result the external subtitles are not recognised.

Here is a solution from a QNAP user, though I don’t know if it’s applicable to every QNAP model:
https://forums.plex.tv/discussion/206148/unicode-error-with-filename-containing-german-umlauts

Thanks for the info! I had disabled “Local Media Assets” (dunno why), and this was the reason for no external subs.

@mm98 said:
I had disabled “Local Media Assets” (dunno why),

Probably because you had some ‘matching’ trouble with bad embedded ‘title’ metadata.
Pull the line with the ‘LMA’ agent downwards, in the list of metadata agents. That way the info from the online agents will take precedence and you can keep the LMA active.

@OttoKerner said:

@mm98 said:
I had disabled “Local Media Assets” (dunno why),

Probably because you had some ‘matching’ trouble with bad embedded ‘title’ metadata.
Pull the line with the ‘LMA’ agent downwards, in the list of metadata agents. That way the info from the online agents will take precedence and you can keep the LMA active.

Yeah, PlexMovie is first now and the LMA :wink:

I’m not sure why you’d want to go to all the trouble. It is my understanding that mkv is an excellent, open and standard container format.

@interconnect said:

From what I have tested … especially different clients (Plex for LG) MP4 will almost always Direct Play.

I’m using Sonos which can’t handle DTS, so I’m also converting the audio track. This way i can get everything to Direct Play (if the client supports the format) - even 4K on the current version of Plex for LG (WebOS 3).

My NAS doesn’t have the power, and it seams like PMS has become more selective/sensitive since v1.0. I will not complaint (plex is awesome!), i’m just finding another solution/way.

I’ve created a script that does this automatically on my desktop machine, so not much trouble =)

MKV is actually the better format. Smaller file and less encumbered than MP4 but since Apple controls MP4 (plus M4A and M4V,) we know why it’s more widely supported and MKV isn’t supported on iOS devices :wink:

It’s not widely known you can move the MOOV atom equvalent (CUE entries) to the front of an MKV and have it stream from a Web site just like any MP4 does. It’s just that MP4 was ‘helped along’.

Either way, it’s your media, so absolutely do what you feel is best.

But sadly I can’t solve the last challenge regarding Direct Play. Subs forces video transcoding. Except burning the subs into the movie.

If they are PGS (which are bitmaps) you must burn them into the image. That’s when foreign language subs are great…

If SRT (text) subs, those are trivial and Plex will do those on almost everything and anything at this point. it’s purely client dependent.

If you do have to burn them in. add the option in the ffmpeg command line… problem solved.

@ChuckPa said:
MKV is actually the better format. Smaller file and less encumbered than MP4 but since Apple controls MP4 (plus M4A and M4V,) we know why it’s more widely supported and MKV isn’t supported on iOS devices :wink:

After some more testing - you’re right. The problem isn’t the actual MKV, but audio (DTS) and enabling subtitles. A DAC on the tos-link would solve the DTS part. More testing needed on my part =)

LG did a lousy job regarding tos-link/optical vs passtrough on their latest TV’s …

@mm98 said:
A DAC on the tos-link would solve the DTS part. More testing needed on my part =)

Only if your TV is able to stream DTS through TOSlink (is not a standard ability, most devices can’t do it. Usually TOSlink is restricted to PCM stereo and AC3 5.1)
and if said DAC has actually a built in DTS decoder (again there are very few which have a DTS decoder and are able to decode DTS from TOSlink)

@OttoKerner said:

@mm98 said:
A DAC on the tos-link would solve the DTS part. More testing needed on my part =)

Only if your TV is able to stream DTS through TOSlink (is not a standard ability, most devices can’t do it. Usually TOSlink is restricted to PCM stereo and AC3 5.1)
and if said DAC has actually a built in DTS decoder (again there are very few which have a DTS decoder and are able to decode DTS from TOSlink)

HDMI to TOSlink DAC would do the job. Read somewhere that TOSLink/optical only can handle DD 5.1 and below.

@mm98 said:
HDMI to TOSlink DAC would do the job.

I’d make double sure, it is really able to pull that off. I have my doubts.
Is there technical documentation available?

Lots of threads regarding Sonos PLAYBAR DTS problem. I guess Sonos wont implement it because of DTS license.

Sonos support:
https://sonos.custhelp.com/app/answers/detail/a_id/3837/kw/DTS

DTS is a surround audio format commonly found on Blu-ray discs that is not supported by the Sonos PLAYBAR. With the below settings, the following devices are able to transcode DTS to Dolby Digital or stereo, which the PLAYBAR has full support for. Some newer Blu-ray players are often able to transcode DTS to Dolby Digital or stereo as well. Consult the Blu-ray player product manual for specific instructions and settings.

PLAYBAR Requirements
The PLAYBAR is compatible with any television that has an optical digital audio output. The PLAYBAR is compatible with a Dolby Digital 5.1 or Stereo PCM signal passed via optical output. The PLAYBAR does not support the DTS format.

Partial solution - Requires additional hardware (like blu-ray player)

There are event German online shops - selling Sonos converters :wink:

http://www.dk-bits.de/sonos-und-zubehoer/audio-converter-fuer-sonos/23/hdmi-v1.3-audio-de-embedder-hdmi-audio-de-embedder-fuer-lpcm-2.0-und-5.1

Sorry, if I am misunderstanding something here, but your post do only confirm my suspicion that it won’t work with a simple HDMI audio extractor.
The audio on the HDMI link is still DTS encoded, and that is what the extractor will extract, if anything.

@OttoKerner said:
Sorry, if I am misunderstanding something here, but your post do only confirm my suspicion that it won’t work with a simple HDMI audio extractor.
The audio on the HDMI link is still DTS encoded, and that is what the extractor will extract, if anything.

Ohhh, my bad. Bookmarked lots of DAC/converter links … Posted the wrong one

https://www.amazon.com/dp/B00BIQER0E/ref=twister_B00VGIEQEG?_encoding=UTF8&psc=1

Extract the digital hdmi audio signal from the HDMI input and convert it to 2 channel analog stereo output or 5.1 channel Audio output

Can’t handle 4K, but this isn’t a problem for me at the moment. There might be a problem with delay, since the audio has to be converted, but I can handle this on the TV.

The previous one might also work, since I can change the HDMI (ARC) audio format trough the LG “secret” service menu (to AC3). Sadly this feature doesn’t exist for PCM, which always return stereo 2.0.