2

I'm having a problem loading a large video into the browser. I have a video.php file, which creates a $token to access the product specified in $_GET['product'] and then video.js requests access to the video files.

<video id="viewer"
class="video-js vjs-default-skin vjs-big-play-centered"
data-setup='{ "controls": true, "autoplay": false, "preload": "metadata" }'
height="500" width="1000" disablePictureInPicture controls="disabled">
  <source src="videostream?type=m3u8&path=<?php echo $token; ?>/prog_index.m3u8" type="application/x-mpegURL">
</video>

The server should then return the chunks of the video. The videos are stored like this:

private
- products
-- 1
--- prog_index.m3u8
--- fileSequence0.ts
--- fileSequence1.ts
--- fileSequence2.ts
--- and so on...

It duplicates the folder to tmp with the name of the folder is the token. Let's say the token was 1234123412341234:

private
- tmp
-- 1234123412341234
--- prog_index.m3u8
--- fileSequence0.ts
--- fileSequence1.ts
--- fileSequence2.ts
--- and so on...

And the files get deleted as they are loaded.

When I try to access mysite.com/video.php?product=1, I get 503 Service Unavailable.

The total size of the video files are about 1-2GB big and I'm using GoDaddy hosting.

Thanks!

Maytha8
  • 846
  • 1
  • 8
  • 26
  • What did you get in the error log ? – Melvyn Marigny Apr 24 '20 at 01:44
  • @MelvynMarigny There was nothing in the error log. – Maytha8 Apr 27 '20 at 01:37
  • 503 errors **always** land in the error log unless explicitly suppressed. What's in the access log? – ximaera Apr 27 '20 at 13:29
  • @ximaera It's error 500s that always land in the error log, not 503s. – Maytha8 Apr 28 '20 at 00:16
  • Are you using shared hosting? If yes, shared hosting won't allow you to upload large/huge file or use high CPU/memory consumption. If you receive 503 error, it means that your application pool is stop working, this indicate that your hosting provider limit your application pool – Mark Spencer Apr 28 '20 at 07:31
  • @MarkSpencer I am using shared hosting, but the files have been segmented using `ffmpeg`. – Maytha8 Apr 29 '20 at 01:33
  • @MarkSpencer I am using shared hosting, but the files have been segmented using `ffmpeg`. – Maytha8 Apr 29 '20 at 01:34
  • @MarkSpencer I am using shared hosting, but the files have been segmented using `ffmpeg`. – Maytha8 Apr 29 '20 at 01:34
  • @TheWebDeveloperBlog I believe you can't upload large video files on shared hosting, it is prohibited. You may need to contact your provider about this issue. What you need to know is that your application pool stop working so you receive above error. – Mark Spencer Apr 29 '20 at 03:24
  • @MarkSpencer The files have been segmented into 10-second-each TS files. They are not 1 big file. – Maytha8 Apr 29 '20 at 08:42
  • @TheWebDeveloperBlog I'm sorry, I'm not too sure, but you may need to discuss this issue with your current provider. Good luck, bro! – Mark Spencer Apr 30 '20 at 06:51

2 Answers2

3

Why are you Getting a 503 Error?

GoDaddy hosting throws a 503 ERROR if either:

a) Your website met its maximum concurrent connection limit or

b) If your hosting account uses up all of its available resources (which is probably the case here since you mention having to load large video files exceeding 1 GB

Resolution

Depending on your hosting account type the solution is as follows:

Linux Hosting (cPanel): End the PHP processes in your Linux Hosting account (for more info click here)

Windows Hosting (Plesk): Try recycling your application pool

Web Hosting (Linux): End processes using Manage system process (Linux) in my Web & Classic Hosting account

Web Hosting (Windows): Try Recycle your application pool(windows)

Another Possible Issue

If you use WordPress along with your website one of your plugins may be causing the issue. Try disabling and enabling all of them and enable them one at a time to see if they are causing the issue.

Troubleshooting and prevention:

Make sure you have enough hard drive space whenever you load large videos so you don't get the 503 ERROR!

Hope this was helpful and I hope this solved your issue.

Note: Nothing showed in your error log since in essence there was no real error. Nothing went wrong in the code as you can see in the solutions above.

Community
  • 1
  • 1
1

I found out that my PHP was timing out. My php.ini file had a max_execution_time of 600 (5 minutes), so when I changed the max_execution_time to -1, it fixed the problem.

Maytha8
  • 846
  • 1
  • 8
  • 26