-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
- let's parametrize over the other encoding methods (to_file_like, to_tensor)
torchcodec/test/test_encoders.py
Line 922 in 17164fd
def test_video_encoder_against_ffmpeg_cli(self, tmp_path, format, encode_params): - Let's call
self._get_video_metadatain this test to ensure the expected metadata is the same. We should explicitly check forduration! frame_rateshould accept a float. Right now it expects anintand errors on floats, but fps come in floats, like in:
import torch
from torchcodec.decoders import VideoDecoder
from torchcodec.encoders import VideoEncoder
dec = VideoDecoder("test/resources/nasa_13013.mp4")
print(dec.metadata) # average_fps=29.xxxxx
frames = dec.get_frames_in_range(0, -1)
enc = VideoEncoder(frames.data, frame_rate=dec.metadata.average_fps)) # this currently raises an errorLet's add a test making sure we can pass a float. The test can just decode and encode nasa_13013.mp4 as done above, and assert that the encoded duration is the same as the original.
- as noted in Add frame rate to VideoEncoder API #1054 (comment) let's make
extra_optionthe last keword-only parameter
Metadata
Metadata
Assignees
Labels
No labels