[mythtv] Transcoding AC3/5ch and video sync

Jesse Crews jcrews at gridlox.net
Mon Sep 18 01:40:50 UTC 2006

Quoting Mark Spieth <mark at dclabs.com.au>:

> I have identified the problem but need to figure out a fix.
> need some way of telling avf that max channels is less.

Isn't avf giving us 2 channels?

> however transcode may transcode to ac3 which means leave as 6ch if 6ch so
> need some way of querying the nvr and telling nvp which passes it to avf.
> so in the mean while use 2ch mode for any backend/frontend combinations.

I'm not sure what you mean by this - the ATSC MPEG2 ts I get is 6ch, I  
can't change this. Certain programs just have 6 channels, where others  
have 2 (mostly the SD transfers on the HD transport). My  
avformatdecoder has the maximum channels set to 2 (I changed nothing).

> frontend only machines are ok of course to leave as 6ch.
> assuming there are no other problems :)
> cheers
> mark

Now I'm just a little bit confused :) Am I missing something monumental here?

> ----- Original Message -----
> From: "Jesse Crews" <jcrews at gridlox.net>
> To: <mythtv-dev at mythtv.org>
> Sent: Monday, September 18, 2006 1:46 AM
> Subject: Re: [mythtv] Transcoding AC3/5ch and video sync
>> Quoting Mark Spieth <mark at dclabs.com.au>:
>>>> Hi,
>>>> I've been working on an AC3/5ch -> stereo transcoding issue on and off
>>>> for a while, and I'm trying to find some advice on where to focus my
>>>> efforts.
>>>> Here's what's happening:
>>>> I transcode an ATSC recording with AC3/5ch audio to MPEG4, mp3 2ch.
>>>> The resulting file has video that is about 300ms early, or, audio that
>>>> is 300ms late, whichever way you like to look at it. This offset is
>>>> constant, and only happens when a recording with 5 channels is
>>>> transcoded. AC3/2ch does not create this effect at all. This may be
>>>> difficult to notice at first, but I see it easily and it is distracting.
>>> if you are using my patch then Im not surprised it doesnt work. only 2ch
>>> and
>>> 6ch are curretnly supported.
>> Using .20 11197, clarificaiton - I meant 5.1 (6ch) audio.
>>> 5ch will generate the wrong data format and the audiooutputbase doesnt
>>> cope
>>> with it.
>>> it will periodically starve and do funny things.
>>> need to fix up audiooutputalsa to cope with the 5ch format or change the
>>> AC3
>>> decoder to generate 6ch format even though 5ch are only found. see a52dec
>>> in
>>> lac.
>>> in 2 ch mode, a52dec is always in 2ch format so should not have a
>>> problem.
>>> transcoding is a completely different issue and is totally unsupported
>>> for
>>>  >2ch if you are using internal mythtranscode support. if you are using
>> Using internal, input format to mythtranscode looks to be 2ch MP3. It
>> spits out a "Copying Audio and transcoding Video" which is why I think
>> that it's being fed MP3 (the driving conditional statment says so).
>> Just to make sure, I actually want the output to have 2 channels, so
>> I'm not saying this is undesirable.
>> I don't think I've seen the entire audio transcoding pipe, mostly
>> because it's a little difficult to follow. I see lavc is being given
>> audio samples and the codec for whatever is in the source, and it's
>> spitting out the 2ch format that nvr/mythtranscode wants. I initally
>> thought the MP3 was done elsewhere, but it looks like lavc is being
>> given MP3/stereo as the requested output format/code, right?
>> So, with this in mind, how are the timecodes controlled and kept
>> synchronous after lavc has done its magic with the 6->2 channel downmix?
>> More generally, how (abstractly) are the audio and video kept
>> synchronous during this process? The timecodes on the -v playback
>> appear to move around quite a bit in relationship to each other. How
>> about those last_apts values?
>> I hope that helps clarify what I'm looking at.
>> Please bear with me, I'm not familiar with the finer points of a/v
>> processing.
>> Regards,
>> Jesse
>>> external programs, then its a different question.
>>> cheers
>>> mark
>>> _______________________________________________
>>> mythtv-dev mailing list
>>> mythtv-dev at mythtv.org
>>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>> _______________________________________________
>> mythtv-dev mailing list
>> mythtv-dev at mythtv.org
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> !DSPAM:1,450df25c272721429516263!

More information about the mythtv-dev mailing list