Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Ogg-to-Ogg transcoding "bug" found... (Read 8207 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Ogg-to-Ogg transcoding "bug" found...

I found a really strange transcoding "bug" in Vorbis encoder, the whole story is here:
http://www.volny.cz/martel

Ogg-to-Ogg transcoding "bug" found...

Reply #1
Quote
I found a really strange transcoding "bug" in Vorbis encoder, the whole story is here:
http://www.volny.cz/martel


Ogg transcoding test - for educational purposes

Not long ago, while trying to transcode a 192kbit Ogg into a 128kbit one, i found something really strange. The resulting 128kbit Ogg bore some heavy artifacting and L/R disbalance at high frequencies (metal percussions - hat and such). I was just about to start using Oggs for archival purposes (instead of MPCs) but this event effectively prevented the transition (luckily for me!). Because 192kbit Oggs sounded up really great ("near" CD) i wondered what was the cause of such mess and whether any other transcodings into 128kbit Ogg would bear the same flaws.

Setup:
I picked up a juicy test sample (17 seconds CDDA->WAV, Czech heavy metal band Arakain) and commited a little test.
First, i encoded the WAV into Oggs using various -q settings (oggenc 2.8, libvorbis aoTuV 4.51). Also used MPC --standard and --xtreme for comparison.
Then, decoded these Oggs/MPCs back into waves (oggdec 1.0.1).
Then, encoded them all into Oggs using -q 4 cmdline switch (filename indicates the source Ogg/MPC bitrate):
direct encode into a -q 4 Ogg
transcode from a -q 6 Ogg into a -q 4 one
transcode from a -q 7 Ogg into a -q 4 one
transcode from a -q 8 Ogg into a -q 4 one
transcode from a -q 9 Ogg into a -q 4 one
transcode from a --standard MPC into a -q 4 Ogg
transcode from a --xtreme MPC into a -q 4 Ogg
transcode from a -q 6 Ogg into --insane MPC, then into a -q 4 Ogg

Results:
The -q 6 result is extraordinarily awful, even without comparison!
The -q 7 file is quite better but still there is a clearly audible artifacting in the first cymbal crash as well as some panning instability of the hat.
The -q 8 file is very close to the directly encoded Ogg but still, there is a slight panning issue of the hat and some artifacting in the first cymbal crash.
Even the -q 9 file still bears some traces of artifacting in the first cymbal crash and the hat in the first part of the sample! If you quickly swap the MPC --xtreme, the Ogg -q 9 and the directly encoded samples, listen to the hat that goes together with the first bass drum kick in the sample. Sure the hat sounds different (a bit deeper) in the Ogg-sourced file than in the rest.
MPC-transcoded files don't bear any mark of the Ogg->Ogg flaw.
The --standard file sounds a bit clumsy with less stereo separation (regarding just high frequencies), but the --xtreme file is completely OK (for a "transcoded-from-238kbits" file). I wonder if someone could even ABX the CD-DA-sourced Ogg from the MPC--xtreme-sourced one!

This is the best part :-))
The last file's quality is completely against my wits. I took the CD-DA source, encoded into a -q 6 Ogg, decoded to WAV, encoded to --insane MPC, decoded to WAV, encoded into a -q 4 Ogg. Not even in a dream i would imagine that inserting a MPC into a Ogg->Ogg transition could substantially improve the process, yet it did! The resulting file sounds exactly the way i would expect the direct-transcode to sound up. I think it even beats the -q 9 Ogg transcoding!
Someone should look into this because something really weird is going on.

Conclusion:
I consider Vorbis to the best codec out there but the fact that it can't transcode its own files properly makes Vorbis look somehow strange to me. If you have 192kbit Oggs at your disposal, sadly, there's just a very awkward way to transcode them into 128kbit (thru MPC, of course!) without sacrificing quality. I'll stick with the verified MPC--insane for archiving (less than 250kbits avg and transcodes perfectly, thus no need of 480kbit Oggs or something like that).

