WWBN / AVideo

Create Your Own Broadcast Network With AVideo Platform Open-Source. OAVP OVP
https://avideo.tube/AVideo_OpenSource
Other
1.91k stars 972 forks source link

[Encoder] WEBP videos error #9387

Open gbrn opened 2 months ago

gbrn commented 2 months ago

@DanielnetoDotCom Danny, I just noticed a problem with the encoder. In the WEBP file it puts a moving image that is completely unknown to me, which is not part of my videos. I would like to know why this happens. I've seen this issue happening in several videos.

image

DanielnetoDotCom commented 2 months ago

If this come from the encoder, check the encoder logs

gbrn commented 1 month ago

@DanielnetoDotCom Danny, this blue image must be familiar to you, it seems to be a test image. All videos that go through the encoder are coming with this image in the WEBP format. I didn't find anything related to this WEBP image in the log, only.. webpimage not set.

I checked the log: Missing media files: There are several messages indicating that expected media files were not set: spectrumimage not set, rawVideo not set, image not set, gifimage not set, webpimage not set, video not set. Potential cause: These are expected output files from the encoding process, which for some reason were not generated. This may indicate a problem with the encoding process or configuration.

Error in video duration calculation: There is an attempt to use the ffprobe command to calculate the video duration, but the command returned an error: "status":"error", "msg":[] ,"return_val":1, "where":"getDuration", "cmd":"ffprobe..." The returned duration was "EE:EE", which indicates that the time could not be calculated correctly. Potential cause: The necessary video file may not be available or could be corrupted at the time of the ffprobe command execution.

HTTP 524 error: "error code: 524": This indicates a timeout occurred during an HTTP request when trying to send data to https://xxxxxx.com.br/objects/aVideoEncoderNotifyIsDone.json.php. Cause: This error code is usually associated with a request that exceeded the time limit. It could be a problem with the connection between the encoder and the remote server.

PHP warning about file not found: "PHP Warning: unlink(/tmp/encoder_run.lock): No such file or directory". Cause: The lock file /tmp/encoder_run.lock was not found when the PHP script tried to remove it. This may occur if the file had already been removed in a previous process or was never created correctly.

Vídeos-·-CNETV.webm

I'm having trouble accessing the encoder log. The log contains sensitive data such as pass="_user_hash_. Also, URLs and endpoints are being exposed. It is necessary to implement better security in the log beforehand.

DanielnetoDotCom commented 1 month ago

error code: 524 is your issue, and this is not an error in the code, but in your webserver

so you probably have a proxy, you must find out and fix it.

gbrn commented 1 month ago

@DanielnetoDotCom

error code: 524 is your issue, and this is not an error in the code, but in your webserver

so you probably have a proxy, you must find out and fix it.

I sent several parts of the encoder LOG... This is just a small error... which may even be from the server. But it does not influence the main problem of this issue. This is not the focus of the issue.

Why is this strange image being loaded in my videos?

DanielnetoDotCom commented 1 month ago

The image is because for some reason you could not get the images from the encoder

Check more from your encoder logs

gbrn commented 1 month ago

@DanielnetoDotCom Danny, I noticed the following error in the encoder log. The image I reported is appearing when ffmpeg fails to execute libwebp:

