ITS: clean up gpylint errors in utils files
bug: 229024916
Change-Id: I60e0c9c1e33c4b7b21b3109f18808bdc3d1a4c75
diff --git a/apps/CameraITS/utils/video_processing_utils.py b/apps/CameraITS/utils/video_processing_utils.py
index b0fef2c..894729c 100644
--- a/apps/CameraITS/utils/video_processing_utils.py
+++ b/apps/CameraITS/utils/video_processing_utils.py
@@ -19,7 +19,6 @@
import logging
import os.path
import subprocess
-import time
ITS_SUPPORTED_QUALITIES = (
@@ -37,8 +36,7 @@
def extract_key_frames_from_video(log_path, video_file_name):
- """
- Returns a list of extracted key frames.
+ """Returns a list of extracted key frames.
Ffmpeg tool is used to extract key frames from the video at path
os.path.join(log_path, video_file_name).
@@ -51,26 +49,26 @@
Args:
log_path: path for video file directory
video_file_name: name of the video file.
- Ex: VID_20220325_050918_0_CIF_352x288.mp4
Returns:
key_frame_files: A list of paths for each key frame extracted from the
- video.
+ video. Ex: VID_20220325_050918_0_CIF_352x288.mp4
"""
ffmpeg_image_name = f"{video_file_name.split('.')[0]}_key_frame"
- ffmpeg_image_file_path = os.path.join(log_path, ffmpeg_image_name + '_%02d.png')
+ ffmpeg_image_file_path = os.path.join(
+ log_path, ffmpeg_image_name + '_%02d.png')
cmd = ['ffmpeg',
- '-skip_frame',
- 'nokey',
- '-i',
- os.path.join(log_path, video_file_name),
- '-vsync',
- 'vfr',
- '-frame_pts',
- 'true' ,
- ffmpeg_image_file_path,
- ]
- logging.debug('Extracting key frames from: %s' % video_file_name)
- output = subprocess.call(cmd)
+ '-skip_frame',
+ 'nokey',
+ '-i',
+ os.path.join(log_path, video_file_name),
+ '-vsync',
+ 'vfr',
+ '-frame_pts',
+ 'true',
+ ffmpeg_image_file_path,
+ ]
+ logging.debug('Extracting key frames from: %s', video_file_name)
+ _ = subprocess.call(cmd)
arr = os.listdir(os.path.join(log_path))
key_frame_files = []
for file in arr:
@@ -80,8 +78,7 @@
def get_key_frame_to_process(key_frame_files):
- """
- Returns the key frame file from the list of key_frame_files.
+ """Returns the key frame file from the list of key_frame_files.
If the size of the list is 1 then the file in the list will be returned else
the file with highest frame_index will be returned for further processing.
@@ -96,8 +93,7 @@
def extract_all_frames_from_video(log_path, video_file_name, img_format):
- """
- Extracts and returns a list of all extracted frames.
+ """Extracts and returns a list of all extracted frames.
Ffmpeg tool is used to extract all frames from the video at path
<log_path>/<video_file_name>. The extracted key frames will have the name