Choose audio stream in video file

This forum is about all development around libVLC.
kangaroo
New Cone
New Cone
Posts: 8
Joined: 09 Dec 2011 11:57

Choose audio stream in video file

Postby kangaroo » 09 Dec 2011 12:23

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?

kangaroo
New Cone
New Cone
Posts: 8
Joined: 09 Dec 2011 11:57

Re: Choose audio stream in video file

Postby kangaroo » 12 Dec 2011 03:38

Thank you, for relocating my question.

kangaroo
New Cone
New Cone
Posts: 8
Joined: 09 Dec 2011 11:57

Re: Choose audio stream in video file

Postby kangaroo » 12 Dec 2011 04:18

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.

devildrey33
Blank Cone
Blank Cone
Posts: 11
Joined: 07 Dec 2010 17:06
Operating System: Windows & Linux
Location: Spain

Re: Choose audio stream in video file

Postby devildrey33 » 12 Dec 2011 05:19

Im not sure, but maybe you need libvlc_audio_set_track function to change audio track on a media.
http://www.devildrey33.es

kangaroo
New Cone
New Cone
Posts: 8
Joined: 09 Dec 2011 11:57

Re: Choose audio stream in video file

Postby kangaroo » 14 Dec 2011 10:57

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.

kangaroo
New Cone
New Cone
Posts: 8
Joined: 09 Dec 2011 11:57

Re: Choose audio stream in video file

Postby kangaroo » 20 Dec 2011 04:34

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)...

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Choose audio stream in video file

Postby Jean-Baptiste Kempf » 20 Dec 2011 14:33

Try VLC 1.2
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kangaroo
New Cone
New Cone
Posts: 8
Joined: 09 Dec 2011 11:57

Re: Choose audio stream in video file

Postby kangaroo » 23 Dec 2011 10:25

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...

kangaroo
New Cone
New Cone
Posts: 8
Joined: 09 Dec 2011 11:57

Re: Choose audio stream in video file

Postby kangaroo » 26 Dec 2011 04:17

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)
Last edited by kangaroo on 26 Dec 2011 07:23, edited 1 time in total.

kangaroo
New Cone
New Cone
Posts: 8
Joined: 09 Dec 2011 11:57

Re: Choose audio stream in video file

Postby kangaroo » 26 Dec 2011 04:40

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;


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 11 guests