FFMpeg Image2Pipe VB.net

时间:2019-02-17 09:55:53

标签: vb.net ffmpeg stdin

我正在尝试将图像从我的代码传递到ffmpeg。。我正在使用流式代码:

但是它不起作用,产生的视频无法播放:(

    Dim proc As Process = New Process()
    Dim objStream As System.IO.Stream
    proc.StartInfo.FileName = strAPPPath & "\ffmpeg.exe"
    proc.StartInfo.Arguments = "-f image2pipe -i pipe:.bmp -crf 25.0 -vcodec libx264 -acodec libvo_aacenc -vf scale=1280:720 -ar 48000 -b:a 160k -coder 1 -rc_lookahead 60 -threads 0 -an out_vid.mp4"
    proc.StartInfo.UseShellExecute = False
    proc.StartInfo.RedirectStandardInput = True
    proc.StartInfo.RedirectStandardOutput = True
    proc.StartInfo.RedirectStandardError = True
    proc.Start()
    objStream = proc.StandardInput.BaseStream
    For i As Integer = 0 To 75 - 1
        Using img As System.Drawing.Image = Image.FromFile(strAPPPath & "\IMG\1033_WebImage.jpg")
            img.Save(objStream, System.Drawing.Imaging.ImageFormat.Bmp)
        End Using
        objStream.Flush()
    Next
    objStream.Close()
    proc.WaitForExit()

那么,我在这里想念的是什么?

最好的问候

0 个答案:

没有答案