ffmpegandroidlibrary
ffmpegandroidlibrary copied to clipboard
Stream to a server
Hi again, I am trying to stream a .mp4 to a remote public server without any luck. The server is not receiving anything on the 8888 port while I try to stream. Here is the code I am using:
String video = getExternalStorageDirectory().getAbsolutePath()+"/send.mp4";
String serverAddress = "udp://xx.xx.xx.xxx:8888";
Controller.getInstance().run(new String[]{
"-re",
"-i",
video,
"-vcodec",
"copy",
"-an",
"-f",
"mpegts",
serverAddress
});
It is good to note that:
- The server is able to receive packets on the 8888 port when I execute the same command on my laptop from CLI and stream the same video (ffmpeg -re -i /home/dimi/send.mp4 -vcodec copy -an -f mpegts udp://xx.xx.xx.xxx:8888)
- If I install and run apps like Packet Capture to monitor the network card, I get 0 reports from the app while I try to stream. This means that the app does not even try to send something on the radio.
- I can do the 1) also if I connect with my laptop to my phone's hotspot.
- On my phone I have enabled permissions for read, write, internet and access_network_state.
- With the phone app I can create a copy of the same video ("-y", "-i", video,"-vcodec","copy","-an", newVideo)
Any ideas?
Seems that this library can only deal with video files on storage. Any help would be greatly appreciated!