Why does renaming file extensions work?

Associate
Joined
15 Nov 2011
Posts
1,237
Hi all

I have a large number of dvds which I ripped to MKV files using handbrake. My question is why do they still work when I change the file extension to m4v, mp4, avi etc? It doesn't make sense to me because, as I understand it, changing the file extension doesn't change the file itself, just the way the computer decodes it...

All of the mkv's were ripped with h.264 and ac3 passthru.

Thanks for any help
 
The player is detecting the media type from the file itself rather than the extention. You could change the extention to anything you like and it will still work.
 
Files can have header info at start of it , eg rar files have
Rar is the first 3 chars in any rar file , progs can read this
 
The extension just determines which program opens the file. The file header (start of the file) says what type of file it is.

If you renamed a video.mp4 to video.txt, you could drag it into your video player and it would play it no problem
 
Hi, Thanks for the explanations. On a related note why is the audio much louder if I change the extension to anything other than MKV?

Thanks again :)
 
Back
Top Bottom