Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Asset] Video preview not working when storing assets in remote stream #5007

@ramundomario

Description

@ramundomario

Bug Report

Expected behavior

Open the video and then see its preview.

Actual behavior

When using remote object storage like AWS S3, Google Cloud Storage, to be able to perform conversion with FFMPEG, the video is downloaded into the temporary folder /var/tmp/asset-temporary.
Then FFMPEG is started in background with empty path to temporary file, because the file has been deleted by the __destruct method of Asset.php class.

public function convert()
{
$this->save();
Console::runPhpScriptInBackground(realpath(PIMCORE_PROJECT_ROOT . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'console'), 'internal:video-converter ' . $this->getProcessId());
}

pimcore/models/Asset.php

Lines 1919 to 1930 in c5660dc

public function __destruct()
{
// close open streams
$this->closeStream();
// delete temporary files
foreach ($this->_temporaryFiles as $tempFile) {
if (file_exists($tempFile)) {
@unlink($tempFile);
}
}
}

Trying to execute the command not in the background the process is successful, but before the video is opened, it is necessary to wait for the download time of the temporary file and the execution of the transcoding.

Related to #4043

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions