mirror of
https://github.com/EvolutionAPI/evolution-audio-converter.git
synced 2025-07-13 15:14:50 -06:00
feat: mp4 convert
This commit is contained in:
parent
3a8356f5fa
commit
8f44a21fc4
2
docker_build.sh
Normal file
2
docker_build.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
docker buildx build --platform linux/amd64,linux/arm64 -t atendai/evolution-audio-converter:latest --push .
|
2
main.go
2
main.go
@ -82,6 +82,8 @@ func convertAudio(inputData []byte, format string) ([]byte, int, error) {
|
|||||||
switch format {
|
switch format {
|
||||||
case "mp3":
|
case "mp3":
|
||||||
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-f", "mp3", "pipe:1")
|
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-f", "mp3", "pipe:1")
|
||||||
|
case "mp4":
|
||||||
|
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-c:a", "aac", "-f", "mp4", "pipe:1")
|
||||||
default:
|
default:
|
||||||
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-ac", "1", "-ar", "16000", "-c:a", "libopus", "-f", "ogg", "pipe:1")
|
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-ac", "1", "-ar", "16000", "-c:a", "libopus", "-f", "ogg", "pipe:1")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user