Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ramundomario opened this issue Sep 24, 2019 · 0 comments

Comments

@ramundomario
Copy link
Contributor

commented Sep 24, 2019

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

@ramundomario ramundomario changed the title Rea,ted Video conversion not working when storing assets in remote stream Sep 24, 2019
@ramundomario ramundomario changed the title Video conversion not working when storing assets in remote stream Video preview not working when storing assets in remote stream Sep 24, 2019
@ramundomario ramundomario changed the title Video preview not working when storing assets in remote stream [Asset] Video preview not working when storing assets in remote stream Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.