u2takey / ffmpeg-go

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

how can i view only the stats #73

Closed noornee closed 1 year ago

noornee commented 1 year ago

how can i replicate this command

ffmpeg -v quiet -stats -i  vid -i aud output.mp4

i currently have this

    in1 := ffmpeg.Input(vid)
    in2 := ffmpeg.Input(aud)

    err = ffmpeg.Concat([]*ffmpeg.Stream{in1, in2}, ffmpeg.KwArgs{"v": 1, "a": 1}).
        Output(filename, ffmpeg.KwArgs{"v": "quiet"}).
        OverWriteOutput().ErrorToStdOut().Run()

    if err != nil {
        fmt.Println(err)
    }

but i dont know where i'm supposed to add ffmpeg.Args{"stats"}

i need to see only the stats(the progress of the files it's merging)

i.e.

frame=  234 fps=155 q=-1.0 Lsize=     554kB time=00:00:07.80 bitrate= 581.2kbits/s speed=5.18x 

[SOLVED] by using GlobalArgs("-stats") i.e.

err = ffmpeg.Concat([]*ffmpeg.Stream{in1, in2}, ffmpeg.KwArgs{"v": 1, "a": 1}).
        Output(filename, ffmpeg.KwArgs{"v": "quiet"}).
        GlobalArgs("-stats").
        OverWriteOutput().ErrorToStdOut().Run()