Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming and playing RTSP #1

Closed
rameezusmani opened this issue May 9, 2013 · 4 comments
Closed

Streaming and playing RTSP #1

rameezusmani opened this issue May 9, 2013 · 4 comments

Comments

@rameezusmani
Copy link

I am developing a simple app that let you record video/audio using this library and stream it over network. App has basically two SurfaceView (one for recording/preview and other for playback) . What I am doing is as follows

  1. Start RtspServer service
  2. Create SessionBuilder instance and configure it.
  3. Create a session using SessionBuilder and start it (for preview and recording)
  4. Create a MediaPlayer passing url "rtsp://127.0.0.1:8086" . Set the second Surface view for display and start
  5. Connection is made to RtspServer but when "SETUP" request is sent, RtspServer start() the session created by the same SessionBuilder (as of step 2) in DESCRIBE request. It throws error in play().

Kindly let me know simple way of achieving the task of recording and playback on same device using RTSP. I checked spydroid camera but its code is right now complex for me to understand as I m short of time.

@rameezusmani
Copy link
Author

I managed to fix this by removing first session.start in my code. But now when I use MediaPlayer to play rtsp stream. It only sends SETUP request for TrackID=0 (audio) ....it is not sending SETUP for video.
I deployed the app on Tablet and tried playing with VLC. Following are the output

  1. If both Audio and Video streams are present , VLC shows error about some "samr" audio or video format and cannot play. After some reading it shows that VLC do this for 3GPP format. But if possible please provide more details if i can fix it

  2. If only video stream is present, when VLC connects to tablet, i can see preview on tablet but no video is played on VLC and after few seconds VLC disconnects without any warning.

@baranyaib90
Copy link

I got the same problem.
I tried to play the RTSP stream from spydroid-ipcamera with Android MediaPlayer API.
In the log appears:
Server specified a non-absolute base URL, combining it with the session URL to get something usable...
Unsupported format. Ignoring track #1.
SETUP(1) completed with result -1010 (Unknown error 1010)

Can you please repair this URL problem?

Full log:
http://pastebin.com/UXvkxydh

Supported Media Formats hint:
http://developer.android.com/guide/appendix/media-formats.html
"For video content that is streamed over HTTP or RTSP, there are additional requirements:

  • For 3GPP and MPEG-4 containers, the moov atom must precede any mdat atoms, but must succeed the ftyp atom.
  • For 3GPP, MPEG-4, and WebM containers, audio and video samples corresponding to the same time offset may be no more than 500 KB apart. To minimize this audio/video drift, consider interleaving audio and video in smaller chunk sizes."

@fyhertz
Copy link
Owner

fyhertz commented Jun 13, 2014

Hi,

When you use the RtspServer, you don't have to create a session object, the session is created by the server.
Have you tried the example 1 ?

@fyhertz fyhertz closed this as completed Jun 13, 2014
@baranyaib90
Copy link

Hy!

Yes I tried example 1.
But MediaPlayer throw error for DESCRIBE command.
I tried to fix it, it worked.
But after that MediaPlayer does not recognise the video format from RTP packets.

Here is my little RTSP fix: http://pastebin.com/anjjbrnU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants