Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6898477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:18:04+00:00 2026-05-27T07:18:04+00:00

I have an Android project where I need to build a client app to

  • 0

I have an Android project where I need to build a client app to receive UDP or RTP unicast video streams and play them back. Unfortunately, I cannot seem to get this working and have searched extensively for a solution!

I have being testing on a Xoom (Android 3.2) and a Nexus S (Android 2.3.6) and know that they can play the content when using MX Player (a third-party media player app) as the client but I can’t get the native media player to play back the content. I have tried using both a simple VideoView and a MediaPlayer but both fail with the same error code and I can’t really find any helpful information on.

The video is H.264 encoded with aac audio.

Also, the server is a solution by a third-party which I have no access to (other than to specify udp or rtp) but as I said, when using MX Player, the streams can be played.

Here is the media player portion of my code:

public class Main extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    try {
        MediaPlayer player = new MediaPlayer();
        SurfaceView surface = (SurfaceView) findViewById(R.id.video);

        player.setDisplay(surface.getHolder());

        player.setDataSource(this, Uri.parse("udp://192.168.0.78:1234"));

        player.prepare();

        player.setOnPreparedListener(new OnPreparedListener() {

            @Override
            public void onPrepared(MediaPlayer mp) {
                Log.d("SimpleVideoPlayer", "Starting player");
                mp.start();
            }
        });

        player.setOnErrorListener(new OnErrorListener() {

            @Override
            public boolean onError(MediaPlayer mp, int what, int extra) {
                Log.d("SimpleVideoPlayer", "error with code: " + what);
                return false;
            }
        });

    }catch(Exception e) {
        e.printStackTrace();
    }
}

The error I’m receiving is:

11-29 15:44:14.660: D/MediaPlayer(15451): Couldn't open file on client side, trying server side
11-29 15:44:14.670: E/MediaPlayer(15451): error (1, -2147483648)
11-29 15:44:14.670: W/System.err(15451): java.io.IOException: Prepare failed.: status=0x1
11-29 15:44:14.670: W/System.err(15451):    at android.media.MediaPlayer.prepare(Native Method)
11-29 15:44:14.670: W/System.err(15451):    at com.android.vidplayer.Main.onCreate(Main.java:26)
11-29 15:44:14.670: W/System.err(15451):    at android.app.Activity.performCreate(Activity.java:4397)
11-29 15:44:14.670: W/System.err(15451):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
11-29 15:44:14.670: W/System.err(15451):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1804)
11-29 15:44:14.670: W/System.err(15451):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1856)
11-29 15:44:14.670: W/System.err(15451):    at android.app.ActivityThread.access$500(ActivityThread.java:125)
11-29 15:44:14.670: W/System.err(15451):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1049)
11-29 15:44:14.670: W/System.err(15451):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 15:44:14.670: W/System.err(15451):    at android.os.Looper.loop(Looper.java:132)
11-29 15:44:14.670: W/System.err(15451):    at android.app.ActivityThread.main(ActivityThread.java:4157)
11-29 15:44:14.670: W/System.err(15451):    at java.lang.reflect.Method.invokeNative(Native Method)
11-29 15:44:14.670: W/System.err(15451):    at java.lang.reflect.Method.invoke(Method.java:491)
11-29 15:44:14.670: W/System.err(15451):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
11-29 15:44:14.670: W/System.err(15451):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
11-29 15:44:14.670: W/System.err(15451):    at dalvik.system.NativeStart.main(Native Method)

I have set the Internet permissions also.

Does anybody have any suggestions please?? I can’t find any helpful info anywhere.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:18:05+00:00Added an answer on May 27, 2026 at 7:18 am

    I’m not sure Android natively supports UDP as it’s not listed in the Network Protocols

    http://developer.android.com/guide/appendix/media-formats.html

    Many 3rd party mediaplayers are based upon the FFMPEG libraries. You may want to use FFMPEG in your project although that’s a task in its own.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android Project where I need to build multiple versions of the
I have an Android project that branched into three different applications, app-1 , app-2
n00b here (first Android project). I have been given a custom video codec that
I have a project where I need to build a C# application that is
in an android-project I need to have a checkbox which may have an indeterminate
I am trying to record a video on my android project. I have found
I have an android eclipse project and have generated the corresponding build.xml ant file
I have Android pet-project DroidIn which utilizes HttpClient 4 (built into Android) to do
I have a Android project for SDK1.5 and now I want to convert it
I have an Android project and Eclipse is telling me my project has an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.