From c38ca40e015b3f71f57a580cebf83dd5e494d17c Mon Sep 17 00:00:00 2001 From: overflowerror Date: Wed, 6 Jan 2021 01:02:14 +0100 Subject: [PATCH] begin of transcode command --- content/.gitignore | 0 src/Command/TranscodeCommand.php | 51 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 content/.gitignore create mode 100644 src/Command/TranscodeCommand.php diff --git a/content/.gitignore b/content/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/src/Command/TranscodeCommand.php b/src/Command/TranscodeCommand.php new file mode 100644 index 0000000..836aacc --- /dev/null +++ b/src/Command/TranscodeCommand.php @@ -0,0 +1,51 @@ +videoService = $videoService; + + } + + protected function configure() + { + $this->setDescription("starts transcode process"); + } + + private function handleVideo(Video $video) + { + //$this->videoService->setVideoState($video, Video::PROCESSING_THUMBNAIL); + + + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + while (true) { + sleep(1); + + $videos = $this->videoService->getVideosForTranscode(); + foreach ($videos as $video) { + $output->writeln("New video: " . $video->getName() . ", " . $video->getUploader()->getName()); + + $this->handleVideo($video); + + $output->writeln("Done"); + } + } + } +} \ No newline at end of file