Add remux option to Convert
This commit is contained in:
parent
8c12ae059d
commit
2490cb4970
13
main.go
13
main.go
|
|
@ -478,6 +478,8 @@ var formatOptions = []formatOption{
|
||||||
// H.264 - Widely compatible, older standard
|
// H.264 - Widely compatible, older standard
|
||||||
{"MP4 (H.264)", ".mp4", "libx264"},
|
{"MP4 (H.264)", ".mp4", "libx264"},
|
||||||
{"MOV (H.264)", ".mov", "libx264"},
|
{"MOV (H.264)", ".mov", "libx264"},
|
||||||
|
// Remux - No re-encode
|
||||||
|
{"MKV (Remux)", ".mkv", "copy"},
|
||||||
// H.265/HEVC - Better compression than H.264
|
// H.265/HEVC - Better compression than H.264
|
||||||
{"MP4 (H.265)", ".mp4", "libx265"},
|
{"MP4 (H.265)", ".mp4", "libx265"},
|
||||||
{"MKV (H.265)", ".mkv", "libx265"},
|
{"MKV (H.265)", ".mkv", "libx265"},
|
||||||
|
|
@ -6302,6 +6304,8 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
mapFormatCodec := func(codec string) string {
|
mapFormatCodec := func(codec string) string {
|
||||||
codec = strings.ToLower(codec)
|
codec = strings.ToLower(codec)
|
||||||
switch {
|
switch {
|
||||||
|
case strings.Contains(codec, "copy"):
|
||||||
|
return "Copy"
|
||||||
case strings.Contains(codec, "265") || strings.Contains(codec, "hevc"):
|
case strings.Contains(codec, "265") || strings.Contains(codec, "hevc"):
|
||||||
return "H.265"
|
return "H.265"
|
||||||
case strings.Contains(codec, "264"):
|
case strings.Contains(codec, "264"):
|
||||||
|
|
@ -6331,6 +6335,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var audioCodecSelect *widget.Select
|
||||||
formatSelect := widget.NewSelect(formatLabels, func(value string) {
|
formatSelect := widget.NewSelect(formatLabels, func(value string) {
|
||||||
for _, opt := range formatOptions {
|
for _, opt := range formatOptions {
|
||||||
if opt.Label == value {
|
if opt.Label == value {
|
||||||
|
|
@ -6350,6 +6355,12 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
state.convert.VideoCodec = newCodec
|
state.convert.VideoCodec = newCodec
|
||||||
videoCodecSelect.SetSelected(newCodec)
|
videoCodecSelect.SetSelected(newCodec)
|
||||||
}
|
}
|
||||||
|
if strings.EqualFold(opt.VideoCodec, "copy") {
|
||||||
|
state.convert.AudioCodec = "Copy"
|
||||||
|
if audioCodecSelect != nil {
|
||||||
|
audioCodecSelect.SetSelected("Copy")
|
||||||
|
}
|
||||||
|
}
|
||||||
if updateQualityVisibility != nil {
|
if updateQualityVisibility != nil {
|
||||||
updateQualityVisibility()
|
updateQualityVisibility()
|
||||||
}
|
}
|
||||||
|
|
@ -7294,7 +7305,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
twoPassCheck.Checked = state.convert.TwoPass
|
twoPassCheck.Checked = state.convert.TwoPass
|
||||||
|
|
||||||
// Audio Codec
|
// Audio Codec
|
||||||
audioCodecSelect := widget.NewSelect([]string{"AAC", "Opus", "MP3", "FLAC", "Copy"}, func(value string) {
|
audioCodecSelect = widget.NewSelect([]string{"AAC", "Opus", "MP3", "FLAC", "Copy"}, func(value string) {
|
||||||
state.convert.AudioCodec = value
|
state.convert.AudioCodec = value
|
||||||
logging.Debug(logging.CatUI, "audio codec set to %s", value)
|
logging.Debug(logging.CatUI, "audio codec set to %s", value)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user