u2takey / ffmpeg-go

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

how to support multi pipe input #115

Open cherishman2005 opened 5 months ago

cherishman2005 commented 5 months ago

such as

    in1 := ffmpeg.Input("pipe:0", inArgs)
    overlay := ffmpeg.Input("pipe:1", inArgs).Filter("scale", ffmpeg.Args{"128:-1"}).WithInput(bytes.NewReader([]byte(testSdp)))
    e := ffmpeg.Filter(
        []*ffmpeg.Stream{
            in1,
            overlay,
        }, "overlay", ffmpeg.Args{"10:10"}, ffmpeg.KwArgs{"enable": "gte(t,1)"}).
        WithInput(bytes.NewReader([]byte(ffmpegSdp))).
        Output(*output, outArgs).OverWriteOutput().ErrorToStdOut().Run()

image

pipe:1: Invalid data found when processing input

cherishman2005 commented 5 months ago

no way, and try to put content into http-server, and ffmpeg input with http-protocol:

    in1 := ffmpeg.Input("http://xxx", inArgs)
    overlay := ffmpeg.Input("http://yyy", inArgs).Filter("scale", ffmpeg.Args{"128:-1"})
    e := ffmpeg.Filter(
        []*ffmpeg.Stream{
            in1,
            overlay,
        }, "overlay", ffmpeg.Args{"10:10"}, ffmpeg.KwArgs{"enable": "gte(t,1)"}).
        Output(*output, outArgs).OverWriteOutput().ErrorToStdOut().Run()