Hi I have a problem with deleting videos
When I click the delete video button on the videos page it deletes it and is not accessible from the url
But it doesn't delete the .MP4 files from the videos folder only the .JPGs and .GIFs
How can I fix this??
Please help thanks
Somebody?
I will check it now, thanks
I found a bug on Encoder, is that what you are talking about right?
I am sending a fix for it soon.
Thanks, that works in my case.
No it didn't help
My problem is that when I delete a video on the site only the .JPGs and .GIFs get deleted but not the .MP4s from the YouPHPTube/videos folder
It did fix the Encoder/videos deletion problem though.
@QuietKiller01 what version are you using? I just tried the latest streamer version and it is deleting all files
I just tried it with the latest version and it still leaves the .MP4 files there
can you please see if there is an error on the log file?
how are you uploading the video? using encoder or direct upload?
I am using the encoder.
I checked the log files and I don't see any errors, but it doesn't log anything about the deletion of a video.
Should I paste the log files?
I am not sure why is it happening.
I am testing and I cant reproduce this.
Please do this
1- clear all your log,
2- encode a file
3- then delete it using queue log button,
4- paste your encoder log here
5- tell us the file name that didnt be deleted
The file name is: TextInMotion-Sample-576p
I got an error now but when I used the delete button on the streamer site it didn't say anything.
[17-Apr-2018 18:41:49 Europe/Berlin] MP4 All
[17-Apr-2018 18:41:49 Europe/Berlin] {"status":"error", "msg":"getDurationFromFile ERROR, File () Not Found"}
[17-Apr-2018 18:41:49 Europe/Berlin] YouPHPTube-Encoder sending file to http://127.0.0.1/youPHPTubeEncoder.json
[17-Apr-2018 18:41:49 Europe/Berlin] YouPHPTube-Encoder reading file from
[17-Apr-2018 18:41:50 Europe/Berlin] YouPHPTube-Streamer answer {"error":false,"video_id":8}
[17-Apr-2018 18:41:50 Europe/Berlin] {"error":false,"format":"mp4","file":"","resolution":"","target":"http:\/\/127.0.0.1\/youPHPTubeEncoder.json","postFields":9,"response_raw":"{\"error\":false,\"video_id\":8}","response":{"error":false,"video_id":8}}
[17-Apr-2018 18:41:54 Europe/Berlin] Getting Video File http://127.0.0.1/YouPHPTube-Encoder/videos/original_TextInMotionSample576p_YPTuniqid_5ad623cdf2ea43.11569255
[17-Apr-2018 18:41:54 Europe/Berlin] runMultiResolution
[17-Apr-2018 18:41:54 Europe/Berlin] YouPHPTube-Encoder Start Encoder [ffmpeg -i /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile.mp4 -vf scale=1280:720 -movflags faststart -preset ultrafast -vcodec h264 -acodec aac -strict -2 -y /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile_converted_HD.mp4]
[17-Apr-2018 18:42:01 Europe/Berlin] YouPHPTube-Encoder Start Encoder [ffmpeg -i /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile.mp4 -vf scale=720:540 -movflags faststart -preset ultrafast -vcodec h264 -acodec aac -strict -2 -y /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile_converted_SD.mp4]
[17-Apr-2018 18:42:01 Europe/Berlin] ffmpeg -i /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile.mp4 -vf scale=720:540 -movflags faststart -preset ultrafast -vcodec h264 -acodec aac -strict -2 -y /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile_converted_SD.mp4
Array
(
)
(7, /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile.mp4, /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile_converted_SD.mp4, 9)
[17-Apr-2018 18:42:01 Europe/Berlin] YouPHPTube-Encoder Start Encoder [ffmpeg -i /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile.mp4 -vf scale=-2:360 -movflags faststart -preset ultrafast -vcodec h264 -acodec aac -strict -2 -y /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile_converted_Low.mp4]
[17-Apr-2018 18:42:01 Europe/Berlin] ffmpeg -i /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile.mp4 -vf scale=-2:360 -movflags faststart -preset ultrafast -vcodec h264 -acodec aac -strict -2 -y /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile_converted_Low.mp4
Array
(
)
(1, /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile.mp4, /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile_converted_Low.mp4, 9)
[17-Apr-2018 18:42:01 Europe/Berlin] stdClass Object
(
[error] => 1
[msg] => Execute code error Array
(
)
Code: ffmpeg -i /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile.mp4 -vf scale=-2:360 -movflags faststart -preset ultrafast -vcodec h264 -acodec aac -strict -2 -y /var/www/html/YouPHPTube-Encoder/videos/9_tmpFile_converted_Low.mp4
)
Hi, I cant see any error regarding the file delete
Then what should I do?
Hello,
Finally, the problem actually appears when using the encoder. Works perfectly with a direct upload however.
So, deleting from the encoder works, the "/Encoder/videos/" folder is emptied correctly. Unfortunately, the deletion from the video manager does not work, the video in the folder "/YouPHPTube/videos" is still alive.
Here my log file :
```[18-Apr-2018 01:01:59 Europe/Berlin] Encoder receiving post
[18-Apr-2018 01:01:59 Europe/Berlin] Array
(
[duration] => 0:00:15
[title] => static1
[videos_id] => 0
[format] => mp4
[resolution] => HD
[videoDownloadedLink] =>
[description] =>
[user] => admin
[password] => **********
)
[18-Apr-2018 01:01:59 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean in /var/www/html/YouPHPTube/objects/video.php:179
Stack trace:
thrown in /var/www/html/YouPHPTube/objects/video.php on line 179
[18-Apr-2018 01:03:53 Europe/Berlin] Class Plugin Not found: /pluginsAvailable.json`
Yes that's my problem too I could've explained it better.
Is there a fix?
Hi, did you skip any update?
that is the query on the file:
$sql = "SELECT * FROM `category_type_cache` WHERE categoryId = '" . $catId . "';";
$res = $global['mysqli']->query($sql);
$catTypeCache = $res->fetch_assoc();
please make sure you have this table on your database;
category_type_cache
if you don't, try to manually run this SQL: https://github.com/DanielnetoDotCom/YouPHPTube/blob/master/update/updateDb.v5.01.sql
I have the category_type_cache table in my database and I don't get this fetch_assoc() error
But the deletion still doesn't work
I just tried it with the direct upload and it deletes it, but if I upload from the encoder it still doesn't work
What is the error log on encoder now?
This is what it says after uploading then deleting a video:
[18-Apr-2018 15:36:31 Europe/Berlin] MP4 All
[18-Apr-2018 15:36:31 Europe/Berlin] {"status":"error", "msg":"getDurationFromFile ERROR, File () Not Found"}
[18-Apr-2018 15:36:31 Europe/Berlin] YouPHPTube-Encoder sending file to http://127.0.0.1/youPHPTubeEncoder.json
[18-Apr-2018 15:36:31 Europe/Berlin] YouPHPTube-Encoder reading file from
[18-Apr-2018 15:36:31 Europe/Berlin] YouPHPTube-Streamer answer {"error":false,"video_id":4}
[18-Apr-2018 15:36:31 Europe/Berlin] {"error":false,"format":"mp4","file":"","resolution":"","target":"http:\/\/127.0.0.1\/youPHPTubeEncoder.json","postFields":9,"response_raw":"{\"error\":false,\"video_id\":4}","response":{"error":false,"video_id":4}}
[18-Apr-2018 15:36:32 Europe/Berlin] Getting Video File http://127.0.0.1/YouPHPTube-Encoder/videos/original_SampleVideo1280x7205mb_YPTuniqid_5ad749df27cfa4.62596447
[18-Apr-2018 15:36:32 Europe/Berlin] runMultiResolution
[18-Apr-2018 15:36:32 Europe/Berlin] YouPHPTube-Encoder Start Encoder [ffmpeg -i /var/www/html/YouPHPTube-Encoder/videos/2_tmpFile.mp4 -vf scale=1280:720 -movflags faststart -preset ultrafast -vcodec h264 -acodec aac -strict -2 -y /var/www/html/YouPHPTube-Encoder/videos/2_tmpFile_converted_HD.mp4]
[18-Apr-2018 15:36:37 Europe/Berlin] YouPHPTube-Encoder Start Encoder [ffmpeg -i /var/www/html/YouPHPTube-Encoder/videos/2_tmpFile.mp4 -vf scale=720:540 -movflags faststart -preset ultrafast -vcodec h264 -acodec aac -strict -2 -y /var/www/html/YouPHPTube-Encoder/videos/2_tmpFile_converted_SD.mp4]
[18-Apr-2018 15:36:43 Europe/Berlin] YouPHPTube-Encoder Start Encoder [ffmpeg -i /var/www/html/YouPHPTube-Encoder/videos/2_tmpFile.mp4 -vf scale=-2:360 -movflags faststart -preset ultrafast -vcodec h264 -acodec aac -strict -2 -y /var/www/html/YouPHPTube-Encoder/videos/2_tmpFile_converted_Low.mp4]
[18-Apr-2018 15:36:49 Europe/Berlin] Duration founded: 0:00:29
[18-Apr-2018 15:36:49 Europe/Berlin] YouPHPTube-Encoder sending file to http://127.0.0.1/youPHPTubeEncoder.json
[18-Apr-2018 15:36:49 Europe/Berlin] YouPHPTube-Encoder reading file from /var/www/html/YouPHPTube-Encoder/videos/2_tmpFile_converted_HD.mp4
[18-Apr-2018 15:36:52 Europe/Berlin] YouPHPTube-Streamer answer {"error":false,"video_id":"4"}
[18-Apr-2018 15:36:52 Europe/Berlin] {"error":false,"format":"mp4","file":"\/var\/www\/html\/YouPHPTube-Encoder\/videos\/2_tmpFile_converted_HD.mp4","resolution":"HD","target":"http:\/\/127.0.0.1\/youPHPTubeEncoder.json","postFields":12,"videoFileSize":"10.52MB","response_raw":"{\"error\":false,\"video_id\":\"4\"}","response":{"error":false,"video_id":"4"}}
[18-Apr-2018 15:36:52 Europe/Berlin] Duration founded: 0:00:29
[18-Apr-2018 15:36:52 Europe/Berlin] YouPHPTube-Encoder sending file to http://127.0.0.1/youPHPTubeEncoder.json
[18-Apr-2018 15:36:52 Europe/Berlin] YouPHPTube-Encoder reading file from /var/www/html/YouPHPTube-Encoder/videos/2_tmpFile_converted_SD.mp4
[18-Apr-2018 15:36:52 Europe/Berlin] YouPHPTube-Streamer answer {"error":false,"video_id":"4"}
[18-Apr-2018 15:36:52 Europe/Berlin] {"error":false,"format":"mp4","file":"\/var\/www\/html\/YouPHPTube-Encoder\/videos\/2_tmpFile_converted_SD.mp4","resolution":"SD","target":"http:\/\/127.0.0.1\/youPHPTubeEncoder.json","postFields":10,"videoFileSize":"6.93MB","response_raw":"{\"error\":false,\"video_id\":\"4\"}","response":{"error":false,"video_id":"4"}}
[18-Apr-2018 15:36:52 Europe/Berlin] Duration founded: 0:00:29
[18-Apr-2018 15:36:52 Europe/Berlin] YouPHPTube-Encoder sending file to http://127.0.0.1/youPHPTubeEncoder.json
[18-Apr-2018 15:36:52 Europe/Berlin] YouPHPTube-Encoder reading file from /var/www/html/YouPHPTube-Encoder/videos/2_tmpFile_converted_Low.mp4
[18-Apr-2018 15:36:52 Europe/Berlin] YouPHPTube-Streamer answer {"error":false,"video_id":"4"}
[18-Apr-2018 15:36:52 Europe/Berlin] {"error":false,"format":"mp4","file":"\/var\/www\/html\/YouPHPTube-Encoder\/videos\/2_tmpFile_converted_Low.mp4","resolution":"Low","target":"http:\/\/127.0.0.1\/youPHPTubeEncoder.json","postFields":10,"videoFileSize":"4.93MB","response_raw":"{\"error\":false,\"video_id\":\"4\"}","response":{"error":false,"video_id":"4"}}
I cant see any delete error
Then what's going on?
I don't know what to do and I can't launch my site until the deletion works properly.
Just to make clear, only the Streamer .mp4 file is not beeing deleted?
Encoder delete fine?
Usually we have 3 resolutions on encoder (Low, SD and HD) any of it is being deleted?
Yes that is the problem and none of them are being deleted
The encoder works fine
I just discovered something!!
When I looked in the database I saw the video there and the filename.
I compared the filename in the database to the one in the 'YouPHPTube/videos' folder and noticed that the '_HD' or '_SD' or '_Low' was missing from the end of the filename in the database so I edited the filename in the db (I put the '_HD' at the end of the filename so it would look like the one in the folder) and then clicked the delete button on the streamer site
and
it deleted the file from the folder but only the one which had the '_HD' at the end of it (it left all the others there including the .GIFs and .JPGs).
And I think it's because it only deletes the file(s) that are named exactly the same in both the db and the '/videos' folder.
So I think I found the problem but how do I fix this?
Btw thanks a lot for your help I really appreciate it :)
(after I edited the filename in the db it didn't have a thumbnail)
After the upgraded sql updates (Encoder and stream site), the videos are correctly removed from the encoder, but strangely in the stream site part the tmp.mp4 file persists again. Is this related to what @QuietKiller01 claims?
Here is my log file (encoder) :
``[19-Apr-2018 01:04:28 Europe/Berlin] MP4 HD
[19-Apr-2018 01:04:28 Europe/Berlin] {"status":"error", "msg":"getDurationFromFile ERROR, File () Not Found"}
[19-Apr-2018 01:04:28 Europe/Berlin] YouPHPTube-Encoder sending file to https://.fryouPHPTubeEncoder.json
[19-Apr-2018 01:04:28 Europe/Berlin] YouPHPTube-Encoder reading file from
[19-Apr-2018 01:04:28 Europe/Berlin] YouPHPTube-Streamer answer {"error":false,"video_id":51}
[19-Apr-2018 01:04:28 Europe/Berlin] {"error":false,"format":"mp4","file":"","resolution":"","target":"https:\/\/.fr\/youPHPTubeEncoder.json","postFields":9,"response_raw":"{\"error\":false,\"video_id\":51}","response":{"error":false,"video_id":51}}
[19-Apr-2018 01:04:32 Europe/Berlin] Getting Video File https://.fr/Encoder/videos/original_Yakuzakiwami1_YPTuniqid_5ad7cefcb90446.52397746
[19-Apr-2018 01:04:32 Europe/Berlin] runMultiResolution
[19-Apr-2018 01:04:32 Europe/Berlin] YouPHPTube-Encoder Start Encoder [ffmpeg -i /var/www/html/YouPHPTube/Encoder/videos/9_tmpFile.mp4 -vf scale=1280:720 -movflags faststart -preset ultrafast -vcodec h264 -acodec aac -strict -2 -y /var/www/html/YouPHPTube/Encoder/videos/9_tmpFile_converted_HD.mp4]
[19-Apr-2018 01:04:43 Europe/Berlin] Duration founded: 0:02:28
[19-Apr-2018 01:04:43 Europe/Berlin] YouPHPTube-Encoder sending file to https://.fr/youPHPTubeEncoder.json
[19-Apr-2018 01:04:43 Europe/Berlin] YouPHPTube-Encoder reading file from /var/www/html/YouPHPTube/Encoder/videos/9_tmpFile_converted_HD.mp4
[19-Apr-2018 01:04:49 Europe/Berlin] YouPHPTube-Streamer answer {"error":false,"video_id":"51"}
[19-Apr-2018 01:04:49 Europe/Berlin] {"error":false,"format":"mp4","file":"\/var\/www\/html\/YouPHPTube\/Encoder\/videos\/9_tmpFile_converted_HD.mp4","resolution":"HD","target":"https:\/\/*.fr\/youPHPTubeEncoder.json","postFields":12,"videoFileSize":"84.38MB","response_raw":"{\"error\":false,\"video_id\":\"51\"}","response":{"error":false,"video_id":"51"}}
[19-Apr-2018 01:04:49 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to undefined method Configuration::getAutodelete() in /var/www/html/YouPHPTube/Encoder/objects/Encoder.php:556
Stack trace:
thrown in /var/www/html/YouPHPTube/Encoder/objects/Encoder.php on line 556``
I don't know but the files that aren't being deleted on my computer aren't temporary(tmp) they are the actual videos and I don't get any errors in the log files.
Is what I found in the db any help for fixing the problem?
I just found a thing, I guess is fixed now, I will update some files soon
This solved the problem, thanks.
However, my log file still contains errors. It does not affect the site at first glance, but I wonder why they appear.
2018 01:04:49 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to undefined method Configuration::getAutodelete() in /var/www/html/YouPHPTube/Encoder/objects/Encoder.php:556 Stack trace: #0 /var/www/html/YouPHPTube/Encoder/objects/Encoder.php(472): Encoder->send() #1 /var/www/html/YouPHPTube/Encoder/view/run.php(6): Encoder::run() #2 {main} thrown in /var/www/html/YouPHPTube/Encoder/objects/Encoder.php on line 556
@ChrisSlS is you encoder up to date?
check this file: https://github.com/DanielnetoDotCom/YouPHPTube-Encoder/blob/e50e2ada01369477c43036fc3c171534fdef90bb/objects/Configuration.php#L42
Thank you, it was the update that was missing ... I thought I did it two days ago but no it was only the steam site. Thanks again.
Yes this fixed the problem thanks a lot for your help! :smiley:
Most helpful comment
I just found a thing, I guess is fixed now, I will update some files soon