# Path: core/config.py
# def full_path(path_to_config):
# def _import(filename):
# def create_if_not_exist(directory):
#     def update(self, new_values):
# def setup_config(path_to_config):
# class Config(object):
# 
# Path: core/utils/network_utils.py
# def get_free_port():
#     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#     s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
#     s.bind(('', 0))
#     port = s.getsockname()[1]
#     s.close()
#     return port
# 
# Path: core/exceptions.py
# class VNCProxyException(Exception):
#     pass


import os
import sys
import time
import signal
import logging
import os.path
import websockify
import multiprocessing
from core.config import config
from vnc2flv import flv, rfb, video
from core.utils.network_utils import get_free_port
from core.exceptions import VNCProxyException
# coding: utf-8



log = logging.getLogger(__name__)


class VNCVideoHelper:
    recorder = None
    __filepath = None

    def __init__(self, host, port=5900, filename_prefix='vnc'):
        self.filename_prefix = filename_prefix

# Path: core/config.py
# def full_path(path_to_config):
# def _import(filename):
# def create_if_not_exist(directory):
#     def update(self, new_values):
# def setup_config(path_to_config):
# class Config(object):
# 
# Path: core/utils/network_utils.py
# def get_free_port():
#     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#     s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
#     s.bind(('', 0))
#     port = s.getsockname()[1]
#     s.close()
#     return port
# 
# Path: core/exceptions.py
# class VNCProxyException(Exception):
#     pass


# Path: core/video.py
import os
import sys
import time
import signal
import logging
import os.path
import websockify
import multiprocessing
from core.config import config
from vnc2flv import flv, rfb, video
from core.utils.network_utils import get_free_port
from core.exceptions import VNCProxyException

# coding: utf-8



log = logging.getLogger(__name__)


class VNCVideoHelper:
    recorder = None
    __filepath = None

    def __init__(self, host, port=5900, filename_prefix='vnc'):
        self.filename_prefix = filename_prefix

        self.dir_path = os.sep.join([config.SCREENSHOTS_DIR,