其他学习笔记

1. C# FFmpeg.AutoGen

  用这个FFmpeg.AutoGen时出现如下错误

1 System.Runtime.InteropServices.MarshalDirectiveException: 无法封送处理“parameter #2”: 无效的托管/非托管类型组合(String 类型的参数和返回类型必须与 LPStr、LPWStr、LPTStr、BStr、TBStr、VBByRefStr 或 AnsiBStr 成对出现)。
2    在 System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerInternal(IntPtr ptr, Type t)
3    在 System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)
4    在 FFmpeg.AutoGen.Native.FunctionLoader.GetFunctionDelegate[T](IntPtr nativeLibraryHandle, String functionName, Boolean throwOnError)
5    在 FFmpeg.AutoGen.ffmpeg.<>c.<.cctor>b__6_336(AVFormatContext** ps, String url, AVInputFormat* fmt, AVDictionary** options)
6    在 FFmpeg.AutoGen.ffmpeg.avformat_open_input(AVFormatContext** ps, String url, AVInputFormat* fmt, AVDictionary** options)
7    在 IPCTool.FFmpegUtils.Start(ShowBitmap show, String url)
8    在 IPCTool.RTSPPlayer.DeCoding()

  这个不是必现的,只在部分win7系统出现过。出现概率也不小。大概的原因是这个FFmpeg封装库,对部分.net版本没有做兼容出现导致的。

  我的解决办法是不用FFmpeg.AutoGen的最新版,用4.1.0.3 版本

 

posted @ 2020-12-11 16:34  无脑仔的小明  阅读(595)  评论(0编辑  收藏  举报