I am trying to make an android media player which should play the media from network stream. I know it can play media that is streamed on RTSP or HTTP but my case is different.
I am not having any media streaming server and if I intend to use one, then I will have to modify it.
What I am trying to do is to stream the video that is being captured from android camera to the server, do little bit of modification in the video (like change color or apply some effect, etc) and stream it back to the phone. So typically my screen is divided in 2 parts, one is for upstreaming and other shows down streamed video.
Now what I am doing is capturing the video on sdcard and at the same time I am reading it and streaming it to the web. On web part, I am capturing the video (saving it in file [I am also able to play the video on the server]) and sending it back to the phone. On phone I am able to receive it but I am not able to figure out how to convert this stream to the proper format so that I can play it in VideoPlayer
.
I also found that MediaPlayer
provides some method to play the video from FileDescriptor
so can I create a FileDescriptor
from the socket and pass it to MediaPlayer
? Will this method work? Is it possible to do it without RTSP or HTTP?
try to use this