mirror of
https://github.com/IllusionMan1212/ffui.git
synced 2026-10-24 02:12:35 +00:00
fix: don't show incompatible encoding options for video encoders
This commit is contained in:
@@ -1,3 +1,2 @@
|
|||||||
## TODO: Don't show incompatible encoding options for encoders
|
|
||||||
## TODO: calculate total progress based on file sizes instead of counts of files for a more accurate progress percentage.
|
## 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
|
## TODO: when passing in a directory, list all video files in that directory and have the user choose which ones they want encoded
|
||||||
|
|||||||
@@ -224,10 +224,39 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
return m, cmd
|
return m, cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func parseConfig(cfg map[int]Config) ParsedConfig {
|
||||||
|
vEncoder := find(cfg, "Video Encoder")
|
||||||
|
aEncoder := find(cfg, "Audio Encoder")
|
||||||
|
preset := find(cfg, "Preset")
|
||||||
|
crf := find(cfg, "Constant Rate Factor (CRF)")
|
||||||
|
|
||||||
|
return ParsedConfig{
|
||||||
|
DeleteOldVideo: find(cfg, "Delete old video(s)?").FocusedOption != 0,
|
||||||
|
SkipEncodedVid: find(cfg, "What should we do about encoded videos?").FocusedOption == 0,
|
||||||
|
VideoEncoder: vEncoder.Opts[vEncoder.FocusedOption],
|
||||||
|
AudioEncoder: aEncoder.Opts[aEncoder.FocusedOption],
|
||||||
|
Preset: preset.Opts[preset.FocusedOption],
|
||||||
|
CRF: crf.Opts[crf.FocusedOption],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func CfgScreenView(m model) string {
|
func CfgScreenView(m model) string {
|
||||||
view := ""
|
view := ""
|
||||||
|
|
||||||
|
config := parseConfig(m.Config)
|
||||||
|
|
||||||
for i, cfg := range Configs {
|
for i, cfg := range Configs {
|
||||||
|
switch config.VideoEncoder {
|
||||||
|
case "copy", "librav1e":
|
||||||
|
if cfg.Name == "Preset" || cfg.Name == "Constant Rate Factor (CRF)" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
case "libvpx-vp9", "libsvtav1":
|
||||||
|
if cfg.Name == "Preset" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
opts := ""
|
opts := ""
|
||||||
|
|
||||||
for j, opt := range cfg.Opts {
|
for j, opt := range cfg.Opts {
|
||||||
|
|||||||
Reference in New Issue
Block a user