Lose audio control in case of playing RTSP with streaming,help me please!

This forum is about all development around libVLC.
spirix
New Cone
New Cone
Posts: 3
Joined: 22 Feb 2019 16:18

Lose audio control in case of playing RTSP with streaming,help me please!

Postby spirix » 22 Feb 2019 17:17

Hi all,
First time coming here.
when I use libVlc library to develop my application on whidows 7, I wanna finish the fuction as following:
1.play a rtsp on the screen
2.at the same time, saving the video contents from RTSP into a local file such as "D:\1.mp4"

so, I did the following programing:(*not very suitable in programming grammar description,just focus on the meaning)
1.Media = libvlc_media_new_location(RTST_URL); // creating media

2.libvlc_media_add_option(Media, optionString); //use duplicate option for streaming to local file when playing
optionString ==> :sout=#duplicate{dst=display,dst="std{access=file,mux=mp4,dst='D:\\1.mp4'}"} :sout-all :sout-keep

3.MediaPlayer = libvlc_media_player_new(VlcInstance); // creating media player

4.libvlc_media_player_set_media(MediaPlayer,Media ); //set media to player

5.libvlc_media_player_play(MediaPlayer); //play the media

As program running result, it works well(video is playing on screen, sound of video playback on speaker normally,video recoding is ok , and record file (1.mp4) is OK too!).
however, I cannot control sound of playing video on screen (such as set mute, change volume ,etc) by libvlc API: libvlc_audio_set_volume(MediaPlayer) and libvlc_audio_set_mute(MediaPlayer).

Is this a bug of libvlc? Otherwise how can I do to control the sound in this case?

waiting for answers!

B.T.W: Without using streaming when playing (donot setting the duplicate option), the APIs works very well!(video playing is ok, audio control is OK too)

spirix
New Cone
New Cone
Posts: 3
Joined: 22 Feb 2019 16:18

Re: Lose audio control in case of playing RTSP with streaming,help me please!

Postby spirix » 22 Feb 2019 18:12

Supplement:
Developing Environment: Microsoft VS 2015
Libvlc liarbry version : 3.0.5

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Lose audio control in case of playing RTSP with streaming,help me please!

Postby mfkl » 25 Feb 2019 03:52

Hmmm can you try using 2 mediaplayers?
https://mfkl.github.io

spirix
New Cone
New Cone
Posts: 3
Joined: 22 Feb 2019 16:18

Re: Lose audio control in case of playing RTSP with streaming,help me please!

Postby spirix » 25 Feb 2019 09:16

you mean make two player instance ,one is for display another for recording? if that,it will create 2 connection to server,ritht? if my understanding is right, it will cost twice Wide-Band need, it's not ok in my enviroment, because band wide of my environment is no very good.
so , local duplicating is necessary in my case.
Like following:
sever -----> pull scream (once only)-----> client ----->duplicating data --------> display & record

Anyway, Thanks for you answering! @mfkl


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 28 guests