package wtff
import "zgo.at/wtff"
Index ¶
- Variables
- func AudioAdd(ctx context.Context, input, audioFile, lang, title string) error
- func AudioRm(ctx context.Context, input, stream string) error
- func AudioSave(ctx context.Context, input, stream, output string) error
- func Cat(ctx context.Context, output string, input ...string) error
- func Cut(ctx context.Context, input, output string, start, stop Time) error
- func SubAdd(ctx context.Context, input, subFile, lang string) error
- func SubRm(ctx context.Context, input, stream string) error
- func SubSave(ctx context.Context, input, stream, output string, overwrite bool) error
- func WriteMeta(ctx context.Context, m Meta, input, output string) error
- type Byte
- type Chapter
- type Chapters
- type Format
- type Meta
- func ParseMeta(input string) (Meta, error)
- func ParseMetaFromTOML(input string) (Meta, error)
- func ReadMeta(ctx context.Context, input string) (Meta, error)
- func (m Meta) IsZero() bool
- func (m Meta) IsZeroExceptChapters() bool
- func (m Meta) String() string
- func (m Meta) TOML() string
- type MetaChapter
- type ProbeFile
- type Stream
- type Streams
- type SubLine
- type Subs
- type Time
Variables ¶
var ShowFFCmd = false
Print all ffmpeg commands to stderr
Functions ¶
func AudioAdd ¶
func AudioRm ¶
func AudioSave ¶
func Cat ¶
Cat all files to the output, without re-encoding.
func Cut ¶
Cut a part and write to output.
func SubAdd ¶
func SubRm ¶
func SubSave ¶
func WriteMeta ¶
Types ¶
type Byte ¶
type Byte float64
func (Byte) String ¶
func (*Byte) UnmarshalText ¶
TODO: finish and move to zstd (it's enough for our purpose here).
type Chapter ¶
type Chapter struct { Id int `json:"id,omitempty"` // -1349333221, TimeBase string `json:"time_base,omitempty"` // "1/1000000000", Start int `json:"start,omitempty"` // 0, StartTime Time `json:"start_time,omitempty"` // "0.000000", End uint `json:"end,omitempty"` // 335400000000, EndTime Time `json:"end_time,omitempty"` // "335.400000", Tags map[string]any `json:"tags,omitempty"` // {"title": "Chapter 01"} }
type Chapters ¶
type Chapters []Chapter
type Format ¶
type Format struct { Filename string `json:"filename,omitempty"` // "01.01 Snooper Force.mkv" NbStreams uint `json:"nb_streams,omitempty"` // 3 NbPrograms uint `json:"nb_programs,omitempty"` // 0 FormatName string `json:"format_name,omitempty"` // "matroska,webm" FormatLongName string `json:"format_long_name,omitempty"` // "Matroska / WebM" StartTime Time `json:"start_time,omitempty"` // "0.000000" Duration Time `json:"duration,omitempty"` // "1746.601000" Size Byte `json:"size,omitempty"` // "324196219" BitRate string `json:"bit_rate,omitempty"` // "1484924" ProbeScore uint `json:"probe_score,omitempty"` // 100 Tags map[string]any `json:"tags,omitempty"` }
type Meta ¶
type Meta struct { Comment string `toml:"-"` MajorBrand string `toml:"-"` MinorVersion string `toml:"-"` CompatibleBrands string `toml:"-"` Encoder string `toml:"-"` Title string `toml:"title"` Artist string `toml:"artist"` Date string `toml:"date"` Chapters []MetaChapter `toml:"chapters"` Other map[string]string `toml:"other"` }
func ParseMeta ¶
func ParseMetaFromTOML ¶
func ReadMeta ¶
func (Meta) IsZero ¶
func (Meta) IsZeroExceptChapters ¶
func (Meta) String ¶
func (Meta) TOML ¶
type MetaChapter ¶
type MetaChapter struct { Timebase [2]int64 `toml:"-"` Start int64 `toml:"-"` End int64 `toml:"-"` Title string `toml:"title"` TOMLStart string `toml:"start"` }
func (MetaChapter) StartSecs ¶
func (m MetaChapter) StartSecs() int
type ProbeFile ¶
type ProbeFile struct { Format Format `json:"format"` Streams Streams `json:"streams"` Chapters Chapters `json:"chapters"` }
func Probe ¶
Probe gets an overview of streams for this file.
func (ProbeFile) String ¶
type Stream ¶
type Stream struct { Index int `json:"index,omitempty"` // 0 CodecName string `json:"codec_name,omitempty"` // "hevc" CodecLongName string `json:"codec_long_name,omitempty"` // "H.265 / HEVC (High Efficiency Video Coding)" Profile string `json:"profile,omitempty"` // "Main 10" CodecType string `json:"codec_type,omitempty"` // "video" CodecTagString string `json:"codec_tag_string,omitempty"` // "[0][0][0][0]" CodecTag string `json:"codec_tag,omitempty"` // "0x0000" Width uint `json:"width,omitempty"` // 720 Height uint `json:"height,omitempty"` // 568 CodedWidth uint `json:"coded_width,omitempty"` // 720 CodedHeight uint `json:"coded_height,omitempty"` // 568 ClosedCaptions uint `json:"closed_captions,omitempty"` // 0 HasBFrames uint `json:"has_b_frames,omitempty"` // 2 SampleAspectRatio string `json:"sample_aspect_ratio,omitempty"` // "349:240" DisplayAspectRatio string `json:"display_aspect_ratio,omitempty"` // "1047:568" PixFmt string `json:"pix_fmt,omitempty"` // "yuv420p10le" Level int `json:"level,omitempty"` // 90, -99? ColorRange string `json:"color_range,omitempty"` // "tv" ChromaLocation string `json:"chroma_location,omitempty"` // "left" Refs uint `json:"refs,omitempty"` // 1 RFrameRate string `json:"r_frame_rate,omitempty"` // "25/1" AvgFrameRate string `json:"avg_frame_rate,omitempty"` // "25/1" TimeBase string `json:"time_base,omitempty"` // "1/1000" StartPts uint `json:"start_pts,omitempty"` // 80 StartTime string `json:"start_time,omitempty"` // "0.080000" SampleFmt string `json:"sample_fmt,omitempty"` // "fltp" SampleRate string `json:"sample_rate,omitempty"` // "48000" Channels uint `json:"channels,omitempty"` // 2 ChannelLayout string `json:"channel_layout,omitempty"` // "stereo" BitsPerSample uint `json:"bits_per_sample,omitempty"` // 0 BitRate string `json:"bit_rate,omitempty"` // "2498735" DurationTs uint `json:"duration_ts,omitempty"` // 1746601 Duration Time `json:"duration,omitempty"` // "1746.601000" Disposition struct { Default uint `json:"default,omitempty"` Dub uint `json:"dub,omitempty"` Original uint `json:"original,omitempty"` Comment uint `json:"comment,omitempty"` Lyrics uint `json:"lyrics,omitempty"` Karaoke uint `json:"karaoke,omitempty"` Forced uint `json:"forced,omitempty"` HearingImpaired uint `json:"hearing_impaired,omitempty"` VisualImpaired uint `json:"visual_impaired,omitempty"` CleanEffects uint `json:"clean_effects,omitempty"` AttachedPic uint `json:"attached_pic,omitempty"` TimedThumbnails uint `json:"timed_thumbnails,omitempty"` } `json:"disposition,omitempty"` Tags map[string]any `json:"tags,omitempty"` }
func (Stream) Audio ¶
func (Stream) Subtitle ¶
func (Stream) Video ¶
type Streams ¶
type Streams []Stream
func (Streams) Find ¶
type SubLine ¶
func (SubLine) String ¶
type Subs ¶
type Subs []SubLine
func ParseSRT ¶
func (Subs) String ¶
type Time ¶
func (Time) MarshalText ¶
func (Time) String ¶
func (*Time) UnmarshalText ¶
Source Files ¶
byte.go meta.go probe.go sub.go wtff.go
Directories ¶
Path | Synopsis |
---|---|
cmd | |
cmd/wtff |
- Version
- v0.0.0-20240619153648-c8d7acddfc0e (latest)
- Published
- Jun 19, 2024
- Platform
- linux/amd64
- Imports
- 17 packages
- Last checked
- 3 days ago –
Tools for package owners.