edwardspec / mediawiki-aws-s3

Extension:AWS allows MediaWiki to use Amazon S3 (instead of the local directory) to store images.
https://www.mediawiki.org/wiki/Extension:AWS
GNU General Public License v2.0
42 stars 32 forks source link

Transcoding is Incompatible with Extension:TimedMediaHandler? #66

Closed MPThLee closed 1 year ago

MPThLee commented 1 year ago

I'm trying to transcode videos with TimedMediaHandler. And It seems like failed with this error (on runJobs):

2023-07-19 07:49:16 webVideoTranscodePrioritized File:[filename].mp4 transcodeMode=derivative transcodeKey=360p.vp9.webm prioritized=1 namespace=6 title=[filename].mp4 requestId=f22e99ac0119b0f767d9f3c5 (uuid=e37678cdbda84285802799a1fd188eca,timestamp=1689749883) STARTING
2023-07-19 07:50:06 webVideoTranscodePrioritized File:[filename].mp4 transcodeMode=derivative transcodeKey=360p.vp9.webm prioritized=1 namespace=6 title=[filename].mp4 requestId=f22e99ac0119b0f767d9f3c5 (uuid=e37678cdbda84285802799a1fd188eca,timestamp=1689749883) t=50618 error=InvalidArgumentException: Found 1 error while validating the input provided for the HeadObject operation:
[Bucket] is missing and is a required parameter

I searched a bit and [Bucket] is missing and is a required parameter is throwed via PHP AWS SDK. But it is weird that s3 is works ok on Web. I'm thinking that E:AWS is incompatible with TimedMediaHandler, or maybe just a bug. I have no idea, so I posted this issue here. If this is not possible to do, closing this issue. It's my first time to work with videos on mediawiki. Without transcode, it works well.

edwardspec commented 1 year ago

Please try adding the following to LocalSettings.php:

$wgAWSRepoZones['transcoded'] = [
    'container' => 'local-transcoded',
    'path' => '/transcoded',
    'isPublic' => true
];
MPThLee commented 1 year ago

It worked. Video is uploaded to bucket! But somehow, it's not ended well. DivisionByZeroError was showed up.

2023-07-19 08:59:43 webVideoTranscodePrioritized File:[filename].mp4 transcodeMode=derivative transcodeKey=180p.vp9.webm prioritized=1 namespace=6 title=[filename].mp4 requestId=f22e99ac0119b0f767d9f3c5 (uuid=e4edec26e87245e794088cb31001520c,timestamp=1689749890) STARTING
2023-07-19 08:59:59 webVideoTranscodePrioritized File:[filename].mp4 transcodeMode=derivative transcodeKey=180p.vp9.webm prioritized=1 namespace=6 title=[filename].mp4 requestId=f22e99ac0119b0f767d9f3c5 (uuid=e4edec26e87245e794088cb31001520c,timestamp=1689749890) t=16413 error=DivisionByZeroError: Division by zero

And it seems like getLength() on File is returns 0 somehow... Error was not enough to tell so I looked up sentry and: image I don't know it is issue with AWS or TimedMediaHandler. But File should be referred somewhere in the AWS?

MPThLee commented 1 year ago

Sorry, Seems like TimedMediaHandler doesn't have correct metadata(for already uploaded videos) in DB which causes this division by zero error. Issue with AWS is solved. Thank you!