ffmpegandroidlibrary icon indicating copy to clipboard operation
ffmpegandroidlibrary copied to clipboard

Stream to a server

Open dimcey opened this issue 7 years ago • 1 comments

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:

  1. 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)
  2. 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.
  3. I can do the 1) also if I connect with my laptop to my phone's hotspot.
  4. On my phone I have enabled permissions for read, write, internet and access_network_state.
  5. With the phone app I can create a copy of the same video ("-y", "-i", video,"-vcodec","copy","-an", newVideo)

Any ideas?

dimcey avatar Mar 02 '18 12:03 dimcey

Seems that this library can only deal with video files on storage. Any help would be greatly appreciated!

SuperAwesomeness avatar Oct 11 '18 13:10 SuperAwesomeness