vb.net - 仅编译 ffmpeg 解码而不使用音频编解码器

标签 vb.net windows video ffmpeg visual-studio-2015

我在媒体管理器上工作并使用 ffmpeg.exe 来提取屏幕截图。
由于 ffmpeg.exe 的最新大小超过 35MB,我正在尝试构建没有其大部分功能的 ffmpeg,只允许保存一帧视频。

我曾认为禁用许多过滤器、音频编解码器等会将 ffmpeg 的大小缩小到更易于管理的程度。

遵循本指南
https://pracucci.com/compile-ffmpeg-on-windows-with-visual-studio-compiler.html
为了允许使用 Visual Studio 2015 构建 ffmpeg,我来到了 ./configuration 的部分并碰壁了。
有这么多选择,但不知道它们的含义或作用,我在问社区中是否有人可以给我外行的指示。

我也知道我需要构建 x264 和可能的 x265 (HEVC),但不确定是否需要任何其他编解码器。
最后,我希望只有一个文件 ffmpeg.exe 用于媒体管理器项目。

我用来获取屏幕截图的代码如下

Public Shared Function CreateScreenShot(ByVal FullPathAndFilename As String, ByVal SavePath As String, ByVal sec As Integer, Optional ByVal Overwrite As Boolean = False) As Boolean
    If Not File.Exists(SavePath) Or Overwrite Then
        Try
            IO.File.Delete(SavePath)
        Catch
            Return False
        End Try
        If IO.File.Exists(FullPathAndFilename) Then
            Dim myProcess As Process = New Process
            Try
                Dim seconds As Integer = sec
                myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
                myProcess.StartInfo.CreateNoWindow = False
                myProcess.StartInfo.FileName = Utilities.applicationPath & "\Assets\ffmpeg.exe"
                Dim proc_arguments As String = "-ss " & seconds.ToString & " -i """ & FullPathAndFilename & """ -vframes:v 1 -an " & """" & SavePath & """"
                myProcess.StartInfo.Arguments = proc_arguments
                myProcess.Start()
                myProcess.WaitForExit()
                If File.Exists(SavePath) Then Return True
            Catch ex As Exception
                Throw ex
            Finally
                myProcess.Close()
            End Try
        End If
    End If
    Return False
End Function

我希望这是足够的信息,并感谢任何帮助或建议。

最佳答案

有一个选项--disable-everything这将禁用所有组件而不显式启用。

我想您可以尝试使用以下方法构建它:

./configure --disable-everything --enable-libx264 --enable-libx265 --toolchain=msvc --enable-yasm --enable-asm

如果需要任何其他编解码器,也应将它们添加到选项中。

如果不需要某些 ffmpeg 库,可以禁用它们,例如:
./configure --disable-postproc

Component options参与./configure --help有关如何禁用/启用这些库的输出。

关于vb.net - 仅编译 ffmpeg 解码而不使用音频编解码器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38624496/

相关文章:

vb.net - 将 Sub 包装为函数以便在 Lambda 中使用

c++ - 在启动特定子进程后挂起进程

使用 MSVC 从 Windows Powershell 编译 C 程序

c++ - 如何在 C++ 中使用 RegQueryValueEx(..) 从注册表中读取 REG_MULTI_SZ 类型的值

video - 使用 Handbrake 将 MKV 无损转换为 MP4

video - gst-omx 和 gst-openmax 有什么区别?

javascript - 使用javascript访问iframe内的asp.net隐藏字段控件?

VB.net HTTP post,计算进度条异步发送的字节数

python - 使用管道直接从 np.array 高效地编写电影

vb.net:在字符串中查找字符串的位置?