What's new

Editing MKV for Plex Server? (1 Viewer)

Kent K H

Supporting Actor
Joined
Oct 4, 2002
Messages
541
I apologize if this needs to be moved to a different forum ahead of time as it's my first go-round on this kind of thing and didn't see anything when I searched.

I recently got a QNAP NAS and set it up to back-up my movie collection to put on a personal Plex server. I've been ripping my blu-rays and DVDs with MakeMKV and then compressing the files with Handbrake (thanks and a tip o' the hat to those who helped guide me through the first steps on here) to a smaller MKV in order to keep the multiple soundtrack and subtitles in the file together.

I have a number of titles that have material at the front or back of the files that I would like to excise: later added studio logos, boutique label intros/outros, "next disc" titles for 2-part films, and in at least one case, several minutes of odd test pattern material before the movie starts.

I've tried using the methods I've seen online, but the closest I've gotten is Avidemux, which won't trim on the frames I want it to, either extending beyond or behind the point that I try to cut and telling me it's because I'm editing MKV to MKV.

What am I doing wrong? Or conversely, how can I do this the way I'm trying to, which is to simply select and cut the material I don't want?
 

Josh Steinberg

Premium
Reviewer
Senior HTF Member
Joined
Jun 10, 2003
Messages
26,393
Real Name
Josh Steinberg
My experience is that it’s really difficult to do frame accurate cuts to already compressed/encoded files without putting it into an actual editing program like Final Cut or Premiere - which in and of itself isn’t really recommended because of the complexities of transcoding the material to a format those programs can read and the back out to something you can use with Plex. It has to do with the way the files are compressed where each frame isn’t actually a unique frame but a piece of compressed data that references surrounding frames that together add up to something your player can read.

MKVToolNix has very limited editing capabilities where you can cut something by timecode and/or chapter but it can wind up being a frame or second off if the point you select isn’t in a place that the file can be truncated without re-encoding. It may or may not work better than the software you’re using, which I’m not familiar with.

Basically what you’re trying to do seems on the surface as being really simple, but it’s actually much more complex than it appears under the hood and that’s why it’s not really feasible to make perfectly frame accurate cuts with the kind of precision you’re going for with the sources and tools at your disposal. I’ve certainly beaten my head against the wall a few times trying.
 

Traveling Matt

Supporting Actor
Joined
Sep 1, 2006
Messages
932
Try MKVToolNix. In the Output tab you can split MKVs by various methods. Timestamps would probably be the best option in your case.

Edit: I see Josh beat me to it. Yes, MKVs can be tricky because you're editing by keyframes. But I've done what you're trying to do and it usually works because studio signatures or boutique logos don't usually play instantly before the movie. There's typically a little space. MKVToolNix will also accept half-seconds (i.e. 1:00:00.5) IIRC which can sometimes make a difference.
 
Last edited:

smithbrad

Senior HTF Member
Joined
Aug 12, 2013
Messages
2,052
Real Name
Brad
Actually, there is software that will do exactly what you request. However, it is not free. It is "TMPGEnc MPEG Smart Renderer 6" (maybe someone else will know of free software). It costs $70. I've been using various "TMPGEnc" software for over a decade for trimming, converting, and authoring.

By "smart renderer" it means it will allow you to edit out any part(s) of an mpeg file without the need for re-encoding. It makes no difference whether you are starting or ending at a full or partial frame. It will correctly piece back together a partial frame to make it a proper full frame. So you can have frame by frame precision. I like to cut out spoiler teasers from the beginning of episodes.

It also handles containers, so in your case, it will allow you to edit the mpeg file within the MKV container, while maintaining the MKV structure when done.

The software has a trial period, so you can download it and play with it before buying.
 

Josh Steinberg

Premium
Reviewer
Senior HTF Member
Joined
Jun 10, 2003
Messages
26,393
Real Name
Josh Steinberg
How well does that do with source files that have multiple proprietary audio tracks involved, like something with a DTS-HD MA 5.1 track and multiple Dolby Digital ones?
 

