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: Split channels of a dual-channel MP3 without re-encoding (Read 13271 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Split channels of a dual-channel MP3 without re-encoding

Is there a way to split channels of a dual-channel MP3 without re-encoding?

Reason: I have an archive of movies passed to me. They are made in 1990s, when it was popular to encode different languages in different channels. Most hardware video player produced by that time have a button to switch left/right/stereo on the remote. Now I  need to republish these content online or they would be lost. But I need to change channels into streams first. The tool I use (
Code: [Select]
ffmpeg -filter_complex channelsplit
) always re-encode the mp3 audio, even if it weren't joint-stero.

Proof the use case exists:
Quote
Dual channel
One example of use would be some speech in two different languages carried in the same bitstream, and and appropriate decoder would decode only the choosen language


Thanks!

This topic is not about:

1. Why joint-stero is as good as dual-channel or 'true' stero and how silly it is to avoid using joint-stero for quality purpose.
2. Why someone would encode different content into channels instead of streams in the first place.

These two topics are very popular on the Internetnet. The OP is not asking about them.

Split channels of a dual-channel MP3 without re-encoding

Reply #1
I seems like it should be possible, but I don't know of an application that can do it.    Your best option is probably to convert the audio to a lossless format or to a higher-quality lossy format.

Here are some lossless MP3 editors that I'm aware of.  You'll have to investigate or try them to see if they can split the channels.   

mp3DirectCut
MP3 Sergeon
Pcutmp3
X-Wave
Fission (OS-X)

Split channels of a dual-channel MP3 without re-encoding

Reply #2
Seems to be impossible with FFmpeg, I kept getting this error :
Code: [Select]
Streamcopy requested for output stream 0:0, which is fed from a complex filtergraph. Filtering and streamcopy cannot be used together.


I tried all the methods listed here (cached link in case previous is dead) with no success.

I suggest filing a bug to the FFmpeg developers here, they are usually responsive and can provide help
Opus 96 kb/s (Android) / Vorbis -q5 (PC) / WavPack -hhx6m (Archive)

Split channels of a dual-channel MP3 without re-encoding

Reply #3
I would not recommend filing bug reports for obscure feature requests.

Split channels of a dual-channel MP3 without re-encoding

Reply #4
I would not recommend filing bug reports for obscure feature requests.

Obscure ?
That is a pretty common use case, that is supposed to work and documented on the official wiki.
Opus 96 kb/s (Android) / Vorbis -q5 (PC) / WavPack -hhx6m (Archive)

Split channels of a dual-channel MP3 without re-encoding

Reply #5
I would not recommend filing bug reports for obscure feature requests.

Obscure ?
That is a pretty common use case, that is supposed to work and documented on the official wiki.


I don't think it the need is obsecure, but I believe dutch109 is saying that the implementation is obsecure.

I think it can't be done in ffmpeg, because the way I assume it works is to decode everything before applying a filter, so that a filter writting for one codec can work with others, and there perhaps isn't any codec-specific filter, so there is no software framework to adapt to it.  But it doesn't hurt to try.  (Dual-stereo is implemented on the codec level, not on MP3 frame level, MP3 designers made the very choice).

The question is whether or not to file it in sox as well.

There are a lot of losy formats that can be edited loselessly:

1. JPEG allow loseless cropping on certain boundary (usually 16x16 grid). Since jpeg allows it, mjpeg should, as well.
2. h.264 allows tripping away 8pixels above and below the video, loselessly. In fact they are not trimmed, just hidden.
3. All video files can be loselessly edited in avidemux if you just cut on key frames.
4. Audio may work the same way as 3.
5. as said, simple stereo and dual-channel mp3 can be split asunder.

None of the features are found in ffmpeg (perhaps except 3), so they perhaps don't have a software framework to adapt such needs.

Split channels of a dual-channel MP3 without re-encoding

Reply #6
mp3DirectCut
MP3 Sergeon
Pcutmp3
X-Wave
Fission (OS-X)


Thanks for the list.

Since I am on Linux now I can only try this:

Pcutmp3 - can do cut and split, but not chanel seperation

The others I did some googling:

X-wave MP3 Cutter Joiner - No mentioning of channel seperation in feature list.
MP3 Surgeon 2004 Pro - No mentioning of channel seperation in feature list.
mp3DirectCut - No mentioning of channel seperation in feature list.
Fission for Mac - No mentioning of channel seperation in feature list.

It is funny to see so many software competing to offer exactly the same set of features (cut/join/normalize/fade-in/fade-out) and their description text is the rewording of each other, yet no one offer differential advantage like channel seperation.

Split channels of a dual-channel MP3 without re-encoding

Reply #7
I would not recommend filing bug reports for obscure feature requests.

Obscure ?
That is a pretty common use case, that is supposed to work and documented on the official wiki.


Dual channel is extremely obscure and that documentation does not mention being able to losslessly split it. Given how ffmpeg works I would be surprised if it can losslessly edit mp3 or any other lossless format.


Split channels of a dual-channel MP3 without re-encoding

Reply #8
I guess this is not as easy as on AAC-LC due to MP3's syntax and it's bit reservoir.
Compared to AAC, bits for each channel is placed scattered in MP3 (even beyond frame boundaries).
In case of AAC-LC, dual mono is implemented as two single channel elements in raw_data_block(), and extracting one channel is relatively easy.

I think it can't be done in ffmpeg, because the way I assume it works is to decode everything before applying a filter, so that a filter writting for one codec can work with others, and there perhaps isn't any codec-specific filter, so there is no software framework to adapt to it.

For bitstream level transformation, ffmpeg provides bitstream filters, although it seems to be used for much simpler tasks.

Split channels of a dual-channel MP3 without re-encoding

Reply #9
Add to the list of lossless editor that cannot do channel seperation:

'quelcom'. commandline tool. Features mp3 cut/join. Development and website ceased for years, but source code still there and available in source repositories of many Linux distributions (e.g. Ubuntu)

Split channels of a dual-channel MP3 without re-encoding

Reply #10
I suggest filing a bug to the FFmpeg developers here, they are usually responsive and can provide help


Now that the need is clear, the software framework is ready, it is okay to file the bug, the implemenation may be difficult but we can leave that to developers, or a brave soul who will only appear some years later and see this request and decide to take it.

Thank you for providing a link, but I couldn't use it. That link request filing bug with gdb, since I got no crash, gdb has no use to me. The second option, according to the linked page, is to file it on ffmpeg tracker, which is https://trac.ffmpeg.org/ which gives 503 error for the last 3 consecutive days. Some projects prefer users not to interfere with feature planning or use bug tracker as support desk, but stick to the users' duty of reporting crash and error message so that they can polish the features they decided to do - this happens more to non-GUI projects. Is it the culture of ffmpeg? Is avconv doing any better in this aspect or they share that culture? I could try my luck with avconv, but not sure if they also have bitstream framework.

Split channels of a dual-channel MP3 without re-encoding

Reply #11
I remember, although loosely, that mp3 cannot be losslessly, without reencoding, split from two channels stereo to two mono files. You can decode it to wav and then do the splitting, and reencoding these back together.
Error 404; signature server not available.

Split channels of a dual-channel MP3 without re-encoding

Reply #12
If I remember correctly, it can be done with simple stereo or dual channel files, eventually with M/S coded frames too. In over 1.5 decades there was not much of a demand for it, so I doubt anyone will implement it now. I think, mp3packer should have almost everything on board to include it therein.