Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions torchvision/csrc/io/decoder/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ bool Decoder::init(
}
}

av_dict_set_int(&options, "probesize", params_.probeSize, 0);

interrupted_ = false;

// ffmpeg avformat_open_input call can hang if media source doesn't respond
Expand Down
6 changes: 6 additions & 0 deletions torchvision/csrc/io/decoder/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ struct DecoderParameters {

// Skip packets that fail with EPERM errors and continue decoding.
bool skipOperationNotPermittedPackets{false};

// probing size in bytes, i.e. the size of the data to analyze to get stream
// information. A higher value will enable detecting more information in case
// it is dispersed into the stream, but will increase latency. Must be an
// integer not lesser than 32. It is 5000000 by default.
int64_t probeSize{5000000};
};

struct DecoderHeader {
Expand Down