Looking for help identifying this error

Let me first say thank you for any help with this problem.

I am looking to identify the problem I am having with a video sharing script. I have contacted the dev and tried explaining the problem but he seems to think the files have been modified when all I have done is uploaded them with an ftp program.

The log shows the file and line I am having the problem with I just want to make sure I am not missing anything. So I wanted to ask for help if anyone is willing to do so ?

I appreciate any responses.

Welcome back Prime! Been awhile!

So, one huge problem with video issues is the formatting! There are literally thousands of formats.
And, every single video player only plays a few of them. You didn’t really tell us the problem you are having with your script. But, often I hear it is a formatting issue. For instance, you can say only MP4 are allowed. But, there are hundreds of different MP4 format’s. The player you are using might not play some of them.

Why don’t you explain what your error is and we can go from there. You did not show the file format or the line you are having problems with, so we do not really know what your problem is.

Welcome back!

Its good to see you to ErnieAlex. Sorry it has to be about another problem I am having. This script is different from the last. This one allows for a direct upload without encoding and as far as I know it only needs to generate the thumbnails which I believe is why it needs ffmpeg. But my issue is a bit different I think. I can upload a 50MB video fine its just bigger videos I am unable to finish the upload.

All the files and folders are listed on github which shows the code in them. I will list the errors below as well as the lines they are on. I also had to edit the php.ini file to adjust upload sizes. I will also mention I tried talking to the dev but I don’t think he understood what I was trying to tell him.

its called youphptube or it was its now called Avideo :https://github.com/WWBN/AVideo

update:I have a bit of a problem now The log is not recording the error. I will try a reinstall and give you an another update tomorrow.

All servers have a limit on how large a file can be uploaded. You should run your phpinfo() function and check to file upload limit size. You can alter that number as needed. Also, 50MB is a very large upload. You might need to use an FTP system that allows restarting if the upload fails. Quite often connection speeds of the user can cause dropouts in a file that large.

Good Point I will look into that.

Update:well they said that I could bypass this problem by installing there encoder and using the bulk ftp import.But having a problem installing encoder. I am however looking at alternatives just incase it gets bad.

Here are the errors I was refering to. I think since they update a file every day instead of just working on and releasing an entire update it has screwed up the files code.

