Skip to content

RTMP Streaming from Android device

Can we create stream from Android app using --sout paramaters?

If yes, lease give some tips to enable this stream type in Android app: vlc -vvv yelove.mp4 --sout '#transcode{vcodec=h264,vb=300,fps=25,scale=1,aenc=ffmpeg{strict=-2},acodec=mp4a,ab=64,channels=2}:std{access=rtmp,mux=ffmpeg{mux=flv},dst=rtmp://localhost:1935/rtmpsample/myStream}'

This I tested in Ubuntu to Wowza server. It's working perfectly. Please give some sample code to integrate with Android app.

I tried like this:

ArrayList<String> options = new ArrayList<String>();
    //options.add("--subsdec-encoding <encoding>");
   //options.add("--aout=opensles");
   options.add("--sout=#transcode{vcodec=h264,vb=300,fps=25,scale=1,acodec=mp4a,ab=64,channels=2}:std{access=rtmp,mux=ffmpeg{mux=flv},dst=rtmp://192.168.0.111:1935/rtmpsample/myStream}");
           // options.add("--audio-time-stretch"); // time stretching
            options.add("-vvv"); // verbosity
            libvlc = new LibVLC(options);
            libvlc.setOnHardwareAccelerationError(this);

            holder.setKeepScreenOn(true);

            // Create media player
            mMediaPlayer = new MediaPlayer(libvlc);
            mMediaPlayer.setEventListener(mPlayerListener);

            // Set up video output
            final IVLCVout vout = mMediaPlayer.getVLCVout();
            vout.setVideoView(mSurface);
            //vout.setSubtitlesView(mSurfaceSubtitles);
            vout.addCallback(this);
            vout.attachViews();

            Media m = new Media(libvlc, media);
            mMediaPlayer.setMedia(m);
            mMediaPlayer.play();

It's not working.

Do I need to remove this line from compile-libvlc.sh file for getting sout functionality in Android: --disable-sout

Edited by Nicolas Pomepuy