Skip to content

Commit

Permalink
Log keyframe extractions errors instead of raising an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaserlang committed Nov 17, 2023
1 parent c82ef95 commit 9da4081
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions seplis_play_server/scanners/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,17 @@ async def get_keyframes(self, path):
stderr=subprocess.PIPE,
)
data, error = await process.communicate()

if error:
if isinstance(error, bytes):
error = error.decode('utf-8')
raise Exception(f'FFprobe error: {error}')
logger.error(f'FFprobe error: {error}')
return

if not data:
raise Exception(f'Failed to get keyframes from {path}, either this is not a media file or it is corrupt.')
logger.error(f'Failed to get keyframes from {path}, either this is not a media file or it is corrupt.')
return

if isinstance(data, bytes):
data = data.decode('utf-8')
data = utils.json_loads(data)
Expand Down

0 comments on commit 9da4081

Please sign in to comment.