ffmpeg-go icon indicating copy to clipboard operation
ffmpeg-go copied to clipboard

Example To Set Custom Ffmpeg Binary Path

Open George-Seven opened this issue 2 years ago • 4 comments

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")

George-Seven avatar Aug 10 '23 05:08 George-Seven

have u solved this problem? I meet it too

ychencode avatar Aug 16 '23 08:08 ychencode

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

George-Seven avatar Aug 17 '23 19:08 George-Seven

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 avatar Aug 17 '23 19:08 Fyb3roptik

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()
}

George-Seven avatar Aug 18 '23 04:08 George-Seven