def __init__(self, clientId, configPath, captureAppPath): self.dir_path = os.path.dirname(os.path.realpath(__file__)) # Log file self.LOG = logger.getLogFile(__name__) config = configparser.ConfigParser() config.readfp(open(configPath)) self.configPath = configPath self.videoSource = config.get("source", "video") self.audioSource = config.get("source", "audio") self.captureAppPath = captureAppPath self.videoResolution = config.get("config", "videoResolution") self.videoFramerate = config.get("config", "videoFramerate") self.captureBitRate = config.get("config", "captureBitRate") try: self.captureResolution = config.get("config", "captureResolution") except: self.captureResolution = '1280*720' try: self.liveResolution = config.get("config", "liveResolution") except: self.liveResolution = '720*406' self.outputFolder = config.get("config", "outputFolder") self.loglevel = config.get("config", "loglevel") try: self.showConsole = config.getboolean("config", "showConsole") except: self.showConsole = True self.outputFileName = '' self.captureAppLogPath = os.path.join(self.dir_path, "Capturing.log") self.captureAppLog = None self.captureAppProc = None # capturing timeout in seconds self.timeout = 30 self.clientId = clientId self.mediaServer = 'None' self.mediaServerApp = 'None' self.liveStreamName = 'None' self.liveFlag = 'False' self.captureTmpFilePath = 'capture.tmp' self.liveABR = 'False'
from __future__ import print_function import os import sys import boto3 from botocore.client import Config import logger from boto3.s3.transfer import TransferConfig import threading import time import socket import clientUploadApp import urllib3 import certifi # Log file LOG = logger.getLogFile(__name__) class uploadVideoDO: def __init__(self, clientId): self.clientId = clientId self.alreadyUploadedList = [] self.uploadRetryCount = 5 self.TEST_REMOTE_SERVER = "www.google.com" self.internetCheckTimeout = 10 * 60 # 30 mins def getUploadClient(self, dokey, dokeysecret): session = boto3.session.Session() client = session.client( 's3', region_name='sgp1',