VLC RTSP live stream to Android

后端 未结 4 658
清歌不尽
清歌不尽 2021-02-14 15:25

For my app I have to stream from a decklink card to an Android app (I must be a live stream, so either HLS or RTSP seems to be good solutions, since my app targets Android 3+).

4条回答
  •  时光说笑
    2021-02-14 15:50

    please try the VLC:

    vlc some_file.mp4 -I http --sout "#transcode{soverlay,ab=128,samplerate=44100,channels=2,acodec=mp4a,vcodec=h264,width=480,height=270,vfilter="canvas{width=480,height=270,aspect=16:9}",fps=25,vb=800,venc=x264{level=12,no-cabac,subme=20,threads=4,bframes=0,min-keyint=1,keyint=50}}:gather:rtp{mp4a-latm,sdp=rtsp://0.0.0.0:5554/stream.sdp}"

    and the android code:

    @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            final VideoView vidView = (VideoView)findViewById(R.id.myVideo);
    
            MediaController vidControl = new MediaController(this);
            vidControl.setAnchorView(vidView);
            vidView.setMediaController(vidControl);
    
            vidView.setVideoPath("rtsp://137.110.92.231:5554/stream.sdp");
    
            vidView.start();
            }
    

提交回复
热议问题