[FFmpeg-devel] Streaming Android supported format

Yadnesh Phadke yadnesh
Wed Jul 28 15:11:18 CEST 2010


Hi All,

I am trying to stream media to play it on android using RTSP/RTP.  I am
using ffmpeg and ffserver for the purpose.  I am trying to do that for quiet
some time now but still unsuccessful.

Now I found that Wowza server streams file that plays fine on my device "
rtsp://ec2-174-129-153-104.compute-1.amazonaws.com/vod/mp4:BigBuckBunny_175k.mov
"
NOTE: My stream also does not play well with ffplay or vlc player.  These
players render either audio or video depending on the ffserver config.

I did packet capture of my stream and the stream that is sent by the wowza
server and noticed that there are minor differences in the SDP sent by
those.

Major Difference
Audio: parameter "config=" and the stream bit rate are different
Video: parameter "profile-level-id=" is missing in SDP sent by FFMpeg

Could anyone please suggest correct parameters for my stream to work from
ffmpeg.  I am currently using "SVN-r24078"

SDP stream that works: (sent by Wowza server)
==========================================================
v=0
o=- 1264037724 1264037724 IN IP4 174.129.153.104
s=WowzaMediaServer
c=IN IP4 174.129.153.104
t=0 0
a=sdplang:en
a=range:npt=0- 596.458
a=control:*
m=audio 0 RTP/AVP 96
a=rtpmap:96 mpeg4-generic/48000/2
a=fmtp:96
profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1190
a=control:trackID=1
m=video 0 RTP/AVP 97
a=rtpmap:97 H264/90000
a=fmtp:97
packetization-mode=1;profile-level-id=42C01E;sprop-parameter-sets=Z0LAHpZiBwjzywgAAAMACAAAAwGAeLFyQA==,aMuMsg==
a=cliprect:0,0,120,212
a=framesize:97 212-120
a=control:trackID=2
==========================================================

SDP stream that does NOT work: (sent by ffserver)
==========================================================
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Title
c=IN IP4 0.0.0.0
t=0 0
a=tool:libavformat 52.73.0
m=audio 0 RTP/AVP 97
b=AS:16
a=rtpmap:97 MPEG4-GENERIC/44100/2
a=fmtp:97
profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;
config=1210
a=control:streamid=0
m=video 0 RTP/AVP 96
b=AS:64
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;
sprop-parameter-sets=Z0LAC/QYJ0IAAAMAAgAAAwAoHihVQA==,aM48gA==
a=control:streamid=1
==========================================================

I use ffmpeg to input stream to ffserver...and ffserver to RTSP stream to
player.

ffmpeg command
===========================================================
./ffmpeg -i ~/Media/fileSequence2.ts http://127.0.0.1:8090/feed1.ffm
FFmpeg version SVN-r24078, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jul 27 2010 16:50:10 with gcc 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
  configuration: --prefix=/home/yadnesh --enable-shared --disable-static
--disable-mmx --enable-version3 --enable-pthreads --enable-gpl
--enable-libfaac --enable-libx264 --enable-nonfree
  libavutil     50.20. 0 / 50.20. 0
  libavcodec    52.79. 1 / 52.79. 1
  libavformat   52.73. 0 / 52.73. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libavfilter    1.20. 1 /  1.20. 1
  libswscale     0.11. 0 /  0.11. 0
[mpegts @ 0x807b510] max_analyze_duration reached

Seems stream 1 codec frame rate differs from container frame rate: 180000.00
(180000/1) -> 14.99 (15000/1001)
Input #0, mpegts, from '/home/yadnesh/Media/fileSequence2.ts':
  Duration: 00:00:09.94, start: 30.015600, bitrate: 212 kb/s
  Program 1
    Stream #0.0[0x101]: Audio: aac, 22050 Hz, mono, s16, 35 kb/s
    Stream #0.1[0x102]: Video: h264, yuv420p, 192x144, 14.99 tbr, 90k tbn,
