[vlc-devel] Patch to filter audio PIDs by --audio-language in TS streams

Mark Paulus mark.paulus at verizonbusiness.com
Fri Sep 21 19:37:25 CEST 2007


Hi,

Attached are 2 patches that I have created against 
the trunk.

The purpose is to allow for the use of the --audio-language
command line option to limit out certain audio streams
from a TS file.

Some background:

I have a mythtv setup that captures DVB TS streams from 
an Avermedia AV180 QAM capable card.  I also have a 
Hauppauge MVPMC front-end for my mythtv system.

Due to certain limitations of the MVPMC device (namely,
proprietary libraries and no data-sheets), there are 
many struggles with playing TS with AC3 audio streams 
and keeping the A/V streams in sync.  So, I was looking
for the best transcode option, and vlc offers it with this
set of options:

vlc -I dummy -vvv "$whole_filename" --sout-all --audio-language eng --sout "#transcode{acodec=mp2a,ab=192,scale=1,channels=2,deinterlace,audio-sync}:std{mux=ps,access=file,dst=\"/var/video/tmp/$filename.tmp\"}" --file-logging vlc:quit >> $logfile 2>&1

However:
Some of the streams (notably stuff from Toon Disney channel) have 2 audio streams, 
spa & eng.  My MVPMC device gets confused with this.
I have also seen several other requests to be able to 
"filter out" certain PIDs from a TS while transcoding,
and the latest applicable reply I saw seemed to imply that
one should "quit whining and start coding".  So, here is
my coding attempt to solve the problem.

The ts patch filters out the stream on the demux side.
The ps patch would be redundant in this case, as it
will filter out on the outbound re-muxing side.  

This is hopefully a starting/discussion point, as if it
looks good, then perhaps I might be interested in adding
filtering in the demuxer to drop PIDs by pid.  But, 
that would require more work, and probably the addition
of another module option, such as --sout-ts-pid-list <string>
which would be a comma-delimited list of PIDs to keep.
Which wouldn't be quite as useful in a batch type environment
as it would require an inspection of each stream beforehand
to figure out which pids to keep.  The solution I have
proposed will hopefully be more automated, as one needs to
merely know one's location/language, and then only get the
relevant streams.  And, it can be overridden by specifying
another language using the --audio-language option.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ts.svn-diff
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070921/3bd5b923/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ps.svn-diff
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070921/3bd5b923/attachment-0001.ksh>


More information about the vlc-devel mailing list