Page 1 of 1

Choose audio stream in video file

Posted: 09 Dec 2011 12:23
by kangaroo
hello everyone. I hesitate, where can I start? I have a problem, I need to integrate video-option in my software and i need to provide user ability to choose audio stream in video file... would it be correct to ask somewhat here on forum? for now i'm using standard delphi 7 - Media Player. I would need to use other common interfaces like start/stop/change position... is there any chances that I'm in a proper place to ask and is there any hope to get help?
Sorry my English. in what theme/branch/segment should i ask such question?

Re: Choose audio stream in video file

Posted: 12 Dec 2011 03:38
by kangaroo
Thank you, for relocating my question.

Re: Choose audio stream in video file

Posted: 12 Dec 2011 04:18
by kangaroo
let me explain the aim of my project. Obviously, I'm making a program for learning English. The idea is simple - provide ability to user to choose his own vocabulary from text to remembering words. But I would like to make it work with a video-content and subtitles. often videofiles and dvd contain a row of audio streams. especially it is true in non English speaking countries like mine. So I need to make an ability to choose an english audio in my player.

Re: Choose audio stream in video file

Posted: 12 Dec 2011 05:19
by devildrey33
Im not sure, but maybe you need libvlc_audio_set_track function to change audio track on a media.

Re: Choose audio stream in video file

Posted: 14 Dec 2011 10:57
by kangaroo
no... for some reason it returns -1 like there was an error.
I've tried with *.MKV and *.AVI files.

all the others like "libvlc_media_player_set_time(p_mi, 66500);" is working.

I've downloaded "PasLibVlc.zip" (http://sourceforge.net/projects/paslibvlc/) but it wasn't work with delphi-7, thus i commented all lines with compiling errors... it may cause a problem, i know, but i don't see another solution.
I did download a latest version of VLC, too.

Re: Choose audio stream in video file

Posted: 20 Dec 2011 04:34
by kangaroo
I've tried it twice and check the code I've commented... it is not working and it is not related to a code I've commented.
I presume there is a bug in source code.

Would anyone, please, test the functions
"libvlc_audio_set_track"
and
"libvlc_audio_get_track_count"
and
"libvlc_audio_get_track"

And share a result with configuration of testing system...

I've tried it in (win 7 / XP) + (delphi 7) + (Videolan 1.1.11)
But it doesn't work with the aforementioned functions.
Many other functions work perfectly like
libvlc_audio_set_volume and libvlc_media_player_set_time

PS
Videolan 1.1.11 - is working perfectly and changes audio tracks from interface even with "b" (hot key)...

Re: Choose audio stream in video file

Posted: 20 Dec 2011 14:33
by Jean-Baptiste Kempf
Try VLC 1.2

Re: Choose audio stream in video file

Posted: 23 Dec 2011 10:25
by kangaroo
There is no official announce of such version on official site there http://www.videolan.org/vlc/download-windows.html
I'm do not sure that there is no viruses on other sites. Can you show me reliable source for downloads?
I would try older version with pleasure in case there would be some...

Re: Choose audio stream in video file

Posted: 26 Dec 2011 04:17
by kangaroo
Eventually I made it work (partially).

But with ActiveX component

Code: Select all

VLCPlugin21: TVLCPlugin2; ... VLCPlugin21.playlist.add(... VLCPlugin21.playlist.play; VLCPlugin21.input.Time := 60000; VLCPlugin21.audio.track := 2;
But for some reason it works only with Windows 7... (it refuses to work with Windows XP)...

PS
it is still (delphi 7) + (Videolan 1.1.11)

Re: Choose audio stream in video file

Posted: 26 Dec 2011 04:40
by kangaroo
even in win 7 I have a problem with shutting down my software.
But it is not constant situation.

this is a kind of destructor I've made

Code: Select all

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin VLCPlugin21.playlist.stop; //application.ProcessMessages; // it does not help // the soft just hanging there... VLCPlugin21.playlist.clear; VLCPlugin21.Destroy; end;
the only way i can close it is

Code: Select all

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin if VLCPlugin21.playlist.isPlaying then begin Action := caNone; Timer1.Enabled:= true; exit; end; VLCPlugin21.playlist.clear; VLCPlugin21.Destroy; end; procedure TForm1.Timer1Timer(Sender: TObject); begin Timer1.Enabled:= false; VLCPlugin21.playlist.stop; application.ProcessMessages; sleep(100); Form1.close; end;