Skip to content

Commit 7a63a54

Browse files
committed
Reapply "Align DecodecOutput with BatchDecodedOutput"
This reverts commit c11024f.
1 parent c11024f commit 7a63a54

File tree

3 files changed

+0
-8
lines changed

3 files changed

+0
-8
lines changed

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,10 +869,8 @@ VideoDecoder::DecodedOutput VideoDecoder::convertAVFrameToDecodedOutput(
869869
AVFrame* frame = rawOutput.frame.get();
870870
output.streamIndex = streamIndex;
871871
auto& streamInfo = streams_[streamIndex];
872-
output.pts = frame->pts;
873872
output.ptsSeconds =
874873
ptsToSeconds(frame->pts, formatContext_->streams[streamIndex]->time_base);
875-
output.duration = getDuration(frame);
876874
output.durationSeconds = ptsToSeconds(
877875
getDuration(frame), formatContext_->streams[streamIndex]->time_base);
878876
// TODO: we should fold preAllocatedOutputTensor into RawDecodedOutput.

src/torchcodec/decoders/_core/VideoDecoder.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,8 @@ class VideoDecoder {
194194
// The stream index of the decoded frame. Used to distinguish
195195
// between streams that are of the same type.
196196
int streamIndex;
197-
// The presentation timestamp of the decoded frame in time base.
198-
int64_t pts;
199197
// The presentation timestamp of the decoded frame in seconds.
200198
double ptsSeconds;
201-
// The duration of the decoded frame in time base.
202-
int64_t duration;
203199
// The duration of the decoded frame in seconds.
204200
double durationSeconds;
205201
};

test/decoders/VideoDecoderTest.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,10 @@ TEST_P(VideoDecoderTest, ReturnsFirstTwoFramesOfVideo) {
172172
torch::Tensor tensor0FromOurDecoder = output.frame;
173173
EXPECT_EQ(tensor0FromOurDecoder.sizes(), std::vector<long>({3, 270, 480}));
174174
EXPECT_EQ(output.ptsSeconds, 0.0);
175-
EXPECT_EQ(output.pts, 0);
176175
output = ourDecoder->getNextFrameNoDemux();
177176
torch::Tensor tensor1FromOurDecoder = output.frame;
178177
EXPECT_EQ(tensor1FromOurDecoder.sizes(), std::vector<long>({3, 270, 480}));
179178
EXPECT_EQ(output.ptsSeconds, 1'001. / 30'000);
180-
EXPECT_EQ(output.pts, 1001);
181179

182180
torch::Tensor tensor0FromFFMPEG =
183181
readTensorFromDisk("nasa_13013.mp4.stream3.frame000000.pt");

0 commit comments

Comments
 (0)