VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. I am having trouble with removing tags from MKV files. I can't figure out how to remove a comment/description tag with mkvpropedit, and Windows 10 says file access denied, that I need permission to edit the file, even though I am an administrator.

    I found this other thread really helpful and I was able to remove the field called "Title" in Windows 10, aka "Movie name" in MediaInfo, using mkvpropedit

    Originally Posted by stehow View Post
    If you want a quick way of batch processing all MKV files in a directory, setting the MKV title to the filename, then install mkvtoolnix and then create a batch script such as:

    echo ***** Starting MKVtitle *****
    for %%m in (*.mkv) do (
    echo Changing %%m Title to "%%~nm"
    "C:\Program Files (x86)\MKVToolNix\mkvpropedit" "%%m" -e info -s title="%%~nm"
    echo -----
    )
    echo ***** Finished *****
    I just changed the line of the batch script to put a blank string for the title/name

    Code:
    "C:\Program Files\MKVToolNix\mkvpropedit" "%%m" -e info -s title=""
    But the "Comments" field in Windows 10, aka "Description" in MediaInfo, has been difficult for me to figure out how to remove.

    I used the MKVToolNix mkvinfo-gui.exe to show all the elements, and I found the tag I'd like to remove in certain location with the name: DESCRIPTION

    the elements listed were
    • EBML head
    • Segment
    • Seek head
    • Segment information
    • EbmlVoid
    • Segment tracks
    • Tags
    • Tag
    • Targets
    • (note: nothing is listed under targets, no track UID or anything)
    • Simple
    • Name: DESCRIPTION
    • String: <this is the string I want to get rid of, or the whole tag>
    • Cluster
    • ...
    • Cluster
    • Cues
    but I don't know how to edit or remove that tag. The mkvpropedit commands are not clear to me on how to do this. This particular tag/field does not show up in the MKVToolNix GUI header editor section either

    any help would be appreciated. Thanks.
    Quote Quote  
  2. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Code:
    mkvpropedit "file.mkv" -t global:
    Will remove all of the global tags. If you want to remove one specific tag you'll need to extract the tags using MKVExtract, edit the resulting XML then add the global tags back in.


    Code:
    mkvextract tags "file.mkv" -r "tags.xml"
    Code:
    mkvpropedit "file.mkv" -t global:"tags.xml"
    If you need to modify tags en masse and don't want to do it manually, Powershell can handle xml much easier than batch.
    Quote Quote  
  3. Code:
    mkvpropedit "file.mkv" --tags all:
    Will remove all global and non-global tags.

    https://mkvtoolnix.download/doc/mkvpropedit.html
    Quote Quote  
  4. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Originally Posted by sneaker View Post
    Code:
    mkvpropedit "file.mkv" --tags all:
    Will remove all global and non-global tags.

    https://mkvtoolnix.download/doc/mkvpropedit.html
    That will get rid of any MKVMerge/MakeMKV Track Statistics Tags as well... if you want to go down that path.
    Quote Quote  
  5. True. Otherwise it is possible to delete all tags and then let mkvpropedit create new statistic tags.
    Code:
    mkvpropedit "file.mkv" --tags all: --add-track-statistics-tags
    But that probably costs extra time so your suggestion is better in case he doesn't want to remove the track tags (incl. statistics).
    Quote Quote  
  6. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    Mosu was incredibly vague as to how to handle the statistics tags early on, I wrote the code for MediaInfo's handling of them and last time I checked it will reject statistics tags made by MKVPropEdit.
    Quote Quote  
  7. Time to fix your software, then.
    I don't really see any difference between tags written by mkvmerge vs those written by mkvpropedit, though. (Except _STATISTICS_WRITING_APP, naturally.)
    Quote Quote  
  8. Thanks, the tags command seemed to remove the tag that I wanted, although it did remove all the other tags

    Originally Posted by sneaker View Post
    Code:
    mkvpropedit "file.mkv" --tags all:
    Will remove all global and non-global tags.

    https://mkvtoolnix.download/doc/mkvpropedit.html
    I don't know that I necessarily care about the other tags, the method from the first answer seems like a lot of work to have to export everything just to delete one tag, and keep the other tags. For the track statistics, with using the option to add them back in one of the replies, sorry for the newbie question, but what is the purpose of the track statistics tags, or rather why would I want to add/keep the track statistics?

    it seems like you are correct that MediaInfo doesn't show up the track statistics written by the MKVToolNix mkvpropedit --add-track-statistics-tags option, and those only appear using the MKVToolNix mkvinfo when option to show all elements is checked. It added tags at the end of the file, such as DURATION, NUMBER_OF_FRAMES, and NUMBER_OF_BYTES for each track, with _STATISTICS_WRITING_APP as mkvpropedit

    thanks for letting me know how to remove the tags, that helped a lot. sorry for the long post. but I had another question about the mkvpropedit commands for the edit selectors how do I go thru and delete the title/name of every track? --edit track:all does not seem to work
    so these are the commands I'm using so far:

    Code:
    "C:\Program Files\MKVToolNix\mkvpropedit" "%%m" -e info -s title=""
    "C:\Program Files\MKVToolNix\mkvpropedit" "%%m" --tags all:
    "C:\Program Files\MKVToolNix\mkvpropedit" "%%m" --edit track:1 --set name=""
    and the last one will work for one track but i want to do it to them all, like if there are more than 2 tracks, like if there are multiple audio tracks

    thanks
    Quote Quote  
  9. I fear there's no command for that. A cheap solution would be to batch a command for e.g. 1 to 10 and just let it run mkvpropedit 10 times. Or from 10 downwards an exiting depending on the error level (or more sophisticated a script to actually count the number of tracks beforehand).
    Quote Quote  
  10. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    The 'first one' was actually

    Code:
    mkvpropedit "file.mkv" -t global:
    which will delete the most used tags yet leave the TSTs intact.

    If you're using CMD (batch), you can just create a loop that tests ERRORLEVEL after calling MKVPropEdit to make sure you get all the tracks.

    Code:
    Set Count=0
    :Loop
    Set /a Count+=1
    type NUL
    MKVPropEdit "%~f1" -e track:%Count% -d name
    if "%ERRORLEVEL%"=="0" goto :Loop
    -edit-

    The purpose of the Track Statistics Tags is to let MediaInfo know the duration of any particular track, how many bytes the tracks are made out of and how many frames. Without them MediaInfo has to either guess what those values are or simply leave fields dependant on that information blank. You'll find that if you have two variable bitrate tracks in an MKV (eg. video and lossless audio) mediainfo will simply leave the bits per second fields for each of the tracks blank. Also, without a valid duration tag MediaInfo simply sets the duration of each of the tracks equal to the duration of the file itself, regardless of the actual duration of the track. Not having tags also makes it difficult for MediaInfo to determine if a file is variable frame rate or not since it has to guess whether it is or not through scanning the first few frames of a file.
    Last edited by ndjamena; 11th Mar 2017 at 12:04.
    Quote Quote  
  11. ok cool thanks. you're right, the global specifier from the first part of your answer removes the comment/description tag I wanted without completely removing the DURATION tag (TSTs = Time Stamp Tags?)

    Originally Posted by ndjamena View Post
    The 'first one' was actually

    Code:
    mkvpropedit "file.mkv" -t global:
    which will delete the most used tags yet leave the TSTs intact.
    although I did notice that MKVToolNix mkvpropedit moved the tags to the end, added some language attributes to each remaining tag, and those tags like (DURATION) no longer show up in MediaInfo after running the mkvpropedit command

    thanks for the ideas on how to loop, I would not have thought about using errorlevel, that would work for me

    here is my final windows CMD script (some lines are commented out if different functionality is desired)

    Code:
    @echo off
    CLS
    
    echo ***** Starting mkvtitle *****
    for %%m in (*.mkv) do (
    echo -----
    echo File: "%%m"
    echo -----
    echo Edit: Info...
    call :_edit_info "%%m"
    echo -----
    echo Edit: Tracks...
    Set count=0
    call :_edit_loop "%%m"
    echo -----
    echo File: Complete.
    echo -----
    )
    echo ***** Finished mkvtitle *****
    goto :eof
    
    
    :_edit_info
    REM echo Changing Title to "%~n1"...
    REM "C:\Program Files\MKVToolNix\mkvpropedit" "%~1" -e info -s title="%~n1"
    echo Removing Title...
    "C:\Program Files\MKVToolNix\mkvpropedit" "%~1" -e info -s title=""
    echo Removing Tags...
    REM "C:\Program Files\MKVToolNix\mkvpropedit" "%~1" -t all:
    "C:\Program Files\MKVToolNix\mkvpropedit" "%~1" -t global:
    exit /b
    
    :_edit_loop
    Set /a count+=1
    echo Changing Track %count%...
    "C:\Program Files\MKVToolNix\mkvpropedit" "%~1" -e track:%count% -s name=""
    if "%ERRORLEVEL%"=="0" call :_edit_loop "%~1"
    exit /b
    
    :eof
    thanks again
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!