I'm try to send the video stream from gopro to android.
I connect and manage the gopro via http thanks to guide of KonradIt https://github.com/KonradIT/goprowifihack
With ffmpeg android library we managed the streaming
http://writingminds.github.io/ffmpeg-android-java/
but i can see only the information about the frame and i can send the
stream to my computer (attacched to gopro) and see it with vlc.
The ffmpeg command launched from the application android is:
ffmpeg -an -f:v mpegts -i udp://:8554 -an -f:v mpegts udp://10.5.5.101:8555
But we want see the stream directly on app android.
How can do it?
Related
I'm trying to implement a simple system to stream voice from microphone to an Android app.
To stream, I used the ffmpeg program.
I tried the following command:
ffmpeg -ar 48000 -f alsa -i hw:0 -acodec mp2 -b:a 384k -f rtp rtp://127.0.0.1:1234
and I was able to start the server.
Then, I used the command:
ffplay rtp://127.0.0.1:1234
and everything worked properly.
Now I need to play this stream in an Android mobile app.
I saw this code somewhere in stackoverflow:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("rtsp://192.168.0.100"));
startActivity(i);
but the app crashed, stating that:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=rtp://192.168.0.100:1234
Can anyone help me with the Android code to play the stream?
Plus, am I using the right protocol (RTP) or should I use RTSP?
Thank you.
I am using the libstreaming library for Android. I wish to use the RTSP client in the library to stream video to a VLC server. I'm not sure how to setup the VLC server on the command line to receive the stream from the Android phone.
Let's say that I want to run the VLC server on port 5444 and I want to save the stream from the Android to a file called test.mp4. How would I do this?
I want to stream a live webcam video and display it on android device with the lowest latency possible. I am streaming video from a computer over rtsp protocol and I am able to watch the stream with ~150ms latency on the second computer using ffplay -fflags nobuffer rtsp://xxx.xxx.xxx.xxx:port/test.sdp command.
So far I have successfully compiled ffmpeg4android library. Unfortunately this library uses NDK which I am not familiar with. All I want to do is to be able to invoke the same command and display the video on the android SurfaceView.
How can I call for such command?
I am creating app to send audio to icecast server. Here I connected to icecast server and sending the audio data to server. But Streaming seen on server, but it is not playing in browser Why?
Is there need to encode that data to any format?
If you're having problems with a web-based player you need to be a lot more specific about what you're trying to do and provide some code for us to look at.
You should also confirm the stream is playing correctly in a compatible desktop app first.
Go to http://example.com:8000/admin and verify the mount point you're sending to is listed (which indicates it has a connected source) - if it is there will be an M3U (for streaming MP3) and XSPF (for Ogg) link on the right which you can use to test.
Playback of Icecast streams on Android requires installation of the Just Playlists app or an equivalent.
The problem was i am sending the audio PCM data to server.Now i encoded that PCM data to ogg format to send on server.Now it's working perfectly.
The problem is with the audio encoding. Set encoding data as follows
Capture device inputs
ffmpeg -list_devices true -f dshow -i dummy
Set input from device or other protocol.
Example:
ffplay -f dshow -i audio="Microphone (FaceCam 1000X)"
Then stream
ffmpeg -stats -report -f dshow -i audio="Microphone (FaceCam 1000X)" -c:a flac -compression_level 10 -ar 192000 -legacy_icecast 1 -content_type application/ogg -ice_name "Optional Name" -f ogg icecast://source:password_for_streaming#127.0.0.1:8000/live.ogg
I have spent quite a while (past week) trying this to little avail. However, what I want seems completely unheard of. So far, I have reviewed recommendations available through google, which include encoding a static file into multiple static files in different formats, creating a playlist that hosts static files in an m3u8 file (files which get added to the playlist as streaming continues).
I have also seen ideas involving rtmp, rtsp etc which are completely out of the question because of their incompatibility.
Ideally, I would have one webpage that would link to the stream (http://server/video.mp4) and/or show it in a webpage (via the video tag). With that in mind, the most likely format would be h264+aac in mp4 container.
Unfortunately, (and probably because the file has no duration metadata) it does not work. I can use a desktop player (such as VLC) to open the stream and play it, but my iPhone and Android both give their respective "Can't be played" messages.
I don't think the problem is caused by the devices' ability to stream, for I have made a streaming shoutcast server work just fine (mp3 only).
Currently, the closest I have become is using the following setup on my win32 machine:
FFMPEG Command:: ffmpeg -f dshow -i video="Logitech Webcam 200":audio="Microphone (Webcam 200)" -b:v 180k -bt 240k -vcodec libx264 -tune zerolatency -profile:v baseline -preset ultrafast -r 10 -strict -2 -acodec aac -ac 2 -ar 48000 -ab 32k -f flv "udp://127.0.0.1:1234"
VLC:: Stream from udp://127.0.0.1:1234 to http:// :8080/video.mp4 (No Transcoding), basically just to convert the UDP stream into an http-accessible stream.
Any hints or suggestions would be warmly welcomed!
Sorry i'm trying to understand your question.
It seems your trying to play mp4 on both android and iphone from your server via http right?
Do you have a streaming server? Or are you simply trying to have the phone pull the file from your server.
If you don't have one, I suggest checking out darwin streaming server (http://justdevelopment.blogspot.com/2009/10/video-streaming-with-android-phone.html).
It will allow you to set up your video to stream with the right encodings needed for each device.
Let me know if that helps