Search for MKV without Chapter Markings

Hello,

I have an External HDD with a lot of MKV Movies on it. Many of these have Chapters Markings embedded in the MKV file. Others don't have any chapters. Is it possible to search for the MKV Files WITHOUT Chapters? That would be very helpful. I am a newbie to scripts. Hopefully you have any suggestions. So it's to write a script that runs all video files through mediainfo and parse the output to find those that don't have any chapter markers. I had a script for xyplorer, but because of stability problems i switched to Directory Opus Pro

Greetings

Bart Peters

We can probably add a column and search type for that in Opus 13, as that is using MediaInfo now. (We've added a bunch of other columns, but that wasn't one I'd thought of.)

In the shorter term, or if you don't want to use the 13 public beta, I bet ExifTool and @Lxp's ExifTool Custom Columns script can get the data. In the Find/Advanced panel, you could then add a Script Column comparison to the filter.

These may also come in handy, if you want to go the script route:

1 Like

There doesn't seem to be a specific field you could use, but searching for a line Menu in MediaInfo dumps looks promising.

So you could run

PrintMeta MEDIAINFO

on all .mkv files and then use the Find panel with this filter (requires Opus v13):

name match *-MediaInfo.txt and contains nomatch ^menu regex utf8
1 Like

AFAIK using MediaInfo.exe the total chapters is the difference between these 2 values: %Chapters_Pos_Begin% and %Chapters_Pos_End% (using the actual MediaInfo library like DOpus I think is more direct and allows to obtain other info like chapters names).
@bartpet I wrote a script some time ago that allows me to search by chapter number, among other things. If you're interested, I could send it to you via DM (since I only tested it myself, I don't know if it's ready for release).

1 Like

Thanks for your reply lxp and errante. this is the script i used in xyplorer. This script worked very good, but somehow caused big stability problems in xyplorer. I'm new to scripting, i can see that you both know a lot about script-writing, so below you find the XYplorer script using MediaInfo CLI, perhaps it's helpful. Thanks you in advance for any input, greetings Bart:

// Find all video file(s) that do NOT have chapter marks
$mediaInfoCLI = "C:\Users\bartp\OneDrive\Bureaublad\Portable Apps\MediaInfo CLI\MediaInfo.exe";
end (exists($mediaInfoCLI) != 1), quote($mediaInfoCLI) . " not found, aborted!";

$videosFiles   = quicksearch("{:Video}", , , "s"); // "/types=mkv;mp4;..."
$cntVideoFiles = gettoken($videosFiles, "count", <crlf>);
end (!$videosFiles), "No video file(s) found, aborted!";

showstatus 0;
$log = "";
while ($i++ < $cntVideoFiles) {
    $videoFile = gettoken($videosFiles, $i, <crlf>);
    status "Processing [" . $i . "/" . $cntVideoFiles . "]: " . quote(gpc($videoFile, "file")), , "progress";
    $result = runret(lax("$mediaInfoCLI" "$videoFile"), , 65001);
    if (regexmatches($result, "^\d{2}:\d{2}:\d{2}")) { continue; }
    $log .= $videoFile . <crlf>;
}
end (!$log), "No video file(s) without chapter marks found!";
paperfolder("Videos without chapter marks.txt", $log);

Thanks for your reply Leo, I installed Opus 13 just now. I will check out the tips you gave me today. Greetings

If you prefer this regex - that is possible as well.

Thanks lxp. Sorry for being unclear. I didn't write the script i posted myself. I got it on the XYplorer forum by someone like you who's an expert on scripting. I am absolutely ignorant when it comes to scripts. I know how to insert input and output, and that's how far i go at this moment. All i know is, the script works in XYplorer and doesn't work (yet) in Opus13. If you could adjust the script for Opus, you're very welcome. And if you have any websites for me where i could learn to write scripts, that would be great. Thanks

The approach I suggested and the XYplorer script will have the same results. Using values like @errante proposed could yield something different. Just try it out.

Opus uses JScript, so any site that teaches JavaScript will be useful. But when it comes to scripts for Opus, look no further, you have already found the right place.

Hey lxp,

I am very sorry for my impatiance and rudeness. Due to some unfortunate incidents (in my family), I lost the crucial rule: Being nice to another, certainly to people who help me in there free time. I am truly sorry and very glad that i didn't deinstall the DO app, because as I always said: It's a great app. I want to learn the scripting languages, but i don't have a lot of time for that because of my work.
Greetings
Bartpet (NL)