commit c25da0de63e2c240c29b3f685cd06bd07ac166b0
Author: David Sorber <david.sorber@gmail.com>
Date:   Tue Jan 8 21:39:15 2019 -0500

    Fix audio encode option bug. Add per file encode log. Version 0.1.1.

diff --git a/software/hbkcd/hbkcd/config.py b/software/hbkcd/hbkcd/config.py
index 196cf05..f9aba12 100644
--- a/software/hbkcd/hbkcd/config.py
+++ b/software/hbkcd/hbkcd/config.py
@@ -3,7 +3,8 @@ import logging
 ###############################################################################
 # 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
diff --git a/software/hbkcd/hbkcd/daemon.py b/software/hbkcd/hbkcd/daemon.py
index b0ca776..95ec347 100755
--- a/software/hbkcd/hbkcd/daemon.py
+++ b/software/hbkcd/hbkcd/daemon.py
@@ -110,12 +110,21 @@ def main():
             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
diff --git a/software/hbkcd/hbkcd/queue.py b/software/hbkcd/hbkcd/queue.py
index 619601c..1006610 100644
--- a/software/hbkcd/hbkcd/queue.py
+++ b/software/hbkcd/hbkcd/queue.py
@@ -164,7 +164,9 @@ class QueueItem(object):
         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
         
diff --git a/software/hbkcd/setup.py b/software/hbkcd/setup.py
index 67ba6ad..e71c53f 100755
--- a/software/hbkcd/setup.py
+++ b/software/hbkcd/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
 
 setup(
     name = 'hbkcd',
-    version = '0.1.0',
+    version = '0.1.1',
     description = 'HandBrake Control Daemon',
     packages = find_packages(),
     python_requires = '>=3.6.0',
