I have too many movies in some hierarchical data structure starting from a directory. I need to remove all their attribute/properties, because some of them have wrong information, and honestly I don't need it.

Typically, the way to do this "manually" (in Windows) is by going to the file's Properties, then Details tab, click on the link at the bottom, then either create a new copy with properties removed, or remove them manually; as shown in the following picture:

enter image description here

I know how to loop over all the files in my movies directory (in both Windows and Linux). So, my question is: Is there a Windows or Linux command prompt/terminal command that will remove these properties, given an mkv/mp4 file?

I expect something like:

mkvtoolnix --remove-all-attributes my-movie.mkv

Did you think of ffmpeg? It is an excellent tool for manupulating video files. Have a look here and see whether it can accomplish what you are looking for.

ffmpeg -i in.mkv -map_metadata -1 -c:v copy -c:a copy out.mkv

This removes metadata and copies both the audio and video streams over to a new file.


Let's say you have other streams (e.g. subtitles) that you want to preserve, the command becomes (note that this will delete all streams' metadata):

ffmpeg -i in.mkv -map_metadata -1 -c copy -map 0 out.mkv

Let's say you want to suppress only one or more metadata, and not all:

ffmpeg -i in.mkv -metadata title='' -c copy -map 0 out.mkv
| improve this answer | |
  • The problem with ffmpeg is that it'll reencode the whole video... right? I just want to remove the attributes without reencoding anything at all. – The Quantum Physicist Mar 16 '17 at 13:50
  • Wrong! With the above parameters the audio and video streams are copied as-is and not reencoded. – simlev Mar 16 '17 at 13:54
  • I tested this solution. It removed embedded subtitles. This is the problem with ffmpeg. I need a way to subtract metadata, not rebuild everything from scratch and not include metadata. – The Quantum Physicist Mar 16 '17 at 18:14
  • From the image you posted it looked like you wanted "Subtitle" to be removed. In any case, it's just a tool: it simply does what you instruct it to do. – simlev Mar 16 '17 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.