def handle(self, *args, **options):
        video_id = options['video_id']

        transcoder = VideoTranscoder()
        video = Video.objects.get(pk=video_id)

        transcoder.video = video # hack, sorry
        transcoder.update_jamstarts()
示例#2
0
    def handle(self, *args, **options):
        self.s3 = boto3.resource('s3')
        video_id = options['video_id']

        transcoder = VideoTranscoder()
        video = Video.objects.get(pk=video_id)

        transcoder.video = video # hack, sorry

        try:
            self.download_source(video)
        except botocore.exceptions.ClientError as e:
            print "The video with id {} wasn't found in S3!".format(video.id)
            sys.exit(1)

        transcoder.transcode(['mp4', 'hls'])

        print "uploading to S3"
        transcoder.upload_to_s3()

        print "Deleting local files"
        transcoder.delete_source()

        print "Done!"