[FFmpeg-user] Real-time streaming of rawdata images to Android with FFMPEG

Philipp Thies philies.stack at gmail.com
Wed Jul 29 16:34:08 CEST 2015

*Hello :)*


I have an C++ server (Linux) and want to transmit rawdata images (RGB,
32bit) to an Android device in real-time. The server generates the rawdata
images (with or without bitmap header) continuously every x miliseconds.
Now, I want to put the rawdata images into a stream and transmit them
without much delay to the Android client.

I've chosen FFMPEG for this kind of job.

The input for FFMPEG should be the rawdata images, which are generated just
in time. The output should be an rtsp stream (h264 or is another format
better?). On client side I will play the stream with the Android
MediaPlayer. That works for a RTSP url like


I've installed FFMPEG on my server (

Depending on this question:
https://ffmpeg.org/pipermail/ffmpeg-user/2013-April/014617.html ... here is
my FFMEG command:

ffmpeg -an -f rawvideo -vcodec rawvideo -pix_fmt rgb32 -r 10 -i
-vcodec libx264 -r 30 -tune zerolatency -preset ultrafast -bsf:v

*Explanation of the parameters:*

   - -an = ignore audio
   - -report = log file in current directory


   - -f = rawvideo (video format)
   - -vcodec = rawvideo (video codec)
   - -pix_fmt = rgb32
   - -r = 10 (frame rate)


   - -vcodec = libx264
   - -r = 30 (frame rate)
   - -bsf:v = h264_mp4toannexb


*C++ Server Code Snippet:*

/* -------  Get image rawdata from source ------- */.../* -------
Create image header which fits to the image rawdata ------- */...
/* ------- Store the picture local (not necessary?) ------- */FILE *f;
f = fopen("/home/philies/test.bmp","wb");
//Write Bitmap Headers
fwrite(imageInfoHeader,1, imageInfoHeader,f);
//Write Bitmap Rawdata

—> ffmpeg ???


*ffserver.conf* After that I will set up a FFserver to create a RTSP stream
like that. Is it also correct?

Port 8090BindAddress 7654RTSPBindAddress 10MaxBandwidth 10000NoDaemon
<Feed feed1.ffm>File /tmp/feed1.ffmFileMaxSize 30M
ACL allow
ACL allow
ACL allow
<Stream mystream.sdp>Feed feed1.ffmFormat rtpVideoCodec
libx264VideoSize 640x480AVOptionVideo flags




   How can I specify the rawvideo of the ffmpeg command respectively how
   can I specify my bitmap rawdata (with or without header?) as the input of
   the FFMPEG?

   Is the FFMPEG command correct?

   Is the ffserver.conf correct?

If I fire the FFMPEG command in the terminal I get this error:

vcodec: no such file or directory


*Android Device (*

VideoView videoView
mediaController= new MediaController(this);
Uri uri = Uri.parse("rtsp://");


More information about the ffmpeg-user mailing list