Closed thekid closed 1 year ago
There are problems when uploading the media takes too long - resulting in an exception after ~30 seconds:
We might be able to fix this using https://github.com/xp-forge/web/pull/92
There are problems when uploading the media takes too long - resulting in an exception after ~30 seconds:
Moving Expect: 100-continue
handling to the REST API library fixes the upload problem for curl
, see https://github.com/xp-forge/rest-api/pull/16
Good question why the PHP upload doesn't work:
$transfer= ['video' => new File('Albums/.../video-20191017_122438000_iOS.MOV.mp4')];
$upload= new RestUpload($this->api, $this->api
->resource('entries/{0}/images/{1}', [$item['slug'], $entry->name()])
->request('PUT')
->waiting(read: 3600)
);
foreach ($transfer as $kind => $file) {
$upload->transfer($kind, $file->in(), $file->filename);
}
$r= $upload->finish();
...but this does:
$ curl -v \
-X PUT \
-F 'video=@Albums/.../video-20191017_122438000_iOS.MOV.mp4' \
'https://...@dialog.sloppy.zone/api/entries/.../images/20191017_122438000_iOS.MOV'
# ...
We also need to make uploads work asynchronously to not block the server while images are being uploaded, see https://github.com/xp-forge/web/pull/92
Four things we can improve upon in the future:
curl
command once we've found the problem why these break after ~30 secondsffmpeg
command line copy this?ffmpeg
command before running (and then potentially breaking if it isn't found)As stated in other pull requests, as long as we're pre-1.0, we can live with this imperfection for the moment 🙃
The screenshot quality looks a bit rough, if I manually pause the video and make a screenshot it looks better. How can the ffmpeg command line copy this?
My observation was that the WebP file ffmpeg was producing was way inferior in quality compared to the JPEG. By removing the -vf scale=xxx:-1
argument and converting to JPEG first, then resizing and converting that we can achieve quite a bit of an improvement
Before | After |
---|---|
This pull request adds support for uploading video in content using FFMPeg