Log in

View Full Version : Choose audio track


fenomeno83
5th August 2010, 11:11
I have a h264 movie in m2ts format with multiple audio tracks.
Player that I use don't support multiple tracks, but see only the first.
Can I Use some avs script to choose a particular track (for example the second). Thanks

fenomeno83
5th August 2010, 23:59
???????

LoRd_MuldeR
6th August 2010, 00:10
Totally depends on the individual source filter you are using in your AVS script:
* With FFAudioSource() there is a parameter to choose the track, see the FFM2 documentation!
* With DirectShowSource() it will depend on the individual DirectShow demuxer that is used, e.g. HaaliMediaSplitter allows switching tracks from its tray icon
* With DGAVCDecode you would choose/demux the audio track in DGAVCIndex and load it separately with something like NicMPG123Source()

Try like this:
V = FFVideoSource("C:\Some Folder\Whatever.m2ts")
A = FFAudioSource("C:\Some Folder\Whatever.m2ts", track=666)
AudioDub(V, A)

fenomeno83
6th August 2010, 11:48
thanks for reply!
I tried ffmpegsource2 as your script but player crash on 1080i h264 m2ts movie.
I tried directshowsource and video works: video is decoded by coreavc, audio by ffdshowaudio and splitter is haali; i tried to change pid audio in haali options but doesn't work(or maybe I didn't make correct action).
I didn't try the third solution.

So, here there is 10 seconds of videos cutted with tsmuxer.
Can you see and give me a working script?
thanks!!!
http://www.zshare.net/download/7906269994e0fb68/

tebasuna51
6th August 2010, 13:45
...
Can you see and give me a working script?
Your m2ts file:
M2TS, 1 video track, 8 audio tracks, 0:00:10, 50i
1: h264/AVC, 1080i50 (16:9)
2: AC3, Italian, 5.1 channels, 384kbps, 48kHz, dialnorm: -23dB, 1ms
3: AC3, Italian, 2.0 channels, 192kbps, 48kHz, dialnorm: -24dB, 1ms
4: AC3, Italian, 2.0 channels, 192kbps, 48kHz, 1ms
5: AC3, Italian, 2.0 channels, 192kbps, 48kHz, 1ms
6: AC3, Italian, 2.0 channels, 192kbps, 48kHz, 1ms
7: AC3, English, 5.1 channels, 448kbps, 48kHz, dialnorm: -24dB, 1ms
8: AC3, 2.0 channels, 128kbps, 44.1kHz, 21ms
9: AC3, Italian, 2.0 channels, 192kbps, 48kHz, 8ms

The LoRd_MuldeR script work for (player mpc-hc) me using track=6 for 7: AC3, English, 5.1 (6th audio)

fenomeno83
7th August 2010, 01:38
so, this is my results:
I need to working to stereoscopic player.

If I use ffmpegsource2, decoding in not efficient: in 10 seconds cutted movie that i posted(test.m2ts)after some seconds video starts, but drops several frames; on original big video instead cause crash of player.

I prefer have decoding from an efficient avc decoder,as coreavc for example (or also divx avc..it's the same)..so if I use directshowsource will be decoding in my case by coreavc, but in haali media splitter or ffdshowaudiodecoder I don't know how change audio tracks.

The other solution is use DGAVCDECODe, but I don't know how make script to choose audio track in this case and also if dgavcdecode is efficient as coreavc or divxavc on m2ts h264 1080i movie

fenomeno83
7th August 2010, 10:36
tried also dgavcdecode, but decoding is slow.

So, the best solution is directshowsource because I can use coreavc decoder for example. But i didn't understand how select audio

b66pak
7th August 2010, 18:24
try this:
V = DirectShowSource("C:\Some Folder\Whatever.m2ts", audio=false)
A = FFAudioSource("C:\Some Folder\Whatever.m2ts", track=6)
AudioDub(V, A)
_

LoRd_MuldeR
7th August 2010, 18:41
try this:
V = DirectShowSource("C:\Some Folder\Whatever.m2ts", audio=false)
A = FFAudioSource("C:\Some Folder\Whatever.m2ts", track=6)
AudioDub(V, A)

...or:

V = DSS2("C:\Some Folder\Whatever.m2ts")
A = FFAudioSource("C:\Some Folder\Whatever.m2ts", track=6)
AudioDub(V, A)

mariner
21st September 2012, 11:40
Greetings.

Struggling to get the script to work with clip with two AC/3 audio streams. Appreciate any help.

v=DirectShowSource("mastiff.m2ts",audio=false)
a=FFaudioSource("mastiff.m2ts",track=2)
audiodub(v,a)


mastiff.m2ts (http://www2.zshare.ma/wlvmoq0cuihx)
mastiff.m2ts (http://depositfiles.com/files/typlphevm)
Original post (http://forum.doom9.org/showthread.php?p=1592221#post1592221)

Edit:
1. Audio track 2 playable by enabling raw codec in FFdshow audio decoder.
2. Audio track 1 not playable, error message: "FFaudioSource : audio stream not seekable."