Skip to content

Commit edb5d06

Browse files
committed
[site] Update redirect
1 parent 8f94e04 commit edb5d06

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

scenedetect/common.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ class Timecode:
139139
"""Presentation timestamp of the frame in units of `time_base`."""
140140
time_base: Fraction
141141
"""The base unit in which `pts` is measured."""
142+
#
143+
# TODO(0.7): We Let's require a frame number to be specified here. It's cheap to calculate
144+
# and store, avoids breaking too much, and allows us to pass that through in FrameTimecode
145+
# where a frame number/index is required.
146+
#
142147

143148
@property
144149
def seconds(self) -> float:

tests/test_cli.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def invoke_scenedetect(
103103
if config_file:
104104
command += " -c %s" % config_file
105105
command += " " + args.format(**value_dict)
106-
return subprocess.call(command.strip().split(" "))
106+
return subprocess.call(command.strip().split(" "), shell=True)
107107

108108

109109
def test_cli_no_args():
@@ -172,6 +172,7 @@ def test_cli_time_end():
172172
+ ["-i", DEFAULT_VIDEO_PATH, "-m", "0", "detect-content", "list-scenes", "-n"]
173173
+ test_case.split(),
174174
text=True,
175+
shell=True,
175176
)
176177
assert EXPECTED in output, test_case
177178

@@ -200,6 +201,7 @@ def test_cli_time_start():
200201
+ ["-i", DEFAULT_VIDEO_PATH, "-m", "0", "detect-content", "list-scenes", "-n"]
201202
+ test_case.split(),
202203
text=True,
204+
shell=True,
203205
)
204206
assert EXPECTED in output, test_case
205207

@@ -245,6 +247,7 @@ def test_cli_time_scene_boundary():
245247
+ ["-i", DEFAULT_VIDEO_PATH, "-m", "0", "detect-content", "list-scenes", "-n"]
246248
+ test_case.split(),
247249
text=True,
250+
shell=True,
248251
)
249252
assert EXPECTED in output, test_case
250253

@@ -256,6 +259,7 @@ def test_cli_time_end_of_video():
256259
SCENEDETECT_CMD.split(" ")
257260
+ ["-i", DEFAULT_VIDEO_PATH, "detect-content", "list-scenes", "-n", "time", "-s", "1872"],
258261
text=True,
262+
shell=True,
259263
)
260264
assert (
261265
"""
@@ -408,7 +412,13 @@ def test_cli_split_video_ffmpeg(tmp_path: Path):
408412
" "
409413
)
410414
command.append(DEFAULT_FFMPEG_ARGS)
411-
assert subprocess.call(command) == 0
415+
assert (
416+
subprocess.call(
417+
command,
418+
shell=True,
419+
)
420+
== 0
421+
)
412422
entries = sorted(tmp_path.glob(f"{DEFAULT_VIDEO_NAME}-Scene-*"))
413423
assert len(entries) == DEFAULT_NUM_SCENES, entries
414424
[entry.unlink() for entry in entries]
@@ -424,7 +434,13 @@ def test_cli_split_video_ffmpeg(tmp_path: Path):
424434
[entry.unlink() for entry in entries]
425435

426436
command += ["-f", "abc$VIDEO_NAME-123$SCENE_NUMBER"]
427-
assert subprocess.call(command) == 0
437+
assert (
438+
subprocess.call(
439+
command,
440+
shell=True,
441+
)
442+
== 0
443+
)
428444
entries = sorted(tmp_path.glob(f"abc{DEFAULT_VIDEO_NAME}-123*"))
429445
assert len(entries) == DEFAULT_NUM_SCENES, entries
430446
[entry.unlink() for entry in entries]
@@ -673,6 +689,7 @@ def test_cli_load_scenes_with_time_frames():
673689
"list-scenes",
674690
],
675691
text=True,
692+
shell=True,
676693
)
677694
assert (
678695
"""
@@ -715,6 +732,7 @@ def test_cli_load_scenes_round_trip():
715732
"400",
716733
],
717734
text=True,
735+
shell=True,
718736
)
719737
loaded_first_pass = subprocess.check_output(
720738
SCENEDETECT_CMD.split(" ")
@@ -734,6 +752,7 @@ def test_cli_load_scenes_round_trip():
734752
"testout2.csv",
735753
],
736754
text=True,
755+
shell=True,
737756
)
738757
SPLIT_POINT = " | Scene # | Start Frame | Start Time | End Frame | End Time |"
739758
assert ground_truth.split(SPLIT_POINT)[1] == loaded_first_pass.split(SPLIT_POINT)[1]

0 commit comments

Comments
 (0)