按照如下方式操作,即可实现在播放的时候进行转录
//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播放器的启动参数实现边播放边转录的功能。主要涉及使用特定的库路径和参数设置,如--plugin-path和--sout等,来指定转录文件的保存位置及格式。
887

被折叠的 条评论
为什么被折叠?



