From e5cd8d133223c7e9038978566a98af1757077fe3 Mon Sep 17 00:00:00 2001 From: "wanglei.w" Date: Wed, 11 Nov 2020 22:58:13 +0800 Subject: [PATCH] fix some comment --- dag.go | 2 +- ffmpeg.go | 26 +++++++++++++------------- probe.go | 9 +-------- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/dag.go b/dag.go index 24e0877..47a4384 100644 --- a/dag.go +++ b/dag.go @@ -35,7 +35,7 @@ import ( // // String representation: // In order for graph visualization tools to show useful information, nodes must be representable as strings. The -// ``repr`` operator should provide a more or less "full" representation of the node, and the ``short_repr`` +// ``String`` operator should provide a more or less "full" representation of the node, and the ``ShortRepr`` // property should be a shortened, concise representation. // // Again, because nodes are immutable, the string representations should remain constant. diff --git a/ffmpeg.go b/ffmpeg.go index f42e606..67a8517 100644 --- a/ffmpeg.go +++ b/ffmpeg.go @@ -50,22 +50,10 @@ func (s *Stream) MergeOutputs(streams ...*Stream) *Stream { return NewMergeOutputsNode("merge_output", streams).Stream("", "") } -func Output(streams []*Stream, fileName string, kwargs ...KwArgs) *Stream { - args := MergeKwArgs(kwargs) - if !args.HasKey("filename") { - if fileName == "" { - panic("filename must be provided") - } - args["filename"] = fileName - } - - return NewOutputNode("output", streams, nil, args).Stream("", "") -} - //Output file URL // // Syntax: -// `ffmpeg.output(stream1[, stream2, stream3...], filename, **ffmpeg_args)` +// `ffmpeg.Output([]*Stream{stream1, stream2, stream3...}, filename, kwargs)` // // Any supplied keyword arguments are passed to ffmpeg verbatim (e.g. // ``t=20``, ``f='mp4'``, ``acodec='pcm'``, ``vcodec='rawvideo'``, @@ -84,6 +72,18 @@ func Output(streams []*Stream, fileName string, kwargs ...KwArgs) *Stream { // // Official documentation: `Synopsis `__ // """ +func Output(streams []*Stream, fileName string, kwargs ...KwArgs) *Stream { + args := MergeKwArgs(kwargs) + if !args.HasKey("filename") { + if fileName == "" { + panic("filename must be provided") + } + args["filename"] = fileName + } + + return NewOutputNode("output", streams, nil, args).Stream("", "") +} + func (s *Stream) Output(fileName string, kwargs ...KwArgs) *Stream { if s.Type != "FilterableStream" { panic("cannot output on non-FilterableStream") diff --git a/probe.go b/probe.go index 855c882..83001a6 100644 --- a/probe.go +++ b/probe.go @@ -7,14 +7,7 @@ import ( "time" ) -// Run ffprobe on the specified file and return a JSON representation of the output. -// -// Raises: -// :class:`ffmpeg.Error`: if ffprobe returns a non-zero exit code, -// an :class:`Error` is returned with a generic error message. -// The stderr output can be retrieved by accessing the -// ``stderr`` property of the exception. - +// Probe Run ffprobe on the specified file and return a JSON representation of the output. func Probe(fileName string, kwargs ...KwArgs) (string, error) { return ProbeWithTimeout(fileName, 0, MergeKwArgs(kwargs)) }