Skip to content

Commit 83d42b3

Browse files
author
arch
committed
add more verbosity
1 parent 07182b8 commit 83d42b3

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

funscript_editor/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def generate_funscript(
3636
"""
3737
setup_logging()
3838
logging.info("Python Funscript Generator %s", VERSION)
39+
logging.info("Startup Path: %s", str(os.getcwd()))
40+
logging.info("Args: video_file=%s, start_time=%s, end_time=%s, output_file=%s", \
41+
str(video_file), str(start_time), str(end_time), str(output_file))
3942
app = QtWidgets.QApplication(sys.argv)
4043
generator = MinimalFunscriptGenerator(video_file, start_time, end_time, output_file)
4144
generator.run()

funscript_editor/data/ffmpegstream.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,22 @@ def get_frame(
101101
return frame
102102

103103

104+
@staticmethod
105+
def get_ffmpeg_command() -> str:
106+
""" Get FFmpeg binary command string
107+
108+
Returns:
109+
str: FFmpeg command
110+
"""
111+
ffmpeg = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ffmpeg")
112+
if os.path.exists(ffmpeg):
113+
# use local ffmpeg
114+
return ffmpeg
115+
else:
116+
# use ffmpeg in $PATH
117+
return "ffmpeg"
118+
119+
104120
@staticmethod
105121
def get_projection(
106122
frame :np.ndarray,
@@ -121,7 +137,7 @@ def get_projection(
121137
video_filter = video_filter.replace('${' + k + '}', str(v))
122138

123139
command = [
124-
'ffmpeg',
140+
FFmpegStream.get_ffmpeg_command(),
125141
'-hide_banner',
126142
'-loglevel', 'warning',
127143
'-y',
@@ -264,7 +280,7 @@ def run(self) -> None:
264280
seek = FFmpegStream.frame_to_timestamp(self.start_frame, self.video_info.fps)
265281

266282
command = [
267-
'ffmpeg',
283+
FFmpegStream.get_ffmpeg_command(),
268284
'-hide_banner',
269285
'-loglevel', 'warning',
270286
'-ss', str(seek),

0 commit comments

Comments
 (0)