<p>No, a Windows (or Mac or Linux) file rename will not change the container. They are inherently different file formats. They store data differently. They reference the audio and video tracks differently. Re-wrapping from one container to another can actually be a fairly complex operation depending on how the two formats store essence tracks. It may seem like ffmpeg isn't doing any "real work" compared to a transcode, but that is because the video doesn't have to be decoded in a re-wrap. The compressed bits only need to be re-written in a new order with some new metadata.</p>

<p>Think about it this way: just renaming a Word document from <code>.docx</code> to <code>.xlsx</code> doesn't make it an Excel workbook. Your story doesn't get turned into a spreadsheet just because you changed the extension. You need to a use a program to convert every tab into a cell.</p>

<p>The only exception where a simple rename works is where the extensions are synonyms of each other. For example, if you have a program that is expecting all QuickTime wrapped files to be <code>.qt</code>, but you have a <code>.mov</code>, you can rename the file to get it to work. But that is only because they are two different extensions that identify the same container format.</p>

CC BY-SA 4.0
2018-12-19T07:04:36.670Z
It's pretending to change the container and it's just tricking ffmpeg and everything into believing its an avi container now? Again, is there a way to confirm this? I believe I understand your post, windows lets me change the extension of a .txt file to a .png and it'll read as a png and all that in ffmpeg as well. But in the case of the avi.....it plays fine...reads as an avi....what is the real difference in that case? I'm just tricking everything into thinking an mkv is an avi? Couldn't that be useful for other purposes?
kite
CC BY-SA 4.0
2018-12-19T07:06:54.027Z
I just find that kinda disturbing if there's no way to confirm for real, as doesn't that mean you can trick anything into believing something is something else? A .exe can be hidden as an image file.....etc?
kite
CC BY-SA 4.0
2018-12-19T23:55:23.930Z
Most programs will actually verify the format of the file using more than just the extension.
Michael Liebman
CC BY-SA 4.0
2018-12-19T03:48:44.027Z
2018-12-19T03:48:44.027Z
Michael Liebman
<p>For example say I use the command:</p>

<pre><code>ffmpeg -i input.mkv -c copy output.avi
</code></pre>

<p>(In my case I need to add -bsf:v h264_mp4toannexb)</p>

<p>Well I can also just copy and rename the file from input.mkv to output.avi manually in windows. When I callup their info in ffmpeg...it's almost same. With the exception that ffmpeg also does slightly different video durations...which is kinda worrisome but from the listed information online it doesn't affect anything other than if you potentially gutted the video into 2 sections and were trying to recombine it using the old times.</p>

<p>But I mean between the two, windows is providing a more accurate and possibly more easy method...no?</p>

<p>Are there just exceptions and for some formats windows won't let you change the containers with filename changes by default?</p>

<p>Or is this just a generic function ffmpeg does in order to facilitate its more advanced commands?</p>

<p>Just curious if I'm missing something.</p>

<ffmpeg>
Is there any difference between changing video containers with ffmpeg vs just renaming with windows?
kite
# Is there any difference between changing video containers with ffmpeg vs just renaming with windows?

(Asked by: username_0 on 2018-12-19)

For example say I use the command:
ffmpeg -i input.mkv -c copy output.avi

(In my case I need to add -bsf:v h264_mp4toannexb)
Well I can also just copy and rename the file from input.mkv to output.avi manually in windows. When I callup their info in ffmpeg...it's almost same. With the exception that ffmpeg also does slightly different video durations...which is kinda worrisome but from the listed information online it doesn't affect anything other than if you potentially gutted the video into 2 sections and were trying to recombine it using the old times.
But I mean between the two, windows is providing a more accurate and possibly more easy method...no?
Are there just exceptions and for some formats windows won't let you change the containers with filename changes by default?
Or is this just a generic function ffmpeg does in order to facilitate its more advanced commands?
Just curious if I'm missing something.

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2018-12-19. Score: 3 | Accepted answer

No, a Windows (or Mac or Linux) file rename will not change the container. They are inherently different file formats. They store data differently. They reference the audio and video tracks differently. Re-wrapping from one container to another can actually be a fairly complex operation depending on how the two formats store essence tracks. It may seem like ffmpeg isn't doing any "real work" compared to a transcode, but that is because the video doesn't have to be decoded in a re-wrap. The compressed bits only need to be re-written in a new order with some new metadata.

Think about it this way: just renaming a Word document from `.docx` to `.xlsx` doesn't make it an Excel workbook. Your story doesn't get turned into a spreadsheet just because you changed the extension. You need to a use a program to convert every tab into a cell.

The only exception where a simple rename works is where the extensions are synonyms of each other. For example, if you have a program that is expecting all QuickTime wrapped files to be `.qt`, but you have a `.mov`, you can rename the file to get it to work. But that is only because they are two different extensions that identify the same container format.

> **Comments:**
> **username_0**: It's pretending to change the container and it's just tricking ffmpeg and everything into believing its an avi container now? Again, is there a way to confirm this? I believe I understand your post, windows lets me change the extension of a .txt file to a .png and it'll read as a png and all that in ffmpeg as well. But in the case of the avi.....it plays fine...reads as an avi....what is the real difference in that case? I'm just tricking everything into thinking an mkv is an avi? Couldn't that be useful for other purposes?  
> **username_0**: I just find that kinda disturbing if there's no way to confirm for real, as doesn't that mean you can trick anything into believing something is something else? A .exe can be hidden as an image file.....etc?  
> **username_1**: Most programs will actually verify the format of the file using more than just the extension.  

---

