Unverified Commit de350bc0 authored by YosuaMichael's avatar YosuaMichael Committed by GitHub
Browse files

Set pytorch vision decoder probesize for getting stream info based on the...

Set pytorch vision decoder probesize for getting stream info based on the value from decode setting (#6900) (#6950)

Summary:
Pull Request resolved: https://github.com/pytorch/vision/pull/6900



1. Pass along the value of probesize from decode setting.
2. allow pytorch vision decoder to set the probesize for getting stream info

Reviewed By: jdsgomes

Differential Revision: D40967782

fbshipit-source-id: 642ae3b67c50b1fdafc20f9814a52fdf5db527d7
Co-authored-by: default avatarChen Liu <cliu7@meta.com>
parent c5958862
...@@ -312,6 +312,8 @@ bool Decoder::init( ...@@ -312,6 +312,8 @@ bool Decoder::init(
} }
} }
av_dict_set_int(&options, "probesize", params_.probeSize, 0);
interrupted_ = false; interrupted_ = false;
// ffmpeg avformat_open_input call can hang if media source doesn't respond // ffmpeg avformat_open_input call can hang if media source doesn't respond
......
...@@ -213,6 +213,12 @@ struct DecoderParameters { ...@@ -213,6 +213,12 @@ struct DecoderParameters {
// Skip packets that fail with EPERM errors and continue decoding. // Skip packets that fail with EPERM errors and continue decoding.
bool skipOperationNotPermittedPackets{false}; 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 { struct DecoderHeader {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment