fixed double file extension
This commit is contained in:
parent
100e5e6b8b
commit
596b8389fb
11
main.go
11
main.go
@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"os"
|
||||
"os/exec"
|
||||
"regexp"
|
||||
@ -77,8 +78,14 @@ func main() {
|
||||
fmt.Println("❌ Aufnahmefehler:", err)
|
||||
}
|
||||
|
||||
// MP4 umwandeln
|
||||
mp4Out := strings.TrimSuffix(outputPath, ".ts") + ".mp4"
|
||||
mp4Out := outputPath
|
||||
ext := filepath.Ext(outputPath)
|
||||
|
||||
// Falls nicht bereits .mp4 als Endung existiert
|
||||
if ext != ".mp4" {
|
||||
mp4Out = strings.TrimSuffix(outputPath, ext) + ".mp4"
|
||||
}
|
||||
|
||||
if err := exec.Command("ffmpeg", "-y", "-i", outputPath, "-c", "copy", mp4Out).Run(); err != nil {
|
||||
fmt.Println("⚠️ Fehler bei Umwandlung in MP4:", err)
|
||||
} else {
|
||||
|
||||
BIN
recorder.exe
BIN
recorder.exe
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user