Skip to content

Commit

Permalink
temp t-shooting logs
Browse files Browse the repository at this point in the history
  • Loading branch information
stevezau committed May 27, 2024
1 parent ec0cc2c commit bb9855f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plex_generate_previews.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,15 @@ def generate_images(video_file_param, output_folder):
args.insert(5, "-hwaccel")
args.insert(6, "cuda")

logger.info('running {}'.format(args))
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

# Allow time for it to start
time.sleep(1)

logger.info('debug test 1')
out, err = proc.communicate()
logger.info('debug test 2')
if proc.returncode != 0:
err_lines = err.decode('utf-8', 'ignore').split('\n')[-5:]
logger.error(err_lines)
Expand Down Expand Up @@ -239,6 +242,7 @@ def process_item(item_key):
try:
generate_images(media_part.attrib['file'], tmp_path)
except Exception as e:
logger.exception(e)
logger.error('Error generating images for {}. `{}` error when generating images'.format(media_file, str(e)))
if os.path.exists(tmp_path):
shutil.rmtree(tmp_path)
Expand Down

0 comments on commit bb9855f

Please sign in to comment.