libstreaming icon indicating copy to clipboard operation
libstreaming copied to clipboard

Is it possible stream video file using this library?

Open Dhaval2404 opened this issue 9 years ago • 4 comments

I want to stream video file available from mobile device. Can I use this library to create stream from video file?

Dhaval2404 avatar Feb 09 '16 09:02 Dhaval2404

yes, use MODE_MEDIACODEC_API_2 to use opengl. Call stopPreview so you aren't using the camera. Then call mediaplayer.setSurface(new Surface(surface.getSurfaceTexture()) then play the video.

sbaar avatar Feb 09 '16 12:02 sbaar

Use MODE_MEDIACODEC_API_2 where? Call stopPreview where? Where do we give the path of the video/audio to be played?

Rishi16 avatar Feb 15 '16 01:02 Rishi16

Start with example three. Immediately after the session is built, set the streaming method like so session.getVideoTrack().setStreamingMethod(MODE_MEDIACODEC_API_2);

When you are ready to play the video, call session.getvideotrack().stopPreview();

Then create a mediaplayer the usual way according to the mediaplayer docs, call mediaplayer.setSurface(new Surface(sv.getSurfaceTexture)) where sv is the special surfaceview class that libstreaming uses. Then prepare the mediaplayer, then play it.

sbaar avatar Feb 15 '16 04:02 sbaar

I'm trying to use this library to either stream from a file or other video buffer and I'm having trouble removing all of the camera stuff.

devinbrown7 avatar May 30 '17 19:05 devinbrown7