mirror of
https://github.com/u2takey/ffmpeg-go.git
synced 2025-10-05 16:06:52 +08:00
Merge pull request #3 from andrewiankidd/ffprobe-default-opts
expose ProbeWithTimeout functionality without default options
This commit is contained in:
13
probe.go
13
probe.go
@@ -13,8 +13,17 @@ func Probe(fileName string, kwargs ...KwArgs) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ProbeWithTimeout(fileName string, timeOut time.Duration, kwargs KwArgs) (string, error) {
|
func ProbeWithTimeout(fileName string, timeOut time.Duration, kwargs KwArgs) (string, error) {
|
||||||
args := []string{"-show_format", "-show_streams", "-of", "json"}
|
args := KwArgs{
|
||||||
args = append(args, ConvertKwargsToCmdLineArgs(kwargs)...)
|
"show_format": "",
|
||||||
|
"show_streams": "",
|
||||||
|
"of": "json",
|
||||||
|
}
|
||||||
|
|
||||||
|
return ProbeWithTimeoutExec(fileName, timeOut, MergeKwArgs([]KwArgs{args, kwargs}))
|
||||||
|
}
|
||||||
|
|
||||||
|
func ProbeWithTimeoutExec(fileName string, timeOut time.Duration, kwargs KwArgs) (string, error) {
|
||||||
|
args := ConvertKwargsToCmdLineArgs(kwargs)
|
||||||
args = append(args, fileName)
|
args = append(args, fileName)
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
if timeOut > 0 {
|
if timeOut > 0 {
|
||||||
|
Reference in New Issue
Block a user