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"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"path/filepath"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"regexp"
|
"regexp"
|
||||||
@ -77,8 +78,14 @@ func main() {
|
|||||||
fmt.Println("❌ Aufnahmefehler:", err)
|
fmt.Println("❌ Aufnahmefehler:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MP4 umwandeln
|
mp4Out := outputPath
|
||||||
mp4Out := strings.TrimSuffix(outputPath, ".ts") + ".mp4"
|
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 {
|
if err := exec.Command("ffmpeg", "-y", "-i", outputPath, "-c", "copy", mp4Out).Run(); err != nil {
|
||||||
fmt.Println("⚠️ Fehler bei Umwandlung in MP4:", err)
|
fmt.Println("⚠️ Fehler bei Umwandlung in MP4:", err)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
BIN
recorder.exe
BIN
recorder.exe
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user