IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Split channels of a dual-channel MP3 without re-encoding
zhangweiwu
post Feb 4 2014, 10:18
Post #1





Group: Members
Posts: 9
Joined: 22-January 14
Member No.: 114168



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
ffmpeg -filter_complex channelsplit
) always re-encode the mp3 audio, even if it weren't joint-stero.

Proof the use case exists:
QUOTE (http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html)
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.

This post has been edited by zhangweiwu: Feb 4 2014, 10:21
Go to the top of the page
+Quote Post
DVDdoug
post Feb 4 2014, 19:30
Post #2





Group: Members
Posts: 2535
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



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)
Go to the top of the page
+Quote Post
dutch109
post Feb 4 2014, 20:20
Post #3





Group: Members
Posts: 122
Joined: 20-June 06
Member No.: 32044



Seems to be impossible with FFmpeg, I kept getting this error :
CODE
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


--------------------
Vorbis -q2/5 (Android/PC) & WavPack -hhx6
http://playnoise.com/
Go to the top of the page
+Quote Post
saratoga
post Feb 5 2014, 00:29
Post #4





Group: Members
Posts: 4854
Joined: 2-September 02
Member No.: 3264



I would not recommend filing bug reports for obscure feature requests.
Go to the top of the page
+Quote Post
dutch109
post Feb 5 2014, 20:05
Post #5





Group: Members
Posts: 122
Joined: 20-June 06
Member No.: 32044



QUOTE (saratoga @ Feb 5 2014, 01:29) *
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.


--------------------
Vorbis -q2/5 (Android/PC) & WavPack -hhx6
http://playnoise.com/
Go to the top of the page
+Quote Post
zhangweiwu
post Feb 6 2014, 06:08
Post #6





Group: Members
Posts: 9
Joined: 22-January 14
Member No.: 114168



QUOTE (dutch109 @ Feb 6 2014, 03:05) *
QUOTE (saratoga @ Feb 5 2014, 01:29) *
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.

This post has been edited by zhangweiwu: Feb 6 2014, 06:15
Go to the top of the page
+Quote Post
zhangweiwu
post Feb 7 2014, 03:03
Post #7





Group: Members
Posts: 9
Joined: 22-January 14
Member No.: 114168



QUOTE (DVDdoug @ Feb 5 2014, 02:30) *
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.
Go to the top of the page
+Quote Post
saratoga
post Feb 7 2014, 03:11
Post #8





Group: Members
Posts: 4854
Joined: 2-September 02
Member No.: 3264



QUOTE (dutch109 @ Feb 5 2014, 14:05) *
QUOTE (saratoga @ Feb 5 2014, 01:29) *
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.

Go to the top of the page
+Quote Post
nu774
post Feb 7 2014, 04:17
Post #9





Group: Developer
Posts: 514
Joined: 22-November 10
From: Japan
Member No.: 85902



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.

QUOTE (zhangweiwu @ Feb 6 2014, 14:08) *
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.
Go to the top of the page
+Quote Post
zhangweiwu
post Feb 7 2014, 10:37
Post #10





Group: Members
Posts: 9
Joined: 22-January 14
Member No.: 114168



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)
Go to the top of the page
+Quote Post
zhangweiwu
post Feb 8 2014, 08:09
Post #11





Group: Members
Posts: 9
Joined: 22-January 14
Member No.: 114168



QUOTE (dutch109 @ Feb 5 2014, 03:20) *
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.

This post has been edited by zhangweiwu: Feb 8 2014, 08:16
Go to the top of the page
+Quote Post
hlloyge
post Feb 8 2014, 09:30
Post #12





Group: Members
Posts: 695
Joined: 10-January 06
From: Zagreb
Member No.: 27018



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.
Go to the top of the page
+Quote Post
robert
post Feb 8 2014, 11:05
Post #13


LAME developer


Group: Developer
Posts: 788
Joined: 22-September 01
Member No.: 5



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.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th July 2014 - 17:42