feat: initial CLI converter (v1.2)

This commit is contained in:
m4xx1m committed 2026-11-12 17:18:06 +03:00
commit 02fd1dc817
5 files changed
+284

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
package main
import (
"encoding/json"
"os/exec"
)
type ffprobeOutput struct {
Streams []struct {
CodecType string `json:"codec_type"`
} `json:"streams"`
}
func ffprobe(inputFile string) (*ffprobeOutput, error) {
var err error
var out ffprobeOutput
args := []string{
"-v", "quiet",
"-print_format", "json",
"-show_streams",
inputFile,
}
proc := exec.Command("ffprobe", args...)
stdout, err := proc.Output()
if err != nil {
return nil, err
}
// fmt.Println("read", string(stdout))
err = json.Unmarshal(stdout, &out)
if err != nil {
return nil, err
}
return &out, nil
}