madhavanmalolan / ffmpegandroidlibrary

One line integration for FFMPEG Library in Android
MIT License
90 stars 15 forks source link

Stream to a server #10

Open dimcey opened 6 years ago

dimcey commented 6 years ago

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?

SuperAwesomeness commented 5 years ago

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