Showing results for 
Search instead for 
Did you mean: 

Issues While Downloading Recorded Sessions Using MediaSense

Hi all,

     Hope you all will be fine. I have two very simple questions. I actually wants to download the sessions that I recorded using mediaSense.

1. Firstly, I converted the recorded session that was in RAW form to mp4 using Convert Session API. My First question is that as this API call is deprecated, so, now how we can convert RAW form to any useful format so that we may listen the recording ?

2. Secondly, I am login in MediaSense Server with default port that is '8440' and the URL returned by Convert Session API call to play recordings contains port '8081'. And when with this Port I make call to download this mp4 recording, I get 401-Unauthorized error. Can anybody guide me that what I am doing wrong ? or Simply how I can download the recorded session as I have gotten URL of mp4 format too of that session ? How I can authenticate myself to use this URL ?

Thanks in Advance :-)

dlender jwolf

27 Replies 27

Cisco Employee
Cisco Employee

The convertSession API is deprecated but not deleted, so you can still use it, at least for the next couple of releases.  However, we recommend you start using the single-step download instead.  This the mp4Url URL that you receive in the JSON data for the session.  The advantage of using the mp4Url of convertSession is that it only takes one HTTP request to fetch the converted recording.  That means you can actually enter it directly into a browser, or into a media player such as VLC.  With convertSession, you had to issue the convertSession request using Poster or using your own MediaSense API client program, then receive the URL for the converted MP4 file, and only then can you supply it to your web browser or your media player.

