[mythtv-users] Mythexport choosing wrong audio stream

HP-mini blm-ubunet at slingshot.co.nz
Fri Dec 7 17:45:48 UTC 2012


On Thu, 2012-12-06 at 21:31 +0000, Stephen Robertson wrote:
> On Tue, Dec 4, 2012 at 10:53 PM, HP-mini <blm-ubunet at slingshot.co.nz> wrote:
> >
> >> It looks as if I may have been mistaken here; in my experience a 256kb/s
> >> track would be the primary one, but now you find the 192 kb/s ac3 has
> >> precedence.  I'm surprised, but you have the evidence :-)
> >

> Thanks for that, I seem to be getting somwhere
> avconv -i /media/500G/8940_20121027202800.mpg -y -vcodec libx264
> -preset medium -pre:v libx264-ipod640 -b 1500k -bt 1000k -threads 0 -s
> 800x480 -ab 192k -ar 48000 -ac 2 -aspect 16:9 -f ipod -map 0:v -map
> 0:a -map -0:a:$aac_latm /var/lib/mythtv/a
> 
> -map 0:v to map all video streams
> -map 0:a to map all audio streams
> -map -0:a:$aac_latm to remove the audio stream I don't want.
> 
> seems to get what I need
> Output #0, ipod, to '/var/lib/mythtv/a':
>   Metadata:
>     encoder         : Lavf53.21.0
>     Stream #0.0: Video: libx264, yuv420p, 800x480 [PAR 16:15 DAR
> 16:9], q=-1--1, 1500 kb/s, 25 tbn, 25 tbc
>     Stream #0.1(eng): Audio: libfaac, 48000 Hz, stereo, s16, 192 kb/s
> Stream mapping:
>   Stream #0:0 -> #0:0 (h264 -> libx264)
>   Stream #0:7 -> #0:1 (ac3 -> libfaac)
> 
> I have hunted to try and find where $aac_latm are defined so that I
> could change this to select the one I want(ac3) rather than reject the
> one I don't(mp2) but I can't find that anywhere
> 
> Any suggestions?
I have found at least 2 valid values for aac_latm & ac3 & dvb_subs, so
to try to define them all is to be reinventing the wheel, ffpmeg has to
be able to define them to use them so..

In a script without access to mythhelper functions, I think an approach
is to search for std ffmpeg keywords (ac3, audio, aac, aac-latm,
dvb-subtitle, teletext etc) with grep/awk in the ffprobe stdout.
You want to get the stream ids for each stream type required.

Then you can match the stream ids to the stream type, for eg:
"-map 0:#$aac_latm" & then "-c:a:p:$aac_latm libfaac"

There is something very odd about ffmpeg & copying one subtitle stream
when there are multiple..it will not work without a "-map 0:s:#ID" &
then a "-c:s:p:ID copy"

Note my mistake with the missing hash:
"-map -0:a:#$aac_latm"

Brett



More information about the mythtv-users mailing list