Draft
Changes from all commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
16d698f
Start implementation of approximate mode
scottsDec 16, 2024
9a5abce
Merge branch 'main' of .com:pytorch/torchcodec into approx
scottsDec 18, 2024
d95b128
Initial seek mode implementation in VideoDecoder.
scottsDec 19, 2024
97ac764
Merge branch 'main' of .com:pytorch/torchcodec into approx
scottsDec 19, 2024
35f2e59
Added Python side support, extended tests.
scottsDec 20, 2024
8c9aeac
Apply lints
scottsDec 20, 2024
921b822
Default C++ tests to approximate mode
scottsDec 20, 2024
b349282
Apply lints
scottsDec 20, 2024
081a5bb
Updated metadata; all tests pass.
scottsDec 20, 2024
802b881
Removed commened out code.
scottsDec 20, 2024
911a3bc
Consolidated logic for timestamp batch. Big perf win.
scottsDec 20, 2024
7267b5a
Consolidated logic for timestamp range.
scottsDec 21, 2024
ae44f78
More mode consolidation.
scottsDec 21, 2024
e4edaf4
Merge branch 'main' of .com:pytorch/torchcodec into approx
scottsJan 9, 2025
64ebefe
Merge branch 'main' into approx
NicolasHugJan 10, 2025
f62af46
Provide constructor param names
scottsJan 11, 2025
d15dfa0
getFramesSize -> getNumFrames
scottsJan 11, 2025
8879c32
Use seek_mode to paramterize metadata tests
scottsJan 11, 2025
8443de5
stream -> streamInfo
scottsJan 11, 2025
446910d
Merge branch 'main' of .com:pytorch/torchcodec into approx
scottsJan 11, 2025
ebebb63
Merge branch 'approx' of .com:scotts/torchcodec into approx
scottsJan 11, 2025
e34ca31
seek -> seekMode
scottsJan 11, 2025
67c1225
remove getFramePlayedAtTimestampNoDemuxInternal
scottsJan 11, 2025
d13879d
Merge branch 'main' of .com:pytorch/torchcodec into approx
scottsJan 14, 2025
06bb2c3
Rationalize time based samplers and valid metadata
scottsJan 14, 2025
8ed3c5e
Refactor setting and using scanned number of frames
scottsJan 14, 2025
bc10db8
Tweak FrameInfo struct initialization
scottsJan 14, 2025
a6a2b6a
Use validateFrameIndex in getFramesInIndices
scottsJan 14, 2025
3cd6842
Update src/torchcodec/decoders/_video_decoder.py
scottsJan 14, 2025
9a46404
Tweak VideoDecoder doc string
scottsJan 14, 2025
f4c001b
Remove comment
scottsJan 15, 2025
4574e95
Merge branch 'main' of .com:pytorch/torchcodec into approx
scottsJan 17, 2025
abad57b
FrameInfo struct initialization
scottsJan 17, 2025
737e1b6
Remove explicit setting of seek_mode in unrelated tests
scottsJan 21, 2025
99b0d4f
Merge branch 'main' of .com:pytorch/torchcodec into approx
scottsJan 21, 2025
32a0f8f
Handle stream names
NicolasHugJan 22, 2025
64f4595
Handle frame names
NicolasHugJan 22, 2025
c629073
Streams again
NicolasHugJan 22, 2025
85569fb
metadata names
NicolasHugJan 22, 2025
d914615
Handle options
NicolasHugJan 22, 2025
621a64c
Frame again
NicolasHugJan 22, 2025
f247884
Lint
NicolasHugJan 22, 2025
55a5840
More videoStreamOptions
NicolasHugJan 22, 2025
793c876
Merge branch 'main' of .com:pytorch/torchcodec into renamingzzzz
NicolasHugJan 22, 2025
79ea167
reduce diff
NicolasHugJan 22, 2025
404b2e4
Fix C++ tests
NicolasHugJan 22, 2025
941d6a3
Fix CUDA?
NicolasHugJan 22, 2025
11779a7
Merge branch 'main' of .com:pytorch/torchcodec into renamingzzzz
NicolasHugJan 23, 2025
a7c5711
Use allStreamMetadata
NicolasHugJan 23, 2025
16d5e52
Rename BatchDecodedOutput into FrameBatchOutput
NicolasHugJan 23, 2025
78b095a
Rename RawDecodedOutput into AVFrameWithStreamIndex
NicolasHugJan 23, 2025
e1e46ff
Rename DecodedOutput into FrameOutput
NicolasHugJan 23, 2025
cd0a181
Rename .frames into .data
NicolasHugJan 23, 2025
0111bfc
rename .frame to .data
NicolasHugJan 23, 2025
42ea096
Use frameBatchOutput variable name
NicolasHugJan 23, 2025
3a2ab2d
rename getFrameOutputWithFilter
NicolasHugJan 23, 2025
05da318
Use frameOutput name
NicolasHugJan 23, 2025
a6a47f1
lint
NicolasHugJan 23, 2025
d1352fe
Merge branch 'main' of .com:pytorch/torchcodec into framezzzzz
NicolasHugJan 23, 2025
658b727
getNextAVFrameNoDemux
NicolasHugJan 23, 2025
62818a7
more stuff
NicolasHugJan 23, 2025
24d0035
use avFrameWithStreamIndex
NicolasHugJan 23, 2025
a1805d1
Cpp tests
NicolasHugJan 23, 2025
eb1773a
more
NicolasHugJan 23, 2025
21b8ff2
Remove getNextAVFrameNoDemux
NicolasHugJan 23, 2025
dac4463
Rename maybeDesiredPts_ into desiredPts_
NicolasHugJan 23, 2025
bc024eb
Merge branch 'desiredPTs' into aelfjnalefjnalfjenljaenf
NicolasHugJan 23, 2025
a17027c
this should work
NicolasHugJan 23, 2025
738a262
Merge branch 'main' of .com:pytorch/torchcodec into this_should…
NicolasHugJan 23, 2025
86c6ffd
Try
NicolasHugJan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
Expand Up@@ -1079,27 +1079,7 @@ VideoDecoder::FrameOutput VideoDecoder::getFramePlayedAtNoDemux(
}

setCursorPtsInSeconds(seconds);
AVFrameStream avFrameStream = getAVFrameUsingFilterFunction(
[seconds, this](int frameStreamIndex, AVFrame* avFrame) {
StreamInfo& streamInfo = streamInfos_[frameStreamIndex];
double frameStartTime = ptsToSeconds(avFrame->pts, streamInfo.timeBase);
double frameEndTime = ptsToSeconds(
avFrame->pts + getDuration(avFrame), streamInfo.timeBase);
if (frameStartTime > seconds) {
// FFMPEG seeked past the frame we are looking for even though we
// set max_ts to be our needed timestamp in avformat_seek_file()
// in maybeSeekToBeforeDesiredPts().
// This could be a bug in FFMPEG: https://trac.ffmpeg.org/ticket/11137
// In this case we return the very next frame instead of throwing an
// exception.
// TODO: Maybe log to stderr for Debug builds?
return true;
}
return seconds >= frameStartTime && seconds < frameEndTime;
});

// Convert the frame to tensor.
FrameOutput frameOutput = convertAVFrameToFrameOutput(avFrameStream);
FrameOutput frameOutput = getNextFrameNoDemuxInternal();
frameOutput.data =
maybePermuteHWC2CHW(frameOutput.streamIndex, frameOutput.data);
return frameOutput;
Expand Down
Loading