RTP streaming of H.264 with bitrates around 600kBit/s

by hayate » Thu, 10 Sep 2009 01:09:11 GMT

Sponsored Links
 I've got a problem when streaming H.264 with bitrates of about 600kBit/
s and a resolution
of 480x320 over RTP to an Android device (HTC Magic).  When playing
the stream, the device
shows decoding artefacts and even gets stuck at some times (in this
case the phone won't play
any streams unless it gets restarted).
The stream actually works well for bitrates up to 500kBits/s. Also the
local playback of the file (with 600kBits/s)
in a mp4 container seems to work without showing artefacts.

For encoding the video file i used mencoder with the following

mencoder version: MEncoder SVN-r29411-4.4.0

mencoder input.flv -nosound -vf scale=480:320 -ovc x264 -x264encopts
decimate=1 -ofps 30 -of rawvideo -o test.h264

I tired playing with the the vbv-bufsize parameter of x264encopts,
setting it to 10-200 which resulted therein
that the phone didn't got stuck during playback, but still showing

The question is if there are any options which would make the video
play without artefacts, because the
site about supported media formats ( http://developer.android.com/guide/ 
says that average bitrates up to 600kBits/s should work fine, or is
the processing overhead for RTP simply
to much to handle for the CPU of the device?


RTP streaming of H.264 with bitrates around 600kBit/s

by RaviY » Thu, 10 Sep 2009 11:58:09 GMT

 My immediate reaction would be to go with the thought that "RTP
processing overhead is higher" compared to progressive streaming or
local playback of a similar file.

One experiment that you could try is to reduce the frame rate (which
would reduce the RTP packets throughput) to see if that helps.

Usually artifacts are because of dropped packets. If you like to get
your hands dirty, you could look into the code to find out if there
are any packets being dropped.



Sponsored Links

Other Threads

1. OpenGL texture display properly on my phone. But 'white box' on some device?


My OpenGL texture display properly on my G1 and Motorola Milestone. (I
only have these 2 devices to test)

But on many other devices(reported by users), there's only a "white
box" displaying instead of the texture.

This bug also appear on  Android 2.3 Emulator.

My texture size is 128x256 in pixel.

Below is the code I use to display the texture:

                gl.glColor4f(0.0f, 0.0f, 0.0f, 0.0f);
                gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
                gl.glEnable(GL10.GL_BLEND); // Turn Blending On
                gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE,
gl.glBindTexture(GL10.GL_TEXTURE_2D, myTextureID);

                        gl.glTranslatef(0, 0, -9.0f);
                        gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texBuff);
                        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, bgBuff);
                        gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);          

And here's the code I used to load the texture:

private int loadTextureById(GL10 gl, int resId) {
                int[] textures = new int[1];
                gl.glGenTextures(1, textures, 0);

                int generatedTextureId = textures[0];
                gl.glBindTexture(GL10.GL_TEXTURE_2D, generatedTextureId);


                gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S,
                gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T,

                  gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE,

                InputStream is =
                Bitmap bitmap;
                try {
                        bitmap = BitmapFactory.decodeStream(is);
                } finally {
                        try {
                        } catch (IOException e) {
                                // Ignore.

                GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);

                return generatedTextureId;


Anyone know how to solve this problem?

Thank you in advance!


2. Bluetooth Chat Sample code combined with SMS receiving

Hey guys,

I'm working on integrating my Android phone with this external piece
of hardware. I have all the direct communication between the two
completed. However I would like to add functionality for the phone to
send a Bluetooth Message with the SMS when an SMS is received.

The way I'm implementing SMS receiving is by having a class
(SmsReceiver) that extends BroadcastReceiver, and having the following
in my Manifest:

<receiver android:name=".SmsReceiver">
android:name="android.provider.Telephony.SMS_RECEIVED" />

My question is how exactly would I make it so that when I receive a
SMS (i'm guessing in the onReceive of my SmsReceiver) I would also
send the message to the external piece of hardware through Bluetooth.
Any ideas?


3. Overclock and Batery Saves Tool for Motorola Defy

4. Benckmark Tools Android

5. Android Dual-Core SuperPhone Fight! Motorola Atrix 4G vs Samsung Galaxy S II vs LG Optimus 3D

6. More DropDown Menu Image

7. Rom buat hero