vb.net - 将 jpg 转换为 avi vb.net

标签 vb.net ffmpeg

我尝试将我的序列号照片 jpg 转换为 output.mp4 或 avi
但我的输出文件是空的
照片重命名喜欢这个 out01.jpg , out02.jpg 等。我有 10 帧(照片)
我试过这段代码:

Dim desk = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
    Dim args As String 'declare args
    'args = " -i C:\mediapubisert\out%03d.jpg -r 10 C:\mediapubisert\out.mp4 "
    args = " -i C:\mediapubisert\out%02d.jpg -c:v libx264 -r 30 -pix_fmt yuv420p C:\mediapubisert\out.mp4 "
    Dim proc As New Process
    Dim proci As New ProcessStartInfo
    proci.FileName = My.Application.Info.DirectoryPath & "\ffmpeg.exe"
    proci.Arguments = args
    proci.WindowStyle = ProcessWindowStyle.Hidden
    proci.CreateNoWindow = True
    proci.UseShellExecute = False
    proc.StartInfo = proci
    proc.Start()
    Do Until proc.HasExited = True
        Me.Text = "Saving"
    Loop
    Me.Text = "your video done"
    'My.Computer.FileSystem.CopyFile(TextBox1.Text, DestPath + TextBox1.Text)
    MsgBox("Done")
    Dim directoryName As String = "C:\mediapubisert\"

最佳答案

如果我开始解释与这个主题相关的每一个术语,我可能会用完字母...... :(

无论如何,这里有一个简单的代码片段来开始。确保你 download this :)

Private Sub createAVideo(ByVal imageInputfolderName As String, ByVal outVideoFileName As String, ByVal Optional fps As Single = 12F, ByVal Optional imgSearchPattern As String = "*.png")
Dim vwriter As VideoWriter = New VideoWriter(outVideoFileName, New Accord.Extensions.Size(500, 500), fps, True) 'Make sure to change 500 with required height and width
Dim ReadImg As Accord.Extensions.Imaging.ImageDirectoryReader = New ImageDirectoryReader(imageInputfolderName, imgSearchPattern)
While ReadImg.Position < ReadImg.Length
    Dim i As IImage = ReadImg.Read()
    vwriter.Write(i)
End While

vwriter.Close()
End Sub

我自己从未尝试过,但曾经在 SO 上听说过这个库,希望他能有所帮助:)

关于vb.net - 将 jpg 转换为 avi vb.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49750830/

相关文章:

android - FFmpeg concat video命令错误

编码: EOF timestamp not reliable期间的ffmpeg错误

SQL Server 'Resume Next' 等效项

vb.net 我的设置

ffmpeg - 在哪里可以找到旧的 ffmpeg/ffprobe 文档?

ffmpeg - 如何判断是否使用 ffmpeg 或 ffprobe 设置了视频的快速启动

C++ ffmpeg实时视频传输

c# - 使用 Web 服务时出现 SocketException

asp.net - 更改代码隐藏中重复器元素的样式?

c# - WPF 中的 CommandLink