discord-exploits/modules/transcode.go
schmenn 5113344272
Implemented FFmpeg Transcoding (#2)
* implemented core ffmpeg functions

[TODO] update README.md and clean code

* Forgot to remove image files afterwards

fucking dumbass

* Upgraded FFmpeg implementation

[^] README.md | for transcoding information
[-] exploits.go | removed skipArg completely as it's not needed at all
[^] exploits.go | changed mode handler because I made a mistake which  makes v the zero duration video mode
[^] .gitignore | added .jpg
[^] transcode-to-webm.go => transcode.go | fixed FFmpeg output and made it print the temporary file location
[^] name.go | made file name longer and changed Unix to UnixNano because the seed as Unix sometimes creates two identical file names when images are transcoded as it is really fast
[^] help.go | changed "doesn't" to "don't"
[^] ffmpeg-check.go | changed error checking function to the one already present in modules/error.go
2021-01-15 11:52:04 +01:00

23 lines
383 B
Go

package modules
import (
"fmt"
"os/exec"
)
//Transcode transcodes videos and images
func Transcode(input string, to string) string {
path := CheckForFFmpeg()
output := CreateName(to)
out, err := exec.Command(path, "-i", input, output).CombinedOutput()
Check(err)
fmt.Println("temporarily saving transcoded file to " + output)
fmt.Println(string(out))
return output
}