From 206a62ee76f9fa8d63e2ed885cfdd1a0db33e142 Mon Sep 17 00:00:00 2001 From: Hisham Aburaqibah Date: Fri, 20 Dec 2024 19:36:11 +0200 Subject: [PATCH] WIP: querying ffmpeg for available encoders --- TODO.md | 7 +++++-- app.go | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 5259cd9..3f2eb5c 100644 --- a/TODO.md +++ b/TODO.md @@ -1,2 +1,5 @@ -## TODO: calculate total progress based on file sizes instead of counts of files for a more accurate progress percentage. -## TODO: when passing in a directory, list all video files in that directory and have the user choose which ones they want encoded +- [ ] query ffmpeg binary for available encoders and list the ones we know +- [ ] when passing in a directory, list all video files in that directory and have the user choose which ones they want encoded + - This will of course have a select all checkbox for quickly encoding all the files in a dir. +- [ ] calculate total progress based on file sizes instead of counts of files for a more accurate progress percentage. + might not do this. diff --git a/app.go b/app.go index 91adf71..df556e1 100644 --- a/app.go +++ b/app.go @@ -55,6 +55,14 @@ func initialModel(fileInfo os.FileInfo, absolutePath string) *model { s.Spinner = spinner.Dot s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205")) + codecs, err := exec.Command("ffmpeg", "-encoders").Output() + if err != nil { + log.Println(err) + } + + // TODO: parse the codecs and get the one we care about. + log.Println(strings.Split(strings.Split(string(codecs), " ------\n")[1], "\n")) + return &model{ IsDirectory: fileInfo.IsDir(), CurrentFileName: fileInfo.Name(),