iOS Question Problems with the "MJPEG decoder"

Discussion in 'iOS Questions' started by Filippo, May 14, 2018.

  1. Filippo

    Filippo Expert Licensed User

    Hi,
    I have problems with the MJPEG decoder, in the new iOS version was changed by Apple something so this decoder stops working.

    With this example I can receive the pictures from the example MJPEG / CCTV Server.

    After the connection, however, only the first picture is displayed and the transfer is terminated.

    Can someone confirm that? If yes, is there a solution?
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Does it work with other mjpeg streams, not created with B4X MJPEG server?
     
  3. Filippo

    Filippo Expert Licensed User

    It works with all, but only with iOS version smaller than 11.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    I've tested it with an Android device running CCTV server and this B4i program:

    Code:
    Sub Process_Globals
       
    Public App As Application
       
    Public NavControl As NavigationController
       
    Private Page1 As Page
       
    Private ImageView1 As ImageView
       
    Private mj1 As MJPEG
    End Sub

    Private Sub Application_Start (Nav As NavigationController)
       NavControl = Nav
       Page1.Initialize(
    "Page1")
       Page1.Title = 
    "Page 1"
       Page1.RootPanel.LoadLayout(
    "1")
       NavControl.ShowPage(Page1)
       mj1.Initialize(Me, 
    "mj1")
       mj1.Connect(
    "192.168.0.7/"51042)
    End Sub
    It works properly in release mode. You can also get it working in debug mode if you reduce the frames per second on the Android device.

    Tested on iPhone 8 running OS 11.3.
     
  5. Filippo

    Filippo Expert Licensed User

    It works with Android and iOS, but not with iOS and iOS devices.
    Look at the time in the 2 pictures.

    20180515_212141.jpg

    20180515_212703.jpg
     
  6. Erel

    Erel Administrator Staff Member Licensed User


    You must include all the relevant information when you post questions. It takes time to configure the test environment. Sorry but I cannot further help you here.
     
  7. Filippo

    Filippo Expert Licensed User

    I beg your pardon, but to explain, and also in English, is very difficult for me. :(

    Try the following with 2 iPhone / iPad with iOS 11+:
    1) The "CCTV server" on iPhone or iPad
    2) Connect and test the client with Safari or other browsers, or the client with my code (see first post) test.

    If the client is an iPhone with iOS 10, then everything works.

    Erel, but if you do not feel like testing any more, which I can understand, then let it stay, I do not mind.
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    You will need to debug it. Things that you should try:
    1. Reduce the frame rate in the server.
    2. Add some log messages to the client to see whether NewData is raised.
    3. Make sure to test in release mode.
     
  9. Filippo

    Filippo Expert Licensed User

    OK, I have already tried points 1 and 3, unfortunately without success; I'll try point 2 now.
     
  10. Filippo

    Filippo Expert Licensed User

    Hi Erel,

    please try your example MJPEG / CCTV Server like this:
    1.Test:
    1) Start your "MJPEG / CCTV Server" on an iPad / iPhone with iOS 11+
    2) Start a browser (Safari or others) on another iPad / iPhone with iOS 11+ and connect.
    Result: it does not work for me. :(

    2.Test:
    1) Start your "MJPEG / CCTV Server" on an iPad / iPhone with iOS 11+
    2) Start a browser (Safari or others) on another iPad / iPhone with iOS 10 and connect.
    Result: I work very well. :)

    3.Test:
    1) Start your "MJPEG / CCTV Server" on an iPad / iPhone with iOS 11+
    2) Launch a browser on an Android device and connect.
    Result: I work very well. :)

    4.Test:
    1) Start your "MJPEG / CCTV Server" on an Android device
    2) Start a browser on an iPad / iPhone with iOS 11+ and connect.
    Result: it does not work for me. :(

    5.Test:
    1) Start your "MJPEG / CCTV Server" on an Android device
    2) Start a browser on an iPad / iPhone with iOS 10 and connect.
    Result: I work very well. :)

    These tests prove that something has been changed in iOS 11+, which makes the whole thing no longer work.

    I have done this test, unfortunately I could not observe anything extraordinary.:(
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    Don't use the browser at all. Use mjpeg decoder. I tested it by running the server on an Android device (it doesn't matter where you run it) and the decoder on an iOS 11.3 device and it worked fine.
     
  12. Filippo

    Filippo Expert Licensed User

    I'm sorry Erel, but the decoder behaves exactly like the browser.
    I did these tests just so you do not have to waste so much time.

    But fine, if it works for you, then it may be on my network or my devices are scrap. :(

    Nevertheless, many thanks for your time. :)
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    With MJpeg Decoder you can at least debug it. You can add log messages and find out why it stops updating. My guess is that it updates too fast and doesn't let the UI redraw itself, but it is just a guess.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice