Online video streaming - php

I want to make a video site in which we can upload the video in any format and display it like youtube. How can I do this? My whole site is in PHP I'm a newbie in the video streaming sp plz be descriptive with your answer
Thanks

First you need a VideoPlayer written in Flash / Actionscript, there are also a lot of free ones arround in the internet, e.g.: FlowPlayer, You also could write you own. You acctually do not net to buy Flash for this. The Flash/Flex compiler mxmlc is available for free. You could also write you Flashvideoplayer in Haxe (also free).
You you do not want the users to switch within the video you could deliver the videos via HTTP, other wise you need an streaming server like: FlashMediaServer (not free). There are also open source alternatives like Red5 or haxeVideo.
You you do not have the video available in the right format you need to encode them: the best tool for this task could be ffmpeg

I suggest looking at the html5 <video> tag, this is probably the simplest way. For an example look at the the one from surfin' safari.
Be aware that some browsers support ogg and others h264, but not both.
Encoding of the video can be made using ffmpeg on the server.

One of my websites does this, and it's a MASSIVE pain.
However, there are websites out there that'll take a video and convert it to an FLV for you (for a price), for example we use a service called Hey!Watch which is reasonably reliable.
If you really want to encode it to flash yourself, you're going to need a full copy of Flash and a LOT of time =]

There is this highly underrated post with 3 great links for open source solutions that are like youtube and fits perfectly your question (and at least another one):
http://www.vidiscript.co.uk/
http://www.phpmotion.com/
http://osshare.sourceforge.net/
I'm posting this here just to point out the links. I think 2 of those 3 questions should be marked as duped anyway.

Related

Convert higher bitrate mp3 files to lower bitrate in PHP

I developed a system that contains many MP3 files that users can listen to them online/stream, since most of my users are Iranians and Iran internet speed is sucks, I came up with an idea, but I can’t find the right/best way to do that.
I have alots of different berates: 128kps, 192kps, 320kps, etc… I would like to know what’s the best way to remotely convert these files to 32/64kps qualitie, and of course, temporarily.
I mean, after the new file 32kbps generated. After period of time the generated file automatically delete.
I did lots of search before I ask this question, but none of the results answered my question.
BTW, I find the LAME library.
Is there a way to do that with pure PHP?
Is there a way to do that with pure PHP?
Nope. Not at all. PHP is a server-side scripting language that depends on add-ons & external functions. That said, there is a SWFMovie::streamMP3 function, but as the page says, “This function is EXPERIMENTAL.”
You are much better off learning about MP3 streaming software like Mopidity which is a Python-based music server. Might also look into Andromeda which appears to be PHP-based. And such. Reinventing the wheel will not be fun at all. You are better off researching how to use Open Source MP3 streaming software as best as possible & adapt it for your needs.

How to extract image from google video?

Images for every youtube videos are hosted their server. You can image of any frame and can display on your site.
I want to do same with other video sites without using getting ffmmpeg installed. Because my share hosting service will not le me do this.
Please suggest me on the same. I want to do it in PHP
It won't work, at least given two conditions:
The video sites don't provide an API for you to extract arbitrary frames from the video. If they do, your solution will be video provider specific.
You don't want to write your own video decoder for the codec (for example H.264) in PHP. Note that this would be a extremely difficult task and the decoder would be really slow if implemented completely in PHP.
Point 1 is rather improbable, at least I don't know of any video site that does this. Point 2 is really really a lot of work, I'd say it's impossible without deep and profund knowledge of the video codec.
So I guess, your best starting point is to either drop this feature or use a hoster that offers you ffmpeg.

Facebook like status url detection

I am wondering if there is a script similar to the facebook status update thing,
What I mean, is when for ex. I paste a youtube/other video site/image/link it automatically detects the contents of the page and associates an embed code with it (if its a video)..
So I'm wondering if there is a ready script that has a large database of websites and can associate video site url's with embed codes.
I could actually do something like that by myself but the problem is that I want to support a lot of websites, like facebook does.
Please help me find a solution.
Thanks.
Take a look at the Embedly API: http://api.embed.ly/
It gets the embed code for a lot of the popular video sites out there and also for some images sites. I highly recomend it,
you can try it out here.
You really wouldn't have to scan that large of a database. With videos, you could keep track of maybe the top three or so uploading sources (youtube, vimeo, metcafe...) and their embed codes.
As for images and links, those are pretty easy to detect and don't require any special embed code. By pretty easy, I mean very simple. Just use a simple regular expression to search for a link in their post.
If it's a picture, you can easily tell by looking at the file extension of the link (jpg, png, gif, etc.). If so, do whatever is proper to embed any old image. If it's just an ordinary old link (doesn't match any of your video sites, or doesn't end in a file extension for an image), just use the link itself.
The only marginally tricky part would be getting the unique embed codes for the video sites. But perhaps there is some external library/api that could do that small part for you (another answerer has provided has a proper API/pre-built library for this). However, images and links are mostly pretty simple.
EDIT It seems I misread your problem, and that you are only looking for pre-built libraries with video embed codes. In that case, the other answer is exactly what you want.

Quicktime to Flash using PHP ? And chapters

For a client, i need to write a complex application used to stream tv episodes in flash format, at least, the player will be in flash.
It's a first for me, and i've a lot of question, since i don't really know about streaming.
But well, first, here is the constraints :
Mac server (might be migrated to linux)
PHP5
Flash
external library could be used with PHP
What i need to do at first, is to write some app (php, python, shell), or find one to convert over 500 quicktime videos to be able to be read within a flash player.
Then, i'll a back office, to add videos with meta data (the meta data will be simple html inputs), and, here is an important part of the project, the ability to generate chapters for each video (manually), the client will choose the start of a chapter, give it a name.
My questions :
Is there any flash player able to do that ? or will i have to use 'playlist' such as youtube to simulate chapters ?
Will it be easy to use the quicktime video within a flash player ?
What would be your advices for such application ?
Thanks
You're probably going to want to install and run ffmpeg to convert quicktime movs to flv or f4v. You may be able to add cue points (chapters) by using something like FLVtool.

PHP Video Editing and Streaming

I am developing online video streaming website on PHP.
I need two functionalities:
Need to add title/text at bottom of the video dynamically.
Need to add background music to video dynamically.
Is it possible with PHP or any available open source library?
Can anyone guide me or provide links to this type of library ?
Thanks.
Editing video with PHP is an extremely bad idea. This idea very closely approximates impossible. At best you would need to decode the video which would be brutally slow in php.
If I had to tackle this problem, I would try to add the title and background music in the player, not to the video file itself. If you're streaming the video it is likely that you're using Flash or some other client-side player. You would need to write the player (or perhaps modify an existing one, there are several available) to add another layer over top of the movie for the title, and an audio track.
Slightly more hare-brained, but still easier than rewriting video in php, would be to layer a transparent image generated in php over top of the player using css and javascript, and embedding the audio in the page. This paragraph contains a terrible idea.
php doesn't provide any video oriented stuff to perform, but there is one CMS namely Kaltura, is designed and implemented in doing these kindaa stuff. Search it , download it and play it.
You can make your own player in Flash and add a default watermark. You don't need PHP for that.

Categories