Skip to content

Commit 817b667

Browse files
author
Daniel Flores
committed
specify v in ffprobe
1 parent b067f48 commit 817b667

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/decoding/custom_frame_mappings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@
8181
long_json_path = Path(temp_dir) / "long_custom_frame_mappings.json"
8282
short_json_path = Path(temp_dir) / "short_custom_frame_mappings.json"
8383

84-
ffprobe_cmd = ["ffprobe", "-i", f"{long_video_path}", "-select_streams", f"{stream_index}", "-show_frames", "-show_entries", "frame=pkt_pts,pkt_duration,key_frame", "-of", "json"]
84+
ffprobe_cmd = ["ffprobe", "-i", f"{long_video_path}", "-select_streams", f"v:{stream_index}", "-show_frames", "-show_entries", "frame=pkt_pts,pkt_duration,key_frame", "-of", "json"]
8585
ffprobe_result = subprocess.run(ffprobe_cmd, check=True, capture_output=True, text=True)
8686
with open(long_json_path, "w") as f:
8787
f.write(ffprobe_result.stdout)
8888

89-
ffprobe_cmd = ["ffprobe", "-i", f"{short_video_path}", "-select_streams", f"{stream_index}", "-show_frames", "-show_entries", "frame=pkt_pts,pkt_duration,key_frame", "-of", "json"]
89+
ffprobe_cmd = ["ffprobe", "-i", f"{short_video_path}", "-select_streams", f"v:{stream_index}", "-show_frames", "-show_entries", "frame=pkt_pts,pkt_duration,key_frame", "-of", "json"]
9090
ffprobe_result = subprocess.run(ffprobe_cmd, check=True, capture_output=True, text=True)
9191
with open(short_json_path, "w") as f:
9292
f.write(ffprobe_result.stdout)

0 commit comments

Comments
 (0)