Developing App to pull stream from cloud

Answered

Comments

36 comments

  • Avatar
    Andrey Terentyev

    Hello  Kamal Agbaria,

    Could you please share your code?

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    I indeed can, 

    the outcome of var: cameraURL is a fine url that I can view on VNC player, its a url with a calculated hash for digest auth with my user/password

    other urls from demo m3u8 files work just fine.

     

    import { Video } from "expo-av";
    <Video
    ref={video}
    style={styles.video}
    source={{
    uri:cameraURL,
    }}
    type="m3u8"
    useNativeControls
    resizeMode="contain"
    shouldPlay
    onPlaybackStatusUpdate={(status) =>setStatus(() =>status)} //log status & errors
    />

     

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    Andrey Terentyev 

    I am developing a high scale app which according to plans will be spread world wildly

    I would like to be contacted ASAP in order to implement a solution I am seeking.

    with my previous knowledge with NX systems, I believe it will be best practice to implement it using NX solution.

    I would like to discuss that further.

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    4.2.0.32840 

    on pi4 (arm) running on linux

    of course this is for the development enviroment and for production once it worked it will be moved to a higher specifications server.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Kamal,

    Could you share the cameraURL value, i.e. tht actual resulting url?

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    I have to mention that the generated url works on VLC player, not ideally (buffering issues and gets stuck few seconds after).

    Tell me whenever I have delete the url since the video should not be shared publicly.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Kamal,

    4.2.0.32840 

    I would highly recommend updating to the latest monthly patch 34633

    other urls from demo m3u8 files work just fine.

    Could you share these as well?

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    I performed the update as suggested.

    I still have the same error as explained previously

      "error": "The AVPlayerItem instance has failed with the error code -12971 and domain \"CoreMediaErrorDomain\".",

    I have to mention that trying to load url locally (which is less relevant) loads the video for few seconds (similar to VLC's activity)

    Sample hls url that works smoothly: 

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    Tried to pull /media/ *.mp4 file for the live stream

    I get a new Error 

    for iOS: 

      "error": "The server is not correctly configured. - The AVPlayerItem instance has failed with the error code -11850 and domain \"AVFoundationErrorDomain\".",

     

    for Android:

      "error": "h.f.c.d.q0.f0: None of the available extractors (e, g, i, e, g, e, d0, c, d, w, b, b) could read the stream.",

     

    digging around points to a server error handling http byte range, as shown here:

    https://stackoverflow.com/questions/33823411/avplayer-fails-to-play-video-sometimes

     

    Eventhrough I think hls will fit more with more stable and smooth stream, I felt like sharing the progress with you.

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    Norman-Nx-Support

    Tony Lannon

     
    Could anybody help here?

    We are discussing a high spread potential app

    As much as this forum is appreciated, I would like to have answers ASAP, this thread was opened a month ago.

    my experience with NX witness is making me stick with it as my solution, I was a technical support agent for your product in the past for one of your resellers aboard.

    Is there any channel where I contact you directly ? 

    0
    Comment actions Permalink
  • Avatar
    Norman - Nx Support

    @...,

    My colleague Andrey Terentyev is your man to talk to.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Kamal,

    First.

    Have you tried our example on github? Does it work with your cameras?

    https://github.com/networkoptix/nx_open_integrations/tree/master/web_integrations_examples/embedding_video_on_a_website

    Second.

    Could you provide with a simple web page on your test environment, please? Not just several lines of code.

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    Andrey,

    As mentioned, I am developing a mobile app using react-native, and official Expo's Player that is tested with other hls urls that work just fine.

    That means the html embedding solution is less relevant, 

    however, generating the auth key was taken from the above example ofcourse, and I can assure you it works fine since I test the URL in VLC.

    2. I sure can attach github url but it will include credentials and secret keys, how safe is it to paste it here ?

     

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    Hi Andrey Terentyev

    I am still trying to figure out the issue here.

    After tons of tests and researching, I am pretty sure the HLS url is not 100% supporting the platform I am trying to play the video on.

    VLC is playing the generated URL fine now.

    I think I've read somewhere that lack of data over the HLS stream can cause the errors I mentioned before.

    For example, this HLS demo URL has live stream by akamai, and it works smoothly

     
    I've tried several services online where I generate a new HLS url from the HLS url by your 
    relay.vmsproxy.com URL, and they seem to work just fine.
     
    I think there should be a patch to fix the streams missing data, just in case.
    The problem is that I cannot provide a webpage for you since I am developing for iOS/Android native devices (using react native over Expo's enviroment)
     
    I've found myself looking for expensive services for online transcoding the stream for converting broken HLS streams to working HLS streams for ios devices and android, which is absolutely not an option to be implemented, it was for debugging only.
     
    I would appreciate if you contact me to schedule a remote session and try to fix this problem.
    We are developing a very wide spread app, where we expect 10,000 cameras to be attached within 1 year.
     
     
    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    UPDATE: I generated the URL conditionally based on Platform OS running the app,

    so in android I generated a fine webm url that works fine and smoothly.

    in iOS I generated hls, that works over VLC but cannot be played on the APP.

     

     

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    Norman-Nx-Support

    Andrey seems to be away, last response was 6 days ago, 

    That frequency is not appropriate for a wide scale potential project as mine.

     

     

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    Update:

    found stream analayzer by akamai

    https://players.akamai.com/stream-validator

    the generated url's data (by nx) lacks resolution information compared to the working m3u8 url I posted here previously.

     

    the generated URL from nx

     

    and the analyzed report says the following:

     

    Andrey Terentyev

    Zohar Schlesinger

    Oscar Hsieh

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello,

    Gentlemen,

    As for now, as I can judge, taking this into account,

    VLC is playing the generated URL fine now.

    The issue is caused by your environment specifics (frameworks, codec packs, player etc). Unless we are not looking at the same code, the troubleshooting becomes extremely complicated.

    Could you, please, create the simplest code example causing the issue and share the code?

    We would try to reproduce the issue in our lab and investigated it.

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    Hey Andrey, 

    As I said before, the code contains sensetive data [password/etc], since its in development only,

    share with me your email and I will share the private repo with you.

    the framework I am working on is expo enviroment, the code is bein ran directly on iphone, embedded the generated URL, no backend envolved here except the ubuntu running the nx witness.

    the usual m3u8 files contains multiple bitrates, as I have read in several forms, its Apple's condition for its compitiblity on iOS devices.

    same happened when I tried to play the url on iphone's browser, compared to akamai's hls file which worked just fine.

     

    Could we schedule a remote session/direct chat ?

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Kamal,

    As I said before, the code contains sensetive data [password/etc], since its in development only,

    Could you just replace this data with some "garbage". We are going to test the code in our lab, and that's why we'll use our own creds.

    0
    Comment actions Permalink
  • 0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hi Kamal,

    Got your sources.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hi,

    I passed the issue to our dev team.

    Could you please check with the latest version 5.0 beta 5.0.0.34744 R7?

    https://meta.nxvms.com/downloads/betas
    Does the issue persist?

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello Kamal,

    I've tried several services online where I generate a new HLS url from the HLS url by your 
    relay.vmsproxy.com URL, and they seem to work just fine.

    Could you please share a link to one of those services the url from which was working?

    Have you tried to open the URL on your iOS device in Safari? Does it play?

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    Hey Andrey Terentyev,

    Regarding your questions:

     

    1. I installed the beta 5.0.0.34744 R7 you suggested, same format of m3u8 file, same file structure, no multi bitrate variants, and of course same error, (I understrood that apple is very strict regarding the information that should be in the hls file in order to play it on their devices).

    2. I tried mux.com and https://api.video (commercial services that offer trial), of course it will not be implemented, it was for testing propuse. 

    3. I even tried <other_vms>, <other_vms> is a server software with high scaleability, connects onvif cameras and have the ability to stream HLS, their format works fine

    4. on safari/chrome on iOS it doesn't work, stuck on loading. 

     

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Kamal,

    2. I tried mux.com and https://api.video (commercial services that offer trial), of course it will not be implemented, it was for testing propuse. 

    I've tried several services online where I generate a new HLS url from the HLS url by your 
    relay.vmsproxy.com URL, and they seem to work just fine.

    Could you please elaborate what exactly have you done to generate an HLS url?

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    Could you please elaborate what exactly have you done to generate an HLS url?

    They offer an api service for live streams, where you send a request with input URL (generated faulty HLS file we are discussing), and got out various of output urls.

    I have to mention their services are very expensive and not designed to solve my issue here.

     

     
    YES I can, through iOS browser (chrome & safari).
     

     

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Kamal,

    Don't you have by chance h265 codec in your camera? Could you test with h264 codec set?

     

    0
    Comment actions Permalink
  • Avatar
    Kamal Agbaria

    I tested with h264, h265

    Same result on both.

    P.S. camera is upgraded to latest fw, no touble with connection to nx.

    0
    Comment actions Permalink

Please sign in to leave a comment.