[FFmpeg-user] Recipe to stream to Android

Joe Kreidler joek at optimaldesignco.com
Fri Jan 18 17:32:19 CET 2013


I found my problem and the solution was very easy. All I had to do was add the
following line to my ffserver configuration file.

AVOptionVideo flags +global_header

The addition of the global_header flag forced ffmpeg to include the
sprop-parameter-sets
and the profile-level-id attributes in the SDP. With this change, I am able
to receive RTSP/RTP content on Android.


Joe




On Thu, Jan 10, 2013 at 10:14 AM, Joe Kreidler <joek at optimaldesignco.com>wrote:

> I asked this question on the ffserver mail list, but there has not been
> any responses. I'm trying the ffmpeg list since this list is more active
> and I am not sure if my problem is in ffserver or ffmpeg.
>
> I am trying to stream H264 video using ffmpeg and ffserver on a Ubuntu
> 12.04LTS desktop to an Android tablet running a small test client app
> on Ice Cream Sandwich v 4.0.4. Note, I am not using ffmpeg or ffserver
> on Android. I know my test client app is working properly because I can
> successfully stream the following H.264 content.
> rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov
>
> I know that the problem is that ffserver is generating the SDP for the
> video media like this:
>
> m=video 0 RTP/AVP 96
> b=AS:128
> a=rtpmap:96 H264/90000
> a=fmtp:96 packetization-mode=1
> a=control:streamid=0
>
> The format parameter line (a=fmtp) is missing the "sprop-parameter-sets"
> and "profile-level-id" parameters and without these parameters, Android
> does not accept the RTP data.  A valid line looks like this:
>
> a=fmtp:96 packetization-mode=1;
> sprop-parameter-sets=Z0LAHukBQHsg,aM4G4g==; profile-level-id=42C01E
>
> My ffmpeg and ffserver configuration files are included below. If
> someone has successfully streamed H.264 content to an Android tablet,
> can you share you configuration me with?
>
> Thank you in advance,
>
> Joe
>
>
> I captured a video on the Android device and played it back just
> to verify that I had a good video file. I then transferred the file to
> my Ubuntu desktop. I send the video content to ffserver using the "copy"
> codec, in other words, no transcoding of the content at all.
>
> ffmpeg -i test.mp4 -c copy http://10.10.10.143:8090/feed1.ffm
>
> Port 8090
> BindAddress 0.0.0.0
> RTSPPort 7654
> RTSPBindAddress 0.0.0.0
> MaxClients 4
> MaxBandwidth 10000
> NoDaemon
>
> <Feed feed1.ffm>
> File /tmp/feed1.ffm
> FileMaxSize 20M
> ACL allow 10.10.10.0 10.10.10.255
> </Feed>
>
> <Stream 4Di.sdp>
> Feed feed1.ffm
> Format rtp
> VideoSize 640x480
> VideoQMin 1
> VideoQMax 2
> NoAudio
> </Stream>
>
> <Stream status.html>
> Format status
> ACL allow 10.10.10.0 10.10.10.255
> </Stream>
>
>


-- 

Joe Kreidler
Lead Software Engineer
Optimal Design

601 W. Campus Dr., Suite B3

Arlington Heights, IL  60004

Office: 847-818-1000 x 38

Fax: 847-483-1461
Mobile: 312-615-6431

 www.OptimalDesignCo.com <http://www.optimaldesignco.com/>


Follow Optimal Design on
Linkedin<http://www.linkedin.com/company/optimal-design>
, Twitter <https://twitter.com/#!/OptimalDesignCo> and
Facebook<http://www.facebook.com/pages/Optimal-Design/217642344936481>


More information about the ffmpeg-user mailing list