24

When watching a MKV file from the web in VLC, the title bar (see "#1" in image below) seems to be pulled from metadata, not the filename.

If you open the “Get Info” panel in VLC, you can change the title (“#2”) and then click “Save Metadata” (“#3”), but when the file is re-opened, the old information is shown.

I have not found any other Mac apps which can edit MKV metadata. Several offer to edit mp4 metadata, but that isn’t what I need.

VLC annotated screenshot

0
26

I have found a way to do this using mkvpropedit which is part of mkvtoolnix.

mkvpropedit "foo.mkv" -e info -s title="This Is The Title"

There is a GUI wrapper for this app and other Mac installation instructions available at the official website.

11

As an addition one could use mkvpropedit in a bash script to set the title of all mkv files in a directory. (Given the filename is the desired title.)

#!/bin/bash

# This script takes all mkv files in the current directory and sets the filename
# (without .mkv) as its title in metadata

for mkvfile in *.mkv; do
    mkvpropedit "$mkvfile" -e info -s title="${mkvfile%.mkv}"
done
0
9

The MKVToolNix GUI way:

  1. From the menu choose header editor.

enter image description here

  1. Open the mkv file.

  2. Under segment information there is a title item, change title as you wish.

enter image description here

  1. There is not a save button, use the main menu to save changes.

enter image description here

macOS Version Support

Current versions of MKVToolNix require macOS Mojave (10.14) or newer, but earlier versions of MKVToolNix might work for previous versions of macOS/OS X.

As of v42.0.0, MKVToolNix uses std::optional,a which requires macOS 10.14.b

macOS High Sierra (10.13) and Sierra (10.12) should run up to v41.0.0 "Smarra" (2019-Dec-06).

As of v30.0.0, MKVToolNix uses Qt 5.12,c which requires macOS 10.12.d

OS X El Capitan (10.11) should run up to v29.0.0 "Like It Or Not" (2018-Dec-01).

As of v26.0.0, the "README.macOS.txt" file states that it works only with macOS 10.11 "El Capitan" or newere (although MACOSX_DEPLOYMENT_TARGET and LSMinimumSystemVersion are still at 10.9, so it might run in Yosemite 10.10 or Mavericks 10.9).

OS X Yosemite (10.10) and Mavericks (10.9) should run up to v25.0.0 "Prog Noir" (2018-July-12).

As of v9.7.1-build4, MACOSX_DEPLOYMENT_TARGET and LSMinimumSystemVersion are set to 10.9.f

OS X Mountain Lion (10.8) might run up to v9.7.1-build2 "Pandemonium" (2016-Dec-27).

As of v8.2.0, the "README.macOS.txt" file states that it works only with Mac OS X 10.9 and higher, although LSMinimumSystemVersion is still at 10.8.0, so it might run in Mountain Lion 10.8.

Furthermore, MACOSX_DEPLOYMENT_TARGET is not set, so it should target whatever OS version it was built in.g As v9.7.0-build2 and v9.7.1-build2 were built in Sierra 10.12, they won't run in Yosemite 10.10 nor El Capitan 10.11 (although they will run in Mavericks 10.9 and Mountain Lion 10.8, which appear to ignore that restriction). See the relevant discussion here.

3
  • This works, but it's one at a time - see apple.stackexchange.com/questions/367737/… for a bulk method.
    – Tetsujin
    Sep 6 '19 at 6:16
  • Can confirm this works for one file at a time.
    – user643011
    Jul 22 '20 at 14:52
  • yes it is not suitable for bulk operation. Other answers already took care of that. This is for small works when you don't bother to check the cli params (mkvpropedit --help ).
    – Xaqron
    Jul 23 '20 at 12:33
5

Just open the file in VLC player, Ctrl+I, choose the desired Metadata, title etc, change and then in the bottom, click 'Save Data'. That's all.

No other external editor is needed.

7
  • 3
    That is in the OP. He said it didn't work.
    – Tetsujin
    Oct 16 '18 at 14:29
  • 1
    I tried this using VLC on a mac and it works. You just have to be sure to click the "Save Metadata" button in the Media Information window. It's not the easiest thing to find.
    – Ascii Dude
    May 8 '19 at 13:05
  • 1
    I think what may happen is if you change it, it will save, but if you just delete it, it doesn't.
    – Tetsujin
    Sep 6 '19 at 6:17
  • 1
    @Tetsujin is correct, if you enter an empty value it will not accept it, it will look like it's working but when you check again the old value is still there, so it's easy to assume it "doesn't work", and in a way I guess it doesn't. In short, you can't delete, just change to something else.
    – pzkpfw
    Jan 11 '20 at 21:02
  • 2
    It does not work, even if you click "save metadata". At first glance it seems to work, but once you reopen the file again in VLC you see the old value is still present. Tested with MKV file.
    – user643011
    Jul 22 '20 at 14:44
0

Downloaded a looot of files, many of which had some *** in it's title, as an extension of another answer made my own script.

It changes title for all .mkv files in directory (and it's subdirectories) while asking for an appropriate action. Actions are "Keep the name?[ 1] / Type a new name?[ 2] / Use the filename as a movie name?[ 3]".

Might update it later on github, here's what there is for now:

#!/bin/sh

# This script takes all mkv files in the (sub)directory and sets it's Movie name/Title
# Requires mkvtools (mkvpropedit) and mediainfo installed
#
# param1 Starting directory (defaults to current)
# param2 Default action to do with files
# (Keep the name?[1] / Type a new name?[2] / Use the filename as a movie name?[3])
# Be carefaul with param2 since this script doesn't (atm) back up the existing movie names.

IFS=$'\n'; set -f

updateTitle() {
    mkvpropedit "${1}" -e info -s title="${2}"
    echo "✅ Updated to \"${2}\"";
}

getMovieTitle() {
    echo "$(mediainfo ${1} | grep "Movie name" | sed 's/^.*: //')";
}

parseFilename() {
    filename=${1##*/}
    filename=${filename%.*}
    echo ${filename}
}

chooseAction() {
    f="${1}"
    curFilename="${2}"
    defaultAction="${3}"

    if [[ -n "${defaultAction}" ]]; then
        ans="${defaultAction}"
    else
        read -p "Keep the name?[1] / Type a new name?[2] / Use the filename as a movie name?[3] : " -n 1 ans
        echo
    fi

    case "${ans}" in

    1)
        echo "Keeping the old name"
        ;;
    2)
        read -p "New movie name: " newName
        updateTitle ${f} ${newName}
        ;;
    3)
        updateTitle ${f} ${curFilename}
        ;;
    *)
        echo "Invalid char \"${ans}\""
        chooseAction $@
        ;;
    esac
    echo
}

renameMovies() {
    for f in $(find ${1} -name '*.mkv'); do
        curTitle="$(getMovieTitle ${f})"
        curFilename="$(parseFilename ${f})"

        echo "File location - ${f}"
        echo "File name     - ${curFilename}"
        echo "Movie name    - ${curTitle}"

        chooseAction ${f} ${curFilename} ${2}
    done
    echo "Done"

}

renameMovies ${1:-$(pwd)} ${2}

unset IFS; set +f
-1

For those using windows I made a command prompt alternative that changes the titles of all Matroska videos to the filename.

REM This batch script changes the title segment information to the name of the file. 
REM The script only selects mkv files in the current directory

for /f "delims=" %%a in ('dir /b /s *.mkv') do (mkvpropedit.exe "%%~nxa" -e info -s title="%%~na")
New contributor
Monty Perrotti is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • This site is for Apple specific software and hardware - so it is expected that questions refer to macOS only unless they explicitly say otherwise. This question actually asks for Mac apps so it is not only an assumption
    – mmmmmm
    Jan 22 at 10:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .