title: ffmpeg on android: playing MPEG2 TS udp multicast stream
body: <p>I want to make android media player using ffmpeg. 
  (catch MPEG2 TS multicast stream via WIFI network and decode it)
  I checked followings:</p>
  
  <ul>
  <li>My iptime AP supports WIFI multicast protocol.
  (send multicast stream in wired PC, and wifi connected PC can receive it)</li>
  <li>My Android phone can receive multicast stream via WIFI.
  I coded NDK socket programming which is join udp multicast group and receive packets
  (I added multicast access grant to AndroidManifest.xml)</li>
  <li>FFMPEG library is ported to android and it can play local media file.</li>
  </ul>
  
  <p>But when I try to open network stream using FFMPEG library, avformat_open_input() function returns fail.</p>
  
  <pre><code>gFormatCtx = avformat_alloc_context();
  av_register_all(); 
  avcodec_register_all(); 
  avformat_network_init(); 
  if(avformat_open_input(&amp;gFormatCtx,"udp://@239.100.100.100:4000",NULL,NULL) != 0)
      return -2;
  </code></pre>
  
  <p>this code always return "-2". 
  If I use "av_dict_set()" api, which option should I use?</p>
  
  <pre><code>av_dict_set(&amp;options, "udp_multicast", "mpegtsraw", 0);
  </code></pre>
  
  <p>please let me know what should I check for avformat_open_input error?</p>
  
  <p>thanks.</p>