video streaming from IP camera

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
labrat
Posts: 32
Joined: Mon Dec 29, 2014 6:17 pm

video streaming from IP camera

Post by labrat » Fri Feb 20, 2015 8:59 pm

I have a wireless network camera that I am trying to connect to with the player object. I can access the camera via a web browser, but so far, not using the LC player. I've looked at this lesson:

http://lessons.runrev.com/m/4603/l/44283-using-players

and noticed at the bottom of the lesson it says that you can access a URL. Below is my code:

Code: Select all

on mouseUp
   set the filename of player "player" to "http://192.168.1.56/video.cgi"
   start player "player"
   launch url "http://192.168.1.56/video.cgi"  -- just testing the URL
end mouseUp

BTW, I recently learned that the new version of Java sometimes blocks access to video in a browser, so just in case, I have made a security exception for 192.168.1.56, so I don't think Java is blocking the process.

What else do I need to do to get the streaming video from the camera?

I appreciate any assistance.
Last edited by labrat on Mon Mar 02, 2015 6:51 pm, edited 1 time in total.

labrat
Posts: 32
Joined: Mon Dec 29, 2014 6:17 pm

Re: video streaming from IP camera

Post by labrat » Mon Mar 02, 2015 6:50 pm

Well, I have been unable to display the streaming video from an IP camera using the player object. Though I can (as mentioned previously) display it with a browser (and browser object), I have found a problem displaying the video with a browser object, namely, it depends on the browser object that I use. Basically, I have discovered that I can display the streaming video from an IP camera using this code:

Code: Select all

put revBrowserOpen(the windowId of this stack, "http://www.runrev.com") into lBrowserId
but not by using this code.

Code: Select all

put revBrowserOpenCef(the windowID of this stack) into lBrowserID
In both cases, I navigate to the link of my camera by entering the URL into a text field.

When I use the reBrowserOpenCef() function, I am asked to enter credentials; then when I enter them (correctly) it denies access saying that authentication failed.

I can use reBrowserOpen, but I wonder what is the problem with revBrowserOpenCef.

EDIT: I have learned that the revBrowserOpenCef() function is a Chrome based browser function, and I now believe that the problem is related to the Chrome browser security settings, though I have been unable to figure out what the correct settings are.

Any help and/or insight is appreciated.

charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Location: Singapore
Contact:

Re: video streaming from IP camera

Post by charms » Mon Mar 02, 2015 10:02 pm

Hi,

I had also issues with revbrowsercef. If you have such issues it makes sense to open a bugreport. revBrowserCef is new in LiveCode and there are still certain bugs. Whats the problem using revbrowser? Which Livecode version are you using? If you don't have the newest version try a newer version in parallel.

Do you know in what format the camera is streaming? MP4, AVI? Check that the streaming format is matching with a supported format in LiveCode. I have no issues streaming movies with play <url> or following commands:

Code: Select all

      if exists(player "Video") then
         delete player "Video"
      end if
      
      create player "Video"
      set the width of player "Video" to the width of this card
      set the height of player "Video" to the height of this card
      set the top of player "Video" to 0
      set the left of player "Video" to 0
      set the lockLoc of player "Video" to true
      set the showBorder of player "Video" to false
      set the filename of player "Video" to "http://192.168.1.1:12345/mystream.mp4"
      wait 1 tick
      start player "Video"
   end if
If the camera is using http auth you can set authentication through the httpHeaders (search for httpHeaders in dictionary).

Code: Select all

put "Authorization: Basic " & base64Encode("myusername:mypassword") into tString
set the httpHeaders to the httpHeaders & cr & tString
Generally this should work. I'm streaming many videos this way. I'm using 7.0.3 for Mac based applications and 6.7.3 with mobile applications.

Hope it helps.

jerold_fritzz
Posts: 1
Joined: Thu Sep 03, 2015 10:45 am

Re: video streaming from IP camera

Post by jerold_fritzz » Thu Sep 03, 2015 12:55 pm

You should try StreamingVideoProvider for streaming IP Cameras over RTSP. You can even set your streams to Pay-Per-View and don’t charge commission on sales.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”