How to host a video locally in Android - android

I am working on a app that host a video(.mp4) from a primary
Android device.
Say in http://192.168.43.88:8080/*.mp4 and the secondary device
connected using wifi will be able to stream the video (with a MediaController object and MediaPlayer)
I am have trouble finding any such example codes for selecting a video and hosting it from the Android device.
Here are some question I looked at
Stream live video from phone to phone using socket fd
https://code.google.com/p/ipcamera-for-android/

it may be easier to have a webhost on your phone on said port that opens up to a flash player that plays whatever video you've linked or is in a specific folder. an ip camera would only broadcast your camera. to play or stream a video, you need a video player. either the host (your phone) would need to have a video player on a web server.. or the client's browser (your computer) would need an mp4 player, else the file would just download from your phone to the computer. for the flash player, you could make it full screen and thus make it look nice.

Related

Stream multiple langauges audio from a playing video on a local live-streaming server

I have a case where I need to have a video being played repeatedly (looped) on a server (that video is being showed on a connected screen) and a client on the same wireless network that can get the current playing video audio stream/s in-sync with video that is being played on the server (the video may have multiple languages or could be linked with multiple audio files that needs to be streamed in-sync to that playing video).
Is there a Nodejs package or a library that I can use to achieve this scenario? and a streaming protocol/server that is easy to use or program those features in the client without too much hassle with the sync and stream?
I'm looking for support on the client side for mobile devices (preferably browser dependent) that can get the stream with Javascript (which is the simpler for me) or something else and potentially run as an full-screen app on the mobile device.
My plan is to have an app on mobile devices where a user can chose a language and video playing on screens to listen to in-sync with the video, like choosing a channel where they can connect to and listen to the audio of that video over the wireless network, So I'm looking for a way or a solutions to program this.
Thanks!

How to use android cam as security surveillance cam for live video streaming like IP Cam app

I wanna build an app that will use android camera video and stream it to another android phone or on the web. I don't wanna do it through my Wifi, but i want the cam streaming to be broadcast live anywhere in the world.
Can anyone help me getting an overview of the android classes or APIs that will be helpful doing this task?
You can't stream live video from a phone directly to another phone, there are just too many possible differences between any two given devices.
To do this you will need to have a publicly accessible server, (that you have control of) running a streaming engine, such as Woza: https://www.wowza.com/products/streaming-engine The source phone sends video to the server, and the destination phone receives video from the server.

Play music/video from a phone to another phone

In Android, is there anyway to play a music/video file via another phone like Apple airplay?
I think vlc can create a media server via rtsp protocol for another phone to get the stream and play it. But perhaps only computer versions of vlc can create media server.

how to record video in one device at that same time play that video live in another device

I have to record video by using camera in one android device,at that same time i have to play that recording video live in another android device.what should i do for recording video and playing at same time in another device.
What you need to do is create a thread for recording a video and in the same time stream it to the next device using a TCP socket connection. you can have the full code for this in the spy-droid application ,go here https://code.google.com/p/spydroid-ipcamera/ in this spydroid application that have created this live video streaming server that can be accessed from any device or any computer by simply typing the ip and port number in the browser itself. after downloading the spydroid source code you can import the packages to your project and can use them in your project

Capture IP Camera Stream and Publish on my Website

I am using IP Cam (an app for android phones) to stream live video. It basically functions as a basic IP camera. It gives me a URL where the feed is. It looks like this http://192.168.2.32:8080/ when I'm connected to my WiFi network. The video stream is at http://192.168.2.32:8080/videofeed.
I want to capture the video feed of the camera which is at http://192.168.2.32:8080/videofeed and embed it in an HTML5 player (the one I plan to use is Video JS) or a Flash player if the HTML5 doesn't work (prefer HTML5 though). The HTML5 player is asking me for a source file (such as .mp4, webm, mov, etc) but at http://192.168.2.32:8080/videofeed there is no source file. It's just HTML stream.
My question is how to I embed that video stream into my HTML5 player and post it on my website.
From what I could see, the streaming is already made by the app to a webpage and this page has the video for you to see. So you want to stream something that's already streaming.
You could try to signup for a dynamic dns like www.no-ip.com to get a url for your network, change your router to accept incoming connection on port 8080 and then use an iframe on your website with the dynamic dns url.
I used to stream a lot of live concerts to websites, but I had a camera connected to a computer and using Adobe Flash Media Streaming (free) connected to a server running Wowza streaming.
You need to get the data that camera is capturing decode it to some common format.
RGB or YUV2 or whatever. Encode it to Vp8/webm or thora/ogg . h264/Mp4 wont do it as it needs a special header in the mp4 file called mdat(unless it is fragmented mp4).
Client video tag makes the request to your phones ip/where you handling the http GET for that app hold that http connection and start streaming to it. This is sort of like long polling.
Most IP cameras have a way to get the raw stream of video. Using RTSP or RTMP
I suggest you get the steeam URI for the «camera», which would be something like rtsp://<camera-ip>:<some-port> or rtmp://<camera-ip>:<some-port>. That is a common feature of IP cameras, even those emulated on a phone, so probably it is mentioned on the docs or can be enable/set on the app configuration.
If there is no documentation, you can do some research by using Chrome to access the feed on the webpage and open the developer tools to see the actual code for the page, the URI may be visible on the embedded player they provide.
Once you get it, open that stream with VLC and see the properties (encoding, framerate, size, etc) and with that you can choose a compatible embedded player for your site.
Hope it helps!
///Pablo

Categories

Resources