1
votes

I hosted my site in Google Cloud and also i developed the site like video blog. I'm uploading the videos through database and using mysql select query i'm fetching the videos in front-end like this.

<?php
while($getSharePer01=mysqli_fetch_assoc($getPostStatus01)){
 extract($getSharePer01);
?>

<video id="sampleMovie" class="embed-responsive-item" height="500" preload controls>
<source src="<?php echo $u_pvid; ?>" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'/>
<object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" width="640" height="360">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="transparent" />
<param name="flashvars" value='config={"clip":{"url":"HTML5Sample_flv.flv","autoPlay":false,"autoBuffering":true}}' />
</object>
</video>

<?php
}
?>

In this case first time buffering it's quickly happening but one position it stop playing the video and buffering balance video that time it's talking long time to buffer like 2-3 mins.. My questions about How to speed up the video buffering time like other social network site?? anyone help me to fix this issues...

1

1 Answers

1
votes

it's hard to be sure without checking your specific videos, but it will come down to one (or more) of three things:

  • optimisation of the video.
  • server support for Byte Range Requests.
  • end-to-end performance.

for the first, there are a number of things you can do using free tools like ffmpeg and then play around with some of the options to see what works best for your content.

eg:

ffmpeg -i "my.mp4" -c:v libx264 -b 1M -preset slow -s 1080x720 -c:a aac -ab 128k -movflags faststart "my_reduced.mp4"

... this will re-encode my.mp4 to my_reduced.mp4, as h264 with aac audio, a video bitrate capped at 1Mbps, setting the frame size to 1080x720, audio bitrate capped at 128kbps, using a slower (but creating smaller filesize) compression, and move the metatdata to the start of the file enabling streaming to start faster

for the second and third you'll need to check how the server is configured and what bandwidth you have available, as well as CPU and memory load on the server to ensure content delivery isn't maxing out any capabilities. If you can serve content via a CDN that will also help take the load off and improve performance