America/Los_Angeles] PHP Warning: filectime(): stat failed for /home/tv/videos/_portrait_thumbsSmallV2.jpg in /home/tv/objects/video.php on line 2255 [05-Dec-2019 16:36:42 America/Los_Angeles] PHP Warning: filectime(): stat failed for /home/tv/videos/_thumbsV2.jpg in /home/tv/objects/video.php on line 2255 [05-Dec-2019 16:36:42

Again really appreciate the help.

Well, that error has to do with getting the creation time of a file. Not enough info to help you.
Can you show the line it is failing on? Line #2255. It must be something like:
$fileCtime = filectime("/home/tv/videos/_thumbsV2.jpg");
Most likely the file location or file name is incorrectly set up. It is showing that you are starting in the root folder and then in a folder named home and then tv then videos and then a filename that starts with an underscore. Any of these folders could be incorrect or the file does not exist. Check those out first…

Sorry I took out my domain name for privacy reasons. the last few versions of this I never had this problem but since the few new updates this just occurred. Same file and folder structure etc. Here is the line of code : $source[‘url’] .= “?”.@filectime($source[‘path’]);

How can the correct file/folder locations be set ?

Well, to debug this, you would first need to see what is inside $source[‘path’] and make sure it is a filename that is the correct one. And, you need to force the correct folder into the variable, too.

Did you have the folder name in the “?” part? if not, you need to add it in. One way to debug all this is to just run the process again and echo the $source[‘url’] right after the line you showed. Make sure that is formatted exactly as you think it should be. My guess is that either the $source[‘path’] is not a valid file that actually exists at this point in the code which would mess up the filectime() results.

But, what is the @ sign doing in a time conversion line? I mean, you get a file name, get the creation time of that file and use it in the source url. If you are trying to access a folder named by a creation date, then
this makes sense. Otherwise, this line makes no sense. But, the @ sign can not be used in a folder address… I will download the script and look at the original code. Perhaps I can tell what you need here.

EDIT: Which module is this line found in? Too many files to look thru!

Sorry its in objects/video.php

> if(substr($type, -4) === ".jpg" || substr($type, -4) === ".png" || substr($type, -4) === ".gif" || substr($type, -4) === ".webp"){
>     $source['url'] .= "?".@filectime($source['path']);
>  }

So, this is the line. Note the @ in the code. This hides the error message. To see what is happening error-wise, you turn on error messages and remove the @ in the line. Then you should see the real error that is being thrown. Also, it is up to allow types of jpg/png/gif and webp, but, only lowercase ones. This could be a problem if a user attempts to upload a JPG or PNG extended file. Probably not an issue, but…
Let us know what the real error is.

Thank you for your hard work I will get started asap.

Update. This script has logging built in as well but just in case I did turn on logging for php which did not show anything related to this. I took out the @ like you suggested and did a direct upload without any encoding and this is what I got.

[14-Dec-2019 13:28:46 America/Los_Angeles] PHP Warning: filectime(): stat failed for /home/example.com/tv/videos/20191015210604_5df4255e10c2f3.44570516_portrait_thumbsV2.jpg in /home/example.com/tv/objects/video.php on line 2255
[14-Dec-2019 13:28:46 America/Los_Angeles] PHP Warning: filectime(): stat failed for /home/example.com/tv/videos/20191015210604_5df4255e10c2f3.44570516_portrait_thumbsSmallV2.jpg in /home/example.com/tv/objects/video.php on line 2255
[14-Dec-2019 13:28:46 America/Los_Angeles] PHP Warning: filectime(): stat failed for /home/example.com/tv/videos/20191015210604_5df4255e10c2f3.44570516_thumbsV2.jpg in /home/example.com/tv/objects/video.php on line 2255
[14-Dec-2019 13:28:46 America/Los_Angeles] PHP Warning: filectime(): stat failed for /home/example.com/tv/videos/20191015210604_5df4255e10c2f3.44570516_thumbsSmallV2.jpg in /home/example.com/tv/objects/video.php on line 2255

Well, I did some research. It appears that this error happens when the data is not valid for the path.
Therefore, the line:
@filectime($source[‘path’])
is throwing an error because the $source[‘path’] part is invalid. So, I would find out what is inside that variable and see if it is formed badly. You can take that URL and see if you can open it directly.
Put " /home/example.com/tv/videos/20191015210604_5df4255e10c2f3.44570516_portrait_thumbsV2.jpg " inside a browser and see if it shows the picture. Fixing the example.com part, of course.

Alright I will try that now.

Update: I get a whitebox with a play icon in the center. at the top the end of the url says view/img/image404.php?notFound=1.

So your problem is not in that code. The path that is pointing to the thumbnail is bad.
You need to find out in the code where the $source[‘path’] is created. That section is bad as it is not
pointing to a valid internet file. That causes the filectime() to fail. At least you know the problem.
Chase down where the path is created…

Thank you for your help. I have another question related to this matter. I know I mite have already asked this but do you know of any other limits other then what can be set in the php.ini ? Here’s what I am thinking currently:I was able to upload a 50MB mp4 file and play it perfectly fine using the script. I set the size limit in php.ini to around 300mb since video’s I make are around 15 -30 mins. But whenever I upload anything 100MB or over is when it fails. I asked my web host and they said the only limits are what I set in the php file. I already talked to the dev they said to set the php ini as well so something is up and I don’t know what.

Rather than screw with that, just chunk the upload.

https://hackernoon.com/resumable-file-upload-in-php-handle-large-file-uploads-in-an-elegant-way-e6c6dfdeaedb

I would but I dont want to start from scratch. Plus I really like this script.

update:well things have changed once again I will get back to you in a few days.

update 2:Well I have switched to a script with less features since the dev can’t do anything to help. I do have another question which I will be posting in the javascript forum.

Thank you for all your help I will make sure to come back and to add a link to the site when I get mine done.

Please read this topic and tell me if you think this person is understanding what I am trying to tell him. There is a log built into avideo formerly youphptube which shows the filename and which line is giving the problem. I have no knowledge of code right now I do plan to learn but I need to complete this project first.

Anyway he expects me to know this and tell him what code in that line is the problem but yet he is the one coding the software. Am I missing something ?

Link to problem on github

That is a lot of code to trace through…

Sponsor our Newsletter | Privacy Policy | Terms of Service