is there any way to automatically edit several mkv files to get rid of the file title on debian 12.11?
from merompetehla@lemmy.ml to linux@lemmy.ml on 29 May 09:11
https://lemmy.ml/post/30837098

file title is an option present on mkvtoolnix (92.0 eyeglow on debian 12.11)

I could single open every file, remove the file title and save, but that’s gonna take ages. almost 100 files.

#linux

threaded - newest

truthfultemporarily@feddit.org on 29 May 09:49 next collapse

Seems like it has a CLI. You can figure out how to do this action with a CLI command, then do something like find -name *mkv -exec … to execute that command for all the files.

racketlauncher831@lemmy.ml on 30 May 01:32 collapse

Combine this with FFmpeg.

ohulancutash@feddit.uk on 30 May 02:56 collapse

Why? mkvpropedit already does everything OP wants. No need to get ffmpeg involved.

tetris11@lemmy.ml on 29 May 09:57 next collapse

Emacs Dired would be my goto here, though it’s cumbersome if you dont know the bindings.

kill-rectangle and multiple-cursors within Dired are immensely useful

Edit: Oh, I just understood you want to mass modify the files themselves. In which case wgrep is useful here within Emacs, for modifying multiple buffers.

It essentially runs a grep command on a directory, collates all the results in a single buffer, lets you modify that buffer for all files, and then save in one go

IsoKiero@sopuli.xyz on 29 May 10:05 next collapse

Someone with more experience on sed or awk should chime in, but out of memory something like this (which MOST LIKELY WONT WORK, verify it before running it on anything important):

find -name *mkv -exec sed -e’s/file=.*/file=’ > {}.changed \;

That, at least in theory, reads every .mkv file recursively in a current working directory, finds lines that contain “file=<whatever><EOL>” and replace that with “file=<EOL>” and stores the output to <original filename>.changed.

DaPorkchop_@lemmy.ml on 29 May 22:08 collapse

I would be very hesitant to run sed on a bunch of files consisting primarily of highly compressed binary data.

retmas@lemm.ee on 29 May 10:16 next collapse

If you are talking about the mkv embedded title, try this:

find -type f -iname "*.mkv" | while read "i" ; do mkvpropedit "${i}" --edit info --set "title=" ; done
floo@retrolemmy.com on 29 May 11:01 next collapse

Just to be clear, this command will simply delete all the titles from all of the MKV files in that particular directory.

retmas@lemm.ee on 29 May 11:53 next collapse

Current directory and all its subdirectories - to be exact :)

You can execute the find command only (with arguments, so until the pipe) to verify modified files beforehand.

merompetehla@lemmy.ml on 30 May 22:11 collapse

thanks!

merompetehla@lemmy.ml on 30 May 22:11 collapse

noted

merompetehla@lemmy.ml on 30 May 22:10 collapse

thank you for taking the time to write the actual command!

D_Air1@lemmy.ml on 29 May 20:59 collapse

I’ve been using some ancient java app called jmkvpropedit to do this.