Revision c25da0de
Added by David Sorber over 7 years ago
| software/hbkcd/hbkcd/config.py | ||
|---|---|---|
|
###############################################################################
|
||
|
# Configuration Options
|
||
|
###############################################################################
|
||
|
LOGFILE_PATH = '/var/log/hbkcd/hbkcd.log'
|
||
|
LOG_DIR = '/var/log/hbkcd/'
|
||
|
LOGFILE_PATH = '{:s}hbkcd.log'.format(LOG_DIR)
|
||
|
LOG_FORMAT_STR = '%(asctime)s|%(levelname)s|%(filename)s:%(lineno)s|%(message)s'
|
||
|
LOG_DATE_FORMAT_STR = '%a %b %d %H:%M:%S %Y'
|
||
|
DEFAULT_LOG_LEVEL = logging.DEBUG
|
||
| software/hbkcd/hbkcd/daemon.py | ||
|---|---|---|
|
status_thread.join()
|
||
|
item.in_progress = False
|
||
|
|
||
|
# Create encode log
|
||
|
ts_str = item.encode_started.strftime('%Y%m%d_%H%M%S')
|
||
|
filename = 'encode_{:s}.log'.format(ts_str)
|
||
|
log_path = os.path.join(LOG_DIR, filename)
|
||
|
with open(log_path, 'w') as log_file:
|
||
|
log_file.write(hbk_proc.stderr.read())
|
||
|
logging.info('Write encode log file: {:s}'.format(log_path))
|
||
|
|
||
|
# Calculate elapsed time
|
||
|
elapsed = item.encode_finished - item.encode_started
|
||
|
hours, remainder = divmod(elapsed.total_seconds(), 3600)
|
||
|
minutes, seconds = divmod(remainder, 60)
|
||
|
elapsed_str = '{:02}:{:02}:{:02}'
|
||
|
elapsed_str = elapsed_str.format(int(hours), int(minutes), int(seconds))
|
||
|
elapsed_str = elapsed_str.format(int(hours), int(minutes),
|
||
|
int(seconds))
|
||
|
|
||
|
# Print success or failure message to the log depending on the
|
||
|
# HandBrake process's return code
|
||
| software/hbkcd/hbkcd/queue.py | ||
|---|---|---|
|
if self.convert_audio:
|
||
|
# If converting audio use AAC
|
||
|
# TODO: double check this audio settings make sure VBR is used
|
||
|
cmd[HANDBRAKE_CMD_AUDIO_IDX] = 'fdk_aac --aq 5'
|
||
|
cmd[HANDBRAKE_CMD_AUDIO_IDX] = 'fdk_aac'
|
||
|
cmd.append('--aq')
|
||
|
cmd.append('5')
|
||
|
|
||
|
return cmd
|
||
|
|
||
| software/hbkcd/setup.py | ||
|---|---|---|
|
|
||
|
setup(
|
||
|
name = 'hbkcd',
|
||
|
version = '0.1.0',
|
||
|
version = '0.1.1',
|
||
|
description = 'HandBrake Control Daemon',
|
||
|
packages = find_packages(),
|
||
|
python_requires = '>=3.6.0',
|
||
Fix audio encode option bug. Add per file encode log. Version 0.1.1.