-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add animation module and animated formats
- Loading branch information
Showing
11 changed files
with
261 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
lib/php/rendition-factory/src/Transformer/Video/FFMpeg/Format/FormatInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Alchemy\RenditionFactory\Transformer\Video\FFMpeg\Format; | ||
|
||
|
||
use Alchemy\RenditionFactory\DTO\FamilyEnum; | ||
// use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; | ||
|
||
// #[AutoconfigureTag(self::TAG)] | ||
interface FormatInterface | ||
{ | ||
final public const TAG = 'alchemy_rendition_factory.ffmpeg_format'; | ||
|
||
public static function getAllowedExtensions(): array; | ||
public static function getMimeType(): string; | ||
public static function getFormat(): string; | ||
public static function getFamily(): FamilyEnum; | ||
} |
29 changes: 29 additions & 0 deletions
29
lib/php/rendition-factory/src/Transformer/Video/FFMpeg/Format/JpegFormat.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Alchemy\RenditionFactory\Transformer\Video\FFMpeg\Format; | ||
|
||
use Alchemy\RenditionFactory\DTO\FamilyEnum; | ||
use FFMpeg\Format\Video\X264; | ||
|
||
class JpegFormat implements FormatInterface | ||
{ | ||
public static function getAllowedExtensions(): array | ||
{ | ||
return ['jpg', 'jpeg']; | ||
} | ||
|
||
public static function getMimeType(): string | ||
{ | ||
return 'image/jpeg'; | ||
} | ||
|
||
public static function getFormat(): string | ||
{ | ||
return 'image-jpeg'; | ||
} | ||
|
||
public static function getFamily(): FamilyEnum | ||
{ | ||
return FamilyEnum::Image; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
lib/php/rendition-factory/src/Transformer/Video/FFMpeg/Format/MkvFormat.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Alchemy\RenditionFactory\Transformer\Video\FFMpeg\Format; | ||
|
||
use Alchemy\RenditionFactory\DTO\FamilyEnum; | ||
use FFMpeg\Format\Video\X264; | ||
use FFMpeg\Format\VideoInterface; | ||
|
||
class MkvFormat implements FormatInterface | ||
{ | ||
private VideoInterface $format; | ||
|
||
public function __construct() | ||
{ | ||
$this->format = new X264(); | ||
} | ||
|
||
public static function getAllowedExtensions(): array | ||
{ | ||
return ['mkv']; | ||
} | ||
|
||
public static function getMimeType(): string | ||
{ | ||
return 'video/x-matroska'; | ||
} | ||
|
||
public static function getFormat(): string | ||
{ | ||
return 'video-mkv'; | ||
} | ||
|
||
public static function getFamily(): FamilyEnum | ||
{ | ||
return FamilyEnum::Video; | ||
} | ||
|
||
public function getFFMpegFormat(): VideoInterface | ||
{ | ||
return $this->format; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
lib/php/rendition-factory/src/Transformer/Video/FFMpeg/Format/Mpeg4Format.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Alchemy\RenditionFactory\Transformer\Video\FFMpeg\Format; | ||
|
||
use Alchemy\RenditionFactory\DTO\FamilyEnum; | ||
use FFMpeg\Format\Video\X264; | ||
use FFMpeg\Format\VideoInterface; | ||
|
||
class Mpeg4Format implements FormatInterface | ||
{ | ||
private VideoInterface $format; | ||
|
||
public function __construct() | ||
{ | ||
$this->format = new X264(); | ||
} | ||
|
||
public static function getAllowedExtensions(): array | ||
{ | ||
return ['mp4']; | ||
} | ||
|
||
public static function getMimeType(): string | ||
{ | ||
return 'video/mp4'; | ||
} | ||
|
||
public static function getFormat(): string | ||
{ | ||
return 'video-mpeg4'; | ||
} | ||
|
||
public static function getFamily(): FamilyEnum | ||
{ | ||
return FamilyEnum::Video; | ||
} | ||
|
||
public function getFFMpegFormat(): VideoInterface | ||
{ | ||
return $this->format; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
lib/php/rendition-factory/src/Transformer/Video/FFMpeg/Format/MpegFormat.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Alchemy\RenditionFactory\Transformer\Video\FFMpeg\Format; | ||
|
||
use Alchemy\RenditionFactory\DTO\FamilyEnum; | ||
use FFMpeg\Format\Video\X264; | ||
use FFMpeg\Format\VideoInterface; | ||
|
||
class MpegFormat implements FormatInterface | ||
{ | ||
private VideoInterface $format; | ||
|
||
public function __construct() | ||
{ | ||
$this->format = new X264(); | ||
} | ||
|
||
public static function getAllowedExtensions(): array | ||
{ | ||
return ['mpeg']; | ||
} | ||
|
||
public static function getMimeType(): string | ||
{ | ||
return 'video/mpeg'; | ||
} | ||
|
||
public static function getFormat(): string | ||
{ | ||
return 'video-mpeg'; | ||
} | ||
|
||
public static function getFamily(): FamilyEnum | ||
{ | ||
return FamilyEnum::Video; | ||
} | ||
|
||
public function getFFMpegFormat(): VideoInterface | ||
{ | ||
return $this->format; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
lib/php/rendition-factory/src/Transformer/Video/FFMpeg/Format/QuicktimeFormat.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Alchemy\RenditionFactory\Transformer\Video\FFMpeg\Format; | ||
|
||
use Alchemy\RenditionFactory\DTO\FamilyEnum; | ||
use FFMpeg\Format\Video\X264; | ||
use FFMpeg\Format\VideoInterface; | ||
|
||
class QuicktimeFormat implements FormatInterface | ||
{ | ||
private VideoInterface $format; | ||
|
||
public function __construct() | ||
{ | ||
$this->format = new X264(); | ||
} | ||
|
||
public static function getAllowedExtensions(): array | ||
{ | ||
return ['mov']; | ||
} | ||
|
||
public static function getMimeType(): string | ||
{ | ||
return 'video/quicktime'; | ||
} | ||
|
||
public static function getFormat(): string | ||
{ | ||
return 'video-quicktime'; | ||
} | ||
|
||
public static function getFamily(): FamilyEnum | ||
{ | ||
return FamilyEnum::Video; | ||
} | ||
|
||
public function getFFMpegFormat(): VideoInterface | ||
{ | ||
return $this->format; | ||
} | ||
} |
22 changes: 0 additions & 22 deletions
22
lib/php/rendition-factory/src/Transformer/Video/FFMpeg/Format/Video/WebM.php
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
lib/php/rendition-factory/src/Transformer/Video/FFMpeg/Format/Video/X264.php
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
lib/php/rendition-factory/src/Transformer/Video/FFMpeg/Format/WebmFormat.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Alchemy\RenditionFactory\Transformer\Video\FFMpeg\Format; | ||
|
||
use Alchemy\RenditionFactory\DTO\FamilyEnum; | ||
use FFMpeg\Format\Video\WebM; | ||
use FFMpeg\Format\VideoInterface; | ||
|
||
class WebmFormat implements FormatInterface | ||
{ | ||
private VideoInterface $format; | ||
|
||
public function __construct() | ||
{ | ||
$this->format = new WebM(); | ||
} | ||
|
||
public static function getAllowedExtensions(): array | ||
{ | ||
return ['webm']; | ||
} | ||
|
||
public static function getMimeType(): string | ||
{ | ||
return 'video/webm'; | ||
} | ||
|
||
public static function getFormat(): string | ||
{ | ||
return 'video-webm'; | ||
} | ||
|
||
public static function getFamily(): FamilyEnum | ||
{ | ||
return FamilyEnum::Video; | ||
} | ||
|
||
public function getFFMpegFormat(): VideoInterface | ||
{ | ||
return $this->format; | ||
} | ||
} |