diff --git a/src/torchcodec/decoders/_core/VideoDecoder.cpp b/src/torchcodec/decoders/_core/VideoDecoder.cpp index f1d53308..4c524f87 100644 --- a/src/torchcodec/decoders/_core/VideoDecoder.cpp +++ b/src/torchcodec/decoders/_core/VideoDecoder.cpp @@ -872,10 +872,8 @@ VideoDecoder::DecodedOutput VideoDecoder::convertAVFrameToDecodedOutput( output.streamIndex = streamIndex; auto& streamInfo = streams_[streamIndex]; TORCH_CHECK(streamInfo.stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO); - output.pts = frame->pts; output.ptsSeconds = ptsToSeconds(frame->pts, formatContext_->streams[streamIndex]->time_base); - output.duration = getDuration(frame); output.durationSeconds = ptsToSeconds( getDuration(frame), formatContext_->streams[streamIndex]->time_base); // TODO: we should fold preAllocatedOutputTensor into RawDecodedOutput. diff --git a/src/torchcodec/decoders/_core/VideoDecoder.h b/src/torchcodec/decoders/_core/VideoDecoder.h index bed2ed05..9afce572 100644 --- a/src/torchcodec/decoders/_core/VideoDecoder.h +++ b/src/torchcodec/decoders/_core/VideoDecoder.h @@ -174,12 +174,8 @@ class VideoDecoder { // The stream index of the decoded frame. Used to distinguish // between streams that are of the same type. int streamIndex; - // The presentation timestamp of the decoded frame in time base. - int64_t pts; // The presentation timestamp of the decoded frame in seconds. double ptsSeconds; - // The duration of the decoded frame in time base. - int64_t duration; // The duration of the decoded frame in seconds. double durationSeconds; }; diff --git a/test/decoders/VideoDecoderTest.cpp b/test/decoders/VideoDecoderTest.cpp index 1fbbd9a0..6b3f32d6 100644 --- a/test/decoders/VideoDecoderTest.cpp +++ b/test/decoders/VideoDecoderTest.cpp @@ -172,12 +172,10 @@ TEST_P(VideoDecoderTest, ReturnsFirstTwoFramesOfVideo) { torch::Tensor tensor0FromOurDecoder = output.frame; EXPECT_EQ(tensor0FromOurDecoder.sizes(), std::vector({3, 270, 480})); EXPECT_EQ(output.ptsSeconds, 0.0); - EXPECT_EQ(output.pts, 0); output = ourDecoder->getNextFrameNoDemux(); torch::Tensor tensor1FromOurDecoder = output.frame; EXPECT_EQ(tensor1FromOurDecoder.sizes(), std::vector({3, 270, 480})); EXPECT_EQ(output.ptsSeconds, 1'001. / 30'000); - EXPECT_EQ(output.pts, 1001); torch::Tensor tensor0FromFFMPEG = readTensorFromDisk("nasa_13013.mp4.stream3.frame000000.pt");