Streaming video from Android camera to server [closed] - android
Closed. This question needs to be more focused. It is not currently accepting answers.
Closed 1 year ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I've seen plenty of info about how to stream video from the server to an android device, but not much about the other way, ala Qik. Could someone point me in the right direction here, or give me some advice on how to approach this?
I have hosted an open-source project to enable Android phone to IP camera:
http://code.google.com/p/ipcamera-for-android
Raw video data is fetched from LocalSocket, and the MDAT MOOV of MP4 was checked first before streaming. The live video is packed in FLV format, and can be played via Flash video player with a build in web server :)
Took me some time, but I finally manage do make an app that does just that. Check out the google code page if you're interested: http://code.google.com/p/spydroid-ipcamera/
I added loads of comments in my code (mainly, look at CameraStreamer.java), so it should be pretty self-explanatory.
The hard part was actually to understand the RFC 3984 and implement a proper algorithm for the packetization process. (This algorithm actually turns the mpeg4/h.264 stream produced by the MediaRecorder into a nice rtp stream, according to the rfc)
Bye
I'm looking into this as well, and while I don't have a good solution for you I did manage to dig up SIPDroid's video code:
http://code.google.com/p/sipdroid/source/browse/trunk/src/org/sipdroid/sipua/ui/VideoCamera.java
I've built an open-source SDK called Kickflip to make streaming video from Android a painless experience.
The SDK demonstrates use of Android 4.3's MediaCodec API to direct the device hardware encoder's packets directly to FFmpeg for RTMP (with librtmp) or HLS streaming of H.264 / AAC. It also demonstrates realtime OpenGL Effects (titling, chroma key, fades) and background recording.
Thanks SO, and especially, fadden.
Here is complete article about streaming android camera video to a webpage.
Android Streaming Live Camera Video to Web Page
Used libstreaming on android app
On server side Wowza Media Engine is used to decode the video stream
Finally jWplayer is used to play the video on a webpage.
I am able to send the live camera video from mobile to my server.using this link
see the link
Refer the above link.there is a sample application in that link. Just you need to set your service url in RecordActivity.class.
Example as:
ffmpeg_link="rtmp://yourserveripaddress:1935/live/venkat";
we can able to send H263 and H264 type videos using that link.
Check Yasea library
Yasea is an Android streaming client. It encodes YUV and PCM data from
camera and microphone to H.264/AAC, encapsulates in FLV and transmits
over RTMP.
Feature:
Android mini API 16.
H.264/AAC hard encoding.
H.264 soft encoding.
RTMP streaming with state callback handler.
Portrait and landscape dynamic orientation.
Front and back cameras hot switch.
Recording to MP4 while streaming.
Mux (my company) has an open source android app that streams RTMP to a server, including setting up the camera and user interactions. It's built to stream to Mux's live streaming API but can easily stream to any RTMP entrypoint.
Depending by your budget, you can use a Raspberry Pi Camera that can send images to a server. I add here two tutorials where you can find many more details:
This tutorial show you how to use a Raspberry Pi Camera and display images on Android device
This is the second tutorial where you can find a series of tutorial about real-time video streaming between camera and android device
Related
display video from h264 stream of an ip camera in android
In my ndroid application, I need to display H264 streams from a GrandStream IP Camera. I saw some topics about decoding H264 frames with MediaCodec in Android, but I really don't know where to start. Before searching this topic, I thought that there were planty of open source library for that purpose but It seems there is not! Can you show me a way where to start? Should I use Android's MediaCodec or is there any open source Java library for that?
You can refer to this site, It has a very thoroughly discussion and sample about Android Media Codec
Recording and watching video live streaming using red 5 and rtsp for android
I have spent enough time searching for a solution but I am not sure which way I should go. That is why I am asking question here. I want to make an application from where I can record a video and same video will be shown live on any other device connected to the network or it can be on web using JWplayer or some thing like that. Now I have done enough R&D and we are not considering WOwza server (as it is paid) . So on web side we have already implemented in which web cam in recording video and which can be seen on our web site and also on android and iphone browsers live. But problem with red 5 is that is does not give support to RTSP (it only supports RTMP) unlike Wowza which handles RTSP internally and convert it into RTMP. I have found few links who suggested client side RTMP handling what so far no success. Convert video Input Stream to RTMP This links explains lot of things but I am not sure which way I should spend my time or it is possible to convert RTSP into RTMP for red 5 server. https://play.google.com/store/apps/details?id=air.Broadcaster this guy has achieve this functionality I guess but we are looking for the native application. Please suggest me in the right direction I should go and invest my time live record and watch video stream. We can use other servers which are open source rather than red 5 , if it fulfill my needs on both iOS, android and web else I ll have to go with wowza which I dnt want for now.
Get frame from live video stream
I am streaming live video from my camera on my android phone to my computer using the MediaRecorder class. recorder.setCamera(mCamera); recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setOutputFile(uav_UDP_Client.pfd.getFileDescriptor()); recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264); That's the basic idea. So I would like to show this stream in real time. My plan is to use FFMpeg to turn the latest frame into a .bmp and show the .bmp on my C# program every time there is a new frame. The problem is there is no header until I stop the recording. So I can not use FFMpeg unless there is a header. I've looked at spydroid and using RTP but I do not want to use this method for various reasons. Any ideas on how I can do this easily?
You can consider streaming a MPEG2 TS and playing it back on your screen or you can also stream H.264 data over RTP and use a client to decode and display the same. In Android, there is a sample executable which performs RTP packetization of H.264 stream and streams it over the network. You can find more details about the MyTransmitter from this file, which could serve as a good reference to your solution. Additional Information In Android 4.2.0 release onwards, there is a similar feature supported by the framework called Miracast or Wi-Fi Display which is standardized by Wi-Fi forum, which is a slightly complex use-case.
Convert video Input Stream to RTMP
I want to stream video recording from my android phone to network media server. The first problem is that when setting MediaRecorder output to socket, the stream is missing some mdat size headers. This can be fixed by preprocessing that stream locally and adding missing data to stream in order to produce valid output stream. The question is how to proceed from there. How can I go about output that stream as an RTMP stream?
First, let's unwind your question. As you've surmised, RTMP isn't currently supported by Android. You can use a few side libraries to add support, but these may not be full implementations or have other undesirable side effects and bugs that cause them to fail to meet your needs. The common alternative in this case is to use RTSP. It provides a comparable session format that has its own RFC, and its packet structure when combined with RTP is very similar (sans some details) to your desired protocol. You could perform the necessary fixups here to transmute RTP/RTSP into RTMP, but as mentioned, such effort is currently outside the development scope of your application. So, let's assume you would like to use RTMP (invalidating this thread) and that the above-linked library does not meet your needs. You could, for example, follow this tutorial for recording and playback using Livu, Wowza, and Adobe Flash Player, talking with the Livu developer(s) about licensing their client. Or, you could use this client library and its full Android recorder example to build your client. To summarize: RTSP This thread, using Darwin Media Server, Windows Media Services, or VLC RTMP This library, This thread and this tutorial, using Livu, Wowza, and Adobe Flash Player This client library and this example recorder Best of luck with your application. I admit that I have a less than comprehensive understanding of all of these libraries, but these appear to be the standard solutions in this space at the time of this writing. Edit: According to the OP, walking the RTMP library set: This library: He couldn't make the library demos work. More importantly, RTMP functionality is incomplete. This thread and this tutorial, using Livu, Wowza, and Adobe Flash Player: This has a long tutorial on how to consume video, but its tutorial on publication is potentially terse and insufficient. This client library and this example recorder: The given example only covers audio publication. More work is needed to make this complete. In short: more work is needed. Other answers, and improvements upon these examples, are what's needed here.
If you are using a web-browser on Android device, you can use WebRTC for video capturing and server-side recording, i.e with Web Call Server 4 Thus the full path would be: Android Chrome [WebRTC] > WCS4 > recording So you don't need RTMP protocol here. If you are using a standalone RTMP app, you can use any RTMP server for video recording. As i know Wowza supports H.264+Speex recording.
Live video feeds in my own android application
I would like to develope a application for viewing a IP camera , DVR video feeds from my own application. Can anyone please tell me the best possible way to achieve it so that the delay is as minimum as possible. What all servers are required to stream the video the formats etc..
androidfan , I believe you need to setup a media server to send & receive video streams. Red5 will be a good option in your case. Red5 is an Open Source Flash Server written in Java that supports: Streaming Video , Audio & RTMP protocols.