fix some comment

This commit is contained in:
wanglei.w
2020-11-11 22:58:13 +08:00
parent 37e228fb53
commit e5cd8d1332
3 changed files with 15 additions and 22 deletions

2
dag.go
View File

@@ -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.

View File

@@ -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 <https://ffmpeg.org/ffmpeg.html#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")

View File

@@ -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))
}