Appendix:
My equipment:
SB Live! soundcard, Sennheiser HD 490 Live headphones (60 Euro-class), 25-years-old ears (can't complain so far :-))
Playback by WinAmp 2.81, Nullsoft Vorbis Decoder v1.2.2 (using DirectSound on Windows XP)

Created using "notepad.exe" on 13th December 2005.


[a href="index.php?act=findpost&pid=350067"][{POST_SNAPBACK}][/a]



Thanks for your report.

Ogg-to-Ogg transcoding "bug" found...

Reply #2
There's something i'd like to know:
1) Why did you ("user") copy the web page into the forum? It is 24-7-web-hosted...
2) Who did increase my warning level?
3) What's
"The General forum is not the "put-everything-here-and-let-moderation-sort-it" forum."?
I am quite capable of reading English but i can't make any sense out of that sentence. :-(

You see, it is a rather complicated story and everyone interested should read it as a whole.
And the web space provider would be annoyed if i linked the sample files from another web space (this forum).

Ogg-to-Ogg transcoding "bug" found...

Reply #3
Matel, you seem to have posted this on the wrong forum, and moderators are not supposed to sort threads out for you.

Vorbis is a lossy format. It's never recommended to transcode itself, although your report sounds strange, as in MPC shouldn't help transcoding quality since it's another lossy format. Maybe someone could use some of its spare time to try this out, and report if the effect is the same.
Join //spreadopenmedia.com to promote Opus, Vorbis, FLAC, etc

Ogg-to-Ogg transcoding "bug" found...

Reply #4
Well, I fast compared the original aganist the "transcode from a -q 6 Ogg into a -q 4 one" and "transcode from a -q 6 Ogg into --insane MPC, then into a -q 4 Ogg".

The second one, with MPC between, sounded better for me, but was easier to ABX. This may be the problem. The first ir closer to original, but the second smoothered the things making it apear better. That was my opinion testing it quick.

Anyway, you shoud not transcode from lossy formats. The best is from the original or an lossless format. Take a look also in an short listening test that Guruboolez done about it: http://www.hydrogenaudio.org/forums/index....showtopic=32440

Vorbis has a feature called 'bitrate peeling' but no toll implemented it yet. This way you can take an higher bitrate ogg and convert in an lower bitrate ogg with almost no diference than direct converting from the source.

Ogg-to-Ogg transcoding "bug" found...

Reply #5
Martel> Did you compare all these files blindly? I see in your reports:

Quote
My equipment:
SB Live! soundcard, Sennheiser HD 490 Live headphones (60 Euro-class), 25-years-old ears (can't complain so far :-))
Playback by WinAmp 2.81, Nullsoft Vorbis Decoder v1.2.2 (using DirectSound on Windows XP)


Otherwise, the test is interesting. I already performed a short transcoding listening test and it appeared that transcoding from MP3 to MP3 produced the worst (by far!) results. Your test could show that the same process (i.e. encoding from one format to the same one) is really a bad thing. Several people are convinced that transcoding is better (or "less bad") if you keep the same format or encoder. Tests may show the opposite. Surprising, isn't it?

Ogg-to-Ogg transcoding "bug" found...

Reply #6
Quote
The second one, with MPC between, sounded better for me, but was easier to ABX. This may be the problem. The first ir closer to original, but the second smoothered the things making it apear better.


Meaning it is actually much worse.
Anyway, why transcode from 192 kbps Vorbis to 128 kbps Vorbis is beyond me.

If you really have to transcode, I'd reccommend trying the P3MOD or P4MOD compile (deending on the processor you have) rather than aoTuV, and playing around a bit with impulse_noisetune, impulse_trigger_profile and lowpass_frequency switches.
I use those for transcoding from a very high bitrate files (no matter the format) into lower bitrate Vorbis and in 99% cases fail to hear the artifacts. Needless to say, it is ABXable, but doesn't hurt (much) when you listen to it with a lot of other noise around you.

Cheerz =]

edit: typos
Only the best is good enough.

Ogg-to-Ogg transcoding "bug" found...

Reply #7
Quote
Several people are convinced that transcoding is better (or "less bad") if you keep the same format or encoder. [a href="index.php?act=findpost&pid=352193"][{POST_SNAPBACK}][/a]

I thought it was generally accepted that the opposite was the case? Because using the same format & encoder twice produces similar artifacts which have a tendancy to reinforce each other (*very* broadly speaking, of course).

Anyway, I thought that the conventional wisdom was "if you have to transcode lossy->lossy, do it to a different format entirely".

 

