Releases: pytorch/torchcodec
TorchCodec 0.1
TorchCodec 0.1 is out ! It is packed with exciting features, and it is the first release of TorchCodec that we're pushing for wide adoption.
New features and improvements
GPU Decoding
Decoding can now be done on CUDA GPUs by simply using the device
parameter: decoder = VideoDecoder(..., device="cuda")
. GPU decoding can lead to faster decoding pipelines in a variety of cases. To learn more on how to use GPU decoding and how to install it, follow our GPU decoding example!
Clip sampling
TorchCodec now supports fast clip samplers in the torchcodec.samplers
namespace. We support random and regular sampling for both index-based and time-based strategies. Read more about samplers in our sampling example!
Improvements to VideoDecoder
Note: SimpleVideoDecoder
became VideoDecoder
! See below for other changes.
-
The
VideoDecoder
class now exposes the following parameter to provide users with more control:num_ffmpeg_threads
stream_index
-
Two new methods were added:
decoder.get_frames_at(indices=[3, 1, 10])
anddecoder.get_frames_played_at(seconds=[10.5, 0.3])
. When decoding multiple frames, calling these method is a lot faster than callingget_frame_at()
orget_frame_played_at()
repeatedly.
Read more on the docs.
Speed improvements
Various performance improvements were made, including:
- The decoder now automatically switches between the lower-level
swscale
andfiltergraph
libraries. These libraries are mainly used to convert YUV colors to RGB, and swscale usually leads to faster results. TorchCodec relies on one or the other when appropriate. - We now avoid extra copies of the output frame tensor in batch-decoding APIs
You can find detailed benchmark results on the repo.
MacOS support
TorchCodec now supports MacOS! Just run pip install torchcodec
and follow our normal installation instructions.
Breaking changes
TorchCodec is still in development stage and some APIs may be updated in future versions without a deprecation cycle, depending on user feedback. For this release, a few important API changes were made, but we do not anticipate significant changes of the sort in future releases, and we now consider the existing APIs largely stable.
- The
SimpleVideoDecoder
class was renamed toVideoDecoder
- Methods of
VideoDecoder
containing the term "displayed" have been changed to the term "played". E.g.get_frame_displayed_at()
is nowget_frame_played_at()
. This is to accommodate for future audio support. - The
get_frames_at()
andget_frames_displayed_at()
methods have been renamed toget_frames_in_range()
andget_frames_played_in_range()
. The method namesget_frames_at()
andget_frames_played_at()
still exist, but they do something else (see new features section).
Bug fixes
- Time-based decoding APIs were returning the wrong frame when the timestamp corresponded to the second-to-last frame. See #287 for more details.
TorchCodec 0.0.3
TorchCodec 0.0.3 is out !
This is a small release which fixes decoding frames for H265.
TorchCodec 0.0.2
TorchCodec 0.0.2 is out !
This is a small release which adds the SimpleVideoDecoder.get_frames_displayed_at()
method.
TorchCodec 0.0.1
This is the first release of TorchCodec!