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 FLAC to FLAC? (Read 3774 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Ogg FLAC to FLAC?

From the flac.exe help:

Code: [Select]
--ogg           When encoding, generate Ogg FLAC output instead
                of native FLAC.  Ogg FLAC streams are FLAC
                streams wrapped in an Ogg transport layer.  The
                resulting file should have an '.oga' extension
                and will still be decodable by flac.  When
                decoding, force the input to be treated as
                Ogg FLAC.  This is useful when piping input
                from stdin or when the filename does not end in
                '.oga' or '.ogg'.


You can encode to Ogg FLAC and you can decode Ogg FLAC using flac.exe. Is there any way to take Ogg FLAC as input and produce plain FLAC as the output?

Ogg FLAC to FLAC?

Reply #1
Since lvqcl does not seem to be feeling particularly wordy today, I’ll point out the bit from the official documentation for flac.exe that you seem to have missed.

Quote
flac can also re-encode FLAC files. In other words, you can specify a FLAC or Ogg FLAC file as an input to the encoder and it will decoder it and re-encode it according to the options you specify.

So, you want something like this
Code: [Select]
flac [-o optionalToChangeOutputFilename.flac] input.ogg

As noted in your quote, --ogg is only necessary if one has to force the input to be interpreted as Ogg FLAC, i.e. if using stdin or an Ogg FLAC file with (inadvisably) a .flac extension. Is this the case for you?

Ogg FLAC to FLAC?

Reply #2
When re-encoding, would the --ogg option be interpreted as an encoding option and force the output to be Ogg FLAC, or can it still be used to force the input to be treated as Ogg FLAC?
Code: [Select]
flac -c --ogg input.xxx

As noted in your quote, --ogg is only necessary if one has to force the input to be interpreted as Ogg FLAC, i.e. if using stdin or an Ogg FLAC file with (inadvisably) a .flac extension. Is this the case for you?
It may be.

Ogg FLAC to FLAC?

Reply #3
When re-encoding, does flac.exe go purely by the file extension to determine the input? No way to force it to see the input as Ogg FLAC?

Ogg FLAC to FLAC?

Reply #4
Why you cannot rename input.xxx to input.oga and forget about the problem?

Ogg FLAC to FLAC?

Reply #5
As db1989 alluded to, input may also come from stdin.

Ogg FLAC to FLAC?

Reply #6
I think you may be overcomplicating things. You could probably just pass the file, whichever format it is in and whichever extension it has (and whether or not these match). I doubt FLAC is so incompetent that it cannot figure everything out for itself. There may be no need for --ogg, since the documentation indicates that it is only for encoding as FLAC or decoding stdin/misnamed files. Have you tried this?

Edit: The above post was made whilst I was writing. If you’re using stdin, that may make the option mandatory after all: perhaps FLAC would otherwise choke on the Ogg header. Then again, perhaps not. Best to test and see!

Ogg FLAC to FLAC?

Reply #7
Code: [Select]
flac --ogg -d -c - < infile | flac -5 - -o outfile.flac

Or even:

Code: [Select]
flac --ogg -d -c - < infile | flac -5 -c - > outfile


 

Ogg FLAC to FLAC?

Reply #8
flac infile.oga -o outfile.flac

or

ffmpeg -i infile.oga -acodec copy outfile.flac

Both methods retain the metadata, and using flac it also retains the original timestamps (this is in Debian stable on x86; builds on other OS conceivably could differ).