mirror of
https://github.com/u2takey/ffmpeg-go.git
synced 2025-09-26 20:11:17 +08:00
fix some comment
This commit is contained in:
2
dag.go
2
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.
|
||||
|
26
ffmpeg.go
26
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 <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")
|
||||
|
9
probe.go
9
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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user