Ogg-to-Ogg transcoding "bug" found...

Reply #8
Quote
I thought that the conventional wisdom was "if you have to transcode lossy->lossy, do it to a different format entirely".


The conventional wisom is:
1. Don't transcode
2. If you must transcode, refer to rule no. 1
3. If you really have to transcode, test a few encoders, formats and settings, and use one most suitable for you; don't sh**e those files
4. Refer to rule no. 1

Cheerz =]
Only the best is good enough.

Ogg-to-Ogg transcoding "bug" found...

Reply #9
I don't usually transcode from ogg@192 to ogg@128, i do transcode from mpc@insane.
This was a rare event when i did not have the high-bitrate backup and accidentaly found the "bug", then looked into it closer.
Generally, i made the post because i see some people on this forum abandoning MPC as archival codec and going to ogg-only. And if the ogg has these problems with transcoding, perhaps the migration is not a good idea.
If you wish to keep a to-ogg-transcodable archive of oggs, you have to choose a considerably higher bitrate (due to reported problems) than you would have to with a MPC-based archive.
This could be because of MPC being based on MPEG-1 Layer 2, possibly having a distinct filtering/FFT-framing structure than MP3-based codecs (i guess the ogg is a Layer 3 based...).
I got the idea of using the MPC between the ogg-to-ogg transition to "de-ogg" the source (remove that taint that corrupted the transcoded file), it wasn't a random mad man's idea! 

Ogg-to-Ogg transcoding "bug" found...

Reply #10
Quote
Well, I fast compared the original aganist the "transcode from a -q 6 Ogg into a -q 4 one" and "transcode from a -q 6 Ogg into --insane MPC, then into a -q 4 Ogg".

The second one, with MPC between, sounded better for me, but was easier to ABX. This may be the problem. The first ir closer to original, but the second smoothered the things making it apear better. That was my opinion testing it quick.
[a href="index.php?act=findpost&pid=352190"][{POST_SNAPBACK}][/a]


Well, don't take me bad, but if you could ABX the direct transcode from the original WORSE than you could ABX the MPC-between sample from the original, then you probably have something wrong with your ears/audio system... or you didn't pay attention to the highest frequencies (as i pointed out somewhere in the article).
Just the high frequencies, please! 
Other content (mids, bass) seems to be transcoded fine...

Ogg-to-Ogg transcoding "bug" found...

Reply #11
Why archiving in a lossy format anyway? Ogg Vorbis (NOT just ogg, ogg is a container, not a format) has the highest bitrates quite close to some lossless formats, such as Monkeys' Audio. I really don't see a point in archiving to insanely-high-bitrate-lossy-format, because later on, you actually won't know what to do with it (transcoding will degrade it's quality a lot, and with it's original bitrate, it will probably be a heavy overkill for your iPod, iRiver, or a similar toy).
Only the best is good enough.

Ogg-to-Ogg transcoding "bug" found...

Reply #12
Quote
Why archiving in a lossy format anyway? Ogg Vorbis (NOT just ogg, ogg is a container, not a format) has the highest bitrates quite close to some lossless formats, such as Monkeys' Audio. I really don't see a point in archiving to insanely-high-bitrate-lossy-format, because later on, you actually won't know what to do with it (transcoding will degrade it's quality a lot, and with it's original bitrate, it will probably be a heavy overkill for your iPod, iRiver, or a similar toy).
[a href="index.php?act=findpost&pid=354264"][{POST_SNAPBACK}][/a]


(a little OT but...) Transcoding from a hybrid like Wavpack lossy results in no degradation that I've been able to discern. So for me, that's a suitable archive format. I'd be very interested to know if anybody has positively abx'd such transcodes from ~384kbps.

Ogg-to-Ogg transcoding "bug" found...

Reply #13
vorbis has always never been able to transcode to vorbis very well. (at least ever since i first tried it 3 years ago)
be it due to the lossy stereo, quantitization... i dont know.

at least its capable of fooling my ears  just not the encoder 

thats why i use q 0 with vorbis, so i'll never have any reason to transcode it to a lower bitrate

transcoding from q 10 vorbis seems to work ok though
Vorbis-q0-lowpass99
lame3.93.1-q5-V9-k-nspsytune