FLV to MP4: Remux or Transcode? A Comparison of the Two Paths
6 min read
The same operation name, two completely different processes
The sentence 'I turned the FLV into an MP4' may describe one of two very different operations happening in the background. One is a packaging job that takes seconds and creates no loss at all. The other is a re-production that takes minutes, compresses the picture from scratch and inevitably loses something.
As a user the difference between the two normally shows up to you in only one way: waiting time. But in terms of the quality of the result the gap is far larger. In this article we compare the two paths and explain how to work out which one your file will fall into.
Remux: changing the box
A video file consists of two layers. On the outside there is the container — FLV, MP4, MOV and so on. On the inside there is the actual data compressed with a codec.
Remuxing means changing the outer layer and never touching the inner one. The video data is read out of the FLV container and written into the MP4 container as it is. The compression algorithm never comes into play.
The consequences of this are very clear:
- Zero quality loss. The picture data stays bit for bit the same.
- Very fast. The operation amounts to copying data; no compression is performed.
- Low processor load. It is independent of the computer's video encoding power.
Remux has one condition, but it is absolute: the target container must be able to carry the source codec. The MP4 container carries H.264 and H.265 video with AAC audio. If those are what is inside your FLV file, a remux is possible.
Transcode: reproducing the content
If the source codec does not fit into the target container, the only remedy is to decode the video and compress it from scratch. This is called transcoding, and it goes through these steps:
- The compressed data inside the FLV is decoded and raw frames are obtained.
- Those frames are compressed again with H.264.
- The result is written into the MP4 container.
The second step is critical. H.264 is a lossy codec; it performs compression by discarding the details the human eye is least likely to notice. That means a transcode always loses a certain amount of information. How visible that loss will be depends on the bitrate chosen, but it cannot be zero.
Transcoding also takes time. Because every frame has to be decoded and re-compressed, the operation can take minutes on long, high resolution files.
So which one is waiting for you?
The decision depends entirely on the age and contents of your FLV file:
The case where a remux is possible: the file belongs to Flash's final period and has H.264 video + AAC audio inside. This applies to most video sharing site recordings produced in those years.
The case where a transcode is mandatory: the file is older and has Sorenson Spark or VP6 video inside, or an old audio codec such as Nellymoser. MP4 carries none of these.
There is also an in-between case: the video is H.264 but the audio is MP3. In that situation the video can be remuxed while the audio may need converting to AAC. Because the audio makes up a very small part of the file this operation is fast, and the picture is never touched.
The two paths compared side by side
Time. A remux runs at data-copying speed. A transcode processes every frame; the difference is not small, and on long files it is the difference between seconds and minutes.
Quality. In a remux there is no loss. In a transcode there is a certain amount of loss, and that loss cannot be undone.
File size. In a remux the size stays almost the same. In a transcode the size can shrink or grow depending on the settings chosen — pick a low bitrate and the file gets smaller but the loss increases.
Flexibility. In a remux you cannot change anything at all — resolution, frame rate, bitrate; everything is carried over as it is. A transcode, on the other hand, gives you the ability to intervene in all of those settings. So while a transcode brings loss, it offers control in return.
Compatibility. The output of both paths is MP4 and plays on modern devices. But a remuxed file also carries across the oddities of the original — for example, if there is a variable frame rate in the source it passes into the MP4 too and can cause sync problems in some players. A transcode gives you the chance to fix that kind of issue.
The decision: what should you do?
In practice we can summarise the decision process as follows.
If a remux is possible, do a remux. This is beyond argument. With a lossless and fast path available, there can be only one justification for preferring a re-encode: if there is a structural problem in the source file that needs fixing. Otherwise a remux is superior in every respect.
If a remux is not possible, accept the transcode but do it once. With old FLV files you have no choice. In that case the smartest thing to do is to perform the conversion once with the best possible quality setting and to keep the original file for a while too. Converting the same file over and over loses a little more quality each time.
Do not expect to exceed the quality of the source. This applies to both paths. FLV files are usually low resolution and narrow bitrate; conversion does not change that limit. Transcoding at a high bitrate makes the file larger but does not improve the picture.
You do not have to control which path gets used yourself. Our FLV to MP4 converter reads the codecs inside when you upload the file and automatically picks the lossless path where possible.
In summary
The difference between remux and transcode is like the difference between putting a book into a new box and having it reprinted from scratch. In one the content is preserved exactly, in the other something is lost each time. Which path your FLV file falls into is determined by its age: late-era files are lucky, early-era files are not. But in both cases the right move is the same — moving the file to MP4 today is the only way to keep it openable.
Frequently Asked Questions
How would you explain the difference between remux and transcode in one sentence?
Remux is taking the video out of one box and putting it into another; transcode is opening the video up and compressing it again from scratch. In a remux the picture data is never touched, so quality is preserved exactly and the operation is fast. In a transcode the data is decoded and re-encoded with a new algorithm, so there is a certain amount of quality loss and the operation takes far longer. Which one gets used is decided not by you but by the codec inside the file.
Can I choose which one gets used?
In practice your choice is limited, because the decision is a technical necessity. If there is H.264 inside, a remux is possible and is already the best option; abandoning it in favour of a transcode has no benefit at all, you would only lose quality. If there is VP6 or Sorenson inside, a remux is impossible, because the MP4 container cannot carry those codecs. So the choice has effectively already been made on your file's behalf.
Is the quality loss after a transcode visible to the eye?
In most cases it goes unnoticed unless you look carefully, but technically it is always there. The loss becomes more apparent particularly in fast-moving scenes, on sharp edges and across flat colour gradients. Because FLV sources were already encoded at a low bitrate, a second round of compression can make the existing degradation a little more visible. If you convert the same file over and over the loss accumulates, so it is worth keeping the original.
Is a remuxed file completely identical to the original?
In terms of picture and audio data, yes, it is exactly identical. The only things that change are how that data is packaged, how the timestamps are written and how the header fields are arranged. You may see small differences in file size; that comes from the container structure carrying a different amount of overhead and has nothing to do with quality. So your MP4 file may be a few hundred kilobytes different from the original, but the picture is the same.
Try this out right away with FLV → MP4 Dönüştür.
Try FLV → MP4 Dönüştür