u2takey / ffmpeg-go

golang binding for ffmpeg
Apache License 2.0
1.66k stars 167 forks source link

Example To Set Custom Ffmpeg Binary Path #97

Open George-Seven opened 1 year ago

George-Seven commented 1 year ago

I want to set a custom ffmpeg binary path. Below is example code -

package main

import (
    ffmpeg "github.com/u2takey/ffmpeg-go"
)

func main() {
    ffmpeg.Input("input.mp4").
        Output("output.mp4", ffmpeg.KwArgs{"c:v": "libx265"}).
        OverWriteOutput().ErrorToStdOut().Run()
}

 

Where to fit in this method?

stream.SetFfmpegPath("/usr/local/bin/ffmpeg")
ychencode commented 1 year ago

have u solved this problem? I meet it too

George-Seven commented 1 year ago

@ychencode not yet. Maybe @Fyb3roptik can help -https://github.com/u2takey/ffmpeg-go/issues/26#issuecomment-1654666397

Fyb3roptik commented 1 year ago

You need to use the latest commit tag instead of a release number. He needs to do an official release, but until then update your go mod to use the latest commit hash

George-Seven commented 1 year ago

You need to use the latest commit tag instead of a release number. He needs to do an official release, but until then update your go mod to use the latest commit hash

@Fyb3roptik thanks, was able to get it working.

 

have u solved this problem? I meet it too

@ychencode you can use this example -

go get github.com/u2takey/ffmpeg-go@6649d14c4aeb35093a062d4660a55507198cd03e
package main

import (
    ffmpeg "github.com/u2takey/ffmpeg-go"
)

func main() {
    ffmpeg.Input("input.mp4").
        Output("output.mp4", ffmpeg.KwArgs{"c:v": "libx265"}).
        SetFfmpegPath("/usr/local/bin/ffmpeg").
        OverWriteOutput().ErrorToStdOut().Run()
}