180k tbc
[scale @ 0x80825b0] w:192 h:144 fmt:yuv420p -> w:176 h:144 fmt:yuv420p
flags:0x4
[libx264 @ 0x80969a0] using cpu capabilities: MMX2 SSE2 SSE3 Cache64
[libx264 @ 0x80969a0] profile High, level 1.1
[libx264 @ 0x80969a0] 264 - core 104 r1677 19df41a - H.264/MPEG-4 AVC codec
- Copyleft 2003-2010 - http://www.videolan.org/x264.html - options: cabac=1
ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=-2 threads=1 sliced_threads=0 nr=0 decimate=1
interlaced=0 constrained_intra=0 bframes=3 b_pyramid=0 b_adapt=1 b_bias=0
direct=1 weightb=1 open_gop=0 weightp=0 keyint=5 keyint_min=3 scenecut=40
intra_refresh=0 rc_lookahead=34 rc=abr mbtree=1 bitrate=48 ratetol=83.3
qcomp=0.50 qpmin=10 qpmax=51 qpstep=4 vbv_maxrate=96 vbv_bufsize=327
ip_ratio=1.41 aq=1:1.00 nal_hrd=none
Output #0, ffm, to 'http://127.0.0.1:8090/feed1.ffm':
  Metadata:
    encoder         : Lavf52.73.0
    Stream #0.0: Audio: libfaac, 44100 Hz, 2 channels, s16, 16 kb/s
    Stream #0.1: Video: libx264, yuv420p, 176x144, q=10-51, 48 kb/s, 1000k
tbn, 10 tbc
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[h264 @ 0x8080370] missing picture in access unit.60 bitrate=  63.0kbits/s
dup=0 drop=29
frame=  101 fps= 97 q=-1.0 Lsize=      76kB time=9.91 bitrate=  62.8kbits/s
dup=0 drop=49
video:55kB audio:6kB global headers:0kB muxing overhead 23.088603%
[libx264 @ 0x80969a0] frame I:21    Avg QP:31.84  size:  1708
[libx264 @ 0x80969a0] frame P:49    Avg QP:37.11  size:   295
[libx264 @ 0x80969a0] frame B:31    Avg QP:39.33  size:   187
[libx264 @ 0x80969a0] consecutive B-frames: 22.5% 77.5%  0.0%  0.0%
[libx264 @ 0x80969a0] mb I  I16..4: 29.4% 17.3% 53.3%
[libx264 @ 0x80969a0] mb P  I16..4:  5.5%  3.0%  5.0%  P16..4: 11.3%  4.1%
 1.7%  0.0%  0.0%    skip:69.4%
[libx264 @ 0x80969a0] mb B  I16..4:  0.8%  1.6%  1.7%  B16..8: 23.4%  1.8%
 0.2%  direct: 0.5%  skip:70.1%  L0:30.6% L1:68.7% BI: 0.7%
[libx264 @ 0x80969a0] final ratefactor: 27.12
[libx264 @ 0x80969a0] 8x8 transform intra:19.3% inter:10.6%
[libx264 @ 0x80969a0] coded y,uvDC,uvAC intra: 38.4% 3.0% 2.9% inter: 4.8%
0.1% 0.0%
[libx264 @ 0x80969a0] i16 v,h,dc,p: 30% 61%  9%  1%
[libx264 @ 0x80969a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 16% 31%  3%  1%  3%
 3%  3%  4%
[libx264 @ 0x80969a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 21% 35%  4%  2%  4%
 3%  3%  3%
[libx264 @ 0x80969a0] i8c dc,h,v,p: 92%  4%  4%  0%
[libx264 @ 0x80969a0] ref P L0: 74.0% 20.0%  5.9%
[libx264 @ 0x80969a0] ref B L0: 70.1% 29.9%
[libx264 @ 0x80969a0] kb/s:44.45
===========================================================

ffserver config
===========================================================
<Stream test1>
Feed feed1.ffm
Format rtp

VideoCodec libx264
VideoFrameRate 10
VideoBitRate 64
VideoSize 176x144
AVPresetVideo default
VideoBitRate 48
VideoBufferSize 40
#VideoSize 192x112
VideoGopSize 5
VideoFrameRate 10
AVOptionVideo flags +global_header vpre hq crf 26 bufsize 2500k maxrate 80k
NoLoop

AudioCodec libfaac
AVOptionAudio flags +global_header
AudioBitRate 16
AudioChannels 2
AudioSampleRate 44100

NoLoop
</Stream>
===========================================================

I have alreasy tried using "baseline" and "default" values
for AVPresetVideo.

Regards,
Yadnesh

-- 

----------------------------------------------------------------------
Christopher Morley - There is only one success - to be able to spend your
life in your own way.



More information about the ffmpeg-devel mailing list