Skip to content

Commit 613e356

Browse files
author
Daniel Flores
committed
adjust vid lengths
1 parent 09799a6 commit 613e356

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/decoding/custom_frame_mappings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# %%
2525
# First, some boilerplate: we'll download a short video from the web, and
2626
# use ffmpeg to create a longer version by repeating it multiple times. We'll end up
27-
# with two videos: a short one of approximately 14 seconds and a long one of about 14 minutes.
27+
# with two videos: a short one of approximately 14 seconds and a long one of about 12 minutes.
2828
# You can ignore this part and skip below to :ref:`frame_mappings_creation`.
2929

3030
import tempfile
@@ -48,7 +48,7 @@
4848
long_video_path = Path(temp_dir) / "long_video.mp4"
4949
ffmpeg_command = [
5050
"ffmpeg",
51-
"-stream_loop", "80", # repeat video 80 times to get a ~18 min video
51+
"-stream_loop", "50", # repeat video 50 times to get a ~12 min video
5252
"-i", f"{short_video_path}",
5353
"-c", "copy",
5454
f"{long_video_path}"
@@ -83,7 +83,7 @@
8383
# Lets define a simple function to run ffprobe on a video's first stream index, then writes the results in output_json_path.
8484
def generate_frame_mappings(video_path, output_json_path, stream_index):
8585
ffprobe_cmd = ["ffprobe", "-i", f"{video_path}", "-select_streams", f"{stream_index}", "-show_frames", "-show_entries", "frame=pts,duration,key_frame", "-of", "json"]
86-
print(f"Running ffprobe:\n{' '.join(ffprobe_cmd)}")
86+
print(f"Running ffprobe:\n{' '.join(ffprobe_cmd)}\n")
8787
ffprobe_result = subprocess.run(ffprobe_cmd, check=True, capture_output=True, text=True)
8888
with open(output_json_path, "w") as f:
8989
f.write(ffprobe_result.stdout)

0 commit comments

Comments
 (0)