For my application, I need to transfer from the decklink card to an Android application (I have to be a live stream, so either HLS or RTSP seem to be good solutions, since my application is for Android 3+). I recompiled VLC using decklink sdk and I can stream it to another computer over the network (but it only works with 60 seconds with RTSP).
Here is what I tried:
HTTP stream:
./vlc -vvv decklink:// --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=56,ab=24,channels=1} :standard{access=http{use-key-frames},mux=ts,dst=:3001/stream.mpeg}'
It works in Android VLC 0.0.11, but only in WiFi, not in 3G. And I can not play it in my application using VideoView. Here is the code I used and the corresponding error messages:
String url = "http://134.246.63.169:5554/stream.mpeg"; VideoView videoView = (VideoView) this.findViewById(R.id.videoView); videoView.setVideoURI(Uri.parse(url)); videoView.setMediaController(new MediaController(this)); videoView.requestFocus(); videoView.start();
Error messages:
04-08 15:26:46.272: D/MediaPlayer(16349): Couldn't open file on client side, trying server side 04-08 15:26:46.272: V/ChromiumHTTPDataSource(7680): connect on behalf of uid 1080867789 04-08 15:26:46.272: I/ChromiumHTTPDataSource(7680): connect to http://134.246.63.169:8554/ @0 04-08 15:26:46.302: I/AwesomePlayer(7680): AwesomePlayer::AwesomePlayer()in 04-08 15:26:46.302: I/AwesomePlayer(7680): AwesomePlayer::AwesomePlayer()aftermClient.connect() 04-08 15:26:46.302: I/AwesomePlayer(7680): setDataSource_l('http://134.246.63.169:5554/') 04-08 15:26:46.302: W/MediaPlayer(16349): info/warning (701, 0) 04-08 15:26:46.302: V/ChromiumHTTPDataSource(7680): connect on behalf of uid 10067 04-08 15:26:46.302: I/ChromiumHTTPDataSource(7680): connect to http://134.246.63.169:5554/ @0 04-08 15:26:46.342: I/ActivityManager(272): Displayed fr.ifremer.testrtsp/.MainActivity: +183ms 04-08 15:26:46.382: I/MediaPlayer(16349): Info (701,0) 04-08 15:27:07.592: E/MediaPlayer(16349): error (1, -2147483648) 04-08 15:27:07.592: E/MediaPlayer(16349): Error (1,-2147483648)
I used the encoding options recommended by Google on this page , for example:
- video codec: h264
- audio codec: AAC
- video bitrate: 56
- audio bitrate: 24
- audio channels: 1
size: 176x144
./vlc -vvv decklink:// --sout-ffmpeg-strict=-2 --sout '#transcode{width=176,height=144,vcodec=h264,acodec=mp4a,vb=56,ab=24,channels=1} :rtp{dst=134.246.63.169,port-video=5554,port-audio=5556,sdp=rtsp://134.246.63.169:5554/stream.sdp}'
I can play the stream on the VLC desktop, but not on Android (even in the Android version of VLC or the default for the Google video player: /). If I do not specify a multiplexer, I can also play it in QuickTime (if I specify a multiplex, either ts or ps, I do not have a video. If I try another multiplexer, VLC tells me that I am allowed to use ts or ps in RTP)
If I try to use the Google video player, I get these messages in the locale:
04-08 15:32:45.792: D/MediaPlayer(13688): Couldn't open file on client side, trying server side 04-08 15:32:45.802: W/MediaPlayer(13688): info/warning (701, 0) 04-08 15:32:45.812: I/MediaPlayer(13688): Info (701,0) 04-08 15:32:45.812: D/MediaPlayer(13688): getMetadata 04-08 15:32:45.812: E/MediaPlayerService(7680): getMetadata failed -38 04-08 15:32:45.852: I/MyHandler(7680): connection request completed with result 0 (Success) 04-08 15:32:45.882: I/ARTSPConnection(7680): status: RTSP/1.0 200 OK 04-08 15:32:45.882: I/MyHandler(7680): DESCRIBE completed with result 0 (Success) 04-08 15:32:45.882: I/ASessionDescription(7680): v=0 04-08 15:32:45.882: I/ASessionDescription(7680): o=- 15352003113363922923 15352003113363922923 IN IP4 to63-169.ifremer.fr 04-08 15:32:45.882: I/ASessionDescription(7680): s=Unnamed 04-08 15:32:45.882: I/ASessionDescription(7680): i=N/A 04-08 15:32:45.882: I/ASessionDescription(7680): c=IN IP4 134.246.63.169 04-08 15:32:45.882: I/ASessionDescription(7680): t=0 0 04-08 15:32:45.882: I/ASessionDescription(7680): a=tool:vlc 2.0.5 04-08 15:32:45.882: I/ASessionDescription(7680): a=recvonly 04-08 15:32:45.882: I/ASessionDescription(7680): a=type:broadcast 04-08 15:32:45.882: I/ASessionDescription(7680): a=charset:UTF-8 04-08 15:32:45.882: I/ASessionDescription(7680): a=control:rtsp://134.246.63.169:5554/stream.sdp 04-08 15:32:45.882: I/ASessionDescription(7680): m=audio 5556 RTP/AVP 96 04-08 15:32:45.882: I/ASessionDescription(7680): b=AS:24 04-08 15:32:45.882: I/ASessionDescription(7680): b=RR:0 04-08 15:32:45.882: I/ASessionDescription(7680): a=rtpmap:96 mpeg4-generic/48000 04-08 15:32:45.882: I/ASessionDescription(7680): a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=118856e500; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1; 04-08 15:32:45.882: I/ASessionDescription(7680): a=control:rtsp://134.246.63.169:5554/stream.sdp/trackID=0 04-08 15:32:45.882: I/ASessionDescription(7680): m=video 5554 RTP/AVP 96 04-08 15:32:45.882: I/ASessionDescription(7680): b=AS:56 04-08 15:32:45.882: I/ASessionDescription(7680): b=RR:0 04-08 15:32:45.882: I/ASessionDescription(7680): a=rtpmap:96 H264/90000 04-08 15:32:45.882: I/ASessionDescription(7680): a=fmtp:96 packetization-mode=1;profile-level-id=64000b;sprop-parameter-sets=Z2QAC6zZQsTv/AC0ALBAAAADAEAAAAyjxQplgA==,aOvssiw=; 04-08 15:32:45.882: I/ASessionDescription(7680): a=control:rtsp://134.246.63.169:5554/stream.sdp/trackID=1 04-08 15:32:45.982: I/ARTSPConnection(7680): status: RTSP/1.0 200 OK 04-08 15:32:45.982: I/MyHandler(7680): SETUP(1) completed with result 0 (Success) 04-08 15:32:45.982: I/MyHandler(7680): server specified timeout of 60 secs. 04-08 15:32:45.992: W/MyHandler(7680): Missing 'source' field in Transport response. Using RTSP endpoint address. 04-08 15:32:45.992: I/APacketSource(7680): dimensions 176x144 04-08 15:32:46.012: I/ARTSPConnection(7680): status: RTSP/1.0 200 OK 04-08 15:32:46.022: I/MyHandler(7680): SETUP(2) completed with result 0 (Success) 04-08 15:32:46.022: I/MyHandler(7680): server specified timeout of 60 secs. 04-08 15:32:46.022: W/MyHandler(7680): Missing 'source' field in Transport response. Using RTSP endpoint address. 04-08 15:32:46.022: W/MyHandler(7680): Server picked an odd RTP port, it should've picked an even one, we'll let it pass for now, but this may break in the future. 04-08 15:32:46.082: I/ARTSPConnection(7680): status: RTSP/1.0 200 OK 04-08 15:32:46.082: D/dalvikvm(13688): GC_FOR_ALLOC freed 303K, 7% free 9289K/9927K, paused 35ms, total 36ms 04-08 15:32:46.092: I/MyHandler(7680): PLAY completed with result 0 (Success) 04-08 15:32:46.092: I/MyHandler(7680): This is a live stream 04-08 15:32:48.262: D/AudioHardware(7680): AudioHardware pcm playback is going to standby. 04-08 15:32:48.262: D/AudioHardware(7680): closePcmOut_l() mPcmOpenCnt: 1 04-08 15:32:56.092: W/MyHandler(7680): Never received any data, switching transports. 04-08 15:32:56.112: I/ARTSPConnection(7680): status: RTSP/1.0 200 OK 04-08 15:32:56.122: I/MyHandler(7680): TEARDOWN completed with result 0 (Success) 04-08 15:32:56.122: I/MyHandler(7680): connection request completed with result 0 (Success) 04-08 15:32:56.152: I/ARTSPConnection(7680): status: RTSP/1.0 200 OK 04-08 15:32:56.152: I/MyHandler(7680): DESCRIBE completed with result 0 (Success) 04-08 15:32:56.152: I/ASessionDescription(7680): v=0 04-08 15:32:56.152: I/ASessionDescription(7680): o=- 15352003157473632156 15352003157473632156 IN IP4 to63-169.ifremer.fr 04-08 15:32:56.152: I/ASessionDescription(7680): s=Unnamed 04-08 15:32:56.152: I/ASessionDescription(7680): i=N/A 04-08 15:32:56.152: I/ASessionDescription(7680): c=IN IP4 134.246.63.169 04-08 15:32:56.152: I/ASessionDescription(7680): t=0 0 04-08 15:32:56.152: I/ASessionDescription(7680): a=tool:vlc 2.0.5 04-08 15:32:56.152: I/ASessionDescription(7680): a=recvonly 04-08 15:32:56.152: I/ASessionDescription(7680): a=type:broadcast 04-08 15:32:56.152: I/ASessionDescription(7680): a=charset:UTF-8 04-08 15:32:56.152: I/ASessionDescription(7680): a=control:rtsp://134.246.63.169:5554/stream.sdp 04-08 15:32:56.152: I/ASessionDescription(7680): m=audio 5556 RTP/AVP 96 04-08 15:32:56.152: I/ASessionDescription(7680): b=AS:24 04-08 15:32:56.152: I/ASessionDescription(7680): b=RR:0 04-08 15:32:56.152: I/ASessionDescription(7680): a=rtpmap:96 mpeg4-generic/48000 04-08 15:32:56.152: I/ASessionDescription(7680): a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=118856e500; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1; 04-08 15:32:56.152: I/ASessionDescription(7680): a=control:rtsp://134.246.63.169:5554/stream.sdp/trackID=0 04-08 15:32:56.152: I/ASessionDescription(7680): m=video 5554 RTP/AVP 96 04-08 15:32:56.152: I/ASessionDescription(7680): b=AS:56 04-08 15:32:56.152: I/ASessionDescription(7680): b=RR:0 04-08 15:32:56.152: I/ASessionDescription(7680): a=rtpmap:96 H264/90000 04-08 15:32:56.152: I/ASessionDescription(7680): a=fmtp:96 packetization-mode=1;profile-level-id=64000b;sprop-parameter-sets=Z2QAC6zZQsTv/AC0ALBAAAADAEAAAAyjxQplgA==,aOvssiw=; 04-08 15:32:56.152: I/ASessionDescription(7680): a=control:rtsp://134.246.63.169:5554/stream.sdp/trackID=1 04-08 15:32:56.222: I/ARTSPConnection(7680): status: RTSP/1.0 461 Unsupported transport 04-08 15:32:56.222: I/MyHandler(7680): SETUP(1) completed with result 0 (Success) 04-08 15:32:56.222: I/APacketSource(7680): dimensions 176x144 04-08 15:32:56.242: I/ARTSPConnection(7680): status: RTSP/1.0 461 Unsupported transport 04-08 15:32:56.252: I/MyHandler(7680): SETUP(2) completed with result 0 (Success) 04-08 15:32:56.272: E/MediaPlayer(13688): error (1, -2147483648) 04-08 15:32:56.272: E/MediaPlayer(13688): Error (1,-2147483648) 04-08 15:32:56.272: D/VideoView(13688): Error: 1,-2147483648
I think the problem is with the โstatus: RTSP / 1.0 461 Unsupported transportโ, but I donโt see what I can change: I already open the ports that I use and receive the video on another computer.
On an Android phone, I can play some rtsp streams that I found on the Internet, for example: rtsp: //184.72.239.149/vod/mp4: BigBuckBunny_115k.mov. Therefore, it should be possible.
If someone can help ...!