Search code examples
androidffmpegvideo-streamingandroid-videoviewrtsp

streaming a webcam feed over rtsp using ffmpeg & ffserver to an android client


I am trying to stream my webcam over rtsp and open the stream using android. I managed to get the first part working (rtsp stream) using ffserver and ffmpgeg. Here is my ffserver.conf file :

HTTPPort 8000
RTSPPort 8001
HTTPBindAddress 192.168.1.74
RTSPBindAddress 192.168.1.74
MaxClients 100
MaxBandwidth 10000
NoDefaults

<Feed witty.ffm>
   File /tmp/witty.ffm
   FileMaxSize 20M
</Feed>

<Stream witty.mov>
   Feed witty.ffm
   Format rtp
   VideoSize 640x480
   VideoQMin 1
   VideoQMax 20
   VideoFrameRate 30
   VideoBitRate 500
   AVOptionVideo flags +global_header
   VideoCodec libx264
   AVPresetVideo baseline
   NoAudio
</Stream>

ffserver :

ffserver -f -d ffserver.conf // luch the server

and then I use FFmpeg to open the webcam (Mac OS)

ffmpeg -f avfoundation -i "default" http://192.168.1.74:8000/witty.ffm

I can open the stream from VLC but on android using a videoView i am getting an error (1,-38) and an alert view saying "can't play this video".


Solution

  • <Stream witty.mov>
    

    .mov (QuickTime) is not among the Android supported video formats.

    Use a supported format like 3GP etc.

    You can find the full list of supported formats here.