Search code examples
androidrtspdarwin

RTSP play video on Android (encoding)


I have a Darwin Server and sample videos (from Darwin installation) are working (they are playable through Android Media Player). Their encoding (via Android logs) is

05-22 02:23:50.544: I/ASessionDescription(117): v=0
05-22 02:23:50.544: I/ASessionDescription(117): o=StreamingServer 3546635030 1110207730000 IN IP4 192.168.1.6
05-22 02:23:50.544: I/ASessionDescription(117): s=\sample_100kbit.mp4
05-22 02:23:50.544: I/ASessionDescription(117): u=http:///
05-22 02:23:50.544: I/ASessionDescription(117): e=admin@
05-22 02:23:50.544: I/ASessionDescription(117): c=IN IP4 0.0.0.0
05-22 02:23:50.544: I/ASessionDescription(117): b=AS:96
05-22 02:23:50.544: I/ASessionDescription(117): t=0 0
05-22 02:23:50.544: I/ASessionDescription(117): a=control:*
05-22 02:23:50.544: I/ASessionDescription(117): a=mpeg4-iod:"data:application/mpeg4-iod;base64,AoJrAE///w/z/wOBdgABQNhkYXRhOmFwcGxpY2F0aW9uL21wZWc0LW9kLWF1O2Jhc2U2NCxBWUVDQVV3Rkh3TklBTWtnQUdVRUx5QVJBRzNkQUFFaytBQUJKUGdGSUFBQUFiRHpBQUFCdFE3Z1FNRFBBQUFCQUFBQUFTQUFoRUQ2S0RBZzhxSWZCaEFBUkFBQUFsZ0FBQUFBSUFBQUFBQURBVElDbndNdUFHVUFCSUNBZ0JSQUZRQVlBQUFBVGlBQUFFNGdCWUNBZ0FJVmtBWVFBRVFBQUI5QUFBQWZRQ0FnQUFBQUF3PT0EDQEFAADIAAAAAAAAAAAGCQEAAAAAAAAAAANpAAJARmRhdGE6YXBwbGljYXRpb24vbXBlZzQtYmlmcy1hdTtiYXNlNjQsd0JBU2daTUNvRmNtRUVIOEFBQUIvQUFBQkVLQ0tDbjQEEgINAABkAAAAAAAAAAAFAwAAYAYJAQAAAAAAAAAA"
05-22 02:23:50.554: I/ASessionDescription(117): a=isma-compliance:1,1.0,1
05-22 02:23:50.554: I/ASessionDescription(117): a=range:npt=0-  70.00000
05-22 02:23:50.554: I/ASessionDescription(117): m=video 0 RTP/AVP 96
05-22 02:23:50.554: I/ASessionDescription(117): b=AS:76
05-22 02:23:50.554: I/ASessionDescription(117): a=rtpmap:96 MP4V-ES/90000
05-22 02:23:50.554: I/ASessionDescription(117): a=control:trackID=3
05-22 02:23:50.554: I/ASessionDescription(117): a=cliprect:0,0,242,192
05-22 02:23:50.554: I/ASessionDescription(117): a=framesize:96 192-242
05-22 02:23:50.554: I/ASessionDescription(117): a=fmtp:96 profile-level-id=1;config=000001B0F3000001B50EE040C0CF0000010000000120008440FA283020F2A21F
05-22 02:23:50.554: I/ASessionDescription(117): a=mpeg4-esid:201
05-22 02:23:50.554: I/ASessionDescription(117): m=audio 0 RTP/AVP 97
05-22 02:23:50.554: I/ASessionDescription(117): b=AS:20
05-22 02:23:50.554: I/ASessionDescription(117): a=rtpmap:97 mpeg4-generic/8000/2
05-22 02:23:50.554: I/ASessionDescription(117): a=control:trackID=4
05-22 02:23:50.554: I/ASessionDescription(117): a=fmtp:97 profile-level-id=15;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1590
05-22 02:23:50.554: I/ASessionDescription(117): a=mpeg4-esid:101

However when I try to stream my video (from that same server) it's not working (they are hinted and encoded). Here is the log :/

05-22 02:24:21.865: I/ASessionDescription(117): v=0
05-22 02:24:21.865: I/ASessionDescription(117): o=StreamingServer 3546635061 1337206009000 IN IP4 192.168.1.6
05-22 02:24:21.875: I/ASessionDescription(117): s=\football_1.mp4
05-22 02:24:21.875: I/ASessionDescription(117): u=http:///
05-22 02:24:21.875: I/ASessionDescription(117): e=admin@
05-22 02:24:21.875: I/ASessionDescription(117): c=IN IP4 0.0.0.0
05-22 02:24:21.875: I/ASessionDescription(117): b=AS:304
05-22 02:24:21.875: I/ASessionDescription(117): t=0 0
05-22 02:24:21.875: I/ASessionDescription(117): a=control:*
05-22 02:24:21.875: I/ASessionDescription(117): a=x-copyright: MP4/3GP File hinted with GPAC 0.4.6-DEV (internal rev. 7) (C)2000-2005 - http://gpac.sourceforge.net
05-22 02:24:21.875: I/ASessionDescription(117): a=range:npt=0-   8.80000
05-22 02:24:21.875: I/ASessionDescription(117): m=video 0 RTP/AVP 96
05-22 02:24:21.875: I/ASessionDescription(117): b=AS:304
05-22 02:24:21.875: I/ASessionDescription(117): a=rtpmap:96 MP4V-ES/90000
05-22 02:24:21.875: I/ASessionDescription(117): a=control:trackID=65536
05-22 02:24:21.875: I/ASessionDescription(117): a=fmtp:96 profile-level-id=1; config=000001b001000001b58913000001000000012000c48d8800550c04241443000001b24c61766335312e34302e34
05-22 02:24:21.875: I/ASessionDescription(117): a=framesize:96 384-288

How to encode it properly?

After few seconds I get

error (1, -2147483648)

which is (I believe) - encoding error.


Solution

  • The problem was in rooted HTC Desire (CyanogenMod) - something with RTSP wasn't quite right :/