Skip to content

Commit 547d8e5

Browse files
author
Molly Xu
committed
address feedback
1 parent 2286285 commit 547d8e5

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

docs/source/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ Decoding
8484

8585
How to sample regular and random clips from a video
8686

87+
.. grid-item-card:: :octicon:`file-code;1em`
88+
Performance Tips
89+
:img-top: _static/img/card-background.svg
90+
:link: generated_examples/decoding/performance_tips.html
91+
:link-type: url
92+
93+
Tips for optimizing video decoding performance
94+
8795

8896
Encoding
8997
^^^^^^^^

examples/decoding/performance_tips.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,13 @@
3939
#
4040
# **Key Methods:**
4141
#
42+
# For index-based frame retrieval:
43+
#
4244
# - :meth:`~torchcodec.decoders.VideoDecoder.get_frames_at` for specific indices
4345
# - :meth:`~torchcodec.decoders.VideoDecoder.get_frames_in_range` for ranges
46+
#
47+
# For timestamp-based frame retrieval:
48+
#
4449
# - :meth:`~torchcodec.decoders.VideoDecoder.get_frames_played_at` for timestamps
4550
# - :meth:`~torchcodec.decoders.VideoDecoder.get_frames_played_in_range` for time ranges
4651
#
@@ -61,7 +66,7 @@
6166
# ----------------------------------------
6267
#
6368
# By default, TorchCodec uses ``seek_mode="exact"``, which performs a :term:`scan` when
64-
# the decoder is created to build an accurate internal index of frames. This
69+
# you create the decoder to build an accurate internal index of frames. This
6570
# ensures frame-accurate seeking but takes longer for decoder initialization,
6671
# especially on long videos.
6772

@@ -90,8 +95,8 @@
9095
#
9196
# **When to use:**
9297
#
93-
# - Frame accuracy is critical, so approximate mode cannot be used
94-
# - Videos can be preprocessed once and then decoded many times
98+
# - Frame accuracy is critical, so you cannot use approximate mode
99+
# - You can preprocess videos once and then decode them many times
95100
#
96101
# **Performance impact:** Enables consistent, predictable performance for repeated
97102
# random access without the overhead of exact mode's scanning.
@@ -116,7 +121,7 @@
116121
# - **Multiprocessing** - Distributing work across multiple processes
117122
# - **Multithreading** - Using multiple threads within a single process
118123
#
119-
# Both multiprocessing and multithreading can be used to decode multiple videos in parallel, or to decode a single long video in parallel by splitting it into chunks.
124+
# You can use both multiprocessing and multithreading to decode multiple videos in parallel, or to decode a single long video in parallel by splitting it into chunks.
120125

121126
# %%
122127
# .. note::

0 commit comments

Comments
 (0)