WWBN / AVideo-Encoder

Encoder Server for AVideo Platform Open-Source
https://platform.avideo.com
GNU Affero General Public License v3.0
152 stars 189 forks source link

Uploading of videos with the encoder fails : try [1] Error on return_vars->videos_id #512

Closed imashi614 closed 1 year ago

imashi614 commented 1 year ago

Hello. I have installed AVideo, but the Encoder is having trouble solving the problem. The error message in the browser is "try [1] Error on return_vars->videos_id" as stated in the heading.

The Encoder's avideo.log shows the following message.

"AVideo-Streamer sendFile error: {"duration": "EE:EE:EE", "title": "20230624_test", "first_request":1, "categories_id":0, "format": "mp4","" resolution":""", "videoDownloadedLink":null, "description":"", "downloadURL":"", "chunkFile":"", "encoderURL": "http:\/{10.4.64.199\/ upload\/", "keepEncoding": "0"} <=>[{"file":"\/var\/www\/html\/upload\/view\/upload.php", "line":114, "function": "sendFile", "class":"" Encoder", "type":":"},{"file":"\/var\/www\/html\/upload\/view\/jquery-file-upload\/server\/php\/fileuploadchunkdone.php", "line":31 , "args":["\/var\/www\/ html\/upload\/view\/upload.php"], "function": "require_once"}]"

There are no specific error messages in the avideo.log of AVideo. The latest versions of both AVideo and Encoder are installed. What else could be the cause?

If anyone can help me, I would be very grateful.

DanielnetoDotCom commented 1 year ago

check your encoder and streamer logs

https://github.com/WWBN/AVideo/wiki/How-to-find-errors-on-AVideo-Platform

imashi614 commented 1 year ago

Thank you, Daniel. The encoder log (/your/path/to/AVideo/Encoder/videos/avideo.log) when the error occurs is as follows.

[26-Jun-2023 09:55:17 Asia/Tokyo] sendToStreamer to aVideoEncoder.json [26-Jun-2023 09:55:17 Asia/Tokyo] AVideo-Streamer sendFile error: {"duration":"EE:EE:EE","title":"20230624_test","first_request":1,"categories_id":0,"format":"mp4","resolution":"","videoDownloadedLink":null,"description":"","downloadURL":"","chunkFile":"","encoderURL":"http:\/\/localhost\/upload\/","keepEncoding":"0"} <=>[{"file":"\/var\/www\/html\/upload\/view\/upload.php","line":114,"function":"sendFile","class":"Encoder","type":"::"},{"file":"\/var\/www\/html\/upload\/view\/jquery-file-upload\/server\/php\/fileuploadchunkdone.php","line":31,"args":["\/var\/www\/html\/upload\/view\/upload.php"],"function":"require_once"}] [26-Jun-2023 09:55:17 Asia/Tokyo] Encoder::save id=() title=(20230624_test)

No logs are output to /your/path/to/AVideo/videos/avideo.log.

There seems to be an error at the sendToStreamer stage, can you identify the cause? Thank you in advance for your help.

imashi614 commented 1 year ago

Reinstalling from scratch does not change the result. Line 114 of upload.php is

$response = Encoder::sendFile('', $obj, $format, $e);
        if (!empty($response->response->video_id)) {
            $obj->videos_id = $response->response->video_id;
        }
        if (!empty($response->response->video_id_hash)) {
            $obj->video_id_hash = $response->response->video_id_hash;
        }
        $e->setReturn_vars(json_encode($obj));

        if (!empty($global['progressiveUpload'])) {
            Encoder::sendFile($destinationFile, $obj, $format, $e, 'HD');
        }

So I think it may be caused by sendFile, but I can't identify it. Could you please help us with your assistance?

DanielnetoDotCom commented 1 year ago

you MUST check the encoder and Streamer logs. without logs I cannot help you

imashi614 commented 1 year ago

Thank you, Daniel. However, as I have already reported, there are no logs about this event in the Streamer's log file! Only the Encoder's log has a log.

Should I re-reinstall? I used https://github.com/WWBN/AVideo.git and https://github.com/WWBN/AVideo-Encoder.git Did I use the wrong file?

DanielnetoDotCom commented 1 year ago

MUST be something, otherwise, you are probably looking in the wrong place

imashi614 commented 1 year ago

Display on browser

Status try [1] Error on return_vars->videos_id Dates Created: 2023-07-03 10:51:12 Modified: 2023-07-03 10:51:17

/var/www/html/AVideo/videos/avideo.log

There is no log of failed upload times.Just about logging in.

[03-Jul-2023 10:46:10 Asia/Tokyo] AVideoLog::DEBUG: Password check Old encoded pass SCRIPT_NAME: /AVideo/objects/login.json.php
[03-Jul-2023 10:46:10 Asia/Tokyo] AVideoLog::DEBUG: Password check Old not found SCRIPT_NAME: /AVideo/objects/login.json.php
[03-Jul-2023 10:46:10 Asia/Tokyo] AVideoLog::DEBUG: User:login finish users_id=1 SCRIPT_NAME: /AVideo/objects/login.json.php
[03-Jul-2023 10:46:10 Asia/Tokyo] AVideoLog::DEBUG: Password check Old encoded pass SCRIPT_NAME: /AVideo/objects/login.json.php
[03-Jul-2023 10:46:10 Asia/Tokyo] AVideoLog::DEBUG: Password check Old not found SCRIPT_NAME: /AVideo/objects/login.json.php
[03-Jul-2023 10:46:10 Asia/Tokyo] AVideoLog::DEBUG: User:login finish users_id=1 SCRIPT_NAME: /AVideo/objects/login.json.php
[03-Jul-2023 10:46:10 Asia/Tokyo] AVideoLog::DEBUG: Cache::isREQUEST_URIWhitelisted: (/login) is whitelisted SCRIPT_NAME: /AVideo/objects/login.json.php
[03-Jul-2023 01:46:10 Africa/Abidjan] AVideoLog::DEBUG: login.json.php user found SCRIPT_NAME: /AVideo/objects/login.json.php

/var/www/html/AVideo/Encoder/videos/avideo.log

[03-Jul-2023 10:51:12 Asia/Tokyo] Upload.php will let function decide decideFormatOrder
[03-Jul-2023 10:51:12 Asia/Tokyo] decideFormatOrder: {"file":"test.mp4","audioOnly":"false","spectrum":"false","webm":"false","override_status":"","update_video_id":0,"inputHLS":"false","inputLow":"false","inputSD":"false","inputHD":"false","inputAutoHLS":"false","inputAutoMP4":"true","inputAutoWebm":"false","inputAutoAudio":"false","title":"","description":"","categories_id":0,"releaseDate":"2023-07-03 10:46:00","timezone":"Etc\/GMT-9","PHPSESSID":"rpjv2vaip2758tfon6ruqs291t","notifyURL":""}
[03-Jul-2023 10:51:12 Asia/Tokyo] decideFormatOrder: auto MP4
[03-Jul-2023 10:51:12 Asia/Tokyo] AVideo-Encoder Format::getFromOrder(7)
[03-Jul-2023 10:51:12 Asia/Tokyo] Upload.php line: 113 "mp4"
[03-Jul-2023 10:51:12 Asia/Tokyo] Encoder::sendFile videos_id=0, format=mp4
[03-Jul-2023 10:51:12 Asia/Tokyo] Encoder::sendFile sending file to aVideoEncoder.json from
[03-Jul-2023 10:51:12 Asia/Tokyo] sendToStreamer to aVideoEncoder.json
[03-Jul-2023 10:51:12 Asia/Tokyo] AVideo-Streamer sendFile error: {"duration":"EE:EE:EE","title":"test","first_request":1,"categories_id":0,"format":"mp4","resolution":"","videoDownloadedLink":null,"description":"","downloadURL":"","chunkFile":"","encoderURL":"http:\/\/localhost\/AVideo\/Encoder\/","keepEncoding":"0"} <=>[{"file":"\/var\/www\/html\/AVideo\/Encoder\/view\/upload.php","line":114,"function":"sendFile","class":"Encoder","type":"::"},{"file":"\/var\/www\/html\/AVideo\/Encoder\/view\/jquery-file-upload\/server\/php\/fileuploadchunkdone.php","line":31,"args":["\/var\/www\/html\/AVideo\/Encoder\/view\/upload.php"],"function":"require_once"}]
[03-Jul-2023 10:51:12 Asia/Tokyo] Encoder::save id=() title=(test)
[03-Jul-2023 10:51:16 Asia/Tokyo] getReturn_vars {"videos_id":0,"video_id_hash":"","releaseDate":"2023-07-03 10:46:00"}
[03-Jul-2023 10:51:16 Asia/Tokyo] sendToStreamer to aVideoEncoder.json
[03-Jul-2023 10:51:16 Asia/Tokyo] getReturn_vars {"videos_id":0,"video_id_hash":"","releaseDate":"2023-07-03 10:46:00"}
[03-Jul-2023 10:51:16 Asia/Tokyo] getReturn_vars {"videos_id":0,"video_id_hash":"","releaseDate":"2023-07-03 10:46:00"}
[03-Jul-2023 10:51:16 Asia/Tokyo] Encoder::save id=(11) title=(test)
[03-Jul-2023 10:51:16 Asia/Tokyo] getReturn_vars {"videos_id":0,"video_id_hash":"","releaseDate":"2023-07-03 10:46:00"}
[03-Jul-2023 10:51:16 Asia/Tokyo] sendToStreamer to aVideoEncoder.json
[03-Jul-2023 10:51:16 Asia/Tokyo] getReturn_vars {"videos_id":0,"video_id_hash":"","releaseDate":"2023-07-03 10:46:00"}
[03-Jul-2023 10:51:16 Asia/Tokyo] getReturn_vars {"videos_id":0,"video_id_hash":"","releaseDate":"2023-07-03 10:46:00"}
[03-Jul-2023 10:51:16 Asia/Tokyo] Encoder::save id=(11) title=(test)
[03-Jul-2023 10:51:16 Asia/Tokyo] Encoder::save id=(11) title=(test)
[03-Jul-2023 10:51:16 Asia/Tokyo] Encoder::save id=(11) title=(test)
[03-Jul-2023 10:51:17 Asia/Tokyo] downloadFile: start queue_id = 11  url = http://localhost/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469 pathFileName = /var/www/html/AVideo/Encoder/videos/11_tmpFile.mp4
[03-Jul-2023 10:51:17 Asia/Tokyo] downloadFile: not using getYoutubeDl
[03-Jul-2023 10:51:17 Asia/Tokyo] downloadFile: this file was uploaded from file and thus is in the videos
[03-Jul-2023 10:51:17 Asia/Tokyo] downloadFile: downloadedFile = /var/www/html/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469 | url = http://localhost/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469
[03-Jul-2023 10:51:17 Asia/Tokyo] getVideoFile start(http://localhost/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469, 11, /var/www/html/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469, /var/www/html/AVideo/Encoder/videos/11_tmpFile.mp4)
[03-Jul-2023 10:51:17 Asia/Tokyo] getVideoFile done 8.67MB
[03-Jul-2023 10:51:17 Asia/Tokyo] Encoder::save id=(11) title=(test)
[03-Jul-2023 10:51:17 Asia/Tokyo] downloadFile: start queue_id = 11  url = http://localhost/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469 pathFileName = /var/www/html/AVideo/Encoder/videos/11_tmpFile.mp4
[03-Jul-2023 10:51:17 Asia/Tokyo] downloadFile: not using getYoutubeDl
[03-Jul-2023 10:51:17 Asia/Tokyo] downloadFile: this file was uploaded from file and thus is in the videos
[03-Jul-2023 10:51:17 Asia/Tokyo] downloadFile: downloadedFile = /var/www/html/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469 | url = http://localhost/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469
[03-Jul-2023 10:51:17 Asia/Tokyo] getVideoFile start(http://localhost/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469, 11, /var/www/html/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469, /var/www/html/AVideo/Encoder/videos/11_tmpFile.mp4)
[03-Jul-2023 10:51:17 Asia/Tokyo] PHP Warning:  copy(/var/www/html/AVideo/Encoder/videos/original_test_YPTuniqid_64a22990ad3951.03673469): failed to open stream: No such file or directory in /var/www/html/AVideo/Encoder/objects/functions.php on line 1149
[03-Jul-2023 10:51:17 Asia/Tokyo] getVideoFile done 8.67MB
[03-Jul-2023 10:51:17 Asia/Tokyo] Encoder::save id=(11) title=(test)
[03-Jul-2023 10:51:17 Asia/Tokyo] downloadFile: {"error":false,"filename":"11_tmpFile.mp4","pathFileName":"\/var\/www\/html\/AVideo\/Encoder\/videos\/11_tmpFile.mp4","msg":"We downloaded the file with success"}
[03-Jul-2023 10:51:17 Asia/Tokyo] Original filesize is 8.67MB
[03-Jul-2023 10:51:17 Asia/Tokyo] Encoder::save id=(11) title=(test)
[03-Jul-2023 10:51:17 Asia/Tokyo] downloadFile: {"error":false,"filename":"11_tmpFile.mp4","pathFileName":"\/var\/www\/html\/AVideo\/Encoder\/videos\/11_tmpFile.mp4","msg":"We downloaded the file with success"}
[03-Jul-2023 10:51:17 Asia/Tokyo] Original filesize is 8.67MB
[03-Jul-2023 10:51:17 Asia/Tokyo] Encoder::save id=(11) title=(test)
[03-Jul-2023 10:51:17 Asia/Tokyo] try [1] return_vars->videos_id is empty {"videos_id":0,"video_id_hash":"","releaseDate":"2023-07-03 10:46:00"}
[03-Jul-2023 10:51:17 Asia/Tokyo] setStatusError(11, try [1] Error on return_vars->videos_id, 1) [{"file":"\/var\/www\/html\/AVideo\/Encoder\/objects\/Encoder.php","line":1074,"function":"setStatusError","class":"Encoder","type":"::","args":["11","try [1] Error on return_vars->videos_id",1]},{"file":"\/var\/www\/html\/AVideo\/Encoder\/view\/run.php","line":7,"function":"run","class":"Encoder","type":"::","args":[]}]
[03-Jul-2023 10:51:17 Asia/Tokyo] Encoder::save id=(11) title=(test)
[03-Jul-2023 10:51:17 Asia/Tokyo] try [1] return_vars->videos_id is empty {"videos_id":0,"video_id_hash":"","releaseDate":"2023-07-03 10:46:00"}
[03-Jul-2023 10:51:17 Asia/Tokyo] setStatusError(11, try [1] Error on return_vars->videos_id, 1) [{"file":"\/var\/www\/html\/AVideo\/Encoder\/objects\/Encoder.php","line":1074,"function":"setStatusError","class":"Encoder","type":"::","args":["11","try [1] Error on return_vars->videos_id",1]},{"file":"\/var\/www\/html\/AVideo\/Encoder\/view\/run.php","line":7,"function":"run","class":"Encoder","type":"::","args":[]}]
[03-Jul-2023 10:51:17 Asia/Tokyo] Encoder::save id=(11) title=(test)
[03-Jul-2023 10:51:17 Asia/Tokyo] getReturn_vars {"videos_id":0,"video_id_hash":"","releaseDate":"2023-07-03 10:46:00"}
[03-Jul-2023 10:51:17 Asia/Tokyo] getReturn_vars {"videos_id":0,"video_id_hash":"","releaseDate":"2023-07-03 10:46:00"}

This is all that was found on 'https://github.com/WWBN/AVideo/wiki/How-to-find-errors-on-AVideo-Platform' to locate the logs. Is there anything else to check?

DanielnetoDotCom commented 1 year ago

you MUST check the logs when you submit the file and get the error.

check the error on the streamer and encoder sides.

imashi614 commented 1 year ago

you MUST check the logs when you submit the file and get the error.

Look at the time, same timing,10:51.

Can I ask another question? I am using Apache 2.4, would 2.2 be better?

DanielnetoDotCom commented 1 year ago

Can I ask another question? I am using Apache 2.4, would 2.2 be better?

Not really sure, I guess would be no difference

imashi614 commented 1 year ago

Eventually, I changed the PHP 7.4 I had been using to PHP 8.2, which now works. Thank you very much.