URLs that fetch actual recordings have to be password protected, for obvious security reasons.  These URLs therefore require that you make your HTTP request using standard HTTP-BASIC authentication headers, as described in RFC-2617 (  This RFC defines an HTTP header where you insert the username and password, encoded as base 64.  If you are using any standard 3rd party HTTP client library for your coding, it probably already has the ability to pass credentials in this way; it's very common.  Since you are receiving a 401-Unauthorized error,  it means you haven't sent credentials.

Thanks for your guidance and time. I have implemented this and it is

working for me now.

Thanks again

The same issue comes again if we talk about 'RTSP Urls'.

Firstly I tried this to play live streaming with Vlc Player by giving the

RTSP Url returned by the getAllACtiveSessions API Call, but I got the error

by Vlc Player that "Your input can't be opened: VLC is unable to open the

MRL 'rtsp://'."

I think this RTSP Url is in Raw form. Because if we remember, we cannot

play directly 'download Url' returned by getSessionsBySessionID API call

directly, there too we first convert the session using ConverSession API

Call. If this is how things happen then how can we Convert this RTSP Url in

Raw form to some useful form that may be streamed ?

Or how can we use this RTSP Url to monitor the live session ? By

programatically and through VLC player too by using RTSP URL ?


Yes, rtspUrl is similarly protected. It also requires HTTP-BASIC style authentication.  VLC doesn't have a way that I know of for you to preconfigure a set of user credentials.  However, it does have the ability to pop up a "Please enter username and password" dialog box when it receives the 401-Unauthorized error.  If you manually enter the credentials, VLC will resend its request to MediaSense and include the authentication header this time.  Are you not seeing the popup dialog?  Are you using the standalone version of VLC, or do you have it embedded into an application or web page?

Have you tried using the MediaSense built-in media player?  Take a look at the documentation for launchMediaPlayer, which is new in MediaSense 10.0.  It works better than VLC.  As described in the SRND, all off-the-shelf media players have various limitations.  VLC for example is only able to play one of the two audio streams at a time.

Come to think of it, that could be your problem.  Try this URL instead of the one in your example above:


- Jeff W.

Yes I am using standalone VLC Player and it prompts for authentication too. Actually issue here is not of authentication as that is successfully done. But, I think VLS is unable to render RTSP Url as error logs for VLC players shows the same that 'Nothing to Play'. I think I am missing conversion of RTSP URl in some usefull playable form such as mp4 as its url should be in form like: rtsp:// etc that we did in the case of download URI that we were unable to use that Download URi directly unless we converted that using Convert Session to useful form like mp4 ?

Or there is issue of appending TRACK # at the end of URL only ?

Secondly, I want to ask that how can we listen live calls in our java App, I think I will have to use Java Media Framework(JMF) or there is some other way too for this ?

And I think I can't use MediaSense Builtin VLC Player as we have MediaSense9 in our lab.

Thanks for your guidance and precious time

main debug: processing request item: rtsp://, node: Playlist, skip: 0

main debug: resyncing on rtsp://

main debug: rtsp:// is at 0

main debug: starting playback of the new playlist item

main debug: resyncing on rtsp://

main debug: rtsp:// is at 0

main debug: creating new input thread

main debug: Creating an input for 'rtsp://'

main debug: using timeshift granularity of 50 MiB, in path 'C:\Users\BIILAL~1\AppData\Local\Temp'

main debug: `rtsp://' gives access `rtsp' demux `' path `'

main debug: creating demux: access='rtsp' demux='' location='' file='\\\37145cbd4e8e81-TRACK0'

main debug: looking for access_demux module matching "rtsp": 12 candidates

live555 debug: version 2014.01.21

qt4 debug: IM: Setting an input

live555 debug: authentication failed

live555 debug: retrying with user=mediasense

live555 warning: RTP subsession 'audio/G722' failed (RTP payload format unknown or not supported)

live555 debug: setup start: 0.000000 stop:0.000000

live555 error: Nothing to play for rtsp://

main debug: no access_demux modules matched

main debug: creating access 'rtsp' location='', path='\\\37145cbd4e8e81-TRACK0'

main debug: looking for access module matching "rtsp": 20 candidates

main debug: net: connecting to port 554

main debug: connection succeeded (socket = 2152)

access_realrtsp debug: rtsp connected

access_realrtsp warning: only real/helix rtsp servers supported for now

main debug: no access modules matched

main error: open of `rtsp://' failed

main debug: dead input

main debug: changing item without a request (current 0/1)

main debug: nothing to play

qt4 debug: IM: Deleting the input

These Are the Logs generated by VLC when I tried to play a live session by giving RTSP URL. Such as:

After pressing play button I get this error.

I think Issue is same of conversion that VLC is un-able to render this URL.RTS in VLC.png

And If I try to play live streaming in my java App using Java Media Framework library, I get CannotRealizeException which generally means there's something wrong with your file... it can't be located, it's corrupted, it's unsupported, it's not a valid file, etc...

So, here too issue is with RTSP URL,

jwolfeld dlender jakohli banderson614 gmagsamen

If any one have worked with RTSP plz guide me that how can we play with RTSP URL programatically or using any player ?

You may share any code snipet you have.


It looks like you are trying to play a G.722 audio stream in VLC. 

live555 warning: RTP subsession 'audio/G722' failed (RTP payload format unknown or not supported)

VLC doesn't support G.722.  Try forcing your call to G.711, then it will record as G.711 and VLC should  be able to play it back.  As I think you already discovered, VLC also can only play one track at a time, so you have to add "-TRACK0" or "-TRACK1" to the end of the RTSP URL when you try to play it in VLC.

I have never used Java Media Framework, so can't help you there.

First of all thanks for your reply.

Secondly, I don't have idea of G.722 and G.711. To make the things more simpler, I just want to know that How I can listen/play Live sessions ? I want to listen both tracks at a time. I have web service listen for live sessions notifications. So, now I have RTSP URL for each live call And Now I just want to play this Live Session using this RTSP.

If you have worked with Live Sessions using RTSP URL, can you please guide me that how I can play this Live Streaming using RTSP URL ???

By using any means which fulfils my requirement.

Thanks a lot for your time and considerations once again.

I will wait for your response.


If you are using MediaSense version 10.0 or later, then you can call the launchMediaPlayer API, which takes the RTSP URL as a parameter.  launchMediaPlayer returns a body of content-type JNLP, which specifies a web start application.  You save that body as a file on disk with extension .jnlp, and then call Desktop.getDesktop().open(jnlpFile).  Assuming your desktop machine is properly configured to run Java web start applications (which it most likely is already), the MediaSense built-in player will be automatically downloaded from MediaSense and started, and it will then open and begin playing the RTSP streams.  However, as the player is a Java application, you will likely have to click through a couple of security warnings until you get to the point of installing trusted signed certificates into the MediaSense nodes.  But don't worry about that for now.

Be sure to check the SRND to make sure your particular combination of desktop operating system and codec (G.722) is supported by the media player.  But generally, MediaSense's media player covers many more cases with fewer caveats than any of the off-the-shelf media players such as VLC, all of which are really designed to play music, not telephone conversations.

I have implemented whole API using MediaSense v9.1 Is there any way to

fulfil my this requirement using version 9.1 ? It seems very basic thing

that if that API version is giving us RTSP URL then there will be some way

to play that too ?

Thanks for you guidance

Hi Bilal,

This is Manish from Mediasense team. Here are the thing you can try:

1. Download latest version of the quick time player to play the RTSP URL. It will ask for login credentials for connecting to Mediasense. Enter API user username and password.

2. In order to download MP4 file for a recording session, Open Search and play portal on Mediasense at the following URL and login with API user ad then go to particular session and click on Icon for download of Mp4 file:

https://<Mediasense server IPaddrss>:8440/mediasense

Let us know in case you face any issues or any further queries. we would be happy to assist.



Hi Manish,

Thanks for your assistance. I followed the steps you told me for playing active sessions but unfortunately I am not able to play live streaming. I got this JSON response of active session:

{"responseMessage":"Success: Your request was successfully completed.","responseCode":2000,"responseBody":{"sessions":[{"sessionState":"ACTIVE",","urls":{"rtspUrl":"rtsp://***.***.***.***/c9147e7fb625e1"}," ................}

After that In Quick Time Player I entered the url: ""rtsp://", After that on prompt I mentioned the credentials too that got verified too. After that I was expecting live streaming of active session whose RTSP URL I mentioned but my Quick Time Player gets stuck as follow:

Actice Session Streaming.png

The window says 'waiting for media' and counts down seconds. Once it reaches 0, where it normally starts playing, it say 'switching transports'. I left it for 15 minutes, and it still says it. It is like this for all quicktime streaming video on the net.

And I could not hear anything. Now, Please guide me if I am doing anything wrong ? Am I giving the right URL ? Do I need to mention the Track Number too in URL ?

Secondly, I want to play this streaming on my application media player ? How I can do that ?

Atleast I should be able to play this active session. Hope to listen from you soon.

Again thanks for your assistance and guidance