Skip to content

Use FFmpeg AVOption in Vitamio 4.1.0

Crossle Song edited this page Sep 16, 2013 · 1 revision

Vitamio 4.1.0 support most FFmpeg AVOptions, you can use MediaPlayer.setDataSource(path, options) set http headers, timeout, user-agent, cookies...

e.g.

  1. Switch rtsp transport layer

     HashMap<String, String> options = new HashMap<String, String>();
     options.put("rtsp_transport", "tcp"); // udp
     mediaPlayer.setDataSource(path, options);
    
  2. Playback swf rtmp

     HashMap<String, String> options = new HashMap<String, String>();
     options.put("rtmp_playpath", "fsb");
     options.put("rtmp_swfurl", "http://www.cdn-br.com/swf/player.swf");
     options.put("rtmp_live", "1"); 
     options.put("rtmp_pageurl", "http://www.cdn-br.com/mastertv/FSB.htm"); 
     mediaPlayer.setDataSource("rtmp://31.204.153.72/live/", options);