WAMP Server Streaming video MP4 start took to much time - php

I am using WAMP server 2.4. I am streaming MP4 videos. Whenever i request video to stream it took around 3-4 mins to start streaming and once streaming is started it works fine.
I am unable to figure out why it takes to much time to start streaming.
I have tried following link as well but it didn't solve my issue.
Load mod_h264_streaming.dll in Windows Apache2
Please help

Are you using Flash or HTML5 or else to playback the video?
It sounds like the browser/client is trying to get the full length file before playing it back. It could be due to the fact that your MP4 file is not properly formatted for the web (MOOV ATOM is at the end of the file and playback cannot begin without it). You can read there for more info.
I would suggest two things:
try with a short 10 sec file and see if it plays rapidly
try a software like handbrake (or MP4Box or ffmpeg if you are more advanced on file transcoding) to transcode your MP4 with the "web optimized" (aka "fast start") check box active.
Let us know if it works.

Related

how to stream video from FTP in PHP

is there any way, how to play movie or get some file (ex. jpg, pdf) from distance FTP server?
I've got an app on my PHP server and really lot of bigsized files, so I store it on FTP. I need to play (videos are the biggest problem) these videos via that app...
I've found ftp_get() function, but it seems to work like - "copy this file to my php server and than play",... it's not acceptable for long time.
Any ideas/solutions?
PS: excuse me my english and maybe not so detailed description.
FTP is a file transfer protocol so it's not the right tool.
Few ways to do it:
PHP HTML5 Video Streaming Tutorial (PHP stream)
Pseudo Streaming MP4’s with PHP
Streaming a large file using PHP

mp4 streaming with jwplayer and download speed limit

hi everyone i have a problem with my streaming. at the moment i have made jwplayer to open a php file (ex. movie2.php) and this php file gives to the jwplayer the movie file pice by pice by sleeping 1 second to limit the speed (this php file also checks referer and session and doesnt show the video path but that but these are not important for the problem) . until here everything is perfect but the problem is : I can not seek the video to a not loaded part and it is obvious the reason why . so can anyone tell me how should i do this ? i need to change this php file somehow to make it support the streaming or can anyone give me a script that supports the streaming and limit the download speed at the same time ??
Check the "start=" value passed to your php code. I've used the JW Player before, and it definitely supports seek. Apparently, a seek is more like a restart, and passes that 'start' to your php file. From there, your file just starts the playing at that point.
There's a couple other comments on that thread about handling the client side of the object to avoid a couple pitfalls. It may be a bit dated, but should be relevant.

Uploading video, with PHP serverside formatting & encoding

