Dynamic Transcoding and streaming - php

im trying to work out the best way to have my site dynamicly transcode and stream video files to users who are mostly on mobile devices, site is php/mysql based and running on a windows 2003 server which i have full access to, any ideas how best to do this - id rather not need to transcode videos on upload if possible

For your services consider something with some oomph: Inlet, Digital Rapids, or Rhozet. Some of these players offer some form of live-stream encoding but you'll generally have limitations on hardware. They all have suitable APIs for interacting with the hardware and profiles.
You can also consider using public transcoding services but keep the assets private. It's not quite as elegant as a roll-your-own but it does solve the problem.
Transcode-/Encode-on-upload will probably serve your needs better if the volume of content or traffic increases. Real-time transcoding has many hurdles including race situations and bandwidth.

I had a similar similar situation in my past at that time I had book marked this like below which has some very interesting stuff ,
php video transcoder
I am sorry If this didn't help you

Related

video hosting with PHP api or PHP script for social network project

I have a project for a small social network where user can upload their videos, video should not be longer than 1 or 2 minutes but they need to be private and related to user that uploaded.
Since uploaded video may be in many different format I have two options:
upload video and use ffmpeg to process them, can i find any PHP script that does that? PROS I have my files on my server and I'm not dependent from third party CONS I guess is a real intensive task and I may need a quite good noting plan since the beginning of this project
use a video hosting service that provide API to upload and process video, i actually find vzaar.com that may seems to do what I need. PROS Scalable CONS I rely on third party for my contents
since the project is a small social network it may be interesting this too opusphp.com, but i never user or read about
can Vimeo PRO suite my needs? Other suggestions?
In future it may be necessary to add a basic video editing function to trim uploaded video setting starting and ending point
I would suggest you use ffmpeg and call it from PHP using ​shell_exec() for example.
If you use x264 for encoding you can tune it to use moderate/lower encoding settings so that your server can deal with the load (up to a certain point of course in a size-controlled environment).
ffmpeg will also allow to trim (and much more) videos as you see fit. Video hosting services may not have that option or this could induce an additional cost.
Beyond that recommending online video services to fit your project does not fit Stackoverflow guidelines for asking questions.

Managing images and other media for large website

I am currently developing a big web application. Users will be able to post images as well as music files to my server. I am using PHP with Codeigniter framework and work off an Apache server from A2hosting.com . I was wondering how I will be able to manage space. I know that they offer unlimited storage but I know that I am going to run into issues if too many people are uploading too much.
How is the best way to deal with this? Would you have your own separate hosting plan for storing all this media? Could it be stored in a through a third party? Will my site eventually be slowing down because there is way too much memory that I am holding for people?
I guess I would kind of like to know what issues I am going to be running into? My project is almost completed and I want to avoid any large scale errors that may occur. I am the only one working on this project so man power is pretty precious, as well as time.
Any help and insights will be greatly appreciated.
Anyone offering you "unlimited storage" at a fixed rate is having you on.
We put our media files on Amazon S3, which is designed to handle trillions of files.
If you do host the uploaded data locally please don't place your uploads folder anywhere in your web root or in a place directly accessible by remote users. Expanding your storage is easy but recovering from a total website or server compromise is not!

Images Sharing Feature

I'm creating for my web application (PHP) a feature of images sharing between users which means all users can upload their images to my server.
so,
my first assumption is that I need a dedicated server to my "images sharing" feature.
the problem is that if the server will get many requests - bottleneck will be created.
I learned about caching (memcached, varnish, squid...)
do you think one of these technologies is suitable for me?
what is the best/ideal architecture for me? I assume only one server is not enough in some point.
so I guess I will need cluster of servers (master and slaves). right?
I will be very glad if you could give me some orientation about the right technologies & architecture.
Everything depends on how big traffic you will have. Can you estimate it ?
Cashinig solutions are good rather for samall images. I've some experience with image sharing/voting website and quite big traffic (12mln fullsize image downloads a month).

Upload Music files into server but restrict download?

I am developing a website for a rock band. I wanted to upload the music into the website and let the users listen to the songs. But, I want to add a functionality or some sort of code so that the users are not able to download the mp3 files that i will let the users listen. Suppose someone uses "Internet download manager", he she will be prompted to save the file on as soon as it get the music file. Is there any way to stop that.
Thanks.
There is always a way to bypass any restriction (either download the file or use an audio recorder).
The protection that iTunes and other music platforms use is to let you listen to a preview of the music (~30 seconds) so you cannot get the entire song.
Well, there is really no way to let someone listen to music without them downloading it. Even if you stream the music, they could still record it.
http://www.codewalkers.com/c/a/Miscellaneous/Using-PHP-to-Stream-MP3-Files-and-Prevent-Illegal-Downloading/
This could be of help to you, though, because it will make it much more difficult to download the music.
As mentioned by others, there is no foolproof way to keep the users from downloading the mp3s. Having said that, you could try streaming the content which will make it much more harder for most people.
You can use a streaming server like Red5 for this.
I've been working on the same, and what I did was to create two (or more) versions of each file. One file will be the listening file which in my case was a low quality MP3 file encoded with 112 kbps. The quality would be good enough for people to listen to it online, but not good enough if people wanted a decent quality when they are on the go with a portable player or the like.
Then i'd also have high quality MP3 versions (320 kbps) and WAV files which people could download only if they were logged in.
I can't say that I've found a solution which guarantees that people can't get hold of the music if that's what they are after. You could certainly use Red5 or some other streaming solution, but that requires you to spend more time and resources on configuring and maintaining that solution. Furthermore, I believe Red5/Wowza or any of the other streaming servers requires that the client use Flash to play music (because the communication is done over RTMP). That rules out iPad/iPhone/iPod users as Flash can't be used on those devices.
My conclusion was thus that with the (limited) resources I had the way to go was to offer playback over HTTP (aka "progressive http") using low quality files.

Quantify streamed video

I'm developing a PHP application which will charge users for the videos they watch. The business model is "everyone pays for how much she watches". For this purpose, I need to;
Implement secure video (FLV) access. (Authorized sessions will gain access)
Calculate how much video (FLV) data is sent from the server.
A trivial solution for this is to read FLV with PHP ("fread") and send it to client chunk by chunk (just "echo"). However I have real performance concerns about this method, because the application server has 1.7GB Rams and just a single core.
In short run we're expecting to get large number of impressions, however we would like to upgrade hardware as late as possible. That's why, I want to implement the requirement with the minimum overhead, in the most effective way.
I'm not tied to a webserver. I prefer Apache 2.2, however lighttpd can also be deployed if it offers a feature for the implementation.
Any idea is appreciated.
Thanks!
The PHP fread solution looks like the way to go, but with the server restriction, I think you will need to tweak the flash player. The flash player could send the server messages based on how much of the video has been played. This might be something to think about. Take a look at the JW FLV Media player, the customisation and Javascript integration will allow you to send xmlhttprequests to the server.
Why not using some videostreaming servers like Red5, I'm sure they have triggers that could perform writing some statistics to a db or something similar.
Another advantage would be that user could skip forward in the video.
So to sum up and for future reference I decided to go with the php fread method, since no satisfactory alternative is suggested.
Thanks to all contributers.

Categories