mirror of
https://github.com/IllusionMan1212/ffui.git
synced 2026-10-24 02:12:35 +00:00
call ffmpeg directly as a command and remove ffmpeg-go dependency
This allows us to send interrupt signals and kill the process when ctrl+c is pressed. Added `copy` and `None` encoder options to copy the video/audio streams without modifications and to allow the removal of audio from video files. Updated to Go 1.23
This commit is contained in:
+4
-5
@@ -7,22 +7,22 @@ import (
|
||||
"math/rand"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
ffmpeg "github.com/u2takey/ffmpeg-go"
|
||||
)
|
||||
|
||||
func getProgressSocket(inFileName string, teaP *tea.Program) string {
|
||||
a, err := ffmpeg.Probe(inFileName)
|
||||
cmd := exec.Command("ffprobe", "-show_format", "-show_streams", "-of", "json", inFileName)
|
||||
probe, err := cmd.Output()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
totalDuration, err := probeDuration(a)
|
||||
totalDuration, err := probeDuration(string(probe))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -33,7 +33,6 @@ func getProgressSocket(inFileName string, teaP *tea.Program) string {
|
||||
func TempSock(totalDuration float64, teaP *tea.Program) string {
|
||||
// serve
|
||||
|
||||
rand.Seed(time.Now().Unix())
|
||||
sockFileName := path.Join(os.TempDir(), fmt.Sprintf("%d_sock", rand.Int()))
|
||||
l, err := net.Listen("unix", sockFileName)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user