We've currently developed an ExpressionEngine site (php), and are using a paid JWPlayer to display video uploaded by the client.
At present we're running into a number of issues, as the client is:
Uploading video at the wrong size
Uploading video randomly in both flv or mp4 format
And the player is chugging along terribly with multiple pauses throughout the video - sometimes buffering the entire clip before it is played.
I know FFMPEG can be installed serverside, but I'm not sure of the way in which to go about this, and how it might interact between ExpressionEngine and JWPlayer. I'm also not sure about the formatting - the ability for this automated encoding process to also crop/resize the video to suit the player dimensions on the site.
We would really like to have the videos playable on all browsers & iOS devices.
A HQ option would also be great where applicable, but it's just a nice to have - as we're struggling with the formatting / encoding issues first and foremost.
Any help figuring out the best process, and what tools I might need would be greatly appreciated.
I'd reccomend using a service like zencoder
I've used them in the past and no matter what video format I've thrown at them it works great. (PS. I'm not affiliated with them at all)
There is a PHP API with a whole lot of resizing, quality and format options. After you've uploaded your video you can send it to zencoder and they'll send you a response some time later with success or fail.
They can put the processed video on Amazon S3 or FTP it to a server.
You'll need a HTML5 player for iOS devices though, unless JWPlayer has come a long way since I used it last.
You could get zencoder to output in mp4. and then you still only need mp4 for JWPlayer/flash and the HTML5 version for iOS, as long as your happy to use flash for all desktop browsers there's no problem.
As far as the buffering issues you are having - I have found that using a CDN version of the swf for JWPlayer (or whatever player you are using) has caused it to load the entire video file before playing. Easily fixed by hosting it yourself.
I have found many times the video conversion capabilities of different CMS to be limited, and often restricting video formats to what the developers thought was appropriate, such as FLV, which nowadays is turning obsolete for video delivery.
One of the ways you can approach it is by creating a custom script to process the videos uploaded by your client using FFmpeg, which in fact can accept almost any video format, and generate the correct output formats and dimensions, ensuring that the resulting videos will be suitable for web playback using your player.
The problem with the video buffering you are facing is because the video file is not prepared for progressive download or pseudo-streaming, so your browser needs to download the whole video before starting to play. This can be solved with programs like qt-faststart for MP4 and MOV video files, and flvtool2 for FLV files. So your script would need to also optimize the encoded videos using these tools.
Also note that if you use an HTML5 video player (browser native or recent JWPlayer), then you can enjoy from random seeking the video files without buffering them.
If starting from scratch is not an option, you can look into a commercial solution like tremendum transcoder which also uses FFmpeg and is quite simple to use, yet it does all you need in regards to dealing with different input formats and aspect ratios automatically.
I have done a few setups this way, separating the CMS part from the video processing part, and it saved me some headaches.

Take a snapshot of a flv video with php/js/as3

I am developing a website in php hosted on a shared linux server.
I need to allow the users of my site to upload and play flv videos with flowplayer.
It would be fantastic to show a snapshot of the video before it starts, something like these: http://flowplayer.org/demos/plugins/streaming/first-frame.html
My server doesn't support pseudostreaming and it has no ffmpeg/mplayer support (it's a shared host after all...)
I am guessing how can I take a snapshot of the nth frame of the video with only php or javascript or action script.
I read something about bitmapdata class in flash >= 8, but i don't know how to do all the work automatically without the user's input.
Can someone help me?
Thanks.
AFAIK - if your server doesn't have ffmpeg, you're not going to be able to do it with PHP.
You definitely can't do it with JS.
Which leaves AS - you can create a bitmap from any display object, and save that as an image file with PHP, both of which are pretty straightforward - but you're not going to be able to run through the video to find the first frame... with AS, the image "snapshot" is the exact current visible state of the display object.
if that is enough - taking the current state of a display object and saving it as an image file - post back and i'll link a sample.
If you're on a shared Linux server, you might have ImageMagick installed. That in turn may be able to extract a screenshot of a particular frame from a movie. However this will probably only work on AVI files - MPEG movies require ffmpeg, and I am not sure about FLV files (they're not in the list of supported formats on the IM website).
Could you switch to a VPS? This will give you the root access you need to install the conversion binaries you need. These days a reasonable one with 256M-512M of RAM will cost you from 5USD pcm depending on the quality and support (I pay 4GBP pcm for a 512M box and it really has been rock solid).

Flash Video player buffer issue and large video files

We have developed flash video player which needs to playe large videos (at least 500 MB videos).
We have some issues in the player right now.
I am playing a 100 MB + video, it start playing and say it is buffering upto 50% of that video. Then I am closing that page. If I take that video again, it starts downloading from beginning. It never resume downloading from where it buffered previous time. But for small video files, this is looking ok. Is there any size limit a video player can buffer? or any other issues. Please share your thoughts
Is there any better way to play large videos (more than 500 MB). Any other protocol or any other settings in flash player? Please give your valid suggestions here also...
If streaming video is out of the question (eg servers are expensive) you may also try a modified-progressive download. The server basically takes the browser request and cuts a specific version of the video which it then sends to the user's browser. I know there are extensions of this for various popular servers. Infact, this is very similar (if not , the same) as what youtube uses.
Some references to gawk at:
Mod H264 Streaming for Apache
FlowPlayer Pseudostreaming
Serving up a video file using php

Categories