[mythtv-users] trandcoding messes up 6 channel audio slow audio playback

Gavin Hurlbut gjhurlbu at gmail.com
Fri Dec 31 10:47:58 UTC 2010

On Fri, Dec 31, 2010 at 1:34 AM, Jean-Yves Avenard <jyavenard at gmail.com> wrote:
> On 31 December 2010 18:03, Gavin Hurlbut <gjhurlbu at gmail.com> wrote:
>> I can confirm that this is the case in all my testing.  Any time
>> mythtranscode (particularly when using the --fifo mode) is sourced 5.1
>> AC3 audio, it spits out 6 channels of 48kHz 16-bit PCM.  In nuvexport,
>> I use sox to downmix that to stereo, but if we can get the mythtv
>> internal downmixer working in that case, that would be so much nicer.
> So you're saying that it does work ? (properly write 6 channels audio) ?

Define "work".  Yes, every 5.1 AC3 file I've tried successfully got 6
channel PCM out (in LF, RF, LR, RR, C, SW order).  However, ffmpeg is
stupid and has no concept of how to downmix PCM from 6->2 channels at
ALL.  It can do AC3 -> 2 channel PCM, but it can't handle 6 channel
PCM, apparently.  Therefore I have to preprocess to get stereo so
ffmpeg can use it.  If we can do this downmixing right in
mythtranscode, it would be better, I think.

> There are many ways we can write 5.1 audio.

Yes, but the only way that people seem to want for archived files
(that I've heard of yet) is AC3 in 5.1 format.  Unfortunately, at this
time, nuvexport can't provide that, although with some work, I could
probably make it do so IF the input audio were already 5.1 from AC3.
But that would be kinda silly as we'd effectively just be reencoding
right back to what it was, hence passthru would be useful in fifo
mode.  The other option is to upmix from ProLogic encoded stereo, and
create AC3 from the 6-channel PCM (or internally in mythtranscode).
This also would be useful for those trying to archive to DVD, and who
want AC3 on the DVD.

> Can do passthrough (of any format), or even if the original audio was
> 16bits PCM re-encode it either as AAC or AC3

Well, if we were to do passthru, I'd want just straight passthru with
at most resyncronization with the video.  If the original is AC3, that
would be the primary use of it, however, this would be passthru WITH
cutting support. :)  AAC or AC3 encoding, I can do with ffmpeg
anyways, last I checked, but reencoding back to the same format as
input (whether MP3, AAC or AC3) is rather... silly.

> Isn't there an option in the transcode setup on what audio you want in the end?

Not when using fifo mode.  In this mode, we currently get raw YUV12
video frames and PCM audio (with however many channels the input audio
had) on two separate fifos (named pipes at the system level).
Anything past that *in fifo mode* would be new support.

When transcoding in file mode (i.e. in the job queue using transcoding
profiles), then yes, I think you can specify audio format to some
extent.  It's been so long since I did so, I'm not sure what all it
can be configured to do.

> sorry if I don't know, I haven't tried transcoding in years..

Neither have I in file mode...  only in fifo mode using nuvexport :)

More information about the mythtv-users mailing list