Project

General

Profile

Audio Stream Filter - by number of input audio channels / or bps?

Added by Jiří Rameš over 7 years ago

Hello,

I have a question - problem with my DVB-T stream. I want to do recordings with transcoding, but DVB-T in CZ has one problem. TVHeadend is unable to distinct between real audio track and audio description (AD) track. So I have sometimes recordings without audio, because the correct track is sometimes the first one in the stream and sometimes it is the second one. So, there is no possible option in Audio Stream Filters to select correct one.

Both tracks are MPEG2AUDIO, both "cze" language. I can identify correct one only by bps (audio is 192kbps, AD is 64kbps) or by number of available audio channels (audio is Stereo, AD is Mono). But Audio Stream Filter setting cannot do that.

Does anybody have some idea how to solve this? Would it be easy/hard to add a possibility to e.g. filter by audio quality (prefer better one, or just prefer specified bps - 192kbps). Or filter by Mono/Stereo?

Or on the other hand - would it be possible to do a transcode with all audio tracks included (not only the first one) ? That would also solve my problem.

Can anything of this be achieved without development changes? Thanks for any reply/idea/anything... I would appreciate any help :-)


Replies (4)

RE: Audio Stream Filter - by number of input audio channels ? - Added by Mark Clarkstone over 7 years ago

Use the service information to find the audio index & filter that.

For example:

To remove the second audio track, in the audio filter dialog, I would enter 3 for "stream index" & set the action to ignore.

RE: Audio Stream Filter - by number of input audio channels / or bps? - Added by Jiří Rameš over 7 years ago

The problem is that Index is not stable, even the PID is not stable.

Sometimes Index 1 PID 68 is the correct one, sometimes Index 2 PID 69 is it. So I cannot simply tell it to take Index 1 on Index 2. Looks a little bit random to me - maybe the MUX provider is just crazy :-/

RE: Audio Stream Filter - by number of input audio channels / or bps? - Added by Mark Clarkstone over 7 years ago

Jiří Rameš wrote:

The problem is that Index is not stable, even the PID is not stable.

Sometimes Index 1 PID 68 is the correct one, sometimes Index 2 PID 69 is it. So I cannot simply tell it to take Index 1 on Index 2. Looks a little bit random to me - maybe the MUX provider is just crazy :-/

This isn't the whackest thing I've seen.

I think your only option now is to use a post-recording script that uses ffmpeg to strip them out.

RE: Audio Stream Filter - by number of input audio channels / or bps? - Added by Jiří Rameš over 7 years ago

Thanks for ideas:) I finally found a solution in pipes.

Short version:
Pass the DVBT stream through ffmpeg, it will automatically select the best audio stream possible.

Long version:
pipe://ffmpeg -f mpegts -analyzeduration 0 -probesize 150000 -i http://192.168.7.55:1122 -f mpegts -vcodec copy -acodec copy pipe:1

- DVBT2IP transformation is done using VLC.exe on Windows PC :-)
- Connection between VLC and TVH is done using that ffmpeg pipe

It is a solution because the default behavior of ffmpeg is to use only 1 video and 1 audio stream - the stream with most audio channels is used first. This exactly solves my situation where audiodescription is Mono and normal audio is Stereo. By passing the stream using pipe through ffmpeg, the correct audio stream is always used and the audiodescription track is always stripped away.

    (1-4/4)