Documentation ¶
Index ¶
- func Convert(opts ...*Opt) tg.VideoModifier
- func ConvertByCopy(opts ...*Opt) tg.VideoModifier
- func ConvertIfNeeded(opts ...*Opt) tg.VideoModifier
- func EmbedMetadata[T any](meta T, opts ...*Opt) tg.VideoModifier
- func EnsureMeta(opts ...*Opt) tg.VideoModifier
- func ExtractMetadata[T any](filename string, opts ...*Opt) (T, error)
- func ExtractMetadataAll[T any](filename string, opts ...*Opt) (*T, error)
- func Mute(opts ...*Opt) tg.VideoModifier
- func OnError(mod tg.VideoModifier, fn func(temporaries []string, err error) error) tg.VideoModifier
- func ThumbnailAt(position interface{}, opts ...*Opt) tg.VideoModifier
- func ThumbnailFrom(filename string, opts ...*Opt) tg.VideoModifier
- type Opt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
func Convert(opts ...*Opt) tg.VideoModifier
Convert is a general purpose VideoModifier, converts a video to h264, could decrease its dimensions. REQUIRES `ffmpeg` on the system, which could be passed via Opt.Convert.
func ConvertByCopy ¶
func ConvertByCopy(opts ...*Opt) tg.VideoModifier
ConvertByCopy allows to upload .webm, .m4v and other video formats without re-encoding. REQUIRES `ffmpeg` on the system.
func ConvertIfNeeded ¶
func ConvertIfNeeded(opts ...*Opt) tg.VideoModifier
ConvertIfNeeded ensures a video is converted to a type supported by Telegram. REQUIRES `ffmpeg` on the system, which could be passed via Opt.Convert.
func EmbedMetadata ¶
func EmbedMetadata[T any](meta T, opts ...*Opt) tg.VideoModifier
EmbedMetadata into a file before sending. REQUIRES `ffmpeg` on the system, which could be passed via Opt.Convert
func EnsureMeta ¶
func EnsureMeta(opts ...*Opt) tg.VideoModifier
EnsureMeta ensures, Telegram would process a file correctly. REQUIRES `ffprobe` on the system, which could be passed via Opt.Convert
func ExtractMetadata ¶
ExtractMetadata gets you metadata at format/tags/comment. It's sort of convenient, taking in mind you can't have custom metadata keys with .mp4
func ExtractMetadataAll ¶
ExtractMetadataAll gets you all metadata you would need. If you need EVERY single key-value, use ExtractMetadataAll[map[string]any](...).
func Mute ¶
func Mute(opts ...*Opt) tg.VideoModifier
Mute a video by creating a local muted copy. REQUIRES `ffmpeg` on the system. Could be passed via Opt.Convert.
func OnError ¶
func OnError(mod tg.VideoModifier, fn func(temporaries []string, err error) error) tg.VideoModifier
OnError allows set action on error for the wrapped tg.VideoModifier. If wrapper returns nil, the error is muted.
func ThumbnailAt ¶
func ThumbnailAt(position interface{}, opts ...*Opt) tg.VideoModifier
ThumbnailAt creates a thumbnail from the video frame. Position could be chosen as:
- float64 -- from [0, 1], relative position in Video
- string -- position in ffmpeg format, i.e. "00:05:12.99"
REQUIRES `ffmpeg`, `ffprobe` on the system, could be passed via Opt.
func ThumbnailFrom ¶
func ThumbnailFrom(filename string, opts ...*Opt) tg.VideoModifier
ThumbnailFrom converts a picture to a 320x320 frame, suitable from Telegram video thumbnail. REQUIRES `convert` on the system, could be passed via Opt.Convert.