libvlc播放节目时,进行转录

按照如下方式操作,即可实现在播放的时候进行转录

//vlc库启动参数配置
private static string pluginPath = System.Environment.CurrentDirectory + "\\plugins\\";
private static string plugin_arg = "--plugin-path=" + pluginPath;
//用于播放节目时,转录节目
private static string program_arg = "--sout=#duplicate{dst=std{access=file,mux=ts,dst=d:/test.ts}}";
private static string[] arguments = { "-I", "dummy", "--ignore-config", "--video-title", plugin_arg, program_arg };
libvlc_instance_t libvlc_instance = IntPtr.Zero;
libvlc_instance = SafeNativeMethods.libvlc_new(arguments.Length, argvPtr);
[SuppressUnmanagedCodeSecurity]
internal static class SafeNativeMethods
{
    // 创建一个libvlc实例,它是引用计数的
    [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
    internal static extern libvlc_instance_t libvlc_new(int argc, IntPtr argv);
}

你可能感兴趣的:(VLC)