mirror of
https://github.com/nextcloud/server.git
synced 2025-07-22 18:25:45 +00:00
fix: unbloc ffmpeg on some broken videos
Co-authored-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
@ -107,7 +107,7 @@ Files: tests/data/integritycheck/htaccessWithValidModifiedContent/.htaccess
|
||||
Copyright: 2016 ownCloud, Inc., 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
License: AGPL-3.0-only
|
||||
|
||||
Files: core/img/favicon*.* core/img/logo/logo*.* tests/data/testimage.webp apps/testing/img/logo.png core/img/apps/spreed.svg
|
||||
Files: core/img/favicon*.* core/img/logo/logo*.* tests/data/testimage.webp tests/data/broken-video.webm apps/testing/img/logo.png core/img/apps/spreed.svg
|
||||
Copyright: 2016-2024 Nextcloud GmbH
|
||||
License: LicenseRef-NextcloudTrademarks
|
||||
|
||||
|
@ -166,8 +166,8 @@ class Movie extends ProviderV2 {
|
||||
$returnCode = -1;
|
||||
$output = '';
|
||||
if (is_resource($proc)) {
|
||||
$stdout = trim(stream_get_contents($pipes[1]));
|
||||
$stderr = trim(stream_get_contents($pipes[2]));
|
||||
$stdout = trim(stream_get_contents($pipes[1]));
|
||||
$returnCode = proc_close($proc);
|
||||
$output = $stdout . $stderr;
|
||||
}
|
||||
|
BIN
tests/data/broken-video.webm
Normal file
BIN
tests/data/broken-video.webm
Normal file
Binary file not shown.
20
tests/lib/Preview/MovieBrokenStuckFfmpegTest.php
Normal file
20
tests/lib/Preview/MovieBrokenStuckFfmpegTest.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Test\Preview;
|
||||
|
||||
/**
|
||||
* Class MovieTest
|
||||
*
|
||||
* @group DB
|
||||
*
|
||||
* @package Test\Preview
|
||||
*/
|
||||
class MovieBrokenStuckFfmpegTest extends MovieTest {
|
||||
protected string $fileName = 'broken-video.webm';
|
||||
}
|
@ -18,6 +18,10 @@ use OCP\Server;
|
||||
* @package Test\Preview
|
||||
*/
|
||||
class MovieTest extends Provider {
|
||||
protected string $fileName = 'testimage.mp4';
|
||||
protected int $width = 560;
|
||||
protected int $height = 320;
|
||||
|
||||
protected function setUp(): void {
|
||||
$binaryFinder = Server::get(IBinaryFinder::class);
|
||||
$movieBinary = $binaryFinder->findBinaryPath('avconv');
|
||||
@ -28,10 +32,7 @@ class MovieTest extends Provider {
|
||||
if (is_string($movieBinary)) {
|
||||
parent::setUp();
|
||||
|
||||
$fileName = 'testimage.mp4';
|
||||
$this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName);
|
||||
$this->width = 560;
|
||||
$this->height = 320;
|
||||
$this->imgPath = $this->prepareTestFile($this->fileName, \OC::$SERVERROOT . '/tests/data/' . $this->fileName);
|
||||
$this->provider = new \OC\Preview\Movie(['movieBinary' => $movieBinary]);
|
||||
} else {
|
||||
$this->markTestSkipped('No Movie provider present');
|
||||
|
Reference in New Issue
Block a user