31 lines
1.5 KiB
Python
31 lines
1.5 KiB
Python
import json
|
|
import os
|
|
import subprocess
|
|
|
|
from django.core.management.base import BaseCommand
|
|
from django.conf import settings
|
|
|
|
from ...render import render_infinity, default_prefix
|
|
|
|
|
|
class Command(BaseCommand):
|
|
help = 'render infinity'
|
|
|
|
def add_arguments(self, parser):
|
|
parser.add_argument('--prefix', action='store', dest='prefix', default=default_prefix, help='prefix to build clips in')
|
|
parser.add_argument('--config', action='store', dest='config', default=None, help='config')
|
|
parser.add_argument('--duration', action='store', dest='duration', default="3600", help='target duration of all fragments in seconds')
|
|
parser.add_argument('--single-file', action='store_true', dest='single_file', default=False, help='render to single video')
|
|
parser.add_argument('--keep-audio', action='store_true', dest='keep_audio', default=False, help='keep independent audio tracks')
|
|
parser.add_argument('--stereo-downmix', action='store_true', dest='stereo_downmix', default=False, help='stereo downmix')
|
|
parser.add_argument('--debug', action='store_true', dest='debug', default=False, help='output more info')
|
|
|
|
def handle(self, **options):
|
|
if options.get("config"):
|
|
if os.path.exists(options["config"]):
|
|
with open(options["config"]) as fd:
|
|
config = json.load(fd)
|
|
options.update(config)
|
|
else:
|
|
print("unable to load config %s" % options["config"])
|
|
render_infinity(options)
|