Solved Revised: Way to map multiple audio streams to single 5.1 output
#1
NOTE: I have learned a lot more abut exactly what I'm trying to deal with here so I have revised this post, both to make it more concise and to clarify what I am actually requesting.

Here is the problem I am facing. I am using XBMC's PVR addon for TVHeadEnd. I am using TVHeadEnd to receive satellite TV signals. If a channel sends 5.1 audio, it generally puts it all in a single stream with multiple channels, only the first six of which contain the 5.1 audio channels, which are in this order:

Left - Right - Center - LFE (low frequency emitter such as a subwoofer) - Left Surround - Right Surround

When recording or streaming such programs, TVHeadEnd saves these programs as .ts files, which XBMC generally has no problem playing. However there is one satellite service that sends its audio in four distinct audio streams, each of which has two channels, and only the first three of those are needed for 5.1 (the last pair is for things like described video or alternate languages). Please understand that those of us who try to view this channel have no control over the format it uses; we have to deal with "the way that it is", so no need saying it is the broadcaster's fault - we already know that, but that's how they choose to send their audio.

The way this service maps its audio is as follows:

Audio stream #1: Left - Right
Audio stream #2: Center - LFE
Audio stream #3: Left Surround - Right Surround

The problem is that XBMC can select any of the streams individually but AFAIK cannot combine them into a single 5.1 output. And since most of the background noise and music is in stream #1, while most of the dialogue is in stream #2, selecting just one of those tracks simply doesn't work well at all for most programs.

What I'd like to see, rather than the current dropdown that only lets you select a single stream, is an "advanced" option that would deal with this type of split audio in some way. Some users may want to mix these channels down to stereo or some other format rather than 5.1, but still I'd like to have some way to map these multiple streams correctly.

Due to copyright limitations I cannot post an example stream online (I live in the USA and we have draconian copyright laws here; there are copyright trolls that love nothing more than to catch an American posting copyrighted material in a public forum). However if any of the developers would be interested in seeing one of these streams you can PM me and I will make arrangements to make one of them accessible to you. Let me know how long a segment you'd need, since they tend to get large rather quickly, and again due to copyright issues I do not want to send any more than is necessary for you to see the problem.
Reply
#2
It sounds like your broadcaster is the one screwing things up, but one way to see what might be going on is to run mediainfo on one of these streams and post the output.

I hear what you are saying about copyright, but a one minute clip should show the problem and shouldn't be objectionable to any copyright holders.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#3
(2014-09-25, 02:38)nickr Wrote: It sounds like your broadcaster is the one screwing things up, but one way to see what might be going on is to run mediainfo on one of these streams and post the output.

I don't disagree with that but anyway here is the audio info:

Code:
Audio #1
ID                                       : 751 (0x2EF)
Menu ID                                  : 9 (0x9)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 4
Duration                                 : 1h 4mn
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Maximum bit rate                         : 432 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 177 MiB (3%)
Language                                 : aaa

Audio #2
ID                                       : 752 (0x2F0)
Menu ID                                  : 9 (0x9)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 4
Duration                                 : 1h 4mn
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Maximum bit rate                         : 432 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 177 MiB (3%)
Language                                 : aac

Audio #3
ID                                       : 753 (0x2F1)
Menu ID                                  : 9 (0x9)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 4
Duration                                 : 1h 4mn
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Maximum bit rate                         : 432 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 177 MiB (3%)
Language                                 : aae

Audio #4
ID                                       : 754 (0x2F2)
Menu ID                                  : 9 (0x9)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 4
Duration                                 : 1h 4mn
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Maximum bit rate                         : 432 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 177 MiB (3%)
Language                                 : aag

(2014-09-25, 02:38)nickr Wrote: I hear what you are saying about copyright, but a one minute clip should show the problem and shouldn't be objectionable to any copyright holders.

I live in the USA and the copyright extortionists are getting really bad here. Sorry, not posting anything that is copyrighted publicly, I do not want to be sued!
Reply
#4
I have learned more about the actual format of the streams in this channels since I made my original post, so I have revised my original post to more clearly state the problem and what I would like to see happen.
Reply
#5
I don't think you'll really find anyone interested in implementing a feature to fix a stream that is so far out of spec. Also the fix you need probably should come from ffmpeg.

If you think some copyright police will trouble you for posting a short sample, then you are wrong. It happens all the time, and I don't think it is even illegal.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#6
In the US if you post a small boring clip that doesn't have any real entertainment value then it should be considered "fair use".

What I want to know is how normal equipment deals with this. Can you tell us more about your setup? You're in the US using satellite with TVHeadend? How do you have that all hooked up hardware wise? What satellite provider are you using?
Reply
#7
For anyone else that comes across this thread at this late date, about a month ago I found a blog post that addresses this issue. I have to convert the video after the fact using ffmpeg, but the technique shown there works and I get full 5.1 sound on the converted recordings.
Reply

Logout Mark Read Team Forum Stats Members Help
Revised: Way to map multiple audio streams to single 5.1 output0