smithbrad

Senior HTF Member
Joined
Aug 12, 2013
Messages
2,052
Real Name
Brad
How well does that do with source files that have multiple proprietary audio tracks involved, like something with a DTS-HD MA 5.1 track and multiple Dolby Digital ones?
The audio is carried along untouched (other than where it is cut). While I never specifically checked before, I just did a sample that had both 6 channel English and French tracks. Both were preserved just fine. If you are concerned about other audio track formats, you may have to try it to find out. I just know that I've never had an issue.

It also supports merging files together. If the two files are not of the exact same format, it will convert one of the parts (your choice) to match the other.
 

smithbrad

Senior HTF Member
Joined
Aug 12, 2013
Messages
2,052
Real Name
Brad
I recently got a QNAP NAS and set it up to back-up my movie collection to put on a personal Plex server.
Btw, I've had a Synology DJ215 server since 2015, but I rarely used it except for casual iPad viewing because my wifi wasn't strong enough to the basement where my primary viewing is. However, a few months back I upgraded my wifi to eero. Now I get great bandwidth to the basement. Since then, I've upgraded my drive for more space and installed Plex. I use my Plex server primarily for TV shows and sporting events. What I've found most interesting is that I used to think I enjoyed binge watching the same series several nights in a row, but it was actually laziness in not wanting to swap out disks more than necessary in a night and trying to remember what episode I last watched per series. Now with my Plex server, I find I'm bouncing across 10+ series that I currently have loaded depending on the night and it manages where I am. Enjoy, Plex is liberating.
 

Josh Steinberg

Premium
Reviewer
Senior HTF Member
Joined
Jun 10, 2003
Messages
26,393
Real Name
Josh Steinberg
What I've found most interesting is that I used to think I enjoyed binge watching the same series several nights in a row, but it was actually laziness in not wanting to swap out disks more than necessary in a night and trying to remember what episode I last watched per series. Now with my Plex server, I find I'm bouncing across 10+ series I currently have loaded depending on the night and it manages where I am. Enjoy, Plex is liberating.

I’m very much in that same boat. I like getting in an episode or two of something before bed as part of the wind down but when I was watching off the discs, I’d usually just work through one show at a time in order. Too much effort otherwise to do multiple shows, remember where I am with each of them, and then get up every 25 minutes to switch discs and then get stuck with five minutes of unskippable previews and copyright warnings. And then if you fall asleep during something, heaven help you if that disc has a loud, looping menu. (I remember a college roommate being worried when he heard the song “Suicide is Painless” on a loop for hours coming from my room - that was just me sleeping through a DVD menu after falling asleep during MASH.) It sort of defeated the whole purpose of winding down to have all of that effort. And then if I wanted a specific episode of a show, say, a Twilight Zone, I’d have to remember or look up which season and disc the episode was actually on.

Plex for movies on disc is nice, but Plex for TV on DVD was a total game changer for me.
 

Kent K H

Supporting Actor
Joined
Oct 4, 2002
Messages
541
I'm starting with all of my movies, which will be enough of a project, haha. But eventually, I'll get to my TV collection as well. Granted, between MST3K and Midnite Mausoleum, there's a lot of movies in my TV as well...
 

Kent K H

Supporting Actor
Joined
Oct 4, 2002
Messages
541
Actually, there is software that will do exactly what you request. However, it is not free. It is "TMPGEnc MPEG Smart Renderer 6" (maybe someone else will know of free software). It costs $70. I've been using various "TMPGEnc" software for over a decade for trimming, converting, and authoring.

By "smart renderer" it means it will allow you to edit out any part(s) of an mpeg file without the need for re-encoding. It makes no difference whether you are starting or ending at a full or partial frame. It will correctly piece back together a partial frame to make it a proper full frame. So you can have frame by frame precision. I like to cut out spoiler teasers from the beginning of episodes.