[22-Sep-2024 21:42:27 UTC] getWebpImage:  Image error : ffmpeg     -y -ss 00:10:00 -t 3 -i '/var/www/html/AVideo-Encoder/videos/110_tmpFile.mp4' -vcodec libwebp -lossless 1 -vf fps=10,scale=640:360:force_original_aspect_ratio=decrease,pad=640:360:-1:-1:color=black -q 60 -preset default -loop 0 -an -vsync 0 '/var/www/html/AVideo-Encoder/videos/110_tmpFile.mp4.webp' 
["ffmpeg version N-116879-g2a6f84718b Copyright (c) 2000-2024 the FFmpeg developers",
 "built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)",
 "configuration: --enable-gpl --enable-libx264 --enable-libfdk-aac --enable-libvpx --enable-libmp3lame --enable-libopus --extra-cflags='-march=armv8-a -mtune=neoverse-n1' --enable-neon --enable-vfp --enable-nonfree",
 "libavutil      59. 35.100 / 59. 35.100",
 "libavcodec     61. 11.100 / 61. 11.100",
 "libavformat    61.  5.101 / 61.  5.101",
 "libavdevice    61.  2.100 / 61.  2.100",
 "libavfilter    10.  2.102 / 10.  2.102",
 "libswscale      8.  2.100 /  8.  2.100",
 "libswresample   5.  2.100 /  5.  2.100",
 "libpostproc    58.  2.100 / 58.  2.100",
 "-vsync is deprecated. Use -fps_mode",
 "Passing a number to -vsync is deprecated, use a string argument as described in the manual.",
 "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/html/AVideo-Encoder/videos/110_tmpFile.mp4':",
 "  Metadata:",
 "    major_brand     : isom",
 "    minor_version   : 512",
 "    compatible_brands: isomiso2avc1mp41",
 "    encoder         : Lavf61.5.101",
 "  Duration: 00:26:03.96, start: 0.000000, bitrate: 3516 kb/s",
 "  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1038 [SAR 1:1 DAR 320:173], 3381 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)",
 "      Metadata:",
 "        handler_name    : ISO Media file produced by Google Inc.",
 "        vendor_id       : [0][0][0][0]",
 "  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)",
 "      Metadata:",
 "        handler_name    : ISO Media file produced by Google Inc.",
 "[vost#0:0 @ 0xba5e360a76c0] Unknown encoder 'libwebp'",
 "[vost#0:0 @ 0xba5e360a76c0] Error selecting an encoder",
 "Error opening output file /var/www/html/AVideo-Encoder/videos/110_tmpFile.mp4.webp.",
 "Error opening output files: Encoder not found"
]

The error message "Unknown encoder 'libwebp'" indicates that the libwebp encoder is not available on the system, resulting in failure when attempting to create the WebP image from the video. The command used to attempt to generate the WebP image was as follows:

ffmpeg -y -ss 00:10:00 -t 3 -i '/var/www/html/AVideo-Encoder/videos/110_tmpFile.mp4' -vcodec libwebp -lossless 1 -vf fps=10,scale=640:360:force_original_aspect_ratio=decrease,pad=640:360:-1:-1:color=black -q 60 -preset default -loop 0 -an -vsync 0 '/var/www/html/AVideo-Encoder/videos/110_tmpFile.mp4.webp'

Libwebp was installed on the server, but it is not compiled into ffmpeg:

 dpkg -l | grep libwebp
ii  libwebp7:arm64                                1.2.2-2ubuntu0.22.04.2                               arm64        Lossy compression of digital photographic images
ii  libwebpdemux2:arm64                           1.2.2-2ubuntu0.22.04.2                               arm64        Lossy compression of digital photographic images.
ii  libwebpmux3:arm64                             1.2.2-2ubuntu0.22.04.2                               arm64        Lossy compression of digital photographic images
ffmpeg -encoders | grep webp
ffmpeg version N-116879-g2a6f84718b Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
  configuration: --enable-gpl --enable-libx264 --enable-libfdk-aac --enable-libvpx --enable-libmp3lame --enable-libopus --extra-cflags='-march=armv8-a -mtune=neoverse-n1' --enable-neon --enable-vfp --enable-nonfree
  libavutil      59. 35.100 / 59. 35.100
  libavcodec     61. 11.100 / 61. 11.100
  libavformat    61.  5.101 / 61.  5.101
  libavdevice    61.  2.100 / 61.  2.100
  libavfilter    10.  2.102 / 10.  2.102
  libswscale      8.  2.100 /  8.  2.100
  libswresample   5.  2.100 /  5.  2.100
  libpostproc    58.  2.100 / 58.  2.100
gbrn commented 1 month ago

@DanielnetoDotCom Danny, I ran the tests and now it is generating the Webp image correctly. But I can't send the videos again to the ID already created, it keeps the WEBP images and doesn't replace the wrong image. Even if I manually send the WEBP image, it is not replaced.

DanielnetoDotCom commented 1 month ago

Create a new video then swap them

image