I have a few videos (avi, mp4, mkv) each is around 1 GB and I have one around 7 GB.
I want to play these videos online, so I tried FlowPlayer which seems to be broken with videos larger than 600MB.
is there any solution that will allow me to play these videos online? without converting to flv as I intend to allow downloads for these videos too.
I've been thinking of red5, but I don't know if it will work for this kind of videos nor if it works with the above-mentioned extensions + I am not familiar on how to make its applications and get direct downloads links (I don't want duplicated files for watch/download).
I will also need a timed captioning support like '.srt' files.
Your suggestions are highly appreciated.
You won't find a web-based player that supports all of the features you mention. However, you can get folks to install VLC's browser plugin. This is not ideal, as most folks won't do this, but it will do what you ask.
Otherwise, I suggest keeping the original available for download, and converting the videos to FLV as well. For the captions, you will need to convert the file to whatever format the player you end up using supports.
For the player, I recommend looking into Longtail.
Related
I am creating an web application, where user can upload his profile introduction video. I tried searching around to look for tutorials, but did not find any. I have the user video upload part/ code in PHP, but my question is that how can I make the video playable in all browsers?
Is there a library for it or application I have to use for that? If anyone can point me in the right direction, I'd appreciate it.
try this it's work for you
<video controls>
<source src="<?php echo $this->webroot; ?>img/uploads/profile/<?php echo $listdata['SubscriberVideo'][0]['name'];?>" type="video/mp4">
</video>
change video path to your path.
If you want the video to play in most major browsers on most common devices an OS's (all is tricky as there are many small niche browsers), then, as I am guessing you have noticed, you need to be aware of the video formats that different combinations require.
Partly this is because new and better encoding methods emerge over time and are adopted at different times by different browsers etc, and partly it is because the video encoding world is full of patented software and different browsers, OS's etc have different rights and different philosophies around this.
On top of that you need to be aware that the requirements change over time as new devices and new codecs etc are released.
You can narrow things down by restricting yourself to the most recent versions of OS's and browsers, and by using HTML5 playback.
There are several resources that provide some example HTML5 code to support playback across as wide a set of devices as possible - e.g.:
http://v4e.thewikies.com
As you can see you do need to convert the uploaded video into several different encodings and packaging format to achieve maximum coverage.
You can do this sever side by using a package like ffmpeg, open source video manipulation software:
https://www.ffmpeg.org
There is a PHP wrapper library for ffmpeg which may be worth looking at if your server is PHP based:
https://github.com/PHP-FFMpeg/PHP-FFMpeg
Having said all the above, if you want a simpler solution that will play back in nearly all browsers at this time, the mp4 format (MP4 container and H.264 codec) will probably meet your needs. You can check current coverage using links such as this one (make sure you use a well known reputable source as this areas changes frequently):
http://caniuse.com/#feat=mpeg4
https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
I'm downloading videos from a 3rd party server (mostly flv, mp4) using php script, after download I'm cutting video at 1:30 mins - now it's ready to be played. Is it possible to download only part (1-2 mins) of the video instead of whole file and still being able to play it (the way it's now it's simply wasting bandwidth, CPU...)?
This is very hard to do, as it requires your script to understand MP4 or FLV. However, this may help you (please note that it still requires ffmpeg, FLVTools2 and Mencode to be installed).
Cutting a flv or mp4 involves some index updating, looking for a possible cutting point etc. Building that in php seems overkill. Look into some Tools that can download and cut in one step and call those from your php. FFMpeg and MPlayer may be able to do that.
I have my own video sharing app,
My question is... is there any library,script or something else, to help me in rotating videos whatever their file extension is?
Many peoples are uploading videos but sometimes i found video (guessing shared with iphones or mobile phones) and i see them horizontally instead of vertically...
Does anyone have any ideas how to rotate them dynamically?
Im not familiar with any "libraries" that will do that. I think your better bet would be to find a command-prompt-enabled video software package (like Any Video Converter [See Q7]) that PHP can execute via command prompt on the fly.
PHP doesn't do that, and there are no extensions that I know off, made for that purpose.
You can use ffmpeg to manipulate videos, by calling it from your scripts (see shell_execute() and such functions). Reading the ffmpeg documentation will help you figure what can (and can't) be done with that powerful tool.
Does anybody know a purely PHP based way to alter the frequency of an MP3 file?
I am on shared hosting with this, so installing ffmpeg or something similar is out of the question.
If this requires actually altering the audio data, then I guess it is not possible nor feasible to do with PHP, but I was thinking maybe this is just a header setting. I don't know.
Background:
A client's website is utilizing a Flash based MP3 player to play some audio.
The client is producing the audio herself.
The trouble is that the tools that she is producing it with, and is familiar with, automatically produces MP3 files with a frequency of 48000hz, while some versions of Flash have trouble playing anything with a frequency differing from 44100khz. (See my related question here).
I would like to avoid adding yet another program to the already complex audio production process, and solve this on the web server end if possible.
I was thinking maybe this is just a header setting.
No. That is, you can probably change it in the header, if you don't mind your MP3s being played too slow or too fast with a shifted pitch.
If you want it to sound the same, you will need to re-encode. Decoding to WAV (or raw samples), resampling, then re-encoding is a possibility, and probably your only one.
Maybe the way MP3 works allows for a shortcut (like JPEG allowing for lossless rotation), but I am unaware of any such methods.
I need a way to extract the audio from some video (in PHP). I have the video streaming in from YouTube, so I would really like it if it were on the fly streaming, not I have to save it to a temp directory and process it there (though that is acceptable.) Thanks, Isaac Waller
Edit: to be more specific, I have a MP4 and I want it to be a MP3.
You're going to want to use something like ffmpeg and call it using php's exec command. If you look around in the docs, I'm sure you can figure out what flag to use to only get the audio.
I've used this app before on a project for live transcoding of video, works like a charm. Just make sure your server has it correctly installed.
Mplayer should do this for you, and there are libraries and codecs that you can call (PHP supports C libraries) which will strip the video from the AV stream on the fly.
Given that you're targeting youttube your job is a bit easier because they use a very small subset of file encodings.
If you take the time to learn the format, you can very easily remove the video stream on the fly and return only the audio stream.
If you give a little more information, such as what you're encoding it to, or where it's going to end up we may be able to help more specifically.
-Adam