Open Source PHP script for HTTP video streaming? - php

Open Source PHP script for HTTP video streaming?
I need some PHP script or script lib for enabling reading and writing from and to a HTTP stream. I want to write chunks of data...
Actually I'm looking for such thing because adobe Flash 10.1 now supports it... So it looks for me lots of such questions will appear soon)
BTW: I do not need some special server - I need a script that will be using PHP Streams
Introduced in php 4.3 so it will work on normal apache php hosting…
So… What do I need?
I need -
• Open Source Libs
• Tutorials
• Blog posts/Articles

would something like xmoov work for you? it appears to have some means to allow you to get intimate with the video-stream, but I've not used it first hand

Related

Open a web browser in a PHP cli app

Disclaimer: I did not think through the right language to use for this project before I developed it. I should have used Python for the webbrowser.open() function knowing that I needed to open browsers. But anyways.. A shot in the dark.
I am working on a PHP command line application. I am almost done, and the last feature allows the user to open a browser using the command line, much like redmine-cli's redmine-cli open [issue #] command.
Checking the source, I can tell that Redmine CLI uses the webbrowser.open.. But I am using PHP [the worst language to make a CLI app out of?].
I knew they wouldn't work, but a shot at the dark, I tried to user the header() function in PHP, as well as embedding the window.open() JS.. Which, obviously doesn't work.
I want to open a web browser in my PHP cli app. Is it possible, or should I just rewrite the app [sigh] in Python?

HTML to picture ( php parser for html2jpg / html2pic / html2img )

I need to make thumbnails from html (and css) code. Similar to flash's AIR1 HTMLLoader.
Is there a php class or php script that does that?
If you have access to the command line from PHP (via exec() or shell_exec()) you can check out PhantomJS, a headless WebKit browser with a JavaScript API. I use this to do exactly what you're describing:
I generate an HTML file locally
I pass the path of that HTML file and an output path for the image (in my case a PNG) to a bash script that executes a call to PhantomJS (there are great examples when you download the package)
I serve up the generated image
I've tried a LOT of potential solutions and spent many hours on this problem and PhantomJS is by far the easiest I've found. There is a bit of lag waiting for the headless browser to start up, but from what I understand the latest version allows you to keep it running on a port of your choosing. I haven't been able to try this yet. You'll need GhostDriver for this as well. Check out the 1.8 Release Notes for more info.
Good luck!

In PHP how to deliver website to client without giving them source code

As in JSP we give "WAR" file to clients and it contains .class files and other configuration files but not the source code, is there any way, in PHP, to deliver the project (website) to client without giving them source code.
Facebook created a project called HipHop php, a php compiler.
See this post:
Can you "compile" PHP code?
Short answer, not really.
I mean you can compile php into a single .phar file however anyone with moderate php knowledge can get the code from that.
There are also solutions http://www.ioncube.com/ though I don't know how easily someone can get the code from it however I would strongly advise against any solution like this as they generally require the user of this "compiled" code to you their proprietary software to run it.

how to scan image on php or javascript?

i dont know its possible or no?
i have a project in php ,
can we scan image on php or javascript or ... via scanner , is any way for that?
Assuming that the scanner is connected to the server where PHP is being executed:
Currently there's some good solutions to scan images through PHP by making use of the Open Source SANE Scanning software:
SCANPHP
A PHP Lightweight Scanning GUI which makes use of the Open Source SANE Scanning software. The PHP GUI can be installed on any Web Server as long as PHP can be run. PHP calls the scanimage command in order to provide the scan. Post scanning, the image is piped "|" to gocr / pnmtojpeg in order to provide the acquired file.
PHPSANE
phpSANE is a web-based frontend for SANE written in HTML/PHP so you can scan with your web-browser. It also supports OCR.
A code example would be:
exec("scanimage --mode Gray --resolution 150 | pnmtojpeg > /tmp/image.jpg");
You can refer to the SANE Project Homepage for further information on options available, installation steps, etc.
It's possible, but only using third-party plug-ins or applets, most of which are not free and limited to a platform (PC / Windows mostly, and some even to Internet Explorer, although there are ActiveX wrappers for other browsers, too.)
Check out the answers to this question. They should give you a good overview about what's possible.
It is impossible to use scanner from the JavaScript on the client unless you have a special browser interface for that. No major browser have built-in support for that -- only via plugins.
Here is some more info:
http://www.ciansoft.com/samples/tcxbrowser.htm
http://www.chestysoft.com/ximage/twainupload.asp

Stream data (such as music) using PHP (or another language)

For years, I've been investigating how to create music streams from my computer. I've seen programs, but anything useful I've seen is Windows only (I use a Mac).
Eventually, I got interested in how streams work. Is there any way I could create my own stream, possibly using socket functions in PHP? Is there a PHP library for this?
Take a look at Ampache. It is a Web-based Open Source Audio file manager. It is implemented with MySQL, and PHP. It allows you to view, edit, and play your audio files via the web.
In the end it all boils down to the protocol you'd want to use. Shoutcast IMHO is plain HTTP, so to make your own stream, you just output the streams content.
To make an ogg based webradio work with my Sonos system, I have created a little transcoding wrapper around sox which is is actually written in PHP, so it may be helpful to you to serve as an example.
You'll find it here: http://www.gnegg.ch/ogg2mp3/
If you are after implementing your very own streaming protocol - maybe even UDP based, then, I'm afraid, PHP may not be the right solution for the problem - at least not as long as it has its share of problems when used for long running processes (which 5.3 may bring some help for with its integrated garbage collection)

Categories