It also handles containers, so in your case, it will allow you to edit the mpeg file within the MKV container, while maintaining the MKV structure when done.

The software has a trial period, so you can download it and play with it before buying.
I took a look and it sounds very promising, except it looks like it's Windows only? I've got a Mac, but I'll poke around and see if I can find something.
 

smithbrad

Senior HTF Member
Joined
Aug 12, 2013
Messages
2,052
Real Name
Brad
I took a look and it sounds very promising, except it looks like it's Windows only? I've got a Mac, but I'll poke around and see if I can find something.
Ahh...I should have mentioned it is Window's specific. I hope you find something for the Mac.
 

DaveF

Moderator
Senior HTF Member
Joined
Mar 4, 2001
Messages
28,784
Location
Catfisch Cinema
Real Name
Dave
I apologize if this needs to be moved to a different forum ahead of time as it's my first go-round on this kind of thing and didn't see anything when I searched.

I recently got a QNAP NAS and set it up to back-up my movie collection to put on a personal Plex server. I've been ripping my blu-rays and DVDs with MakeMKV and then compressing the files with Handbrake (thanks and a tip o' the hat to those who helped guide me through the first steps on here) to a smaller MKV in order to keep the multiple soundtrack and subtitles in the file together.

I have a number of titles that have material at the front or back of the files that I would like to excise: later added studio logos, boutique label intros/outros, "next disc" titles for 2-part films, and in at least one case, several minutes of odd test pattern material before the movie starts.

I've tried using the methods I've seen online, but the closest I've gotten is Avidemux, which won't trim on the frames I want it to, either extending beyond or behind the point that I try to cut and telling me it's because I'm editing MKV to MKV.

What am I doing wrong? Or conversely, how can I do this the way I'm trying to, which is to simply select and cut the material I don't want?

I took a look and it sounds very promising, except it looks like it's Windows only? I've got a Mac, but I'll poke around and see if I can find something.

MKVToolNix can do all this for free for the enthusiast. I have used it to do things akin to what you describe. I use it on Windows, but it looks like there's a compilation of it for the Mac, but I'm unsure on that.

 

DaveF

Moderator
Senior HTF Member
Joined
Mar 4, 2001
Messages
28,784
Location
Catfisch Cinema
Real Name
Dave
I remain convinced that if you really want to get into "HTPC", you're best off using Windows. All the software is there; the choices for Mac are appreciably slimmer. Throw together a cheap Windows computer, put all the freeware enthusiast software and go to town. :)
 

Josh Steinberg

Premium
Reviewer
Senior HTF Member
Joined
Jun 10, 2003
Messages
26,393
Real Name
Josh Steinberg
MKVToolNix can do all this for free for the enthusiast. I have used it to do things akin to what you describe.

MKVToolNix is a great tool but it’s not completely frame accurate when you try to make a cut. Even if you enter in the exact time stamp or numbered frame, it will move your cut to the nearest key frame, which may be before or after the point you’ve selected.

If you’re making a cut in a place where there’s a second or more of black on either side, it should work seamlessly. If you make a cut where the disc has an actual chapter stop, it’ll usually be frame accurate. But if you’re trying to be super fine about it and need to make a cut where the margin of error may be nonexistent or less than a second, the results aren’t always perfect. I think it’s good enough most of the time but not perfect.

Recent case in point: Zack Snyder’s Justice League is on two discs, and there’s a title card amended to the end of the first part that says something like “Continues on Disc 2”. It does touch black before that card fades in, but very briefly. There’s also a music cue from Part 1 that fades out before that added title card plays out. I have tried cutting it out with probably a dozen different adjustments and no matter what I do, the cut lands in one of two places each and every time: either during the black screen but during the music cue, or after the music cue but after the change disc title has started fading in. There is a tiny moment of several frames where the source file is both in black and silent but MKVToolNix cannot make the cut in that position.

