best transcoding method
Mar 3, 2006 at 11:39 AM Thread Starter Post #1 of 12

terrymx

Headphoneus Supremus
Joined
Apr 24, 2003
Posts
4,759
Likes
12
when you transcode a compressed audio format, one compressed format to another compressed format. you can either go from, for example, mp2 directly to mp3. or you can do: mp2 -> wav -> mp3.
this is necesary for movie play in my archos gmini. so its not necesary to talk about how transcoding is bad, that is off topic.

i've always read it is more recommended to convert back to wav first before compressioning again. can somenoe explain to me why its better that way, than to go directly from compressed to another compressed? do you save more data that way? and is this also hold true to video format? since i d notice a big lost in video quality when re-compressioning.
 
Mar 3, 2006 at 3:25 PM Post #2 of 12

Sparky191

Headphoneus Supremus
Joined
Apr 17, 2005
Posts
2,538
Likes
17
I'm only guessing. But don't all software apps decode to uncompressed before recompressing it. Doing it to a WAV file on the HD might use less RAM and resources but would be slower than doing it all in RAM. Even for MP3 playback it has to be decompressed before its passed through a DAC.

There would be an obvious speed gain if you could trancode directly though. So perhaps some software does this. In fact there was an interesting idea that MP3 support on some Sony device was transcoding on the fly to ATRAC but I doubt thats true. In fact I'd assume most applications and hardware that claims to transcode on the fly decompresses and recompresses on the fly. Its doesn't anaylze the compressed file but the uncompressed file.

Its simply more efficient to write one routine to decompress and one routine to compress. Than take the time to write a difference routine for each file format. Especially if the speed of the hardware makes any speed gains neligible.

But since I don't know how they encode or decode the MP3 streams I could be completely wrong. I'm only theorising.
 
Mar 3, 2006 at 3:28 PM Post #3 of 12

Sycraft

100+ Head-Fier
Joined
Jul 6, 2004
Posts
440
Likes
11
Doesn't matter how you do it because, in reality, it's being done the same way. If you have a program that does a direct MP2 - MP3 conversion, it's really not. What it's doing is decoding the MP2 to PCM data, then compressing the PCM data to MP3. It's just never writing the decoded data to disk. All you do when you convert to WAV first is write the PCM data to disk (WAV is mroe or less raw PCM data with a header on it). The only real reason is if you are useing a different program for decoding and encoding. Like maybe the encoder you use doesn't support MP2 input, so you use a decoder to make it WAV, then feed it to your encoder.

Video is the same way, any transcoder will first transform the video to uncompressed RGB 888 or YUV 4:4:4 before recoding to a new compressed format.

The reason you notice a loss in quality is because transcoding adds all the flaws of the orignal with all the flaws of the new format. It can never make quality better, only worse. If you transcode an MPEG-2 to an MPEG-4, you take all the MPEG-2 artifacts that were there, and add to that new MPEG-4 artifacts. With a good transcode the degradation can be minimised, but the quality is still capped by the orignal.
 
Mar 3, 2006 at 3:44 PM Post #5 of 12

Febs

Headphoneus Supremus
Joined
Mar 25, 2005
Posts
2,853
Likes
12
I suspect that the recommendations about decompressing to .wav and then back again come from people who are under the mistaken impression that decompressing to .wav will restore data lost in the initial compression process.
 
Mar 3, 2006 at 4:29 PM Post #6 of 12

Sparky191

Headphoneus Supremus
Joined
Apr 17, 2005
Posts
2,538
Likes
17
Something I've been thing about lately is just archiving everything as lossless. Not for use on a player but because it removes all transcoding issues. Especially if you think that you'll probably move on to better gear in the future and that portable formats will probably improve aswell. Be nice not to have to rerip everything in the future.
 
Mar 3, 2006 at 5:47 PM Post #7 of 12

Sycraft

100+ Head-Fier
Joined
Jul 6, 2004
Posts
440
Likes
11
For CD audio, that's feasable. You can rip a large collection to a 200GB harddrive or so, which isn't expensive these days. For video it is not feasable. NTSC quality video requires on the order of 1.7 gigabytes per minute. You can loslessly comrpess that 4:1 or so, but that's still nearly 900MB/minute. You don't even want to know about HD.

Even in pro uses uncompressed video is uncommon, generally lightly compressed formats like DV are used. However those are still infeasable for archival on today's disks at reasonable prices. For example a 1 hour, 20 minute capture I did receantly is 16.8GB on disk. At around 20GB even for a short movie, things fill up real quick.
 
Mar 3, 2006 at 9:23 PM Post #9 of 12

Sycraft

100+ Head-Fier
Joined
Jul 6, 2004
Posts
440
Likes
11
Never stated it wasn't, however you cannot do it now. There's no feasablility to currently rip video to lossless and keep it, you'll run out of space. That aside, I am not aware of video distributed in lossless formats. Best to just leave it in its orignal compressed format, whatever that is.
 
Mar 5, 2006 at 7:29 AM Post #10 of 12

Twombly

100+ Head-Fier
Joined
Feb 25, 2005
Posts
413
Likes
10
Quote:

Originally Posted by Sycraft
Doesn't matter how you do it because, in reality, it's being done the same way. If you have a program that does a direct MP2 - MP3 conversion, it's really not. What it's doing is decoding the MP2 to PCM data, then compressing the PCM data to MP3. It's just never writing the decoded data to disk.


If your encoder supports pipes (most do), this is basically what it does. I think the program may need to write something to disk otherwise.
 
Mar 6, 2006 at 5:26 AM Post #12 of 12

Sycraft

100+ Head-Fier
Joined
Jul 6, 2004
Posts
440
Likes
11
Quote:

Originally Posted by Twombly
If your encoder supports pipes (most do), this is basically what it does. I think the program may need to write something to disk otherwise.


No it can do all the processing in memory if it likes, there's no need ot use the disk, though it may elect to. The point is there is no direct translaton. One cannot take encoded MP3 data and recode it to say OGG, with no decoding phase. It must be first decoded back to uncompressed audio and then recompressed to the new format.

The point of all that is it doesn't matter if you have a program that does the decode/recode in one shot, or one that writes all the intermediate PCM data to disc. They both work the same way.
 

Users who are viewing this thread

Top