Пример #1
0
import string
import re
import md5
import math
import shlex
import helper
from time import time, sleep
from urllib import unquote
import subprocess
#from subprocess import subprocess.Popen, subprocess.PIPE
WIN32 = True if sys.platform.startswith('win') else False
if WIN32:
  import winhelper
DISABLE_LIVE_TRANSCODE = False
# Maximum length of time we'll keep video chunks on disk 
MAX_CACHE_TIME = helper.hours_to_seconds(6) 
# Maximum time we'll continue to transcode without having received a request
MAX_IDLE_TIME = helper.minutes_to_seconds(30)

class Segmenter(object):
  def __init__(self, path=None):
    if path:
      self.path = os.path.abspath(path)
    else:  
      name = 'live_segmenter.exe' if WIN32 else 'live_segmenter'
      self.path = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), name)
    self.cmd_tmpl = string.Template(helper.shellquote(self.path)+" 10 $tmpDir $segmentPrefix mpegts $startSegment")
    if not helper.validate_exec(self.path):
      DISABLE_LIVE_TRANSCODE = True
      print "Live transcode disabled. Could not find segmenter at path: "+self.path
    
Пример #2
0
# Currently not supporting SSL on the client, so don't show it.
SHOW_SSL = False

DEBUG = False
UPDATEURL = 'http://update.scribbeo.com/windows'
GUI_NAME = 'ScribbeoServerGUI.exe' # this script
VERSION = '1.2'

DATADIR = winhelper.DATADIR
SETTINGSFILEPATH = winhelper.SETTINGSFILEPATH

APP_PATH = os.path.abspath('ScribbeoServer.exe')
FFMPEG_PATH = os.path.abspath('ffmbc.exe')
SEGMENTER_PATH = os.path.abspath('live_segmenter.exe')

UPDATE_CHECK_INTERVAL = helper.hours_to_seconds(24)

if not os.path.exists(APP_PATH) and os.path.exists('app.py'):
    DEBUG = True # Use alternate startup commands for easier debug

class Window(QtGui.QDialog):
    def __init__(self):
        super(Window, self).__init__()
        self.serverOn = False
        self.lastUpdateCheck = None
        self.loadConfigFile()
        # set up the enclosure for Status, Dir, Port, Start/stop btn
        self.createMessageGroupBox() 
        # set up the actions for the tray
        self.createActions()
        # Create the tray icon, bind the actions to it.