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 版本

作者:無腦仔的小明 出處:http://www.cnblogs.com/wunaozai/ 本文版權歸作者和部落格園共有,歡迎轉載,但未經作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接配接,否則保留追究法律責任的權利。 如果文中有什麼錯誤,歡迎指出。以免更多的人被誤導。有需要溝通的,可以站内私信,文章留言,或者關注“無腦仔的小明”公衆号私信我。一定盡力回答。 |