I remain convinced that if you really want to get into "HTPC", you're best off using Windows. All the software is there; the choices for Mac are appreciably slimmer. Throw together a cheap Windows computer, put all the freeware enthusiast software and go to town. :)

I think that’s definitely true but I think a lot of people are in a similar position to me (and the OP) in that they built their systems with the components already available to them and buying a PC solely for that purpose doesn’t fit the plan or budget. I readily acknowledge all of this could have been easier on a PC, but on the other hand, out of thousands of discs ripped, I’ve maybe had five where I would have liked a tool that wasn’t on the Mac, and that’s not enough for me to justify buying a PC and revamping the whole setup. :)
 

Kent K H

Supporting Actor
Joined
Oct 4, 2002
Messages
541
I remain convinced that if you really want to get into "HTPC", you're best off using Windows. All the software is there; the choices for Mac are appreciably slimmer. Throw together a cheap Windows computer, put all the freeware enthusiast software and go to town. :)
That's fair, but I've put together my "system" as someone who does a lot of graphic work, etc., so that's won out. At some point I might be able to do that, but I just don't have the time and money now.
 

Kent K H

Supporting Actor
Joined
Oct 4, 2002
Messages
541
Recent case in point: Zack Snyder’s Justice League is on two discs, and there’s a title card amended to the end of the first part that says something like “Continues on Disc 2”. It does touch black before that card fades in, but very briefly. There’s also a music cue from Part 1 that fades out before that added title card plays out. I have tried cutting it out with probably a dozen different adjustments and no matter what I do, the cut lands in one of two places each and every time: either during the black screen but during the music cue, or after the music cue but after the change disc title has started fading in. There is a tiny moment of several frames where the source file is both in black and silent but MKVToolNix cannot make the cut in that position.
That's a perfect example of the situations I've been finding myself in.
 

Josh Steinberg

Premium
Reviewer
Senior HTF Member
Joined
Jun 10, 2003
Messages
26,393
Real Name
Josh Steinberg
That's a perfect example of the situations I've been finding myself in.

For this specific title, I made the transition as best I could and called it a day, but I saved the original two part files on a separate part of the drive in case I ever have the inclination and tools to redo it.

If it were technically easier (and less time consuming to do so), I would have chopped off all the modern 16x9 Universal logos that appear in front of their 1.37:1 films from their own library and their Paramount holdings. But in the end I found leaving them as is less distracting than it was to have files where either the last second abruptly appears or the fade in on the original studio logo got slightly clipped.

I’m not compressing my rips any further beyond what’s on the disc, so that does make it more possible to trim the files at a later time if I ever have the tools. I wouldn’t have to start at square one and rip the disc again.
 

Kent K H

Supporting Actor
Joined
Oct 4, 2002
Messages
541
For this specific title, I made the transition as best I could and called it a day, but I saved the original two part files on a separate part of the drive in case I ever have the inclination and tools to redo it.

If it were technically easier (and less time consuming to do so), I would have chopped off all the modern 16x9 Universal logos that appear in front of their 1.37:1 films from their own library and their Paramount holdings. But in the end I found leaving them as is less distracting than it was to have files where either the last second abruptly appears or the fade in on the original studio logo got slightly clipped.

I’m not compressing my rips any further beyond what’s on the disc, so that does make it more possible to trim the files at a later time if I ever have the tools. I wouldn’t have to start at square one and rip the disc again.
Yeah, the Criterion/Janus logos, Universal logos on Paramount films, Vinegar Syndrome logos, Olive logos... there are a decent amount of things that have been stuck on films over the years from studios or labels. And don't get me started on how much I chafe seeing that modern MGM logo at the start and end of everything they've ever touched at the expense of their period logos.
 

Users who are viewing this thread

Sign up for our newsletter

and receive essential news, curated deals, and much more







You will only receive emails from us. We will never sell or distribute your email address to third party companies at any time.

Forum statistics

Threads
357,078
Messages
5,130,270
Members
144,283
Latest member
mycuu
Recent bookmarks
1
Top