Log in

View Full Version : ffmpeg: remove audio channel without re-encoding


Wowfunhappy
28th June 2014, 15:29
Hi I like audiobooks and always have. As a result, I have a ton of audiobooks files saved on my computer that I ripped from CD's many years ago. I've long since the lost most of the original CD's.

Being young and stupid, I saved all the these files as stereo rather than mono. In order to save space, I'd like to downmix them to one channel, but I'd rather not re-encode them, partly because I'd like to avoid the inherent quality loss that comes with re-encoding (however small), and partly because the length of each book combined with the size of my library means that a re-encode would actually take a significant amount of time.

I'm assuming that it's impossible to downmix without doing a re-encode—it makes logical sense, and certainly doing '-codec copy -ac 1' doesn't seem—but since I'm pretty sure both the left and right are exact duplicates anyway, would it be possible to simply remove one of the two audio channels? I've done quite a bit of searching on Google and I can't seem to find any information.

Thanks!

tebasuna51
29th June 2014, 00:01
You don't say what is the format of your files.

With lossy formats (mp3, aac, ...) you can't downmix without recode.
But, by default, stereo audio with equal left and right channel is compressed using, more or less, the same bitrate than the equivalent mono channel.
Then you can't save space without lose quality.

setarip_old
29th June 2014, 17:00
@Wowfunhappy

Hi!

since I'm pretty sure both the left and right are exact duplicates anyway, would it be possible to simply remove one of the two audio channels? I've done quite a bit of searching on Google and I can't seem to find any information.

I believe you canaccomplish this using VirtualDub...

raffriff42
29th June 2014, 18:46
@tebasuna51 is right, most compression schemes save stereo audio in such a way ("joint stereo" (http://wiki.hydrogenaud.io/index.php?title=Joint_stereo)) that it doesn't take much more space than mono, especially if there isn't much channel difference content ("separation"). Audiobooks don't usually have a lot of separation.

There's a detailed discussion of this exact question on hydrogenaud.io (http://www.hydrogenaud.io/forums/index.php?showtopic=104503). They seem to conclude the channels can't be separated without re-encoding - they are multiplexed together at a low binary level.

Gew
4th September 2021, 11:57
Sorry for a thread bump, but I thought that since it's been half a decade or so, perhaps some new technology is in place? Also, I think that my question is looking for a slight different outcome than the thread starter, so perhaps there's hope for me.

It's like this, I have an .M4A (containing a stereo AAC stream) but one channel is empty (flat-line) so when I walk with my headphones to listen to this it's annoying to only get the audio from one ear.

Hence, I was thinking if there's a way to just "wipe away" the deaf channel, perhaps by hex:ing some kind of mono track metadata into it? I don't know if it's possible? I pulled a simple "-ac 1" for now, which obviously is re-encoding it, thus a slight quality loss.

So, do you guys know of any way to proceed without any quality loss, except for punching it out as a PCM mono output? :P

Cheers!