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: Lossless and Lossy together? (Read 6349 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Lossless and Lossy together?

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.

Lossless and Lossy together?

Reply #1
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.

Lossless and Lossy together?

Reply #2
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. 
The question are: will you be able to play if afterwards?

Lossless and Lossy together?

Reply #3
If you don't need MP3 specifically, but just "a lossy codec", Wavpack Hybrid will do what you want.

Lossless and Lossy together?

Reply #4
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.

Lossless and Lossy together?

Reply #5
Quote
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.[{POST_SNAPBACK}][/a]

There is a solution for this: using [a href="http://musicbrainz.org/]MusicBrainz[/url] 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.

Lossless and Lossy together?

Reply #6
Quote
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.

Lossless and Lossy together?

Reply #7
Quote
Correct. ogmmerge doesn't support either raw FLAC nor OggFLAC files and never will as I don't develop the ogmtools anymore.[a href="index.php?act=findpost&pid=244393"][{POST_SNAPBACK}][/a]

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

Lossless and Lossy together?

Reply #8
Quote
I'm sorry to read that. Those tools are very useful. So what happens to the container format? Is something else taking its place?
[a href="index.php?act=findpost&pid=244395"][{POST_SNAPBACK}][/a]


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...).

Lossless and Lossy together?

Reply #9
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 (?).


Lossless and Lossy together?

Reply #11
Quote
Quote
Correct. ogmmerge doesn't support either raw FLAC nor OggFLAC files and never will as I don't develop the ogmtools anymore.[a href="index.php?act=findpost&pid=244393"][{POST_SNAPBACK}][/a]

I'm sorry to read that. Those tools are very useful. So what happens to the container format? Is something else taking its place?
[a href="index.php?act=findpost&pid=244395"][{POST_SNAPBACK}][/a]
.... something else took its place, and quite some time ago already  .....

Lossless and Lossy together?

Reply #12
Quote
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 
  .....    .....

Lossless and Lossy together?

Reply #13
Quote
Quote
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 
  .....    .....
[a href="index.php?act=findpost&pid=244554"][{POST_SNAPBACK}][/a]


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

I find my explanation more probable :B

Lossless and Lossy together?

Reply #14
Quote
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. [a href="index.php?act=findpost&pid=244404"][{POST_SNAPBACK}][/a]


For a moment I thought that your message was dated 2003  Yes you can view and extract attach files with the Matroska shell extension and probably a few other tools.

Lossless and Lossy together?

Reply #15
Quote
.... oh my god, i havent done enough advertising still  
  .....    .....
[a href="index.php?act=findpost&pid=244554"][{POST_SNAPBACK}][/a]


I'd better not comment... 

 

Lossless and Lossy together?

Reply #16
Quote
For a moment I thought that your message was dated 2003  Yes you can view and extract attach files with the Matroska shell extension and probably a few other tools.
[a href="index.php?act=findpost&pid=248444"][{POST_SNAPBACK}][/a]

Could you point me to a video or music player under linux that displays images embedded in matroska files?