Tuesday, April 10, 2012

Streaming Video From Android


I'm trying to stream video from the Android phone, which should be watched in an mediaplayer. I've been looking at http://www.mattakis.com/blog/kisg/20090708/broadcasting-video-with-android-without-writing-to-the-file-system which seems to be a dead end since it send the raw file data, and not a streamable format.



Then I tried using some code from SipDroid, more specific; parts of VideoCamera.java, RtpPacket.java and RtpSocket.java, which gives a stream on UDP, however these is not playable in i.e. mplayer(can't detect the codec). Wireshark tells that it is a UDP packet and not a RTP packet so something might be missing?



I'm kind'a stuck, have you any suggestions how to get past this bump?


Source: Tips4all

3 comments:

  1. I think u can find solution from this:
    package com.Videoplaying;

    import android.app.Activity;
    import android.net.Uri;
    import android.os.Bundle;
    import android.widget.MediaController;
    import android.widget.VideoView;

    public class Video extends Activity {
    private MediaController mc;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    VideoView vd = (VideoView) findViewById(R.id.VideoView);
    String LINK = "http://daily3gp.com/vids/747.3gp";
    mc = new MediaController(this);
    mc.setMediaPlayer(vd);
    Uri uri = Uri.parse(LINK);
    vd.setMediaController(mc);
    vd.setVideoURI(uri);
    vd.requestFocus();
    vd.start();
    }
    }

    ReplyDelete
  2. There's a similar question with some good answers.

    ReplyDelete
  3. If you don't get solution up till now, then i will help you.
    right click on the packet (in wireshark) and select decode as option. Then select rtp. Now you can see RTP packets in wireshark.

    ReplyDelete