videocutting/cutvideo
Daniel Siepmann 8124631d5d
Allow to define temp folder
Some systems might have limited temp folder sizes.
A new option is added to configure the folder to use for temp files.
2023-02-12 11:31:31 +01:00

23 lines
1.3 KiB
PHP
Executable file

#!/usr/bin/env php
<?php
require __DIR__.'/vendor/autoload.php';
use DanielSiepmann\Videcutting\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\SingleCommandApplication;
(new SingleCommandApplication())
->setName('Cutvideo')
->setHelp('Allows to cut a given video multiple times. Uses ffmpeg under the hood. Example: cutvideo Alf_season-1_episode-20_der-rollentausch_nq.mp4 08:05 38:24 --ad=26:22/33:08')
->setVersion('0.1.0')
->addArgument('file', InputArgument::REQUIRED, 'The video file to cut.')
->addArgument('start', InputArgument::REQUIRED, 'The starting point of the video')
->addArgument('end', InputArgument::REQUIRED, 'The end point of the video')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force generation, even if target already exists.')
->addOption('remove', 'r', InputOption::VALUE_NONE, 'Remove input file on success.')
->addOption('tmp', 't', InputOption::VALUE_OPTIONAL, 'Temporary folder for temporary files. Defaults to system temp.')
->addOption('ad', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Start and end of ads, separate start and end via "/".', [])
->setCode(new Command())
->run();