Help - Search - Members - Calendar
Full Version: Lossless and Lossy together?
Hydrogenaudio Forums > Lossless Audio Compression > Lossless / Other Codecs
FunkyRes
If this already exists - I would like to know.

What I'm looking for is some kind of single file container that can hold the lossless encoding of a file and a lossy encoding of a file - all in the same container. IE flac and mp3

The idea being that when I play the audio file in through my stereo system, the jukebox software decides the flac and sends that to the stereo, but when I burn an mp3 CD or sync to a portable mp3 player, it grabs the already encoded lossy version.

Ideally the tagging information would be separate so that you only have one place where you need to fix bad cddb info (such as when the cddb gives a 2004 year date for a 2004 compilation CD of jazz songs that were recorded in various years in the 70's ... jeez I hate that)

I hear the WMA lossless does this, but WMA does me no good - I'm a linux guy, I do have Windows and Mac OS but I'm a linux guy, and so I want this in a format that works particularly in Linux but also in other platforms, and it would be good to be able to use _whatever_ lossless and _whatever_ lossy codec the user wants inside the container - so long as the jukebox knows how to decode it.

Am I alone in this or is there a better solution?
Primary reason for wanting single file is the tags - when I come across band info in tags, I want to be able to fix it ONE place.
jimhaddon
Well, AFAIK, there is only 'hybrid' codecs such as Wavpack and the like, that do what you say. Dont know about mp3 n flac tho.
krmathis
I'm not 100% sure, but I think you should be able to place one FLAC and one Vorbis encoded audio stream inside a Ogg file. unsure.gif
The question are: will you be able to play if afterwards?
Garf
If you don't need MP3 specifically, but just "a lossy codec", Wavpack Hybrid will do what you want.
skamp
The OGM container format allows you to do that, at least in theory. I just tried it, and had some problems. First, ogmmerge didn't reckognize .flac files as valid input files. So I re-encoded the track to produce an Ogg file using the FLAC codec. Didn't work either, ogmmerge dies with the following error:
Error: the reader for track.flac.ogg did not produce a header page.

So I simply ripped the track into a wav file, an produced an Ogg Vorbis file as well. I then merged them together with ogmmerge, which finally worked:
ogmmerge -o test.ogm track.wav track.ogg

I was able to read back the file and select either stream, but only with mplayer.
I used mplayer -aid 0 test.ogm to play back the wav stream, and mplayer -aid 1 test.ogm to play back the Ogg Vorbis stream. Now, we need OGMtools to be fixed, and software supporting ogm files.

Great idea, BTW.
skamp
QUOTE(FunkyRes @ Sep 25 2004, 02:19 AM)
Primary reason for wanting single file is the tags - when I come across band info in tags, I want to be able to fix it ONE place.
*

There is a solution for this: using MusicBrainz ID's. If you tag all version of a given song with the same MB track ID, your software could then apply changes to all files tagged with the same ID. But yet again, you need software fully supporting MusicBrainz, which still doesn't exist yet, AFAIK.

An alternative for the time being, is to write your own script (in PHP, Python, whatever) that would do all that. Wouldn't be difficult, just a bit time consuming.
mosu
QUOTE(skamp @ Sep 25 2004, 04:06 PM)
The OGM container format allows you to do that, at least in theory. I just tried it, and had some problems. First, ogmmerge didn't reckognize .flac files as valid input files.


Correct. ogmmerge doesn't support either raw FLAC nor OggFLAC files and never will as I don't develop the ogmtools anymore.
skamp
QUOTE(mosu @ Sep 25 2004, 07:51 AM)
Correct. ogmmerge doesn't support either raw FLAC nor OggFLAC files and never will as I don't develop the ogmtools anymore.
*

I'm sorry to read that. Those tools are very useful. So what happens to the container format? Is something else taking its place?
mosu
QUOTE(skamp @ Sep 25 2004, 04:56 PM)
I'm sorry to read that. Those tools are very useful. So what happens to the container format? Is something else taking its place?
*



Nothing has been happening to/with that container format for over two years now. What will happen is that Theora is going to change things a bit, and the Xiph associates will hopefully create some apps that can deal with all those streams (Vorbis, Theora, FLAC, Writ...).
skamp
I didn't know about MKVtoolnix until I saw your signature, although I did know about Matroska. Well, as I just tested it, you can embed a FLAC file and an Ogg Vorbis file into a .mkv file:
mkvmerge -o foo.mkv track.flac track.ogg

Apparently you can also "attach" files of any type to .mkv files. That means you could attach an image (cover art) to it, although I doubt there is any program currently available that would display it. MKVtoolnix supports the following audio files: AAC, AC3, DTS, MP2, MP3, Ogg Vorbis, Real Audio, WAV, FLAC and TTA (?).
Daijoubu
TTA = The True Audio
http://www.hydrogenaudio.org/forums/index....showtopic=26818

Right on the front page of HA wink.gif
ChristianHJW
QUOTE(skamp @ Sep 25 2004, 03:56 PM)
QUOTE(mosu @ Sep 25 2004, 07:51 AM)
Correct. ogmmerge doesn't support either raw FLAC nor OggFLAC files and never will as I don't develop the ogmtools anymore.
*

I'm sorry to read that. Those tools are very useful. So what happens to the container format? Is something else taking its place?
*

.... something else took its place, and quite some time ago already wink.gif .....
ChristianHJW
QUOTE(FunkyRes @ Sep 25 2004, 10:19 AM)
If this already exists - I would like to know. What I'm looking for is some kind of single file container that can hold the lossless encoding of a file and a lossy encoding of a file - all in the same container. IE flac and mp3
.... oh my god, i havent done enough advertising still crying.gif
ohmy.gif ..... tongue.gif .....
David Nordin
QUOTE(ChristianHJW @ Sep 26 2004, 09:07 AM)
QUOTE(FunkyRes @ Sep 25 2004, 10:19 AM)
If this already exists - I would like to know. What I'm looking for is some kind of single file container that can hold the lossless encoding of a file and a lossy encoding of a file - all in the same container. IE flac and mp3
.... oh my god, i havent done enough advertising still crying.gif
ohmy.gif ..... tongue.gif .....
*



alternatively, user hasn't paid enought attention to board news and relevant discussions ;O)

I find my explanation more probable :B
robUx4
QUOTE(skamp @ Sep 25 2004, 05:40 PM)
Apparently you can also "attach" files of any type to .mkv files. That means you could attach an image (cover art) to it, although I doubt there is any program currently available that would display it.
*


For a moment I thought that your message was dated 2003 wink.gif Yes you can view and extract attach files with the Matroska shell extension and probably a few other tools.
rjamorim
QUOTE(ChristianHJW @ Sep 26 2004, 05:07 AM)
.... oh my god, i havent done enough advertising still  crying.gif
ohmy.gif .....  tongue.gif  .....
*


I'd better not comment... rolleyes.gif
skamp
QUOTE(robUx4 @ Oct 18 2004, 03:44 PM)
For a moment I thought that your message was dated 2003 wink.gif Yes you can view and extract attach files with the Matroska shell extension and probably a few other tools.
*

Could you point me to a video or music player under linux that displays images embedded in matroska files?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.