Sunday, April 3, 2011

How can I stream images from a webcam to my site using PHP?

I will be using PHP.

I want to build a basic dating site so I think I need to learn how module by module or piece by piece until I have it completed. What I want to start with is the webcam part.

How would I go about streaming a webcam to a website?

How would I fetch a few screenshots of the webcam and post it on the site (storing it into a db)?

From stackoverflow
  • you can use AJAX to refresh images (or use metarefresh) in some intervals...

    strager : That doesn't even need Ajax. Just plain ol' Javascript.
  • You should use something like Flash or Flex to display the video.

  • The simple answer is that you cannot do this directly in PHP you will have to use a client-side technology like Flash, Flex, Silverlight(?) or even AJAX (super low tech), to do this kind of thing, as PHP only operates on the server-side and there for after page load is unable to change the content of the page.

    If I were to do something like this (again) I would use Flash, from my experience it is best suited for this type of media, with the best user-experience and the best browser/os cross-platform availability.

    strager : I think the OP is concerned on how to implement it on the server side. Regardless, good answer.
    Unkwntech : Unfortunately without some clarification from the OP we will never know.

0 comments:

Post a Comment