Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20521] Android: RTSP Streaming with authentication Error

GitHub Issuen/a
TypeImprovement
PriorityCritical
StatusClosed
ResolutionNot Our Bug
Resolution Date2016-04-12T16:06:04.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid, iOS
Labelsauthentication, player, rtsp, video
ReporterRodrigo Macazaga
AssigneeAngel Petkov
Created2016-02-28T15:54:49.000+0000
Updated2017-05-31T22:26:18.000+0000

Description

With a rtsp streaming that needs authentication I just can't see the video but If its open with vlc player it works. I need this to get the cctv video for a custom app. Sample url: rtsp://username:password@ipaddress/stream sample code

Comments

  1. Rodrigo Macazaga 2016-04-05

    Hi Any updates? Thank you!!
  2. Angel Petkov 2016-04-07

    [~macazaga] Hello, could you please check if the link is still active and if not update it :), as i cannot seem to open it. After which will continue looking it to the issue and getting a fix to you as soon as possible. Thank you
  3. Rodrigo Macazaga 2016-04-07

    Hi How can i give you a private url so you can have a real streaming? We need this to be fixed urgently, our customer is just waiting for this to launch the app. thank you!
  4. Angel Petkov 2016-04-07

    Hi, there is only 3 watches on this ticket you can post it here and i could delete it after or if you want just email it to me at apetkov@appcelerator.com. If you use Ti slack I'm on there too so you could just send me a 1on1 message :).
  5. Rodrigo Macazaga 2016-04-07

    Thanks! you can use vlc player to open that streaming so you can check how it works. :D
  6. Angel Petkov 2016-04-07

    [~rodrigok] Im sorry to deliver this however, after doing some more research turns out apple does not support RTSP , any videos sent through RTSP connection will actually also be removed from the app store you will get this [warning](https://gist.github.com/AngelkPetkov/7040470d953d4a6f26d3eb543d9db637) . What you could do if you have access to the server is create a pipeline feed the RTSP to vlc then export that as a HTTP and connect it to the client(your app) as a HTTP link.
  7. Rodrigo Macazaga 2016-04-07

    Thanks Angel, There are a lot of apps for CCTV in the app store. I wonder how they do it, because not al DVR use http, there are a lot that use RTSP, warning the user for data consumption. Our customer builds houses in some complex and with this app they want to be able that residents can check all the cctv of the complex they are living. Is this able with Android?
  8. Angel Petkov 2016-04-07

    From what i can find online , Android does not directly support it either. Like i said feed the data through VLC and export that instead of the RTSP link, then you will be able to stream the CCTV to an android app or an iOS app. Theres a couple of solutions on stack overflow regarding how to have vlc running along side the connection to convert the stream.
  9. Rodrigo Macazaga 2016-04-07

    Android support RTSP, please check this offical doc: http://developer.android.com/guide/appendix/media-formats.html
  10. Angel Petkov 2016-04-08

    Ah yeah i apologies , i work on iOS and theres so many android version i must have got confused to as which one supports it. We'll see what we can do for android.
  11. Rodrigo Macazaga 2016-04-11

    Thank you Angel Hope to hear good news soon.
  12. Ashraf Abu 2016-04-12

    Classic app code:
     
        var vidWin = Titanium.UI.createWindow({
            title : 'Video View Demo',
            backgroundColor : '#fff'
        });
        
        var videoPlayer = Titanium.Media.createVideoPlayer({
            top : 2,
            autoplay : true,
            backgroundColor : 'blue',
            height : 300,
            width : 300,
            mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,
            scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT
        });
        
        videoPlayer.url = 'rtsp://admin:123456@ipaddress:554/cam/realmonitor?channel=1&subtype=1';
        
        vidWin.add(videoPlayer);
        vidWin.open();
        
  13. Ashraf Abu 2016-04-12

    While RTSP is supported in Android, it seems there is no support for authentication with RTSP. Please see Android Issue Ticket: https://code.google.com/p/android/issues/detail?id=10703 It's something that is not provided by Android.
  14. Rodrigo Macazaga 2016-04-16

    Its possible with this code but with the appcelerator limitations we cant create a socket right? http://stackoverflow.com/questions/19979818/mediaplayer-rtsp-video-stream-with-authentication
  15. Ashraf Abu 2016-04-18

    There is a socket api exposed http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Network.Socket.TCP If you are able to use that api to do so, that would be great. I would believe that this might also be possible if it's written natively and perhaps as an android module that exposes the functionality written in stackoverflow http://stackoverflow.com/a/33323072/6207774 that you mentioned (assuming that code functions well). This would be a new feature request.
  16. Lee Morris 2017-05-31

    Closing ticket as this issue is not our bug.

JSON Source