├── .gitattributes ├── .gitignore ├── FFmpegSharp ├── Codes │ ├── CodeBase.cs │ ├── CodeType.cs │ ├── Flv.cs │ ├── Jpg.cs │ ├── M4A.cs │ ├── Mp3.cs │ ├── Mp4.cs │ ├── Png.cs │ ├── Wav.cs │ └── Wmv.cs ├── Config.cs ├── Directshow │ ├── DsDevice.cs │ └── DsUuids.cs ├── Executor │ ├── Encoder.cs │ ├── IExecutor.cs │ ├── Network.cs │ ├── Processor.cs │ └── TargetType.cs ├── FFmpegSharp.csproj ├── Filters │ ├── AudioBitrateFilter.cs │ ├── AudioChannelFilter.cs │ ├── AudioRateFilter.cs │ ├── DisableVideoFilter.cs │ ├── Extentions.cs │ ├── FilterBase.cs │ ├── FilterType.cs │ ├── IFilter.cs │ ├── ImageWatermarkFilter.cs │ ├── ResizeFilter.cs │ ├── ResizeType.cs │ ├── Resolution.cs │ ├── SegmentFilter.cs │ ├── SnapshotFilter.cs │ ├── VideoBitrateFilter.cs │ ├── VideoRateFilter.cs │ ├── WatermarkPosition.cs │ ├── X264Filter.cs │ └── X264Preset .cs ├── Media │ ├── AudioInfo.cs │ ├── MediaStream.cs │ ├── StreamInfo.cs │ ├── StreamInfoBase.cs │ ├── StreamType.cs │ ├── TimeBase.cs │ └── VideoInfo.cs ├── Properties │ └── AssemblyInfo.cs ├── Utils │ ├── Application.cs │ ├── Recorder.cs │ ├── ScreenShot.cs │ ├── SizeUtils.cs │ ├── Video.cs │ └── VideoAPI.cs ├── lib-list.txt └── packages.config ├── LICENSE ├── README.md ├── SampleApp ├── App.config ├── Directshow │ ├── DsDevice.cs │ └── DsUuids.cs ├── Images │ └── a.png ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── SampleApp.csproj └── logo.png ├── VedioFFmpegPushRTMP.sln └── licenses ├── bzip2.txt ├── fontconfig.txt ├── freetype.txt ├── frei0r.txt ├── gnutls.txt ├── lame.txt ├── libass.txt ├── libbluray.txt ├── libcaca.txt ├── libgsm.txt ├── libiconv.txt ├── libilbc.txt ├── libmodplug.txt ├── libtheora.txt ├── libvorbis.txt ├── libvpx.txt ├── opencore-amr.txt ├── openjpeg.txt ├── opus.txt ├── rtmpdump.txt ├── schroedinger.txt ├── soxr.txt ├── speex.txt ├── twolame.txt ├── vid.stab.txt ├── vo-aacenc.txt ├── vo-amrwbenc.txt ├── wavpack.txt ├── x264.txt ├── xavs.txt ├── xvid.txt └── zlib.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /FFmpegSharp/Codes/CodeBase.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Codes 2 | { 3 | public class CodeBase 4 | { 5 | public string Name { get; protected set; } 6 | public string Extension { get; protected set; } 7 | public CodeType CodeType { get; protected set; } 8 | public CodeBase() 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /FFmpegSharp/Codes/CodeType.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Codes 2 | { 3 | public enum CodeType 4 | { 5 | Audio, 6 | Image, 7 | Video 8 | } 9 | } -------------------------------------------------------------------------------- /FFmpegSharp/Codes/Flv.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Codes 2 | { 3 | public class Flv : CodeBase 4 | { 5 | public Flv() 6 | { 7 | CodeType = CodeType.Video; 8 | Name = "FLV"; 9 | Extension = ".flv"; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /FFmpegSharp/Codes/Jpg.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Codes 2 | { 3 | public class Jpg : CodeBase 4 | { 5 | public Jpg() 6 | { 7 | CodeType = CodeType.Image; 8 | Name = "JPG"; 9 | Extension = ".jpg"; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /FFmpegSharp/Codes/M4A.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Codes 2 | { 3 | public class M4A : CodeBase 4 | { 5 | public M4A() 6 | { 7 | CodeType = CodeType.Video; 8 | Name = "M4A"; 9 | Extension = ".m4a"; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /FFmpegSharp/Codes/Mp3.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Codes 2 | { 3 | public class Mp3 : CodeBase 4 | { 5 | public Mp3() 6 | { 7 | CodeType = CodeType.Audio; 8 | Name = "MP3"; 9 | Extension = ".mp3"; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /FFmpegSharp/Codes/Mp4.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Codes 2 | { 3 | public class Mp4 : CodeBase 4 | { 5 | public Mp4() 6 | { 7 | CodeType = CodeType.Video; 8 | Name = "MP4"; 9 | Extension = ".mp4"; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /FFmpegSharp/Codes/Png.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Codes 2 | { 3 | public class Png : CodeBase 4 | { 5 | public Png() 6 | { 7 | CodeType = CodeType.Image; 8 | Name = "PNG"; 9 | Extension = ".png"; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /FFmpegSharp/Codes/Wav.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Codes 2 | { 3 | public class Wav : CodeBase 4 | { 5 | public Wav() 6 | { 7 | CodeType = CodeType.Audio; 8 | Name = "WAV"; 9 | Extension = ".wav"; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /FFmpegSharp/Codes/Wmv.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Codes 2 | { 3 | public class Wmv : CodeBase 4 | { 5 | public Wmv() 6 | { 7 | CodeType = CodeType.Video; 8 | Name = "WMV"; 9 | Extension = ".wmv"; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /FFmpegSharp/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | 5 | namespace FFmpegSharp 6 | { 7 | /// 8 | /// base config 9 | /// 10 | public sealed class Config 11 | { 12 | /// 13 | /// the path for ffmpeg.exe 14 | /// 15 | /// 16 | /// default:{Host runtime Directory}/external/ffmpeg/{OS architecture(for 32bit is x86,for 64bit is x64)}/ffmpeg.exe 17 | /// 18 | public string FFmpegPath { get; set; } 19 | 20 | /// 21 | /// the path for ffprobe.exe 22 | /// 23 | /// 24 | /// default:{Host runtime Directory}/external/ffmpeg/{OS architecture(for 32bit is x86,for 64bit is x64)}/ffprobe.exe 25 | /// 26 | public string FFprobePath { get; set; } 27 | 28 | 29 | 30 | /// 31 | /// FFplayPath路径读取 32 | /// 33 | public string FFplayPath { get; set; } 34 | 35 | private Config() 36 | { 37 | var currentDir = new FileInfo(Uri.UnescapeDataString(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath)); 38 | //var appPath = currentDir.DirectoryName; 39 | var arch = Environment.Is64BitOperatingSystem ? "x64" : "x86"; 40 | FFmpegPath = Path.Combine(currentDir.DirectoryName, "external", "ffmpeg", arch, "ffmpeg.exe"); 41 | FFprobePath = Path.Combine(currentDir.DirectoryName, "external", "ffmpeg", arch, "ffprobe.exe"); 42 | FFplayPath = Path.Combine(currentDir.DirectoryName, "external", "ffmpeg", arch, "ffplay.exe"); 43 | } 44 | 45 | /// 46 | /// The single instance for FFmpegConfg 47 | /// 48 | public static Config Instance 49 | { 50 | get { return ConfigInstance.instance; } 51 | } 52 | 53 | /// 54 | /// default output directory path; 55 | /// 56 | /// 57 | /// it will not work when it's null or empty 58 | /// 59 | public string OutputPath { get; set; } 60 | 61 | /// 62 | /// nested class for single instance 63 | /// 64 | class ConfigInstance 65 | { 66 | internal static readonly Config instance = new Config(); 67 | 68 | static ConfigInstance() 69 | { 70 | 71 | } 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /FFmpegSharp/Directshow/DsDevice.cs: -------------------------------------------------------------------------------- 1 | /****************************************************** 2 | DirectShow .NET 3 | netmaster@swissonline.ch 4 | *******************************************************/ 5 | // DsDevice 6 | // enumerate directshow devices and moniker handling 7 | 8 | 9 | using System; 10 | using System.Collections; 11 | using System.Runtime.InteropServices; 12 | 13 | namespace FFmpegSharp.Directshow 14 | { 15 | 16 | [ComVisible(false)] 17 | public class DsDev 18 | { 19 | 20 | public static bool GetDevicesOfCat(Guid cat, out ArrayList devs,out string _dsshow) 21 | { 22 | devs = null; 23 | _dsshow = ""; 24 | int hr; 25 | object comObj = null; 26 | ICreateDevEnum enumDev = null; 27 | UCOMIEnumMoniker enumMon = null; 28 | UCOMIMoniker[] mon = new UCOMIMoniker[1]; 29 | try 30 | { 31 | Type srvType = Type.GetTypeFromCLSID(Clsid.SystemDeviceEnum); 32 | if (srvType == null) 33 | throw new NotImplementedException("System Device Enumerator"); 34 | 35 | comObj = Activator.CreateInstance(srvType); 36 | enumDev = (ICreateDevEnum)comObj; 37 | hr = enumDev.CreateClassEnumerator(ref cat, out enumMon, 0); 38 | if (hr != 0) 39 | throw new NotSupportedException("No devices of the category"); 40 | 41 | int f, count = 0; 42 | do 43 | { 44 | hr = enumMon.Next(1, mon, out f); 45 | if ((hr != 0) || (mon[0] == null)) 46 | break; 47 | DsDevice dev = new DsDevice(); 48 | dev.Name = GetFriendlyName(mon[0]); 49 | if (devs == null) 50 | devs = new ArrayList(); 51 | _dsshow = dev.Name; 52 | dev.Mon = mon[0]; 53 | mon[0] = null; 54 | devs.Add(dev); 55 | dev = null; 56 | count++; 57 | } 58 | while (true); 59 | 60 | return count > 0; 61 | } 62 | catch (Exception) 63 | { 64 | if (devs != null) 65 | { 66 | foreach (DsDevice d in devs) 67 | d.Dispose(); 68 | devs = null; 69 | _dsshow = ""; 70 | } 71 | return false; 72 | } 73 | finally 74 | { 75 | enumDev = null; 76 | if (mon[0] != null) 77 | Marshal.ReleaseComObject(mon[0]); mon[0] = null; 78 | if (enumMon != null) 79 | Marshal.ReleaseComObject(enumMon); enumMon = null; 80 | if (comObj != null) 81 | Marshal.ReleaseComObject(comObj); comObj = null; 82 | } 83 | 84 | } 85 | 86 | private static string GetFriendlyName(UCOMIMoniker mon) 87 | { 88 | object bagObj = null; 89 | IPropertyBag bag = null; 90 | try 91 | { 92 | Guid bagId = typeof(IPropertyBag).GUID; 93 | mon.BindToStorage(null, null, ref bagId, out bagObj); 94 | bag = (IPropertyBag)bagObj; 95 | object val = ""; 96 | int hr = bag.Read("FriendlyName", ref val, IntPtr.Zero); 97 | if (hr != 0) 98 | Marshal.ThrowExceptionForHR(hr); 99 | string ret = val as string; 100 | if ((ret == null) || (ret.Length < 1)) 101 | throw new NotImplementedException("Device FriendlyName"); 102 | return ret; 103 | } 104 | catch (Exception) 105 | { 106 | return null; 107 | } 108 | finally 109 | { 110 | bag = null; 111 | if (bagObj != null) 112 | Marshal.ReleaseComObject(bagObj); bagObj = null; 113 | } 114 | } 115 | } 116 | 117 | 118 | [ComVisible(false)] 119 | public class DsDevice : IDisposable 120 | { 121 | public string Name; 122 | public UCOMIMoniker Mon; 123 | 124 | public void Dispose() 125 | { 126 | if (Mon != null) 127 | Marshal.ReleaseComObject(Mon); Mon = null; 128 | } 129 | } 130 | 131 | public class GetDSname 132 | { 133 | public static string GetFriendlyName(UCOMIMoniker mon) 134 | { 135 | object bagObj = null; 136 | IPropertyBag bag = null; 137 | try 138 | { 139 | Guid bagId = typeof(IPropertyBag).GUID; 140 | mon.BindToStorage(null, null, ref bagId, out bagObj); 141 | bag = (IPropertyBag)bagObj; 142 | object val = ""; 143 | int hr = bag.Read("FriendlyName", ref val, IntPtr.Zero); 144 | if (hr != 0) 145 | Marshal.ThrowExceptionForHR(hr); 146 | string ret = val as string; 147 | if ((ret == null) || (ret.Length < 1)) 148 | throw new NotImplementedException("Device FriendlyName"); 149 | return ret; 150 | } 151 | catch (Exception) 152 | { 153 | return null; 154 | } 155 | finally 156 | { 157 | bag = null; 158 | if (bagObj != null) 159 | Marshal.ReleaseComObject(bagObj); bagObj = null; 160 | } 161 | } 162 | } 163 | 164 | 165 | 166 | 167 | 168 | [ComVisible(true), ComImport, 169 | Guid("29840822-5B84-11D0-BD3B-00A0C911CE86"), 170 | InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 171 | public interface ICreateDevEnum 172 | { 173 | [PreserveSig] 174 | int CreateClassEnumerator( 175 | [In] ref Guid pType, 176 | [Out] out UCOMIEnumMoniker ppEnumMoniker, 177 | [In] int dwFlags); 178 | } 179 | 180 | 181 | 182 | [ComVisible(true), ComImport, 183 | Guid("55272A00-42CB-11CE-8135-00AA004BB851"), 184 | InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 185 | public interface IPropertyBag 186 | { 187 | [PreserveSig] 188 | int Read( 189 | [In, MarshalAs(UnmanagedType.LPWStr)] string pszPropName, 190 | [In, Out, MarshalAs(UnmanagedType.Struct)] ref object pVar, 191 | IntPtr pErrorLog); 192 | 193 | [PreserveSig] 194 | int Write( 195 | [In, MarshalAs(UnmanagedType.LPWStr)] string pszPropName, 196 | [In, MarshalAs(UnmanagedType.Struct)] ref object pVar); 197 | } 198 | 199 | 200 | 201 | 202 | } // namespace DShowNET.Device 203 | -------------------------------------------------------------------------------- /FFmpegSharp/Directshow/DsUuids.cs: -------------------------------------------------------------------------------- 1 | /****************************************************** 2 | DirectShow .NET 3 | netmaster@swissonline.ch 4 | *******************************************************/ 5 | // UUIDs from uuids.h 6 | 7 | using System; 8 | using System.Runtime.InteropServices; 9 | 10 | namespace FFmpegSharp.Directshow 11 | { 12 | 13 | 14 | [ComVisible(false)] 15 | public class FilterCategory // uuids.h : CLSID_* 16 | { 17 | /// CLSID_AudioInputDeviceCategory, audio capture category 18 | public static readonly Guid AudioInputDevice = new Guid( 0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x00,0xa0,0xc9,0x11,0xce,0x86 ); 19 | 20 | /// CLSID_VideoInputDeviceCategory, video capture category 21 | public static readonly Guid VideoInputDevice = new Guid( 0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86 ); 22 | } 23 | 24 | 25 | 26 | [ComVisible(false)] 27 | public class Clsid // uuids.h : CLSID_* 28 | { 29 | /// CLSID_SystemDeviceEnum for ICreateDevEnum 30 | public static readonly Guid SystemDeviceEnum = new Guid( 0x62BE5D10,0x60EB,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86 ); 31 | 32 | /// CLSID_FilterGraph, filter Graph 33 | public static readonly Guid FilterGraph = new Guid( 0xe436ebb3, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 34 | 35 | /// CLSID_CaptureGraphBuilder2, new Capture graph building 36 | public static readonly Guid CaptureGraphBuilder2 = new Guid( 0xBF87B6E1, 0x8C27, 0x11d0, 0xB3, 0xF0, 0x0, 0xAA, 0x00, 0x37, 0x61, 0xC5 ); 37 | 38 | /// CLSID_SampleGrabber, Sample Grabber filter 39 | public static readonly Guid SampleGrabber = new Guid( 0xC1F400A0, 0x3F08, 0x11D3, 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37 ); 40 | 41 | /// CLSID_DvdGraphBuilder, DVD graph builder 42 | public static readonly Guid DvdGraphBuilder = new Guid( 0xFCC152B7, 0xF372, 0x11d0, 0x8E, 0x00, 0x00, 0xC0, 0x4F, 0xD7, 0xC0, 0x8B ); 43 | 44 | } 45 | 46 | 47 | 48 | [ComVisible(false)] 49 | public class MediaType // MEDIATYPE_* 50 | { 51 | /// MEDIATYPE_Video 'vids' 52 | public static readonly Guid Video = new Guid( 0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 53 | 54 | /// MEDIATYPE_Interleaved 'iavs' 55 | public static readonly Guid Interleaved = new Guid( 0x73766169, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 56 | 57 | /// MEDIATYPE_Audio 'auds' 58 | public static readonly Guid Audio = new Guid( 0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 59 | 60 | /// MEDIATYPE_Text 'txts' 61 | public static readonly Guid Text = new Guid( 0x73747874, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 62 | 63 | /// MEDIATYPE_Stream 64 | public static readonly Guid Stream = new Guid( 0xe436eb83, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 65 | } 66 | 67 | [ComVisible(false)] 68 | public class MediaSubType // MEDIASUBTYPE_* 69 | { 70 | /// MEDIASUBTYPE_YUYV 'YUYV' 71 | public static readonly Guid YUYV = new Guid( 0x56595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 72 | 73 | /// MEDIASUBTYPE_IYUV 'IYUV' 74 | public static readonly Guid IYUV = new Guid( 0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 75 | 76 | /// MEDIASUBTYPE_DVSD 'DVSD' 77 | public static readonly Guid DVSD = new Guid( 0x44535644, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 78 | 79 | /// MEDIASUBTYPE_RGB1 'RGB1' 80 | public static readonly Guid RGB1 = new Guid( 0xe436eb78, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 81 | 82 | /// MEDIASUBTYPE_RGB4 'RGB4' 83 | public static readonly Guid RGB4 = new Guid( 0xe436eb79, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 84 | 85 | /// MEDIASUBTYPE_RGB8 'RGB8' 86 | public static readonly Guid RGB8 = new Guid( 0xe436eb7a, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 87 | 88 | /// MEDIASUBTYPE_RGB565 'RGB565' 89 | public static readonly Guid RGB565 = new Guid( 0xe436eb7b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 90 | 91 | /// MEDIASUBTYPE_RGB555 'RGB555' 92 | public static readonly Guid RGB555 = new Guid( 0xe436eb7c, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 93 | 94 | /// MEDIASUBTYPE_RGB24 'RGB24' 95 | public static readonly Guid RGB24 = new Guid( 0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 96 | 97 | /// MEDIASUBTYPE_RGB32 'RGB32' 98 | public static readonly Guid RGB32 = new Guid( 0xe436eb7e, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 99 | 100 | 101 | /// MEDIASUBTYPE_Avi 102 | public static readonly Guid Avi = new Guid( 0xe436eb88, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 103 | 104 | /// MEDIASUBTYPE_Asf 105 | public static readonly Guid Asf = new Guid( 0x3db80f90, 0x9412, 0x11d1, 0xad, 0xed, 0x0, 0x0, 0xf8, 0x75, 0x4b, 0x99 ); 106 | } 107 | 108 | 109 | [ComVisible(false)] 110 | public class FormatType // FORMAT_* 111 | { 112 | /// FORMAT_None 113 | public static readonly Guid None = new Guid( 0x0F6417D6, 0xc318, 0x11d0, 0xa4, 0x3f, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96 ); 114 | 115 | /// FORMAT_VideoInfo 116 | public static readonly Guid VideoInfo = new Guid( 0x05589f80, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a ); 117 | 118 | /// FORMAT_VideoInfo2 119 | public static readonly Guid VideoInfo2 = new Guid( 0xf72a76A0, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba ); 120 | 121 | /// FORMAT_WaveFormatEx 122 | public static readonly Guid WaveEx = new Guid( 0x05589f81, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a ); 123 | 124 | /// FORMAT_MPEGVideo 125 | public static readonly Guid MpegVideo = new Guid( 0x05589f82, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a ); 126 | 127 | /// FORMAT_MPEGStreams 128 | public static readonly Guid MpegStreams = new Guid( 0x05589f83, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a ); 129 | 130 | /// FORMAT_DvInfo 131 | public static readonly Guid DvInfo = new Guid( 0x05589f84, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a ); 132 | } 133 | 134 | 135 | 136 | 137 | [ComVisible(false)] 138 | public class PinCategory // PIN_CATEGORY_* 139 | { 140 | /// PIN_CATEGORY_CAPTURE 141 | public static readonly Guid Capture = new Guid( 0xfb6c4281, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba ); 142 | 143 | /// PIN_CATEGORY_PREVIEW 144 | public static readonly Guid Preview = new Guid( 0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba ); 145 | } 146 | 147 | 148 | 149 | } // namespace DShowNET 150 | -------------------------------------------------------------------------------- /FFmpegSharp/Executor/Encoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using FFmpegSharp.Codes; 8 | using FFmpegSharp.Filters; 9 | using FFmpegSharp.Media; 10 | 11 | namespace FFmpegSharp.Executor 12 | { 13 | public class Encoder : IExecutor 14 | { 15 | private readonly List _filters; 16 | 17 | 18 | private string _inputPath; 19 | private string _outputPath; 20 | private MediaStream _source; 21 | private CodeBase _code; 22 | 23 | 24 | private Encoder() 25 | { 26 | _filters = new List(); 27 | } 28 | 29 | public Encoder WidthInput(string filePath) 30 | { 31 | _inputPath = filePath; 32 | _source = new MediaStream(_inputPath, false); 33 | return this; 34 | } 35 | 36 | public Encoder WithFilter(FilterBase filter) 37 | { 38 | if (_filters.Any(x => x.Name.Equals(filter.Name, StringComparison.OrdinalIgnoreCase))) 39 | { 40 | var old = _filters.First(x => x.Name.Equals(filter.Name, StringComparison.OrdinalIgnoreCase)); 41 | _filters.Remove(old); 42 | } 43 | 44 | _filters.Add(filter); 45 | return this; 46 | } 47 | 48 | public Encoder To(string ouputPath) where T : CodeBase, new() 49 | { 50 | _outputPath = ouputPath; 51 | _code = new T(); 52 | return this; 53 | } 54 | 55 | public static Encoder Create() 56 | { 57 | return new Encoder(); 58 | } 59 | 60 | public void Execute() 61 | { 62 | Validate(); 63 | 64 | FixFilters(); 65 | 66 | var @params = BuildParams(); 67 | 68 | var message = Processor.FFmpeg(@params); 69 | 70 | if (!string.IsNullOrWhiteSpace(message) && -1 == message.IndexOf("kb/s", StringComparison.InvariantCultureIgnoreCase)) 71 | throw new ApplicationException(message); 72 | } 73 | 74 | private string BuildParams() 75 | { 76 | var builder = new StringBuilder(); 77 | 78 | builder.Append(" -i"); 79 | builder.Append(" "); 80 | builder.Append(_inputPath); 81 | 82 | foreach (var filter in _filters.OrderBy(x => x.Rank)) 83 | { 84 | filter.Source = _source; 85 | builder.Append(filter.Execute()); 86 | } 87 | 88 | var dir = Path.GetDirectoryName(_outputPath); 89 | 90 | if (string.IsNullOrWhiteSpace(dir)) 91 | throw new ApplicationException("output directory error."); 92 | 93 | var fileName = Path.GetFileNameWithoutExtension(_outputPath); 94 | 95 | if (string.IsNullOrWhiteSpace(fileName)) 96 | throw new ApplicationException("output filename is null"); 97 | 98 | builder.AppendFormat(" {0}\\{1}{2}", dir, fileName, _code.Extension); 99 | 100 | return builder.ToString(); 101 | } 102 | 103 | private void Validate() 104 | { 105 | if (string.IsNullOrWhiteSpace(_inputPath)) 106 | { 107 | throw new ApplicationException("input file is null."); 108 | } 109 | 110 | if (string.IsNullOrWhiteSpace(_outputPath)) 111 | { 112 | throw new ApplicationException("outout path is null"); 113 | } 114 | 115 | var outdir = Path.GetDirectoryName(_outputPath); 116 | 117 | if (!string.IsNullOrWhiteSpace(outdir) && !Directory.Exists(outdir)) 118 | { 119 | Directory.CreateDirectory(outdir); 120 | } 121 | } 122 | 123 | private void FixFilters() 124 | { 125 | if (_filters.Any(x => x.Name.Equals("Snapshot", StringComparison.OrdinalIgnoreCase))) 126 | { 127 | var snapshot = _filters.First(x => x.Name.Equals("Snapshot", StringComparison.OrdinalIgnoreCase)); 128 | snapshot.Source = _source; 129 | 130 | _filters.Remove(snapshot); 131 | 132 | Task.Run(() => 133 | { 134 | Processor.FFmpeg(snapshot.ToString()); 135 | }); 136 | } 137 | 138 | if (!_source.AudioInfo.CodecName.Equals("aac", StringComparison.OrdinalIgnoreCase) && 139 | !_filters.Any(x => x.Name.Equals("AudioChannel", StringComparison.OrdinalIgnoreCase))) 140 | { 141 | _filters.Add(new AudioChannelFilter(2)); 142 | } 143 | 144 | if (_filters.Any(x => x.Name.Equals("X264", StringComparison.OrdinalIgnoreCase)) && 145 | !_filters.Any(x => x.Name.Equals("Resize", StringComparison.OrdinalIgnoreCase))) 146 | { 147 | _filters.Add(new ResizeFilter()); 148 | } 149 | 150 | if (_code.Name.Equals("flv", StringComparison.OrdinalIgnoreCase)) 151 | { 152 | WithFilter(new AudioRatelFilter(44100)); 153 | } 154 | } 155 | } 156 | } -------------------------------------------------------------------------------- /FFmpegSharp/Executor/IExecutor.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Executor 2 | { 3 | public interface IExecutor 4 | { 5 | void Execute(); 6 | } 7 | } -------------------------------------------------------------------------------- /FFmpegSharp/Executor/Network.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using FFmpegSharp.Codes; 9 | using FFmpegSharp.Filters; 10 | using FFmpegSharp.Media; 11 | using System.Collections; 12 | using FFmpegSharp.Directshow; 13 | using System.Runtime.InteropServices; 14 | 15 | namespace FFmpegSharp.Executor 16 | { 17 | public class Network 18 | { 19 | private readonly List _filters; 20 | 21 | private string _source; 22 | private string _dest; 23 | private TargetType _sourceType; 24 | private TargetType _destType; 25 | /// list of installed video devices. 26 | private ArrayList capDevices; 27 | private string _dsshow; 28 | private string _dsshowname; 29 | 30 | public Network() 31 | { 32 | _sourceType = TargetType.Default; 33 | _destType = TargetType.Default; 34 | _filters = new List(); 35 | } 36 | 37 | public Network WithFilter(FilterBase filter) 38 | { 39 | if (_filters.Any(x => x.Name.Equals(filter.Name, StringComparison.OrdinalIgnoreCase))) 40 | { 41 | var old = _filters.First(x => x.Name.Equals(filter.Name, StringComparison.OrdinalIgnoreCase)); 42 | _filters.Remove(old); 43 | } 44 | 45 | _filters.Add(filter); 46 | return this; 47 | } 48 | 49 | public Network WithSource(string source) 50 | { 51 | _sourceType = GetTargetType(source); 52 | _source = source; 53 | 54 | return this; 55 | } 56 | 57 | public Network WithDest(string dest) 58 | { 59 | _destType = GetTargetType(dest); 60 | _dest = dest; 61 | 62 | return this; 63 | } 64 | 65 | public static Network Create() 66 | { 67 | return new Network(); 68 | } 69 | 70 | /// 71 | /// 推流到RTMP服务器 72 | /// 73 | public void Push() 74 | { 75 | Validate(); 76 | 77 | if (_destType != TargetType.Live) 78 | { 79 | throw new ApplicationException("当推流到RTMP服务器的时候,源类型必须是'RtmpType.Live'类型."); 80 | } 81 | 82 | //参数为false的时候则为推流 83 | //true为获取实时设备图像 84 | var @params = GetParams(false); 85 | if (@params != "") 86 | { 87 | Processor.FFmpeg(@params); 88 | } 89 | else 90 | { 91 | Console.WriteLine("There is no stream or devices input/output,please check again!"); 92 | } 93 | } 94 | 95 | /// 96 | /// 把流从RTMP服务器拉取--读取视频数据 ==pull a stream from rtmp server 97 | /// 98 | public void Pull() 99 | { 100 | Validate(); 101 | 102 | if (!TestRtmpServer(_source, true)) 103 | throw new ApplicationException("RTMP服务器发送错误."); 104 | 105 | if (_sourceType != TargetType.Live) 106 | { 107 | throw new ApplicationException("必须是RTMP服务器."); 108 | } 109 | //参数为true的时候则为读取视频流 110 | var @params = GetParams(false); 111 | 112 | Processor.FFmpeg(@params); 113 | } 114 | 115 | 116 | /// 117 | /// 检测输出输入源以及过滤器 118 | /// 119 | private void Validate() 120 | { 121 | if (_sourceType == TargetType.Default) 122 | throw new ApplicationException("源错误.请输入源!"); 123 | 124 | if (_destType == TargetType.Default) 125 | throw new ApplicationException("dest错误.请输入一个dest"); 126 | 127 | var supportFilters = new[] { "Resize", "Segment", "X264", "AudioRate", "AudioBitrate" }; 128 | 129 | if (_filters.Any(x => !supportFilters.Contains(x.Name))) 130 | { 131 | throw new ApplicationException(string.Format("过滤器不支持,过滤器只支持:{0} 类型", 132 | supportFilters.Aggregate(string.Empty, (current, filter) => current + (filter + ",")).TrimEnd(new[] { ',' }))); 133 | } 134 | } 135 | 136 | private static TargetType GetTargetType(string target) 137 | { 138 | if (target.StartsWith("rtmp://", StringComparison.OrdinalIgnoreCase) || target == "") 139 | { 140 | //获取服务器当前流的状态 141 | return TargetType.Live; 142 | } 143 | else if (File.Exists(target)) 144 | { 145 | //判断是否为本地文件 146 | return TargetType.File; 147 | } 148 | else 149 | { 150 | return TargetType.Directshow; 151 | } 152 | 153 | 154 | throw new ApplicationException("源错误,未知的访问源."); 155 | } 156 | 157 | 158 | private static CodeBase GuessCode(string filePath) 159 | { 160 | var codes = new Dictionary 161 | { 162 | {"MP3", new Mp3()}, 163 | {"MP4", new Mp4()}, 164 | {"M4A", new M4A()}, 165 | {"FLV", new Flv()} 166 | }; 167 | 168 | var ext = Path.GetExtension(filePath); 169 | 170 | if (string.IsNullOrEmpty(ext)) 171 | throw new ApplicationException(string.Format("can't guess the code from Path :'{0}'", filePath)); 172 | 173 | var key = ext.TrimStart(new[] { '.' }); 174 | 175 | if (codes.Keys.Any(x => x.Equals(key, StringComparison.OrdinalIgnoreCase))) 176 | { 177 | return codes[key]; 178 | } 179 | 180 | throw new ApplicationException(string.Format("not support file extension :{0}", key.ToLower())); 181 | } 182 | 183 | private string GetParams(bool is_push) 184 | { 185 | var builder = new StringBuilder(); 186 | int showflag = 0; 187 | 188 | if (_sourceType == TargetType.File) 189 | { 190 | builder.Append(" -re -i "); 191 | builder.Append(_source); 192 | } 193 | 194 | if (_sourceType == TargetType.Live) 195 | { 196 | builder.Append(" -i"); 197 | 198 | builder.AppendFormat( 199 | -1 < _source.IndexOf("live=1", StringComparison.OrdinalIgnoreCase) ? " {0} live=1" : " {0}", 200 | _source); 201 | } 202 | 203 | if (_sourceType == TargetType.Directshow) 204 | { 205 | 206 | //如果输入是设备开始获取设备名称 207 | if (DsDev.GetDevicesOfCat(FilterCategory.VideoInputDevice, out capDevices, out _dsshow)) 208 | { 209 | //获取正常 210 | _dsshowname = "\"" + _dsshow + "\""; 211 | 212 | _dest = " -f dshow -i video=" + _dsshowname + " -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -f flv " + _dest + ""; 213 | builder.Append(_dest); 214 | } 215 | else 216 | { 217 | Console.WriteLine("No video capture devices found!"); 218 | showflag = 1; 219 | builder.Clear(); 220 | } 221 | 222 | } 223 | 224 | if (_sourceType != TargetType.Directshow) 225 | { 226 | 227 | if (_sourceType == TargetType.File) 228 | { 229 | if (_filters.Any(x => x.Name.Equals("Segment", StringComparison.OrdinalIgnoreCase))) 230 | { 231 | var filter = _filters.First(x => x.Name.Equals("Segment", StringComparison.OrdinalIgnoreCase)); 232 | _filters.Remove(filter); 233 | } 234 | } 235 | 236 | 237 | if (!_filters.Any(x => x.Name.Equals("x264", StringComparison.OrdinalIgnoreCase))) 238 | { 239 | builder.Append(" -vcodec copy"); 240 | } 241 | 242 | if (_destType == TargetType.Live) 243 | { 244 | if (!_filters.Any(x => x.Name.Equals("AudioRate", StringComparison.OrdinalIgnoreCase))) 245 | { 246 | _filters.Add(new AudioRatelFilter(44100)); 247 | } 248 | 249 | if (!_filters.Any(x => x.Name.Equals("AudioBitrate", StringComparison.OrdinalIgnoreCase))) 250 | { 251 | _filters.Add(new AudioBitrateFilter(128)); 252 | } 253 | } 254 | 255 | 256 | if (_sourceType != TargetType.Directshow) 257 | { 258 | var sourcefile = new MediaStream(_source, is_push); 259 | foreach (var filter in _filters.OrderBy(x => x.Rank)) 260 | { 261 | filter.Source = sourcefile; 262 | builder.Append(filter.Execute()); 263 | } 264 | } 265 | 266 | if (_destType == TargetType.File) 267 | { 268 | var dir = Path.GetDirectoryName(_dest); 269 | 270 | if (string.IsNullOrWhiteSpace(dir)) 271 | throw new ApplicationException("output directory error."); 272 | 273 | var fileName = Path.GetFileNameWithoutExtension(_dest); 274 | 275 | if (string.IsNullOrWhiteSpace(fileName)) 276 | throw new ApplicationException("output filename is null"); 277 | 278 | var code = GuessCode(_dest); 279 | 280 | if (!_filters.Any(x => x.Name.Equals("Segment", StringComparison.OrdinalIgnoreCase))) 281 | { 282 | // out%d.mp4 283 | builder.AppendFormat(" {0}{1}%d{2}", dir, fileName, code.Extension); 284 | } 285 | } 286 | 287 | if (_destType == TargetType.Live) 288 | { 289 | builder.Append(" -f flv "); 290 | builder.Append(_dest); 291 | } 292 | 293 | 294 | } 295 | 296 | return builder.ToString(); 297 | } 298 | 299 | /// 300 | /// 测试RTMP服务器是否响应 301 | /// 302 | /// 303 | /// 304 | private bool TestRtmpServer(string server, bool is_push) 305 | { 306 | var val = false; 307 | 308 | var @params = string.Format( 309 | -1 < _source.IndexOf("live=1", StringComparison.OrdinalIgnoreCase) ? "\" -i {0} live=1\"" : "\" -i {0}\"", 310 | server); 311 | 312 | //try 10 times 313 | var i = 0; 314 | do 315 | { 316 | try 317 | { 318 | var message = Processor.FFprobe(@params, is_push, 319 | id => Task.Run(async () => 320 | { 321 | await Task.Delay(1000); 322 | 323 | /* 324 | * if rtmp is alive but no current stream output, 如果RTMP是启动状态但是没有当前输出流 325 | * FFmpeg will be in a wait state forerver. FFMPEG将会一直在等待状态 326 | * so after 1s, kill the process. 最后关闭进程 327 | */ 328 | 329 | try 330 | { 331 | var p = Process.GetProcessById(id); 332 | //when the process was exited will throw a excetion. 333 | //当进程还存在的时候将会抛出异常 334 | p.Kill(); 335 | } 336 | catch (Exception) 337 | { 338 | } 339 | 340 | })); 341 | 342 | if (message.Equals("error", StringComparison.OrdinalIgnoreCase)) 343 | { 344 | throw new ApplicationException("error"); 345 | } 346 | 347 | val = true; 348 | i = 10; 349 | } 350 | catch (Exception) 351 | { 352 | i += 1; 353 | } 354 | 355 | } while (i < 10); 356 | 357 | return val; 358 | } 359 | 360 | private static string GetFriendlyName(UCOMIMoniker mon) 361 | { 362 | object bagObj = null; 363 | IPropertyBag bag = null; 364 | try 365 | { 366 | Guid bagId = typeof(IPropertyBag).GUID; 367 | mon.BindToStorage(null, null, ref bagId, out bagObj); 368 | bag = (IPropertyBag)bagObj; 369 | object val = ""; 370 | int hr = bag.Read("FriendlyName", ref val, IntPtr.Zero); 371 | if (hr != 0) 372 | Marshal.ThrowExceptionForHR(hr); 373 | string ret = val as string; 374 | if ((ret == null) || (ret.Length < 1)) 375 | throw new NotImplementedException("Device FriendlyName"); 376 | return ret; 377 | } 378 | catch (Exception) 379 | { 380 | return null; 381 | } 382 | finally 383 | { 384 | bag = null; 385 | if (bagObj != null) 386 | Marshal.ReleaseComObject(bagObj); bagObj = null; 387 | } 388 | } 389 | } 390 | } -------------------------------------------------------------------------------- /FFmpegSharp/Executor/Processor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | 5 | namespace FFmpegSharp.Executor 6 | { 7 | internal class Processor 8 | { 9 | internal static string FFmpeg(string @params, Action onStart = null) 10 | { 11 | return Execute(true, @params, onStart); 12 | } 13 | 14 | internal static string FFprobe(string @params,bool is_push, Action onStart = null) 15 | { 16 | //当参数1是false的时候则为获取视频流的信息 17 | //当参数1是true的时候则为获取视频流 18 | 19 | return Execute(is_push, @params, onStart); 20 | } 21 | 22 | private static string Execute(bool userFFmpeg, string @params,Action onStart = null) 23 | { 24 | Process p = null; 25 | try 26 | { 27 | using (p = new Process()) 28 | { 29 | var workdir = Path.GetDirectoryName(Config.Instance.FFmpegPath); 30 | 31 | if (string.IsNullOrWhiteSpace(workdir)) 32 | throw new ApplicationException("work directory is null"); 33 | 34 | var exePath = userFFmpeg ? Config.Instance.FFmpegPath : Config.Instance.FFprobePath; 35 | 36 | var info = new ProcessStartInfo(exePath) 37 | { 38 | Arguments = @params, 39 | CreateNoWindow = true, 40 | RedirectStandardError = true, 41 | RedirectStandardOutput = true, 42 | UseShellExecute = false, 43 | WorkingDirectory = workdir 44 | }; 45 | 46 | p.StartInfo = info; 47 | p.Start(); 48 | 49 | if (null != onStart) 50 | { 51 | onStart.Invoke(p.Id); 52 | } 53 | 54 | var message = string.Empty; 55 | 56 | if (userFFmpeg) 57 | { 58 | while (!p.StandardError.EndOfStream) 59 | { 60 | message =p.StandardError.ReadLine(); 61 | } 62 | } 63 | else 64 | { 65 | message = p.StandardOutput.ReadToEnd(); 66 | } 67 | 68 | p.WaitForExit(); 69 | 70 | return message; 71 | } 72 | } 73 | finally 74 | { 75 | if (null != p) 76 | { 77 | p.Close(); 78 | p.Dispose(); 79 | } 80 | } 81 | 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /FFmpegSharp/Executor/TargetType.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Executor 2 | { 3 | public enum TargetType 4 | { 5 | Default, 6 | File, 7 | Live, 8 | Directshow, 9 | Picture 10 | } 11 | } -------------------------------------------------------------------------------- /FFmpegSharp/FFmpegSharp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {F6C4359B-766E-40EE-820C-FA7865CAC400} 8 | Library 9 | Properties 10 | FFmpegSharp 11 | FFmpegSharp 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | False 35 | C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.DirectSound.dll 36 | 37 | 38 | ..\packages\Newtonsoft.Json.6.0.6\lib\net45\Newtonsoft.Json.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | ASPXCodeBehind 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | PreserveNewest 125 | 126 | 127 | PreserveNewest 128 | 129 | 130 | PreserveNewest 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 151 | -------------------------------------------------------------------------------- /FFmpegSharp/Filters/AudioBitrateFilter.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | /// 4 | /// audio bitrate filter 5 | /// 6 | public class AudioBitrateFilter : FilterBase 7 | { 8 | public int Rate { get; private set; } 9 | 10 | /// 11 | /// audio bitrate 12 | /// 13 | /// (eg. 64k 96k 128k 192k 320k) 14 | public AudioBitrateFilter(int rate) 15 | { 16 | Name = "AudioBitrate"; 17 | FilterType = FilterType.Audio; 18 | Rate = rate; 19 | Rank = 8; 20 | } 21 | 22 | public override string ToString() 23 | { 24 | if (Rate > 320) 25 | Rate = 320; 26 | 27 | if (Rate < 64) 28 | Rate = 64; 29 | 30 | return string.Format(" -b:a {0}k", Rate); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/AudioChannelFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FFmpegSharp.Filters 4 | { 5 | /// 6 | /// audio channel select filter 7 | /// 8 | public class AudioChannelFilter : FilterBase 9 | { 10 | public int Channel { get; private set; } 11 | 12 | public AudioChannelFilter(int channel) 13 | { 14 | Name = "AudioChannel"; 15 | FilterType = FilterType.Audio; 16 | Channel = channel; 17 | Rank = 8; 18 | } 19 | 20 | public override string ToString() 21 | { 22 | if(Channel > Source.AudioInfo.Channels) 23 | throw new ApplicationException(string.Format("there only {0} channels in audio stream.", Source.AudioInfo.Channels)); 24 | 25 | return string.Concat(" -ac ", Channel); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/AudioRateFilter.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | /// 4 | /// audio rate filter 5 | /// 6 | public class AudioRatelFilter : FilterBase 7 | { 8 | public int Rate { get; private set; } 9 | 10 | /// 11 | /// audio sampling rate (in Hz) 12 | /// 13 | /// in flv not above 44100 14 | public AudioRatelFilter(int rate) 15 | { 16 | Name = "AudioRate"; 17 | FilterType = FilterType.Audio; 18 | Rate = rate; 19 | Rank = 8; 20 | } 21 | 22 | public override string ToString() 23 | { 24 | return string.Concat(" -ar ", Rate); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/DisableVideoFilter.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | /// 4 | /// audio channel select filter 5 | /// 6 | public class DisableVideoFilter : FilterBase 7 | { 8 | 9 | public DisableVideoFilter() 10 | { 11 | Name = "DisableVideo"; 12 | FilterType = FilterType.Video; 13 | Rank = 8; 14 | } 15 | 16 | public override string ToString() 17 | { 18 | return " -vn"; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/Extentions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | 4 | namespace FFmpegSharp.Filters 5 | { 6 | public static class Extentions 7 | { 8 | public static string GetDescription(this X264Preset value) 9 | { 10 | var type = value.GetType(); 11 | var name = Enum.GetName(type, value); 12 | 13 | if (name == null) return null; 14 | 15 | var field = type.GetField(name); 16 | 17 | if (field == null) return null; 18 | 19 | var attr = 20 | Attribute.GetCustomAttribute(field, 21 | typeof(DescriptionAttribute)) as DescriptionAttribute; 22 | 23 | return attr != null ? attr.Description : null; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/FilterBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using FFmpegSharp.Media; 3 | 4 | namespace FFmpegSharp.Filters 5 | { 6 | public abstract class FilterBase : IFilter 7 | { 8 | public MediaStream Source = null; 9 | 10 | public int Rank { get; protected set; } 11 | public string Name { get; protected set; } 12 | protected FilterType FilterType { get; set; } 13 | 14 | protected FilterBase() 15 | { 16 | Rank = 9; 17 | } 18 | 19 | protected virtual void ValidateVideoStream() 20 | { 21 | if(null == Source) 22 | throw new ApplicationException("source file is null."); 23 | 24 | if(null == Source.VideoInfo) 25 | //视频流 26 | throw new ApplicationException("non video stream found in source file."); 27 | } 28 | 29 | protected virtual void ValidateAudioStream() 30 | { 31 | if (null == Source) 32 | throw new ApplicationException("source file is null."); 33 | 34 | if (null == Source.AudioInfo) 35 | //音频流 36 | throw new ApplicationException("non audio stream found in source file."); 37 | } 38 | 39 | public string Execute() 40 | { 41 | switch (FilterType) 42 | { 43 | case FilterType.Audio: 44 | ValidateAudioStream(); 45 | break; 46 | case FilterType.Video: 47 | ValidateVideoStream(); 48 | break; 49 | default: 50 | throw new ApplicationException("unknown filter type."); 51 | } 52 | return ToString(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /FFmpegSharp/Filters/FilterType.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | public enum FilterType 4 | { 5 | Video, 6 | Audio 7 | } 8 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/IFilter.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | public interface IFilter 4 | { 5 | string Execute(); 6 | } 7 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/ImageWatermarkFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace FFmpegSharp.Filters 7 | { 8 | public class ImageWatermarkFilter : FilterBase 9 | { 10 | public string ImageFile { get; private set; } 11 | 12 | public WatermarkPosition Position { get; private set; } 13 | public Point Offset { get; private set; } 14 | 15 | public ImageWatermarkFilter(string imageFile, WatermarkPosition position, Point offset) 16 | { 17 | Name = "ImageWatermark"; 18 | FilterType = FilterType.Video; 19 | ImageFile = imageFile; 20 | Position = position; 21 | Offset = offset; 22 | Rank = 0; 23 | } 24 | 25 | public ImageWatermarkFilter(string imageFile, WatermarkPosition position) 26 | { 27 | Name = "ImageWatermark"; 28 | FilterType = FilterType.Video; 29 | ImageFile = imageFile; 30 | Position = position; 31 | Offset = new Point(10, 10); 32 | Rank = 0; 33 | } 34 | 35 | public override string ToString() 36 | { 37 | if (!File.Exists(ImageFile)) 38 | throw new ApplicationException("image file not exists."); 39 | 40 | var builder = new StringBuilder(); 41 | 42 | string overlayFormat; 43 | 44 | switch (Position) 45 | { 46 | case WatermarkPosition.TopLeft: 47 | overlayFormat = "{0}:{1}"; 48 | break; 49 | case WatermarkPosition.TopRight: 50 | overlayFormat = "main_w-overlay_w-{0}:{1}"; 51 | break; 52 | case WatermarkPosition.BottomLeft: 53 | overlayFormat = "{0}:main_h-overlay_h-{1}"; 54 | break; 55 | case WatermarkPosition.BottomRight: 56 | overlayFormat = "main_w-overlay_w-{0}:main_h-overlay_h-{1}"; 57 | break; 58 | case WatermarkPosition.Center: 59 | overlayFormat = "(main_w-overlay_w)/2-{0}:(main_h-overlay_h)/2-{1}"; 60 | break; 61 | case WatermarkPosition.MiddleLeft: 62 | overlayFormat = "{0}:(main_h-overlay_h)/2-{1}"; 63 | break; 64 | case WatermarkPosition.MiddleRight: 65 | overlayFormat = "main_w-overlay_w-{0}:(main_h-overlay_h)/2-{1}"; 66 | break; 67 | case WatermarkPosition.CenterTop: 68 | overlayFormat = "(main_w-overlay_w)/2-{0}:{1}"; 69 | break; 70 | case WatermarkPosition.CenterBottom: 71 | overlayFormat = "(main_w-overlay_w)/2-{0}:main_h-overlay_h-{1}"; 72 | break; 73 | 74 | default: 75 | throw new ArgumentException("unknown wartermark position"); 76 | 77 | } 78 | 79 | var overlayPostion = String.Format(overlayFormat, Offset.X, Offset.Y); 80 | 81 | builder.AppendFormat(" -vf \"movie=\\'{0}\\' [watermark]; [in][watermark] overlay={1} [out]\"", 82 | ImageFile.Replace("\\", "\\\\"), overlayPostion); 83 | 84 | return builder.ToString(); 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/ResizeFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Drawing; 3 | using FFmpegSharp.Utils; 4 | 5 | namespace FFmpegSharp.Filters 6 | { 7 | /// 8 | /// video resize filter 9 | /// 10 | public class ResizeFilter : FilterBase 11 | { 12 | private static readonly Dictionary Sizes = new Dictionary 13 | { 14 | {Resolution.X240P, new Size(424, 240)}, 15 | {Resolution.X360P, new Size(640, 360)}, 16 | {Resolution.X480P, new Size(848, 480)}, 17 | {Resolution.X720P, new Size(1280, 720)}, 18 | {Resolution.X1080P, new Size(1920, 1080)}, 19 | }; 20 | 21 | public Resolution Resolution { get; private set; } 22 | 23 | 24 | public ResizeFilter(Resolution resolution = Resolution.X480P) 25 | { 26 | Name = "Resize"; 27 | FilterType = FilterType.Video; 28 | Resolution = resolution; 29 | 30 | } 31 | 32 | public override string ToString() 33 | { 34 | var size = Sizes[Resolution]; 35 | 36 | return string.Format(" -s {0}x{1} ", size.Width, size.Height); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/ResizeType.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | public enum ResizeType 4 | { 5 | Fixed, 6 | /// 7 | /// default value. 8 | /// 9 | Scale 10 | } 11 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/Resolution.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | public enum Resolution 4 | { 5 | X240P, 6 | X360P, 7 | X480P, 8 | X720P, 9 | X1080P 10 | } 11 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/SegmentFilter.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | public class SegmentFilter : FilterBase 4 | { 5 | public int SegmentTime { get; private set; } 6 | 7 | public SegmentFilter(int segmentTime) 8 | { 9 | Name = "Segment"; 10 | FilterType = FilterType.Video; 11 | Rank = 5; 12 | SegmentTime = segmentTime; 13 | } 14 | 15 | public override string ToString() 16 | { 17 | return string.Format(" -f segment -segment_time {0} -reset_timestamps 1", SegmentTime); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/SnapshotFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.IO; 4 | using System.Text; 5 | using FFmpegSharp.Utils; 6 | 7 | namespace FFmpegSharp.Filters 8 | { 9 | public class SnapshotFilter : FilterBase 10 | { 11 | public int? Number { get; private set; } 12 | public TimeSpan? Time { get; private set; } 13 | public string OutputPath { get; private set; } 14 | public int Width { get; private set; } 15 | public int Height { get; private set; } 16 | public ResizeType ResizeType { get; private set; } 17 | 18 | /// 19 | /// create multiple snapshot. 20 | /// 21 | /// 22 | /// 23 | /// 24 | /// number of snapshot 25 | /// 26 | public SnapshotFilter(string outputPath, int width,int height, int number = 1, ResizeType type = ResizeType.Scale) 27 | { 28 | 29 | Name = "Snapshot"; 30 | FilterType = FilterType.Video; 31 | OutputPath = outputPath; 32 | Width = width; 33 | Height = height; 34 | Rank = 6; 35 | ResizeType = type; 36 | if (number <= 1) 37 | { 38 | Number = null; 39 | Time = new TimeSpan(0, 0, 0, 1); 40 | } 41 | else 42 | { 43 | Number = number; 44 | Time = null; 45 | } 46 | } 47 | 48 | /// 49 | /// create single snapshot at the fixed time. 50 | /// 51 | /// 52 | /// 53 | /// 54 | /// 55 | /// 56 | public SnapshotFilter(string outputPath, int width, int height, TimeSpan time, ResizeType type = ResizeType.Scale) 57 | { 58 | Name = "Snapshot"; 59 | FilterType = FilterType.Video; 60 | OutputPath = outputPath; 61 | Width = width; 62 | Height = height; 63 | Time = time; 64 | ResizeType = type; 65 | Number = null; 66 | Rank = 6; 67 | } 68 | 69 | 70 | public override string ToString() 71 | { 72 | //ffmpeg -i test.mp4 -f image2 -ss 00:00:14.435 -s 960*550 -vframes 1 out.jpg 73 | //ffmpeg -i test.mp4 -ss 00:00:14.435 -s 960*550 -f image2 -vframes 1 out.jpg 74 | //ffmpeg -i input.flv -f image2 -vf fps=fps=1 out%d.png 75 | 76 | var builder = new StringBuilder(); 77 | 78 | builder.Append(" -i "); 79 | builder.Append(Source.FilePath); 80 | builder.Append(" -f image2"); 81 | 82 | if (ResizeType == ResizeType.Scale) 83 | { 84 | var sourceSize = new Size(Source.VideoInfo.Width, Source.VideoInfo.Height); 85 | var resultSize = SizeUtils.CalculateOutSize(sourceSize, Width, Height); 86 | 87 | builder.AppendFormat(" -s {0}x{1}", resultSize.Width, resultSize.Height); 88 | } 89 | else 90 | { 91 | builder.AppendFormat(" -s {0}x{1}", Width, Height); 92 | } 93 | 94 | var dir = Path.GetDirectoryName(OutputPath); 95 | 96 | if (string.IsNullOrEmpty(dir)) 97 | throw new ApplicationException("snapshot outpath directory is null."); 98 | 99 | if (!Directory.Exists(dir)) 100 | { 101 | Directory.CreateDirectory(dir); 102 | } 103 | 104 | var filename = Path.GetFileNameWithoutExtension(OutputPath); 105 | 106 | if (string.IsNullOrEmpty(filename)) 107 | throw new ApplicationException("snapshot outpath filename is null."); 108 | 109 | var ext = Path.GetExtension(OutputPath); 110 | 111 | if (string.IsNullOrEmpty(ext)) 112 | ext = ".jpg"; 113 | 114 | 115 | if (null != Time) 116 | { 117 | builder.AppendFormat(" -ss {0} -vframes 1", Time.Value); 118 | builder.Append(" "); 119 | builder.Append(OutputPath); 120 | } 121 | 122 | if (null != Number) 123 | { 124 | var duration = Source.VideoInfo.Duration; 125 | 126 | var num = duration.TotalSeconds/(Number.Value - 1); 127 | 128 | builder.AppendFormat(" -vf fps=fps=1/{0} {1}\\{2}%d{3}", Math.Floor(num), dir, filename, ext); 129 | } 130 | 131 | return builder.ToString(); 132 | } 133 | } 134 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/VideoBitrateFilter.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | public class VideoBitrateFilter : FilterBase 4 | { 5 | public float Bitrate { get; private set; } 6 | 7 | /// 8 | /// set frame rate 9 | /// 10 | /// Hz value, fraction or abbreviation(eg. 64k) 11 | public VideoBitrateFilter(float bitrate) 12 | { 13 | Name = "VideoBitrate"; 14 | FilterType = FilterType.Video; 15 | Bitrate = bitrate; 16 | Rank = 6; 17 | } 18 | 19 | public override string ToString() 20 | { 21 | return string.Concat(" -b:v ", Bitrate); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/VideoRateFilter.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | public class VideoRateFilter : FilterBase 4 | { 5 | public int Rate { get; private set; } 6 | 7 | /// 8 | /// set frame rate 9 | /// 10 | /// Hz value, fraction or abbreviation 11 | public VideoRateFilter(int rate) 12 | { 13 | Name = "VideoRate"; 14 | FilterType = FilterType.Video; 15 | Rate = rate; 16 | Rank = 6; 17 | } 18 | 19 | public override string ToString() 20 | { 21 | return string.Concat(" -r ", Rate); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/WatermarkPosition.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Filters 2 | { 3 | public enum WatermarkPosition 4 | { 5 | TopLeft, 6 | TopRight, 7 | BottomLeft, 8 | BottomRight, 9 | Center, 10 | MiddleLeft, 11 | MiddleRight, 12 | CenterTop, 13 | CenterBottom, 14 | } 15 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/X264Filter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * resource: 3 | * https://trac.ffmpeg.org/wiki/Encode/H.264 4 | * http://mewiki.project357.com/wiki/X264_Settings 5 | */ 6 | using System.Text; 7 | 8 | namespace FFmpegSharp.Filters 9 | { 10 | public class X264Filter : FilterBase 11 | { 12 | /// 13 | /// change options to trade off compression efficiency against encoding speed. 14 | /// default: Medium 15 | /// 16 | public X264Preset Preset { get; set; } 17 | /// 18 | /// 编码X264 19 | /// set x264 to encode the movie in Constant Quantizer mode. 20 | /// range 0-54. 21 | /// a setting of 0 will produce lossless output. 22 | /// usually 21-26 23 | /// 24 | public int? ConstantQuantizer { get; set; } 25 | public int? MaxRate { get; set; } 26 | public int? MinRate { get; set; } 27 | 28 | //todo -movflags faststart 29 | 30 | public X264Filter() 31 | { 32 | Name = "X264"; 33 | FilterType = FilterType.Video; 34 | Preset = X264Preset.Medium; 35 | Rank = 1; 36 | } 37 | 38 | public override string ToString() 39 | { 40 | var builder = new StringBuilder(); 41 | 42 | builder.Append(" -c:v libx264"); 43 | 44 | if (X264Preset.Medium != Preset) 45 | { 46 | var param = Preset.GetDescription(); 47 | 48 | if (!string.IsNullOrWhiteSpace(param)) 49 | { 50 | builder.AppendFormat(" -preset {0}", param); 51 | } 52 | } 53 | 54 | if (null != ConstantQuantizer) 55 | { 56 | if (ConstantQuantizer < 0 || ConstantQuantizer > 51) 57 | { 58 | ConstantQuantizer = 22; 59 | } 60 | 61 | builder.AppendFormat(" -qp {0}", ConstantQuantizer.Value); 62 | } 63 | 64 | return builder.ToString(); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /FFmpegSharp/Filters/X264Preset .cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace FFmpegSharp.Filters 4 | { 5 | public enum X264Preset 6 | { 7 | [Description("ultrafast")] 8 | Ultrafast, 9 | [Description("superfast")] 10 | Superfast, 11 | [Description("veryfast")] 12 | Veryfast, 13 | [Description("faster")] 14 | Faster, 15 | [Description("fast")] 16 | Fast, 17 | [Description("medium")] 18 | Medium, 19 | [Description("slow")] 20 | Slow, 21 | [Description("slower")] 22 | Slower, 23 | [Description("veryslow")] 24 | Veryslow, 25 | [Description("placebo")] 26 | Placebo 27 | } 28 | } -------------------------------------------------------------------------------- /FFmpegSharp/Media/AudioInfo.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Media 2 | { 3 | public class AudioInfo : StreamInfoBase 4 | { 5 | public int Channels { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /FFmpegSharp/Media/MediaStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using FFmpegSharp.Executor; 8 | using Newtonsoft.Json.Linq; 9 | 10 | namespace FFmpegSharp.Media 11 | { 12 | public class MediaStream 13 | { 14 | public MediaStream(string path, bool is_push) 15 | { 16 | if (!path.StartsWith("rtmp://", StringComparison.OrdinalIgnoreCase)) 17 | { 18 | if (!File.Exists(path)) 19 | { 20 | throw new ApplicationException(string.Format("file not found in the path: {0} .", path)); 21 | } 22 | } 23 | 24 | //try 10 times 25 | var i = 0; 26 | do 27 | { 28 | try 29 | { 30 | var infostr = GetStreamInfo(path, is_push); 31 | 32 | LoadInfo(infostr); 33 | 34 | i = 10; 35 | } 36 | catch (Exception) 37 | { 38 | i += 1; 39 | } 40 | 41 | } while (i < 10); 42 | 43 | FilePath = path; 44 | 45 | } 46 | 47 | 48 | 49 | 50 | 51 | public VideoInfo VideoInfo { get; private set; } 52 | public AudioInfo AudioInfo { get; private set; } 53 | public string FilePath { get; set; } 54 | 55 | private static string GetStreamInfo(string path, bool is_push) 56 | { 57 | var @param = ""; 58 | const string paramStr = " -v quiet -print_format json -hide_banner -show_format -show_streams -pretty {0}"; 59 | @param = string.Format(paramStr, path); 60 | 61 | var message = Processor.FFprobe(@param, is_push, 62 | id => Task.Run(async () => 63 | { 64 | await Task.Delay(1000); 65 | 66 | /* 67 | * if rtmp is alive but no current stream output, //如果RTMP服务器是激活状态但没有流输出 68 | * FFmpeg will be in a wait state forerver.//FFmpeg永远在等待的状态 69 | * so after 1s, kill the process.//这个之后关闭进程 70 | */ 71 | 72 | try 73 | { 74 | //当进程存在的时候抛出异常 75 | var p = Process.GetProcessById(id);//when the process was exited will throw a excetion. 76 | p.Kill(); 77 | } 78 | catch (Exception) 79 | { 80 | } 81 | 82 | })); 83 | 84 | if (message.Equals("error", StringComparison.OrdinalIgnoreCase)) 85 | { 86 | throw new ApplicationException("there some errors on ffprobe execute"); 87 | } 88 | 89 | return message; 90 | } 91 | 92 | private void LoadInfo(string infostr) 93 | { 94 | var streams = JObject.Parse(infostr).SelectToken("streams", false).ToObject>(); 95 | var mediaInfo = JObject.Parse(infostr).SelectToken("format").ToObject(); 96 | 97 | if (null == streams) 98 | { 99 | throw new ApplicationException("no stream found in the source."); 100 | } 101 | 102 | var videoStream = streams.FirstOrDefault(x => x.Type.Equals("video")); 103 | 104 | if (null != videoStream) 105 | { 106 | VideoInfo = new VideoInfo 107 | { 108 | CodecName = videoStream.CodecName, 109 | Height = videoStream.Height, 110 | Width = videoStream.Width, 111 | Duration = videoStream.Duration 112 | }; 113 | 114 | if (VideoInfo.Duration.Ticks < 1) 115 | { 116 | VideoInfo.Duration = mediaInfo.Duration; 117 | } 118 | } 119 | 120 | var audioStream = streams.FirstOrDefault(x => x.Type.Equals("audio")); 121 | 122 | if (null != audioStream) 123 | { 124 | AudioInfo = new AudioInfo 125 | { 126 | CodecName = audioStream.CodecName, 127 | Channels = audioStream.Channels, 128 | Duration = audioStream.Duration, 129 | }; 130 | 131 | if (AudioInfo.Duration.Ticks < 1) 132 | { 133 | AudioInfo.Duration = mediaInfo.Duration; 134 | } 135 | } 136 | 137 | } 138 | } 139 | } -------------------------------------------------------------------------------- /FFmpegSharp/Media/StreamInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace FFmpegSharp.Media 5 | { 6 | [JsonObject] 7 | internal class StreamInfo 8 | { 9 | [JsonProperty("codec_long_name")] 10 | public string CodecName { get; set; } 11 | [JsonProperty("width")] 12 | public int Width { get; set; } 13 | [JsonProperty("height")] 14 | public int Height { get; set; } 15 | [JsonProperty("codec_type")] 16 | public string Type { get; set; } 17 | [JsonProperty("duration")] 18 | public TimeSpan Duration { get; set; } 19 | [JsonProperty("channels")] 20 | public int Channels { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /FFmpegSharp/Media/StreamInfoBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FFmpegSharp.Media 4 | { 5 | public class StreamInfoBase 6 | { 7 | public string CodecName { get; set; } 8 | public TimeSpan Duration { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /FFmpegSharp/Media/StreamType.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Media 2 | { 3 | public enum StreamType 4 | { 5 | Video, 6 | Audio 7 | } 8 | } -------------------------------------------------------------------------------- /FFmpegSharp/Media/TimeBase.cs: -------------------------------------------------------------------------------- 1 | //namespace FFmpegSharp.Media 2 | //{ 3 | // public class TimeBase 4 | // { 5 | // /// 6 | // /// denominator 7 | // /// 8 | // public int Den { get; set; } 9 | 10 | // /// 11 | // /// numerator 12 | // /// 13 | // public int Num { get; set; } 14 | // } 15 | //} -------------------------------------------------------------------------------- /FFmpegSharp/Media/VideoInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FFmpegSharp.Media 4 | { 5 | public class VideoInfo : StreamInfoBase 6 | { 7 | 8 | public int Width { get; set; } 9 | 10 | public int Height { get; set; } 11 | 12 | 13 | } 14 | } -------------------------------------------------------------------------------- /FFmpegSharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("FFmpegSharp")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("Microsoft")] 8 | [assembly: AssemblyProduct("FFmpegSharp")] 9 | [assembly: AssemblyCopyright("Copyright © Microsoft 2014")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | [assembly: ComVisible(false)] 13 | [assembly: Guid("5c59a5b7-9737-46be-93ab-4e0e15b85001")] 14 | [assembly: AssemblyVersion("1.0.0.0")] 15 | [assembly: AssemblyFileVersion("1.0.0.0")] 16 | -------------------------------------------------------------------------------- /FFmpegSharp/Utils/Application.cs: -------------------------------------------------------------------------------- 1 | namespace FFmpegSharp.Utils 2 | { 3 | internal class Application 4 | { 5 | public static string StartupPath = ""; 6 | } 7 | } -------------------------------------------------------------------------------- /FFmpegSharp/Utils/Recorder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | //OS support:Windows 7, Windows Server 2003, Windows Server 2008, Windows Vista, Windows XP 5 | //Windows 10 integrated this DirectX sdk in C:\Windows\Microsoft.NET\DirectX for Managed Code 6 | using Microsoft.DirectX.DirectSound; 7 | using System.Runtime.InteropServices; 8 | using System.Reflection; 9 | /// 10 | /// FFmpeg 音视频录制 11 | /// DirectX SDK 下载地址 https://www.microsoft.com/en-us/download/details.aspx?id=6812 12 | /// 13 | namespace FFmpegSharp.Utils 14 | { 15 | public class Recorder 16 | { 17 | [DllImport("kernel32.dll")] 18 | static extern bool GenerateConsoleCtrlEvent(int dwCtrlEvent, int dwProcessGroupId); 19 | 20 | [DllImport("kernel32.dll")] 21 | static extern bool SetConsoleCtrlHandler(IntPtr handlerRoutine, bool add); 22 | 23 | [DllImport("kernel32.dll")] 24 | static extern bool AttachConsole(int dwProcessId); 25 | 26 | [DllImport("kernel32.dll")] 27 | static extern bool FreeConsole(); 28 | 29 | 30 | // ffmpeg进程 31 | static Process p = new Process(); 32 | 33 | // ffmpeg.exe实体文件路径 34 | static string ffmpegPath = AppDomain.CurrentDomain.BaseDirectory + "external\\ffmpeg\\x64\\ffmpeg.exe"; 35 | 36 | /// 37 | /// 获取声音输入设备列表 38 | /// 39 | /// 声音输入设备列表 40 | /// OS support: Windows 7, Windows Server 2003, Windows Server 2008, Windows Vista, Windows XP 41 | /// Windows 10 integrated this DirectX sdk in C:\Windows\Microsoft.NET\DirectX for Managed Code 42 | public static CaptureDevicesCollection GetAudioList() 43 | { 44 | CaptureDevicesCollection collection = new CaptureDevicesCollection(); 45 | 46 | return collection; 47 | } 48 | 49 | /// 50 | /// 功能: 开始录制 51 | /// 52 | public static void Start(string audioDevice, string outFilePath) 53 | { 54 | if (File.Exists(outFilePath)) 55 | { 56 | File.Delete(outFilePath); 57 | } 58 | 59 | /* 60 | * 转码, 61 | * 视频录制设备:gdigrab; 62 | * 录制对象:桌面; 63 | * 音频录制方式:dshow; 64 | * 视频编码格式:h.264;*/ 65 | ProcessStartInfo startInfo = new ProcessStartInfo(ffmpegPath); 66 | startInfo.WindowStyle = ProcessWindowStyle.Normal; 67 | startInfo.UseShellExecute = false;// 必须设置使用shell否则异常 68 | startInfo.Arguments = "-f gdigrab -framerate 15 -i desktop -f dshow -i audio=\"" + audioDevice + "\" -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -acodec libmp3lame \"" + outFilePath + "\""; 69 | 70 | p.StartInfo = startInfo; 71 | 72 | p.Start(); 73 | } 74 | 75 | /// 76 | /// 功能: 停止录制 77 | /// 78 | public static void Stop() 79 | { 80 | AttachConsole(p.Id); 81 | SetConsoleCtrlHandler(IntPtr.Zero, true); 82 | GenerateConsoleCtrlEvent(0, 0); 83 | FreeConsole(); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /FFmpegSharp/Utils/ScreenShot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | /// 7 | /// flv视频截图工具 8 | /// 9 | namespace FFmpegSharp.Utils 10 | { 11 | class ScreenShot: System.Web.UI.Page 12 | { 13 | //文件路径 14 | public static string ffmpegtool = "ffmpeg/ffmpeg.exe"; 15 | public static string mencodertool = "mencoder/mencoder.exe"; 16 | public static string flvtool = "flvtool/flvtool2.exe";//flv标记工具 17 | public static string upFile = "UpFiles" + "/";//上传文件夹 18 | public static string imgFile = "ImgFile" + "/";//图片文件夹 19 | public static string playFile = "PlayFiles" + "/";//flv文件夹 20 | public static string xmlFile = "xmlFiles" + "/";//xml文件夹 21 | public static string sizeOfImg = "240x180";//图片的宽与高 22 | public static string widthOfFile = "400";//flv文件的宽度 23 | public static string heightOfFile = "350";//flv文件的高度 24 | //public static string ffmpegtool = ConfigurationManager.AppSettings["ffmpeg"]; 25 | //public static string mencodertool = ConfigurationManager.AppSettings["mencoder"]; 26 | //public static string upFile = ConfigurationManager.AppSettings["upfile"] + "/"; 27 | //public static string imgFile = ConfigurationManager.AppSettings["imgfile"] + "/"; 28 | //public static string playFile = ConfigurationManager.AppSettings["playfile"] + "/"; 29 | //文件图片大小 30 | //public static string sizeOfImg = ConfigurationManager.AppSettings["CatchFlvImgSize"]; 31 | //文件大小 32 | //public static string widthOfFile = ConfigurationManager.AppSettings["widthSize"]; 33 | //public static string heightOfFile = ConfigurationManager.AppSettings["heightSize"]; 34 | //获取文件的名字 35 | private System.Timers.Timer myTimer = new System.Timers.Timer(3000);//记时器 36 | public static string flvName = ""; 37 | public static string imgName = ""; 38 | public static string flvXml = ""; 39 | public static int pId = 0; 40 | public static string GetFileName(string fileName) 41 | { 42 | int i = fileName.LastIndexOf("\\") + 1; 43 | 44 | string Name = fileName.Substring(i); 45 | return Name; 46 | } 47 | //获取文件扩展名 48 | public static string GetExtension(string fileName) 49 | { 50 | int i = fileName.LastIndexOf(".") + 1; 51 | string Name = fileName.Substring(i); 52 | return Name; 53 | } 54 | // 55 | #region //运行FFMpeg的视频解码,(这里是绝对路径) 56 | /// 57 | /// 转换文件并保存在指定文件夹下面(这里是绝对路径) 58 | /// 59 | /// 上传视频文件的路径(原文件) 60 | /// 转换后的文件的路径(网络播放文件) 61 | /// 从视频文件中抓取的图片路径 62 | /// 成功:返回图片虚拟地址; 失败:返回空字符串 63 | public void ChangeFilePhy(string fileName, string playFile, string imgFile) 64 | { 65 | //取得ffmpeg.exe的路径,路径配置在Web.Config中,如: 66 | string ffmpeg = Server.MapPath(ScreenShot.ffmpegtool); 67 | if ((!System.IO.File.Exists(ffmpeg)) || (!System.IO.File.Exists(fileName))) 68 | { 69 | return; 70 | } 71 | //获得图片和(.flv)文件相对路径/最后存储到数据库的路径,如:/Web/User1/00001.jpg 72 | string flv_file = System.IO.Path.ChangeExtension(playFile, ".flv"); 73 | //截图的尺寸大小,配置在Web.Config中,如: 74 | string FlvImgSize = ScreenShot.sizeOfImg; 75 | System.Diagnostics.ProcessStartInfo FilestartInfo = new System.Diagnostics.ProcessStartInfo(ffmpeg); 76 | FilestartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; 77 | FilestartInfo.Arguments = " -i " + fileName + " -ab 56 -ar 22050 -b 500 -r 15 -s " + widthOfFile + "x" + heightOfFile + " " + flv_file; 78 | //ImgstartInfo.Arguments = " -i " + fileName + " -y -f image2 -t 0.05 -s " + FlvImgSize + " " + flv_img; 79 | try 80 | { 81 | //转换 82 | System.Diagnostics.Process.Start(FilestartInfo); 83 | //截图 84 | CatchImg(fileName, imgFile); 85 | //System.Diagnostics.Process.Start(ImgstartInfo); 86 | } 87 | catch 88 | { 89 | } 90 | } 91 | #endregion 92 | #region 截图 93 | public string CatchImg(string fileName, string imgFile) 94 | { 95 | // 96 | string ffmpeg = Server.MapPath(ScreenShot.ffmpegtool); 97 | // 98 | string flv_img = imgFile + ".jpg"; 99 | // 100 | string FlvImgSize = ScreenShot.sizeOfImg; 101 | // 102 | System.Diagnostics.ProcessStartInfo ImgstartInfo = new System.Diagnostics.ProcessStartInfo(ffmpeg); 103 | ImgstartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; 104 | // 105 | ImgstartInfo.Arguments = " -i " + fileName + " -y -f image2 -ss 2 -vframes 1 -s " + FlvImgSize + " " + flv_img; 106 | try 107 | { 108 | System.Diagnostics.Process.Start(ImgstartInfo); 109 | } 110 | catch 111 | { 112 | return ""; 113 | } 114 | // 115 | catchFlvTool(fileName); 116 | if (System.IO.File.Exists(flv_img)) 117 | { 118 | return flv_img; 119 | } 120 | return ""; 121 | } 122 | #endregion 123 | #region //运行FFMpeg的视频解码,(这里是(虚拟)相对路径) 124 | /// 125 | /// 转换文件并保存在指定文件夹下面(这里是相对路径) 126 | /// 127 | /// 上传视频文件的路径(原文件) 128 | /// 转换后的文件的路径(网络播放文件) 129 | /// 从视频文件中抓取的图片路径 130 | /// 成功:返回图片虚拟地址; 失败:返回空字符串 131 | public void ChangeFileVir(string fileName, string playFile, string imgFile) 132 | { 133 | //取得ffmpeg.exe的路径,路径配置在Web.Config中,如: 134 | string ffmpeg = Server.MapPath(ScreenShot.ffmpegtool); 135 | if ((!System.IO.File.Exists(ffmpeg)) || (!System.IO.File.Exists(fileName))) 136 | { 137 | return; 138 | } 139 | //获得图片和(.flv)文件相对路径/最后存储到数据库的路径,如:/Web/User1/00001.jpg 140 | string flv_img = System.IO.Path.ChangeExtension(Server.MapPath(imgFile), ".jpg"); 141 | string flv_file = System.IO.Path.ChangeExtension(Server.MapPath(playFile), ".flv"); 142 | //截图的尺寸大小,配置在Web.Config中,如: 143 | string FlvImgSize = ScreenShot.sizeOfImg; 144 | System.Diagnostics.ProcessStartInfo FilestartInfo = new System.Diagnostics.ProcessStartInfo(ffmpeg); 145 | FilestartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; 146 | //此处组合成ffmpeg.exe文件需要的参数即可,此处命令在ffmpeg 0.4.9调试通过 147 | //ffmpeg -i F:\01.wmv -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 f:\test.flv 148 | FilestartInfo.Arguments = " -i " + fileName + " -ab 56 -ar 22050 -b 500 -r 15 -s " + widthOfFile + "x" + heightOfFile + " " + flv_file; 149 | try 150 | { 151 | System.Diagnostics.Process ps = new System.Diagnostics.Process(); 152 | ps.StartInfo = FilestartInfo; 153 | ps.Start(); 154 | Session.Add("ProcessID", ps.Id); 155 | Session.Add("flv", flv_file); 156 | Session.Add("img", imgFile); 157 | myTimer.Elapsed += new System.Timers.ElapsedEventHandler(myTimer_Test); 158 | myTimer.Enabled = true; 159 | } 160 | catch 161 | { 162 | } 163 | } 164 | #endregion 165 | #region //运行mencoder的视频解码器转换(这里是(绝对路径)) 166 | public void MChangeFilePhy(string vFileName, string playFile, string imgFile) 167 | { 168 | string tool = Server.MapPath(ScreenShot.mencodertool); 169 | //string mplaytool = Server.MapPath(PublicMethod.ffmpegtool); 170 | if ((!System.IO.File.Exists(tool)) || (!System.IO.File.Exists(vFileName))) 171 | { 172 | return; 173 | } 174 | string flv_file = System.IO.Path.ChangeExtension(playFile, ".flv"); 175 | //截图的尺寸大小,配置在Web.Config中,如: 176 | string FlvImgSize = ScreenShot.sizeOfImg; 177 | System.Diagnostics.ProcessStartInfo FilestartInfo = new System.Diagnostics.ProcessStartInfo(tool); 178 | FilestartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; 179 | FilestartInfo.Arguments = " " + vFileName + " -o " + flv_file + " -of lavf -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=200:mbd=2:mv0:trell:v4mv:cbp:last_pred=1:dia=-1:cmp=0:vb_strategy=1 -vf scale=" + widthOfFile + ":" + heightOfFile + " -ofps 12 -srate 22050"; 180 | try 181 | { 182 | System.Diagnostics.Process ps = new System.Diagnostics.Process(); 183 | ps.StartInfo = FilestartInfo; 184 | ps.Start(); 185 | Session.Add("ProcessID", ps.Id); 186 | Session.Add("flv", flv_file); 187 | Session.Add("img", imgFile); 188 | //pId = ps.Id; 189 | //flvName = flv_file; 190 | //imgName = imgFile; 191 | myTimer.Elapsed += new System.Timers.ElapsedEventHandler(myTimer_Test); 192 | myTimer.Enabled = true; 193 | } 194 | catch 195 | { 196 | } 197 | } 198 | /// 199 | /// 记时器功能,自动保存截图 200 | /// 201 | /// 202 | /// 203 | private void myTimer_Test(object sender, System.Timers.ElapsedEventArgs e) 204 | { 205 | if (!object.Equals(null, Session["ProcessID"])) 206 | { 207 | try 208 | { 209 | System.Diagnostics.Process prs = System.Diagnostics.Process.GetProcessById(int.Parse(Session["ProcessID"].ToString())); 210 | if (prs.HasExited) 211 | { 212 | CatchImg(Session["flv"].ToString(), Session["img"].ToString()); 213 | catchFlvTool(Session["flv"].ToString()); 214 | myTimer.Enabled = false; 215 | myTimer.Close(); 216 | myTimer.Dispose(); 217 | Session.Abandon(); 218 | } 219 | } 220 | catch 221 | { 222 | CatchImg(Session["flv"].ToString(), Session["img"].ToString()); 223 | catchFlvTool(Session["flv"].ToString()); 224 | myTimer.Enabled = false; 225 | myTimer.Close(); 226 | myTimer.Dispose(); 227 | Session.Abandon(); 228 | } 229 | } 230 | } 231 | #endregion 232 | public string catchFlvTool(string fileName) 233 | { 234 | // 235 | string flvtools = Server.MapPath(ScreenShot.flvtool); 236 | // 237 | string flv_xml = fileName.Replace(".flv", ".xml").Replace(ScreenShot.upFile.Replace("/", ""), ScreenShot.xmlFile.Replace("/", "")); 238 | // 239 | System.Diagnostics.ProcessStartInfo ImgstartInfo = new System.Diagnostics.ProcessStartInfo(flvtools); 240 | ImgstartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; 241 | // 242 | ImgstartInfo.Arguments = " " + fileName + " -UPx " + fileName + " > " + flv_xml; 243 | try 244 | { 245 | System.Diagnostics.Process.Start(ImgstartInfo); 246 | } 247 | catch 248 | { 249 | return ""; 250 | } 251 | // 252 | if (System.IO.File.Exists(flv_xml)) 253 | { 254 | return flv_xml; 255 | } 256 | return ""; 257 | } 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /FFmpegSharp/Utils/SizeUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace FFmpegSharp.Utils 4 | { 5 | internal class SizeUtils 6 | { 7 | /// 8 | /// calculate out size in scale 9 | /// 10 | /// source size 11 | /// max width 12 | /// max height 13 | /// 14 | internal static Size CalculateOutSize(Size source, int maxWidth, int maxHeight) 15 | { 16 | var result = new Size(); 17 | 18 | double sourceScale = (double)source.Width / source.Height; 19 | 20 | double calculatedScale = (double)maxWidth / maxHeight; 21 | 22 | if (sourceScale < calculatedScale) 23 | { 24 | result.Width = (source.Width * maxHeight) / source.Height; 25 | result.Height = maxHeight; 26 | } 27 | else 28 | { 29 | result.Width = maxWidth; 30 | result.Height = (source.Height * maxWidth) / source.Width; 31 | } 32 | 33 | return result; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /FFmpegSharp/Utils/Video.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Runtime.InteropServices; 4 | using System.Threading; 5 | 6 | namespace FFmpegSharp.Utils 7 | { 8 | public class Video //视频类 9 | { 10 | public bool flag = true; 11 | private IntPtr lwndC; //保存无符号句柄 12 | private IntPtr mControlPtr; //保存管理指示器 13 | private int mWidth; 14 | private int mHeight; 15 | public delegate void RecievedFrameEventHandler(byte[] data); 16 | public event RecievedFrameEventHandler RecievedFrame; 17 | 18 | VideoAPI.CAPTUREPARMS Capparms; 19 | private VideoAPI.FrameEventHandler mFrameEventHandler; 20 | VideoAPI.CAPDRIVERCAPS CapDriverCAPS;//捕获驱动器的能力,如有无视频叠加能力、有无控制视频源、视频格式的对话框等; 21 | VideoAPI.CAPSTATUS CapStatus;//该结构用于保存视频设备捕获窗口的当前状态,如图像的宽、高等 22 | string strFileName; 23 | public Video(IntPtr handle, int width, int height) 24 | { 25 | CapDriverCAPS = new VideoAPI.CAPDRIVERCAPS();//捕获驱动器的能力,如有无视频叠加能力、有无控制视频源、视频格式的对话框等; 26 | CapStatus = new VideoAPI.CAPSTATUS();//该结构用于保存视频设备捕获窗口的当前状态,如图像的宽、高等 27 | mControlPtr = handle; //显示视频控件的句柄 28 | mWidth = width; //视频宽度 29 | mHeight = height; //视频高度 30 | } 31 | 32 | /// 33 | /// 打开视频设备 34 | /// 35 | public bool StartWebCam() 36 | { 37 | //byte[] lpszName = new byte[100]; 38 | //byte[] lpszVer = new byte[100]; 39 | //VideoAPI.capGetDriverDescriptionA(0, lpszName, 100, lpszVer, 100); 40 | //this.lwndC = VideoAPI.capCreateCaptureWindowA(lpszName, VideoAPI.WS_CHILD | VideoAPI.WS_VISIBLE, 0, 0, mWidth, mHeight, mControlPtr, 0); 41 | //if (VideoAPI.SendMessage(lwndC, VideoAPI.WM_CAP_DRIVER_CONNECT, 0, 0)) 42 | //{ 43 | // VideoAPI.SendMessage(lwndC, VideoAPI.WM_CAP_SET_PREVIEWRATE, 100, 0); 44 | // VideoAPI.SendMessage(lwndC, VideoAPI.WM_CAP_SET_PREVIEW, true, 0); 45 | // return true; 46 | //} 47 | //else 48 | //{ 49 | // return false; 50 | //} 51 | this.lwndC = VideoAPI.capCreateCaptureWindow("", VideoAPI.WS_CHILD | VideoAPI.WS_VISIBLE, 0, 0, mWidth, mHeight, mControlPtr, 0);//AVICap类的捕捉窗口 52 | VideoAPI.FrameEventHandler FrameEventHandler = new VideoAPI.FrameEventHandler(FrameCallback); 53 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_CALLBACK_ERROR, 0, 0);//注册错误回调函数 54 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_CALLBACK_STATUS, 0, 0);//注册状态回调函数 55 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);//注册视频流回调函数 56 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_CALLBACK_FRAME, 0, FrameEventHandler);//注册帧回调函数 57 | 58 | //if (!CapDriverCAPS.fCaptureInitialized)//判断当前设备是否被其他设备连接已经连接 59 | //{ 60 | 61 | if (VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_DRIVER_CONNECT, 0, 0)) 62 | { 63 | //----------------------------------------------------------------------- 64 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_DRIVER_GET_CAPS, VideoAPI.SizeOf(CapDriverCAPS), ref CapDriverCAPS);//获得当前视频 CAPDRIVERCAPS定义了捕获驱动器的能力,如有无视频叠加能力、有无控制视频源、视频格式的对话框等; 65 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_GET_STATUS, VideoAPI.SizeOf(CapStatus), ref CapStatus);//获得当前视频流的尺寸 存入CapStatus结构 66 | 67 | VideoAPI.BITMAPINFO bitmapInfo = new VideoAPI.BITMAPINFO();//设置视频格式 (height and width in pixels, bits per frame). 68 | bitmapInfo.bmiHeader = new VideoAPI.BITMAPINFOHEADER(); 69 | bitmapInfo.bmiHeader.biSize = VideoAPI.SizeOf(bitmapInfo.bmiHeader); 70 | bitmapInfo.bmiHeader.biWidth = mWidth; 71 | bitmapInfo.bmiHeader.biHeight = mHeight; 72 | bitmapInfo.bmiHeader.biPlanes = 1; 73 | bitmapInfo.bmiHeader.biBitCount = 24; 74 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_PREVIEWRATE, 40, 0);//设置在PREVIEW模式下设定视频窗口的刷新率 设置每40毫秒显示一帧,即显示帧速为每秒25帧 75 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_SCALE, 1, 0);//打开预览视频的缩放比例 76 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_VIDEOFORMAT, VideoAPI.SizeOf(bitmapInfo), ref bitmapInfo); 77 | 78 | this.mFrameEventHandler = new VideoAPI.FrameEventHandler(FrameCallback); 79 | this.capSetCallbackOnFrame(this.lwndC, this.mFrameEventHandler); 80 | 81 | 82 | VideoAPI.CAPTUREPARMS captureparms = new VideoAPI.CAPTUREPARMS(); 83 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_GET_SEQUENCE_SETUP, VideoAPI.SizeOf(captureparms), ref captureparms); 84 | if (CapDriverCAPS.fHasOverlay) 85 | { 86 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_OVERLAY, 1, 0);//启用叠加 注:据说启用此项可以加快渲染速度 87 | } 88 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_PREVIEW, 1, 0);//设置显示图像启动预览模式 PREVIEW 89 | VideoAPI.SetWindowPos(this.lwndC, 0, 0, 0, mWidth, mHeight, VideoAPI.SWP_NOZORDER | VideoAPI.SWP_NOMOVE);//使捕获窗口与进来的视频流尺寸保持一致 90 | return true; 91 | } 92 | else 93 | { 94 | 95 | flag = false; 96 | return false; 97 | } 98 | } 99 | 100 | /// 101 | /// 打开视频设备 102 | /// 103 | /// 104 | /// 105 | /// 106 | public bool StartWebCam(int mWidth,int mHeight) 107 | { 108 | this.mWidth = mWidth; 109 | this.mHeight = mHeight; 110 | return StartWebCam(); 111 | } 112 | public void get() 113 | { 114 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_GET_SEQUENCE_SETUP, VideoAPI.SizeOf(Capparms), ref Capparms); 115 | } 116 | public void set() 117 | { 118 | VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_SEQUENCE_SETUP, VideoAPI.SizeOf(Capparms), ref Capparms); 119 | } 120 | private bool capSetCallbackOnFrame(IntPtr lwnd, VideoAPI.FrameEventHandler lpProc) 121 | { 122 | return VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SET_CALLBACK_FRAME, 0, lpProc); 123 | } 124 | /// 125 | /// 关闭视频设备 126 | /// 127 | public void CloseWebcam() 128 | { 129 | VideoAPI.SendMessage(lwndC, VideoAPI.WM_CAP_DRIVER_DISCONNECT, 0, 0); 130 | } 131 | /// 132 | /// 拍照 133 | /// 134 | /// 要保存bmp文件的路径 135 | public void GrabImage(IntPtr hWndC, string path) 136 | { 137 | IntPtr hBmp = Marshal.StringToHGlobalAnsi(path); 138 | VideoAPI.SendMessage(lwndC, VideoAPI.WM_CAP_SAVEDIB, 0, hBmp.ToInt32()); 139 | } 140 | public void StarKinescope(string path) 141 | { 142 | strFileName = path; 143 | string dir = path.Remove(path.LastIndexOf("\\")); 144 | if (!File.Exists(dir)) 145 | { 146 | Directory.CreateDirectory(dir); 147 | } 148 | int hBmp = Marshal.StringToHGlobalAnsi(path).ToInt32(); 149 | bool b = VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_FILE_SET_CAPTURE_FILE, 0, hBmp); 150 | b = VideoAPI.SendMessage(this.lwndC, VideoAPI.WM_CAP_SEQUENCE, 0, 0); 151 | } 152 | /// 153 | /// 停止录像 154 | /// 155 | public void StopKinescope() 156 | { 157 | VideoAPI.SendMessage(lwndC, VideoAPI.WM_CAP_STOP, 0, 0); 158 | } 159 | private void FrameCallback(IntPtr lwnd, IntPtr lpvhdr) 160 | { 161 | VideoAPI.VIDEOHDR videoHeader = new VideoAPI.VIDEOHDR(); 162 | byte[] VideoData; 163 | videoHeader = (VideoAPI.VIDEOHDR)VideoAPI.GetStructure(lpvhdr, videoHeader); 164 | VideoData = new byte[videoHeader.dwBytesUsed]; 165 | VideoAPI.Copy(videoHeader.lpData, VideoData); 166 | if (this.RecievedFrame != null) 167 | this.RecievedFrame(VideoData); 168 | } 169 | private Thread myThread; 170 | 171 | public void CompressVideoFfmpeg() 172 | { 173 | //myThread = new Thread(new ThreadStart(testfn)); 174 | //myThread.Start(); 175 | testfn(); 176 | } 177 | private void testfn() // 压缩视频 178 | { 179 | string file_name = strFileName; 180 | string command_line = " -i " + file_name + " -vcodec libx264 -cqp 25 -y " + file_name.Replace(".avi", "_264") + ".avi"; 181 | System.Diagnostics.Process proc = new System.Diagnostics.Process(); 182 | proc.StartInfo.WorkingDirectory = Application.StartupPath; 183 | proc.StartInfo.UseShellExecute = false; //use false if you want to hide the window 184 | proc.StartInfo.CreateNoWindow = true; 185 | proc.StartInfo.FileName = "ffmpeg"; 186 | proc.StartInfo.Arguments = command_line; 187 | proc.Start(); 188 | proc.WaitForExit(); 189 | proc.Close(); 190 | 191 | // 删除原始avi文件 192 | FileInfo file = new FileInfo(file_name); 193 | if (file.Exists) 194 | { 195 | try 196 | { 197 | file.Delete(); //删除单个文件 198 | } 199 | catch (Exception e) 200 | { 201 | Console.Write("删除视频文件“" + file_name + "”出错!" + e.Message); 202 | } 203 | } 204 | //myThread.Abort(); 205 | } 206 | 207 | //////////////////////如何使用////////////////////// 208 | /// 209 | /// 210 | /// 211 | /// 212 | /// 213 | //private void VedioForm_Load(object sender, EventArgs e) 214 | //{ 215 | // var currentDir = 216 | // new FileInfo(Uri.UnescapeDataString(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath)); 217 | // var appPath = currentDir.DirectoryName; 218 | 219 | // Video video = new Video(picCapture.Handle, 640, 480); 220 | 221 | // //打开视频 222 | // video.StartWebCam(320, 240); 223 | // //开始录像 224 | // video.StarKinescope(System.IO.Path.Combine(appPath, System.DateTime.Now.ToString("yyyy-MM-dd(HH.mm.ss)") + ".avi")); 225 | // //停止录像 226 | // video.StopKinescope(); 227 | // //压缩(压缩效率还是很低,不要用于实际开发) 228 | // //video.CompressVideoFfmpeg(); 229 | //} 230 | } 231 | } 232 | -------------------------------------------------------------------------------- /FFmpegSharp/lib-list.txt: -------------------------------------------------------------------------------- 1 | if you want build this project, 2 | please donwload ffmpeg first. 3 | 4 | for x32 build with: 5 | http://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-20141117-git-3f07dd6-win32-shared.7z 6 | 7 | for x64 build withd: 8 | http://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-20141117-git-3f07dd6-win64-shared.7z 9 | 10 | after extract the files, copy the contents of the 'bin' folder to the path '/external/ffmpeg/x32(or x64)/' -------------------------------------------------------------------------------- /FFmpegSharp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## The project is going to solve what kind of problems? 3 | 4 | In c# with FFmpeg to record camera vedio and push its file stream to RTMP Server and we use VLC media player to play the network-stream. 5 | 6 | ![Live-Vedio](https://github.com/BoonyaCSharp-ASP/VedioFFmpegPushRTMP/raw/master/SampleApp/Images/a.png) 7 | 8 | 9 | 10 | ## Push a file to RTMP Server 11 | ``` 12 | Network.Create() 13 | .WithSource(inputPath) 14 | .WithDest("rtmp://192.168.10.12/live/stream") 15 | .WithFilter(new X264Filter{ConstantQuantizer = 20}) 16 | .WithFilter(new ResizeFilter(980,550)) 17 | .Push(); 18 | ``` 19 | 20 | 21 | ### FFmpegLib 22 | if you want build this project, 23 | please donwload ffmpeg lib first. 24 | 25 | for x32 build with: 26 | http://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-20141117-git-3f07dd6-win32-shared.7z 27 | 28 | for x64 build withd: 29 | http://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-20141117-git-3f07dd6-win64-shared.7z 30 | 31 | after extract the files, copy the contents of the 'bin' folder to the path '/external/ffmpeg/x32(or x64)/' 32 | 33 | 34 | ### By owner License 35 | 36 | [License by ower](https://github.com/at0717/FFmpegSharp/blob/master/LICENSE) 37 | 38 | 39 | ## Nginx-RTMP server configuration 40 | nginx.conf 41 | ``` 42 | worker_processes 1; 43 | 44 | #error_log logs/error.log; 45 | #error_log logs/error.log notice; 46 | #error_log logs/error.log info; 47 | 48 | #pid logs/nginx.pid; 49 | 50 | 51 | events { 52 | worker_connections 1024; 53 | } 54 | 55 | rtmp { 56 | 57 | server { 58 | 59 | listen 1935; #监听的端口 60 | 61 | chunk_size 4000; 62 | 63 | 64 | application video { 65 | play /usr/local/data/video; 66 | } 67 | 68 | application live{ #第一处添加的直播字段 69 | live on; 70 | } 71 | } 72 | } 73 | 74 | 75 | http { 76 | include mime.types; 77 | default_type application/octet-stream; 78 | 79 | #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 80 | # '$status $body_bytes_sent "$http_referer" ' 81 | # '"$http_user_agent" "$http_x_forwarded_for"'; 82 | 83 | #access_log logs/access.log main; 84 | 85 | sendfile on; 86 | #tcp_nopush on; 87 | 88 | #keepalive_timeout 0; 89 | keepalive_timeout 65; 90 | 91 | #gzip on; 92 | 93 | server { 94 | listen 1990; 95 | server_name 172.16.20.10; 96 | 97 | #charset koi8-r; 98 | 99 | #access_log logs/host.access.log main; 100 | 101 | location / { 102 | root /usr/share/nginx/html; 103 | index index.html index.htm; 104 | } 105 | 106 | location /stat { #第二处添加的location字段。 107 | rtmp_stat all; 108 | rtmp_stat_stylesheet stat.xsl; 109 | } 110 | 111 | location /stat.xsl { #第二处添加的location字段。 112 | root /usr/local/nginx-rtmp-module/; 113 | } 114 | 115 | #error_page 404 /404.html; 116 | 117 | # redirect server error pages to the static page /50x.html 118 | # 119 | error_page 500 502 503 504 /50x.html; 120 | location = /50x.html { 121 | root html; 122 | } 123 | 124 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 125 | # 126 | #location ~ \.php$ { 127 | # proxy_pass http://127.0.0.1; 128 | #} 129 | 130 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 131 | # 132 | #location ~ \.php$ { 133 | # root html; 134 | # fastcgi_pass 127.0.0.1:9000; 135 | # fastcgi_index index.php; 136 | # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 137 | # include fastcgi_params; 138 | #} 139 | 140 | # deny access to .htaccess files, if Apache's document root 141 | # concurs with nginx's one 142 | # 143 | #location ~ /\.ht { 144 | # deny all; 145 | #} 146 | } 147 | 148 | 149 | # another virtual host using mix of IP-, name-, and port-based configuration 150 | # 151 | #server { 152 | # listen 8000; 153 | # listen somename:8080; 154 | # server_name somename alias another.alias; 155 | 156 | # location / { 157 | # root html; 158 | # index index.html index.htm; 159 | # } 160 | #} 161 | 162 | 163 | # HTTPS server 164 | # 165 | #server { 166 | # listen 443 ssl; 167 | # server_name localhost; 168 | 169 | # ssl_certificate cert.pem; 170 | # ssl_certificate_key cert.key; 171 | 172 | # ssl_session_cache shared:SSL:1m; 173 | # ssl_session_timeout 5m; 174 | 175 | # ssl_ciphers HIGH:!aNULL:!MD5; 176 | # ssl_prefer_server_ciphers on; 177 | 178 | # location / { 179 | # root html; 180 | # index index.html index.htm; 181 | # } 182 | #} 183 | 184 | } 185 | ``` 186 | Live server address looks like: rtmp://host:1935/live 187 | -------------------------------------------------------------------------------- /SampleApp/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SampleApp/Directshow/DsDevice.cs: -------------------------------------------------------------------------------- 1 | /****************************************************** 2 | DirectShow .NET 3 | netmaster@swissonline.ch 4 | *******************************************************/ 5 | // DsDevice 6 | // enumerate directshow devices and moniker handling 7 | 8 | 9 | using System; 10 | using System.Collections; 11 | using System.Runtime.InteropServices; 12 | 13 | namespace SampleApp.Directshow 14 | { 15 | 16 | [ComVisible(false)] 17 | public class DsDev 18 | { 19 | 20 | public static bool GetDevicesOfCat(Guid cat, out ArrayList devs) 21 | { 22 | devs = null; 23 | int hr; 24 | object comObj = null; 25 | ICreateDevEnum enumDev = null; 26 | UCOMIEnumMoniker enumMon = null; 27 | UCOMIMoniker[] mon = new UCOMIMoniker[1]; 28 | try 29 | { 30 | Type srvType = Type.GetTypeFromCLSID(Clsid.SystemDeviceEnum); 31 | if (srvType == null) 32 | throw new NotImplementedException("System Device Enumerator"); 33 | 34 | comObj = Activator.CreateInstance(srvType); 35 | enumDev = (ICreateDevEnum)comObj; 36 | hr = enumDev.CreateClassEnumerator(ref cat, out enumMon, 0); 37 | if (hr != 0) 38 | throw new NotSupportedException("No devices of the category"); 39 | 40 | int f, count = 0; 41 | do 42 | { 43 | hr = enumMon.Next(1, mon, out f); 44 | if ((hr != 0) || (mon[0] == null)) 45 | break; 46 | DsDevice dev = new DsDevice(); 47 | dev.Name = GetFriendlyName(mon[0]); 48 | if (devs == null) 49 | devs = new ArrayList(); 50 | dev.Mon = mon[0]; mon[0] = null; 51 | devs.Add(dev); dev = null; 52 | count++; 53 | } 54 | while (true); 55 | 56 | return count > 0; 57 | } 58 | catch (Exception) 59 | { 60 | if (devs != null) 61 | { 62 | foreach (DsDevice d in devs) 63 | d.Dispose(); 64 | devs = null; 65 | } 66 | return false; 67 | } 68 | finally 69 | { 70 | enumDev = null; 71 | if (mon[0] != null) 72 | Marshal.ReleaseComObject(mon[0]); mon[0] = null; 73 | if (enumMon != null) 74 | Marshal.ReleaseComObject(enumMon); enumMon = null; 75 | if (comObj != null) 76 | Marshal.ReleaseComObject(comObj); comObj = null; 77 | } 78 | 79 | } 80 | 81 | private static string GetFriendlyName(UCOMIMoniker mon) 82 | { 83 | object bagObj = null; 84 | IPropertyBag bag = null; 85 | try 86 | { 87 | Guid bagId = typeof(IPropertyBag).GUID; 88 | mon.BindToStorage(null, null, ref bagId, out bagObj); 89 | bag = (IPropertyBag)bagObj; 90 | object val = ""; 91 | int hr = bag.Read("FriendlyName", ref val, IntPtr.Zero); 92 | if (hr != 0) 93 | Marshal.ThrowExceptionForHR(hr); 94 | string ret = val as string; 95 | if ((ret == null) || (ret.Length < 1)) 96 | throw new NotImplementedException("Device FriendlyName"); 97 | return ret; 98 | } 99 | catch (Exception) 100 | { 101 | return null; 102 | } 103 | finally 104 | { 105 | bag = null; 106 | if (bagObj != null) 107 | Marshal.ReleaseComObject(bagObj); bagObj = null; 108 | } 109 | } 110 | } 111 | 112 | 113 | [ComVisible(false)] 114 | public class DsDevice : IDisposable 115 | { 116 | public string Name; 117 | public UCOMIMoniker Mon; 118 | 119 | public void Dispose() 120 | { 121 | if (Mon != null) 122 | Marshal.ReleaseComObject(Mon); Mon = null; 123 | } 124 | } 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | [ComVisible(true), ComImport, 133 | Guid("29840822-5B84-11D0-BD3B-00A0C911CE86"), 134 | InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 135 | public interface ICreateDevEnum 136 | { 137 | [PreserveSig] 138 | int CreateClassEnumerator( 139 | [In] ref Guid pType, 140 | [Out] out UCOMIEnumMoniker ppEnumMoniker, 141 | [In] int dwFlags); 142 | } 143 | 144 | 145 | 146 | [ComVisible(true), ComImport, 147 | Guid("55272A00-42CB-11CE-8135-00AA004BB851"), 148 | InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 149 | public interface IPropertyBag 150 | { 151 | [PreserveSig] 152 | int Read( 153 | [In, MarshalAs(UnmanagedType.LPWStr)] string pszPropName, 154 | [In, Out, MarshalAs(UnmanagedType.Struct)] ref object pVar, 155 | IntPtr pErrorLog); 156 | 157 | [PreserveSig] 158 | int Write( 159 | [In, MarshalAs(UnmanagedType.LPWStr)] string pszPropName, 160 | [In, MarshalAs(UnmanagedType.Struct)] ref object pVar); 161 | } 162 | 163 | 164 | 165 | 166 | } // namespace DShowNET.Device 167 | -------------------------------------------------------------------------------- /SampleApp/Directshow/DsUuids.cs: -------------------------------------------------------------------------------- 1 | /****************************************************** 2 | DirectShow .NET 3 | netmaster@swissonline.ch 4 | *******************************************************/ 5 | // UUIDs from uuids.h 6 | 7 | using System; 8 | using System.Runtime.InteropServices; 9 | 10 | namespace SampleApp.Directshow 11 | { 12 | 13 | 14 | [ComVisible(false)] 15 | public class FilterCategory // uuids.h : CLSID_* 16 | { 17 | /// CLSID_AudioInputDeviceCategory, audio capture category 18 | public static readonly Guid AudioInputDevice = new Guid( 0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x00,0xa0,0xc9,0x11,0xce,0x86 ); 19 | 20 | /// CLSID_VideoInputDeviceCategory, video capture category 21 | public static readonly Guid VideoInputDevice = new Guid( 0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86 ); 22 | } 23 | 24 | 25 | 26 | [ComVisible(false)] 27 | public class Clsid // uuids.h : CLSID_* 28 | { 29 | /// CLSID_SystemDeviceEnum for ICreateDevEnum 30 | public static readonly Guid SystemDeviceEnum = new Guid( 0x62BE5D10,0x60EB,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86 ); 31 | 32 | /// CLSID_FilterGraph, filter Graph 33 | public static readonly Guid FilterGraph = new Guid( 0xe436ebb3, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 34 | 35 | /// CLSID_CaptureGraphBuilder2, new Capture graph building 36 | public static readonly Guid CaptureGraphBuilder2 = new Guid( 0xBF87B6E1, 0x8C27, 0x11d0, 0xB3, 0xF0, 0x0, 0xAA, 0x00, 0x37, 0x61, 0xC5 ); 37 | 38 | /// CLSID_SampleGrabber, Sample Grabber filter 39 | public static readonly Guid SampleGrabber = new Guid( 0xC1F400A0, 0x3F08, 0x11D3, 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37 ); 40 | 41 | /// CLSID_DvdGraphBuilder, DVD graph builder 42 | public static readonly Guid DvdGraphBuilder = new Guid( 0xFCC152B7, 0xF372, 0x11d0, 0x8E, 0x00, 0x00, 0xC0, 0x4F, 0xD7, 0xC0, 0x8B ); 43 | 44 | } 45 | 46 | 47 | 48 | [ComVisible(false)] 49 | public class MediaType // MEDIATYPE_* 50 | { 51 | /// MEDIATYPE_Video 'vids' 52 | public static readonly Guid Video = new Guid( 0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 53 | 54 | /// MEDIATYPE_Interleaved 'iavs' 55 | public static readonly Guid Interleaved = new Guid( 0x73766169, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 56 | 57 | /// MEDIATYPE_Audio 'auds' 58 | public static readonly Guid Audio = new Guid( 0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 59 | 60 | /// MEDIATYPE_Text 'txts' 61 | public static readonly Guid Text = new Guid( 0x73747874, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 62 | 63 | /// MEDIATYPE_Stream 64 | public static readonly Guid Stream = new Guid( 0xe436eb83, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 65 | } 66 | 67 | [ComVisible(false)] 68 | public class MediaSubType // MEDIASUBTYPE_* 69 | { 70 | /// MEDIASUBTYPE_YUYV 'YUYV' 71 | public static readonly Guid YUYV = new Guid( 0x56595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 72 | 73 | /// MEDIASUBTYPE_IYUV 'IYUV' 74 | public static readonly Guid IYUV = new Guid( 0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 75 | 76 | /// MEDIASUBTYPE_DVSD 'DVSD' 77 | public static readonly Guid DVSD = new Guid( 0x44535644, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); 78 | 79 | /// MEDIASUBTYPE_RGB1 'RGB1' 80 | public static readonly Guid RGB1 = new Guid( 0xe436eb78, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 81 | 82 | /// MEDIASUBTYPE_RGB4 'RGB4' 83 | public static readonly Guid RGB4 = new Guid( 0xe436eb79, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 84 | 85 | /// MEDIASUBTYPE_RGB8 'RGB8' 86 | public static readonly Guid RGB8 = new Guid( 0xe436eb7a, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 87 | 88 | /// MEDIASUBTYPE_RGB565 'RGB565' 89 | public static readonly Guid RGB565 = new Guid( 0xe436eb7b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 90 | 91 | /// MEDIASUBTYPE_RGB555 'RGB555' 92 | public static readonly Guid RGB555 = new Guid( 0xe436eb7c, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 93 | 94 | /// MEDIASUBTYPE_RGB24 'RGB24' 95 | public static readonly Guid RGB24 = new Guid( 0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 96 | 97 | /// MEDIASUBTYPE_RGB32 'RGB32' 98 | public static readonly Guid RGB32 = new Guid( 0xe436eb7e, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 99 | 100 | 101 | /// MEDIASUBTYPE_Avi 102 | public static readonly Guid Avi = new Guid( 0xe436eb88, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); 103 | 104 | /// MEDIASUBTYPE_Asf 105 | public static readonly Guid Asf = new Guid( 0x3db80f90, 0x9412, 0x11d1, 0xad, 0xed, 0x0, 0x0, 0xf8, 0x75, 0x4b, 0x99 ); 106 | } 107 | 108 | 109 | [ComVisible(false)] 110 | public class FormatType // FORMAT_* 111 | { 112 | /// FORMAT_None 113 | public static readonly Guid None = new Guid( 0x0F6417D6, 0xc318, 0x11d0, 0xa4, 0x3f, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96 ); 114 | 115 | /// FORMAT_VideoInfo 116 | public static readonly Guid VideoInfo = new Guid( 0x05589f80, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a ); 117 | 118 | /// FORMAT_VideoInfo2 119 | public static readonly Guid VideoInfo2 = new Guid( 0xf72a76A0, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba ); 120 | 121 | /// FORMAT_WaveFormatEx 122 | public static readonly Guid WaveEx = new Guid( 0x05589f81, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a ); 123 | 124 | /// FORMAT_MPEGVideo 125 | public static readonly Guid MpegVideo = new Guid( 0x05589f82, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a ); 126 | 127 | /// FORMAT_MPEGStreams 128 | public static readonly Guid MpegStreams = new Guid( 0x05589f83, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a ); 129 | 130 | /// FORMAT_DvInfo 131 | public static readonly Guid DvInfo = new Guid( 0x05589f84, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a ); 132 | } 133 | 134 | 135 | 136 | 137 | [ComVisible(false)] 138 | public class PinCategory // PIN_CATEGORY_* 139 | { 140 | /// PIN_CATEGORY_CAPTURE 141 | public static readonly Guid Capture = new Guid( 0xfb6c4281, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba ); 142 | 143 | /// PIN_CATEGORY_PREVIEW 144 | public static readonly Guid Preview = new Guid( 0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba ); 145 | } 146 | 147 | 148 | 149 | } // namespace DShowNET 150 | -------------------------------------------------------------------------------- /SampleApp/Images/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boonya-csharp/VedioFFmpegPushRTMP/dcabf17af06d4f867a9f5efaa2cabf6efb233785/SampleApp/Images/a.png -------------------------------------------------------------------------------- /SampleApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using FFmpegSharp.Codes; 7 | using FFmpegSharp.Executor; 8 | using FFmpegSharp.Filters; 9 | using FFmpegSharp.Media; 10 | using System.Diagnostics; 11 | using FFmpegSharp.Utils; 12 | 13 | namespace SampleApp 14 | { 15 | class Program 16 | { 17 | static void Main(string[] args) 18 | { 19 | var currentDir = 20 | new FileInfo(Uri.UnescapeDataString(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath)); 21 | var appPath = currentDir.DirectoryName; 22 | 23 | if (string.IsNullOrWhiteSpace(appPath)) 24 | throw new ApplicationException("app path not found."); 25 | 26 | var inputPath = Path.Combine(appPath, "Surrender.MP4");//需要推流的视频 27 | var outputPath = Path.Combine(appPath, Guid.NewGuid().ToString());//视频读取之后的缓存地址 28 | var image = Path.Combine(appPath, "logo.png"); 29 | 30 | //Console.WriteLine("开始推流中..."); 31 | 32 | //Console.WriteLine("正在点播中..."); 33 | Console.WriteLine("正在直播中..."); 34 | 35 | 36 | #region 视频编码方法格式转换(**已注释**) 37 | //视频编码 38 | //Encoder.Create() 39 | // .WidthInput(inputPath) 40 | // .WithFilter(new X264Filter { Preset = X264Preset.Faster, ConstantQuantizer = 18 }) 41 | // .WithFilter(new ImageWatermarkFilter(image, WatermarkPosition.TopRight)) 42 | // .WithFilter(new ResizeFilter(Resolution.X720P)) 43 | // .WithFilter(new SnapshotFilter(Path.Combine(appPath, "output", "output.png"), 320, 180, 10))//with snapshot 44 | // .To(outputPath)//编码完成之后保存的地址 45 | // .Execute(); 46 | 47 | #endregion 48 | 49 | 50 | 51 | 52 | #region RTMP推流(**已成功推流至服务器,推流本地视频**) 53 | //Network.Create() 54 | // .WithSource(inputPath)//inputPath可以改成获取设备的视频流 55 | // .WithDest("rtmp://192.168.61.128/live/livestream")//可以根据自己的需求更新RTMP服务器地址 56 | // .WithFilter(new X264Filter { ConstantQuantizer = 20 }) 57 | // .WithFilter(new ResizeFilter(Resolution.X360P)) 58 | // .Push(); 59 | 60 | #endregion 61 | 62 | 63 | #region RTMP推流(**自动获取设备并推流至服务器**) 64 | Network.Create() 65 | .WithSource("Directshow")//inputPath可以改成获取设备的视频流 66 | // .WithDest("rtmp://192.168.61.128/live/livestream")//可以根据自己的需求更新RTMP服务器地址 67 | .WithDest("rtmp://172.16.20.10:1935/live") 68 | .WithFilter(new X264Filter { ConstantQuantizer = 20 }) 69 | .WithFilter(new ResizeFilter(Resolution.X720P)) 70 | .Push(); 71 | 72 | #endregion 73 | 74 | 75 | 76 | 77 | 78 | #region 从RTMP服务器接收流(录屏功能,支持以后需要播放) 79 | 80 | //Network.Create() 81 | // .WithSource("rtmp://192.168.61.128/live/livestream")//inputPath可以改成获取设备的视频流 82 | // .WithDest(inputPath)//这个路径可以自由更改,如果是直播就不需要使用这个路径,直接读取流至播放器播放实时接收即可。 83 | // .WithFilter(new X264Filter { ConstantQuantizer = 20 }) 84 | // .WithFilter(new ResizeFilter(Resolution.X720P)) 85 | // .Pull(); 86 | 87 | 88 | 89 | //var ffPlay = Path.Combine(AssemblyDirectory, "ffplay.exe"); 90 | //Process.Start(ffPlay, "rtmp://192.168.61.128/live/livestream"); 91 | 92 | #endregion 93 | Console.WriteLine("直播结束.\n 按任意键进行退出!"); 94 | 95 | 96 | //测试声音设备录音 97 | //Devices参考 http://www.ffmpeg.org/ffmpeg-devices.html 98 | Recorder.Start("Microphone", "C://test.avi"); 99 | 100 | Console.ReadKey(); 101 | } 102 | 103 | 104 | //public static string AssemblyDirectory 105 | //{ 106 | // get 107 | // { 108 | // string codeBase = Assembly.GetExecutingAssembly().CodeBase; 109 | // var uri = new UriBuilder(codeBase); 110 | // string path = Uri.UnescapeDataString(uri.Path); 111 | // return Path.GetDirectoryName(path); 112 | // } 113 | //} 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /SampleApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("SampleApp")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("Microsoft")] 8 | [assembly: AssemblyProduct("SampleApp")] 9 | [assembly: AssemblyCopyright("Copyright © Microsoft 2014")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | [assembly: ComVisible(false)] 13 | [assembly: Guid("3baf27ab-11ac-467c-ad98-d81b88770c4c")] 14 | [assembly: AssemblyVersion("1.0.0.0")] 15 | [assembly: AssemblyFileVersion("1.0.0.0")] 16 | -------------------------------------------------------------------------------- /SampleApp/SampleApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {499A0AE4-485D-46B5-B194-36108523502B} 8 | Exe 9 | Properties 10 | SampleApp 11 | SampleApp 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | False 37 | bin\Debug\DShowNET.dll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {f6c4359b-766e-40ee-820c-fa7865cac400} 61 | FFmpegSharp 62 | 63 | 64 | 65 | 66 | 67 | PreserveNewest 68 | 69 | 70 | 71 | 72 | 79 | -------------------------------------------------------------------------------- /SampleApp/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boonya-csharp/VedioFFmpegPushRTMP/dcabf17af06d4f867a9f5efaa2cabf6efb233785/SampleApp/logo.png -------------------------------------------------------------------------------- /VedioFFmpegPushRTMP.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FFmpegSharp", "FFmpegSharp\FFmpegSharp.csproj", "{F6C4359B-766E-40EE-820C-FA7865CAC400}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp", "SampleApp\SampleApp.csproj", "{499A0AE4-485D-46B5-B194-36108523502B}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {F6C4359B-766E-40EE-820C-FA7865CAC400}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {F6C4359B-766E-40EE-820C-FA7865CAC400}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {F6C4359B-766E-40EE-820C-FA7865CAC400}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {F6C4359B-766E-40EE-820C-FA7865CAC400}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {499A0AE4-485D-46B5-B194-36108523502B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {499A0AE4-485D-46B5-B194-36108523502B}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {499A0AE4-485D-46B5-B194-36108523502B}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {499A0AE4-485D-46B5-B194-36108523502B}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {8C6ABDA1-B7CF-4589-B2B9-16478CF4E989} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /licenses/bzip2.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------- 3 | 4 | This program, "bzip2", the associated library "libbzip2", and all 5 | documentation, are copyright (C) 1996-2010 Julian R Seward. All 6 | rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions 10 | are met: 11 | 12 | 1. Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | 15 | 2. The origin of this software must not be misrepresented; you must 16 | not claim that you wrote the original software. If you use this 17 | software in a product, an acknowledgment in the product 18 | documentation would be appreciated but is not required. 19 | 20 | 3. Altered source versions must be plainly marked as such, and must 21 | not be misrepresented as being the original software. 22 | 23 | 4. The name of the author may not be used to endorse or promote 24 | products derived from this software without specific prior written 25 | permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 28 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 33 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 34 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 36 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 37 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | Julian Seward, jseward@bzip.org 40 | bzip2/libbzip2 version 1.0.6 of 6 September 2010 41 | 42 | -------------------------------------------------------------------------- 43 | -------------------------------------------------------------------------------- /licenses/fontconfig.txt: -------------------------------------------------------------------------------- 1 | fontconfig/COPYING 2 | 3 | Copyright © 2000,2001,2002,2003,2004,2006,2007 Keith Packard 4 | Copyright © 2005 Patrick Lam 5 | Copyright © 2009 Roozbeh Pournader 6 | Copyright © 2008,2009 Red Hat, Inc. 7 | Copyright © 2008 Danilo Šegan 8 | 9 | 10 | Permission to use, copy, modify, distribute, and sell this software and its 11 | documentation for any purpose is hereby granted without fee, provided that 12 | the above copyright notice appear in all copies and that both that 13 | copyright notice and this permission notice appear in supporting 14 | documentation, and that the name of the author(s) not be used in 15 | advertising or publicity pertaining to distribution of the software without 16 | specific, written prior permission. The authors make no 17 | representations about the suitability of this software for any purpose. It 18 | is provided "as is" without express or implied warranty. 19 | 20 | THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 21 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 22 | EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR 23 | CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 24 | DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 25 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 26 | PERFORMANCE OF THIS SOFTWARE. 27 | 28 | -------------------------------------------------------------------------------- /licenses/freetype.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boonya-csharp/VedioFFmpegPushRTMP/dcabf17af06d4f867a9f5efaa2cabf6efb233785/licenses/freetype.txt -------------------------------------------------------------------------------- /licenses/libass.txt: -------------------------------------------------------------------------------- 1 | Permission to use, copy, modify, and/or distribute this software for any 2 | purpose with or without fee is hereby granted, provided that the above 3 | copyright notice and this permission notice appear in all copies. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 6 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 7 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 8 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 9 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 10 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 11 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 12 | -------------------------------------------------------------------------------- /licenses/libcaca.txt: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 14 rue de Plaisance, 75014 Paris, France 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /licenses/libgsm.txt: -------------------------------------------------------------------------------- 1 | Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, 2 | Technische Universitaet Berlin 3 | 4 | Any use of this software is permitted provided that this notice is not 5 | removed and that neither the authors nor the Technische Universitaet Berlin 6 | are deemed to have made any representations as to the suitability of this 7 | software for any purpose nor are held responsible for any defects of 8 | this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. 9 | 10 | As a matter of courtesy, the authors request to be informed about uses 11 | this software has found, about bugs in this software, and about any 12 | improvements that may be of general interest. 13 | 14 | Berlin, 28.11.1994 15 | Jutta Degener 16 | Carsten Bormann 17 | 18 | oOo 19 | 20 | Since the original terms of 15 years ago maybe do not make our 21 | intentions completely clear given today's refined usage of the legal 22 | terms, we append this additional permission: 23 | 24 | Permission to use, copy, modify, and distribute this software 25 | for any purpose with or without fee is hereby granted, 26 | provided that this notice is not removed and that neither 27 | the authors nor the Technische Universitaet Berlin are 28 | deemed to have made any representations as to the suitability 29 | of this software for any purpose nor are held responsible 30 | for any defects of this software. THERE IS ABSOLUTELY NO 31 | WARRANTY FOR THIS SOFTWARE. 32 | 33 | Berkeley/Bremen, 05.04.2009 34 | Jutta Degener 35 | Carsten Bormann 36 | -------------------------------------------------------------------------------- /licenses/libilbc.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, The WebRTC project authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | * Neither the name of Google nor the names of its contributors may 16 | be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /licenses/libmodplug.txt: -------------------------------------------------------------------------------- 1 | ModPlug-XMMS and libmodplug are now in the public domain. 2 | -------------------------------------------------------------------------------- /licenses/libtheora.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2002-2009 Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /licenses/libvorbis.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2008 Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /licenses/libvpx.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, The WebM Project authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | * Neither the name of Google, nor the WebM Project, nor the names 16 | of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written 18 | permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /licenses/opencore-amr.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, and 10 | distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by the 13 | copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all other 16 | entities that control, are controlled by, or are under common control with 17 | that entity. For the purposes of this definition, "control" means (i) the 18 | power, direct or indirect, to cause the direction or management of such 19 | entity, whether by contract or otherwise, or (ii) ownership of fifty 20 | percent (50%) or more of the outstanding shares, or (iii) beneficial 21 | ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity exercising 24 | permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation source, 28 | and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical transformation 31 | or translation of a Source form, including but not limited to compiled 32 | object code, generated documentation, and conversions to other media types. 33 | 34 | "Work" shall mean the work of authorship, whether in Source or Object form, 35 | made available under the License, as indicated by a copyright notice that 36 | is included in or attached to the work (an example is provided in the 37 | Appendix below). 38 | 39 | "Derivative Works" shall mean any work, whether in Source or Object form, 40 | that is based on (or derived from) the Work and for which the editorial 41 | revisions, annotations, elaborations, or other modifications represent, as 42 | a whole, an original work of authorship. For the purposes of this License, 43 | Derivative Works shall not include works that remain separable from, or 44 | merely link (or bind by name) to the interfaces of, the Work and Derivative 45 | Works thereof. 46 | 47 | "Contribution" shall mean any work of authorship, including the original 48 | version of the Work and any modifications or additions to that Work or 49 | Derivative Works thereof, that is intentionally submitted to Licensor for 50 | inclusion in the Work by the copyright owner or by an individual or Legal 51 | Entity authorized to submit on behalf of the copyright owner. For the 52 | purposes of this definition, "submitted" means any form of electronic, 53 | verbal, or written communication sent to the Licensor or its 54 | representatives, including but not limited to communication on electronic 55 | mailing lists, source code control systems, and issue tracking systems that 56 | are managed by, or on behalf of, the Licensor for the purpose of discussing 57 | and improving the Work, but excluding communication that is conspicuously 58 | marked or otherwise designated in writing by the copyright owner as "Not a 59 | Contribution." 60 | 61 | "Contributor" shall mean Licensor and any individual or Legal Entity on 62 | behalf of whom a Contribution has been received by Licensor and 63 | subsequently incorporated within the Work. 64 | 65 | 2. Grant of Copyright License. Subject to the terms and conditions of this 66 | License, each Contributor hereby grants to You a perpetual, worldwide, 67 | non-exclusive, no-charge, royalty-free, irrevocable copyright license to 68 | reproduce, prepare Derivative Works of, publicly display, publicly perform, 69 | sublicense, and distribute the Work and such Derivative Works in Source or 70 | Object form. 71 | 72 | 3. Grant of Patent License. Subject to the terms and conditions of this 73 | License, each Contributor hereby grants to You a perpetual, worldwide, 74 | non-exclusive, no-charge, royalty-free, irrevocable (except as stated in 75 | this section) patent license to make, have made, use, offer to sell, sell, 76 | import, and otherwise transfer the Work, where such license applies only to 77 | those patent claims licensable by such Contributor that are necessarily 78 | infringed by their Contribution(s) alone or by combination of their 79 | Contribution(s) with the Work to which such Contribution(s) was submitted. 80 | If You institute patent litigation against any entity (including a 81 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a 82 | Contribution incorporated within the Work constitutes direct or 83 | contributory patent infringement, then any patent licenses granted to You 84 | under this License for that Work shall terminate as of the date such 85 | litigation is filed. 86 | 87 | 4. Redistribution. You may reproduce and distribute copies of the Work or 88 | Derivative Works thereof in any medium, with or without modifications, and 89 | in Source or Object form, provided that You meet the following conditions: 90 | 91 | 1. You must give any other recipients of the Work or Derivative Works a 92 | copy of this License; and 93 | 94 | 2. You must cause any modified files to carry prominent notices stating 95 | that You changed the files; and 96 | 97 | 3. You must retain, in the Source form of any Derivative Works that You 98 | distribute, all copyright, patent, trademark, and attribution notices from 99 | the Source form of the Work, excluding those notices that do not pertain to 100 | any part of the Derivative Works; and 101 | 102 | 4. If the Work includes a "NOTICE" text file as part of its 103 | distribution, then any Derivative Works that You distribute must include a 104 | readable copy of the attribution notices contained within such NOTICE file, 105 | excluding those notices that do not pertain to any part of the Derivative 106 | Works, in at least one of the following places: within a NOTICE text file 107 | distributed as part of the Derivative Works; within the Source form or 108 | documentation, if provided along with the Derivative Works; or, within a 109 | display generated by the Derivative Works, if and wherever such third-party 110 | notices normally appear. The contents of the NOTICE file are for 111 | informational purposes only and do not modify the License. You may add Your 112 | own attribution notices within Derivative Works that You distribute, 113 | alongside or as an addendum to the NOTICE text from the Work, provided that 114 | such additional attribution notices cannot be construed as modifying the 115 | License. 116 | 117 | You may add Your own copyright statement to Your modifications and may 118 | provide additional or different license terms and conditions for use, 119 | reproduction, or distribution of Your modifications, or for any such 120 | Derivative Works as a whole, provided Your use, reproduction, and 121 | distribution of the Work otherwise complies with the conditions stated in 122 | this License. 123 | 124 | 5. Submission of Contributions. Unless You explicitly state otherwise, any 125 | Contribution intentionally submitted for inclusion in the Work by You to 126 | the Licensor shall be under the terms and conditions of this License, 127 | without any additional terms or conditions. Notwithstanding the above, 128 | nothing herein shall supersede or modify the terms of any separate license 129 | agreement you may have executed with Licensor regarding such Contributions. 130 | 131 | 6. Trademarks. This License does not grant permission to use the trade 132 | names, trademarks, service marks, or product names of the Licensor, except 133 | as required for reasonable and customary use in describing the origin of 134 | the Work and reproducing the content of the NOTICE file. 135 | 136 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to 137 | in writing, Licensor provides the Work (and each Contributor provides its 138 | Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 139 | KIND, either express or implied, including, without limitation, any 140 | warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or 141 | FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for 142 | determining the appropriateness of using or redistributing the Work and 143 | assume any risks associated with Your exercise of permissions under this 144 | License. 145 | 146 | 8. Limitation of Liability. In no event and under no legal theory, whether 147 | in tort (including negligence), contract, or otherwise, unless required by 148 | applicable law (such as deliberate and grossly negligent acts) or agreed to 149 | in writing, shall any Contributor be liable to You for damages, including 150 | any direct, indirect, special, incidental, or consequential damages of any 151 | character arising as a result of this License or out of the use or 152 | inability to use the Work (including but not limited to damages for loss of 153 | goodwill, work stoppage, computer failure or malfunction, or any and all 154 | other commercial damages or losses), even if such Contributor has been 155 | advised of the possibility of such damages. 156 | 157 | 9. Accepting Warranty or Additional Liability. While redistributing the 158 | Work or Derivative Works thereof, You may choose to offer, and charge a fee 159 | for, acceptance of support, warranty, indemnity, or other liability 160 | obligations and/or rights consistent with this License. However, in 161 | accepting such obligations, You may act only on Your own behalf and on Your 162 | sole responsibility, not on behalf of any other Contributor, and only if 163 | You agree to indemnify, defend, and hold each Contributor harmless for any 164 | liability incurred by, or claims asserted against, such Contributor by 165 | reason of your accepting any such warranty or additional liability. 166 | 167 | END OF TERMS AND CONDITIONS 168 | 169 | APPENDIX: How to apply the Apache License to your work 170 | 171 | To apply the Apache License to your work, attach the following boilerplate 172 | notice, with the fields enclosed by brackets "[]" replaced with your own 173 | identifying information. (Don't include the brackets!) The text should be 174 | enclosed in the appropriate comment syntax for the file format. We also 175 | recommend that a file or class name and description of purpose be included 176 | on the same "printed page" as the copyright notice for easier 177 | identification within third-party archives. 178 | 179 | Copyright [yyyy] [name of copyright owner] 180 | 181 | Licensed under the Apache License, Version 2.0 (the "License"); you may 182 | not use this file except in compliance with the License. You may obtain a 183 | copy of the License at 184 | 185 | http://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable 188 | law or agreed to in writing, software distributed under the License is 189 | distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 190 | KIND, either express or implied. See the License for the specific language 191 | governing permissions and limitations under the License. 192 | -------------------------------------------------------------------------------- /licenses/openjpeg.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2012, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium 3 | * Copyright (c) 2002-2012, Professor Benoit Macq 4 | * Copyright (c) 2003-2012, Antonin Descampe 5 | * Copyright (c) 2003-2009, Francois-Olivier Devaux 6 | * Copyright (c) 2005, Herve Drolon, FreeImage Team 7 | * Copyright (c) 2002-2003, Yannick Verschueren 8 | * Copyright (c) 2001-2003, David Janssens 9 | * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France 10 | * Copyright (c) 2012, CS Systemes d'Information, France 11 | * 12 | * All rights reserved. 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * 1. Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * 2. Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in the 21 | * documentation and/or other materials provided with the distribution. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | -------------------------------------------------------------------------------- /licenses/opus.txt: -------------------------------------------------------------------------------- 1 | Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, 2 | Jean-Marc Valin, Timothy B. Terriberry, 3 | CSIRO, Gregory Maxwell, Mark Borgerding, 4 | Erik de Castro Lopo 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | - Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | - Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | - Neither the name of Internet Society, IETF or IETF Trust, nor the 18 | names of specific contributors, may be used to endorse or promote 19 | products derived from this software without specific prior written 20 | permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 26 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | 34 | Opus is subject to the royalty-free patent licenses which are 35 | specified at: 36 | 37 | Xiph.Org Foundation: 38 | https://datatracker.ietf.org/ipr/1524/ 39 | 40 | Microsoft Corporation: 41 | https://datatracker.ietf.org/ipr/1914/ 42 | 43 | Broadcom Corporation: 44 | https://datatracker.ietf.org/ipr/1526/ 45 | -------------------------------------------------------------------------------- /licenses/rtmpdump.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /licenses/soxr.txt: -------------------------------------------------------------------------------- 1 | SoX Resampler Library Copyright (c) 2007-13 robs@users.sourceforge.net 2 | 3 | This library is free software; you can redistribute it and/or modify it 4 | under the terms of the GNU Lesser General Public License as published by 5 | the Free Software Foundation; either version 2.1 of the License, or (at 6 | your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 11 | General Public License for more details. 12 | 13 | You should have received a copy of the GNU Lesser General Public License 14 | along with this library; if not, write to the Free Software Foundation, 15 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | 17 | 18 | Notes 19 | 20 | 1. Re software in the `examples' directory: works that are not resampling 21 | examples but are based on the given examples -- for example, applications using 22 | the library -- shall not be considered to be derivative works of the examples. 23 | 24 | 2. If building with pffft.c, see the licence embedded in that file. 25 | -------------------------------------------------------------------------------- /licenses/speex.txt: -------------------------------------------------------------------------------- 1 | Copyright 2002-2008 Xiph.org Foundation 2 | Copyright 2002-2008 Jean-Marc Valin 3 | Copyright 2005-2007 Analog Devices Inc. 4 | Copyright 2005-2008 Commonwealth Scientific and Industrial Research 5 | Organisation (CSIRO) 6 | Copyright 1993, 2002, 2006 David Rowe 7 | Copyright 2003 EpicGames 8 | Copyright 1992-1994 Jutta Degener, Carsten Bormann 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions 12 | are met: 13 | 14 | - Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | - Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | - Neither the name of the Xiph.org Foundation nor the names of its 22 | contributors may be used to endorse or promote products derived from 23 | this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 29 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | -------------------------------------------------------------------------------- /licenses/vid.stab.txt: -------------------------------------------------------------------------------- 1 | In this project is open source in the sense of the GPL. 2 | 3 | * This program is free software; you can redistribute it and/or modify * 4 | * it under the terms of the GNU General Public License as published by * 5 | * the Free Software Foundation; either version 2 of the License, or * 6 | * (at your option) any later version. * 7 | * * 8 | * You should have received a copy of the GNU General Public License * 9 | * along with this program; if not, write to the * 10 | * Free Software Foundation, Inc., * 11 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 12 | * * 13 | * This program is distributed in the hope that it will be useful, * 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 16 | * GNU General Public License for more details. * 17 | -------------------------------------------------------------------------------- /licenses/vo-aacenc.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, and 10 | distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by the 13 | copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all other 16 | entities that control, are controlled by, or are under common control with 17 | that entity. For the purposes of this definition, "control" means (i) the 18 | power, direct or indirect, to cause the direction or management of such 19 | entity, whether by contract or otherwise, or (ii) ownership of fifty 20 | percent (50%) or more of the outstanding shares, or (iii) beneficial 21 | ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity exercising 24 | permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation source, 28 | and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical transformation 31 | or translation of a Source form, including but not limited to compiled 32 | object code, generated documentation, and conversions to other media types. 33 | 34 | "Work" shall mean the work of authorship, whether in Source or Object form, 35 | made available under the License, as indicated by a copyright notice that 36 | is included in or attached to the work (an example is provided in the 37 | Appendix below). 38 | 39 | "Derivative Works" shall mean any work, whether in Source or Object form, 40 | that is based on (or derived from) the Work and for which the editorial 41 | revisions, annotations, elaborations, or other modifications represent, as 42 | a whole, an original work of authorship. For the purposes of this License, 43 | Derivative Works shall not include works that remain separable from, or 44 | merely link (or bind by name) to the interfaces of, the Work and Derivative 45 | Works thereof. 46 | 47 | "Contribution" shall mean any work of authorship, including the original 48 | version of the Work and any modifications or additions to that Work or 49 | Derivative Works thereof, that is intentionally submitted to Licensor for 50 | inclusion in the Work by the copyright owner or by an individual or Legal 51 | Entity authorized to submit on behalf of the copyright owner. For the 52 | purposes of this definition, "submitted" means any form of electronic, 53 | verbal, or written communication sent to the Licensor or its 54 | representatives, including but not limited to communication on electronic 55 | mailing lists, source code control systems, and issue tracking systems that 56 | are managed by, or on behalf of, the Licensor for the purpose of discussing 57 | and improving the Work, but excluding communication that is conspicuously 58 | marked or otherwise designated in writing by the copyright owner as "Not a 59 | Contribution." 60 | 61 | "Contributor" shall mean Licensor and any individual or Legal Entity on 62 | behalf of whom a Contribution has been received by Licensor and 63 | subsequently incorporated within the Work. 64 | 65 | 2. Grant of Copyright License. Subject to the terms and conditions of this 66 | License, each Contributor hereby grants to You a perpetual, worldwide, 67 | non-exclusive, no-charge, royalty-free, irrevocable copyright license to 68 | reproduce, prepare Derivative Works of, publicly display, publicly perform, 69 | sublicense, and distribute the Work and such Derivative Works in Source or 70 | Object form. 71 | 72 | 3. Grant of Patent License. Subject to the terms and conditions of this 73 | License, each Contributor hereby grants to You a perpetual, worldwide, 74 | non-exclusive, no-charge, royalty-free, irrevocable (except as stated in 75 | this section) patent license to make, have made, use, offer to sell, sell, 76 | import, and otherwise transfer the Work, where such license applies only to 77 | those patent claims licensable by such Contributor that are necessarily 78 | infringed by their Contribution(s) alone or by combination of their 79 | Contribution(s) with the Work to which such Contribution(s) was submitted. 80 | If You institute patent litigation against any entity (including a 81 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a 82 | Contribution incorporated within the Work constitutes direct or 83 | contributory patent infringement, then any patent licenses granted to You 84 | under this License for that Work shall terminate as of the date such 85 | litigation is filed. 86 | 87 | 4. Redistribution. You may reproduce and distribute copies of the Work or 88 | Derivative Works thereof in any medium, with or without modifications, and 89 | in Source or Object form, provided that You meet the following conditions: 90 | 91 | 1. You must give any other recipients of the Work or Derivative Works a 92 | copy of this License; and 93 | 94 | 2. You must cause any modified files to carry prominent notices stating 95 | that You changed the files; and 96 | 97 | 3. You must retain, in the Source form of any Derivative Works that You 98 | distribute, all copyright, patent, trademark, and attribution notices from 99 | the Source form of the Work, excluding those notices that do not pertain to 100 | any part of the Derivative Works; and 101 | 102 | 4. If the Work includes a "NOTICE" text file as part of its 103 | distribution, then any Derivative Works that You distribute must include a 104 | readable copy of the attribution notices contained within such NOTICE file, 105 | excluding those notices that do not pertain to any part of the Derivative 106 | Works, in at least one of the following places: within a NOTICE text file 107 | distributed as part of the Derivative Works; within the Source form or 108 | documentation, if provided along with the Derivative Works; or, within a 109 | display generated by the Derivative Works, if and wherever such third-party 110 | notices normally appear. The contents of the NOTICE file are for 111 | informational purposes only and do not modify the License. You may add Your 112 | own attribution notices within Derivative Works that You distribute, 113 | alongside or as an addendum to the NOTICE text from the Work, provided that 114 | such additional attribution notices cannot be construed as modifying the 115 | License. 116 | 117 | You may add Your own copyright statement to Your modifications and may 118 | provide additional or different license terms and conditions for use, 119 | reproduction, or distribution of Your modifications, or for any such 120 | Derivative Works as a whole, provided Your use, reproduction, and 121 | distribution of the Work otherwise complies with the conditions stated in 122 | this License. 123 | 124 | 5. Submission of Contributions. Unless You explicitly state otherwise, any 125 | Contribution intentionally submitted for inclusion in the Work by You to 126 | the Licensor shall be under the terms and conditions of this License, 127 | without any additional terms or conditions. Notwithstanding the above, 128 | nothing herein shall supersede or modify the terms of any separate license 129 | agreement you may have executed with Licensor regarding such Contributions. 130 | 131 | 6. Trademarks. This License does not grant permission to use the trade 132 | names, trademarks, service marks, or product names of the Licensor, except 133 | as required for reasonable and customary use in describing the origin of 134 | the Work and reproducing the content of the NOTICE file. 135 | 136 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to 137 | in writing, Licensor provides the Work (and each Contributor provides its 138 | Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 139 | KIND, either express or implied, including, without limitation, any 140 | warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or 141 | FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for 142 | determining the appropriateness of using or redistributing the Work and 143 | assume any risks associated with Your exercise of permissions under this 144 | License. 145 | 146 | 8. Limitation of Liability. In no event and under no legal theory, whether 147 | in tort (including negligence), contract, or otherwise, unless required by 148 | applicable law (such as deliberate and grossly negligent acts) or agreed to 149 | in writing, shall any Contributor be liable to You for damages, including 150 | any direct, indirect, special, incidental, or consequential damages of any 151 | character arising as a result of this License or out of the use or 152 | inability to use the Work (including but not limited to damages for loss of 153 | goodwill, work stoppage, computer failure or malfunction, or any and all 154 | other commercial damages or losses), even if such Contributor has been 155 | advised of the possibility of such damages. 156 | 157 | 9. Accepting Warranty or Additional Liability. While redistributing the 158 | Work or Derivative Works thereof, You may choose to offer, and charge a fee 159 | for, acceptance of support, warranty, indemnity, or other liability 160 | obligations and/or rights consistent with this License. However, in 161 | accepting such obligations, You may act only on Your own behalf and on Your 162 | sole responsibility, not on behalf of any other Contributor, and only if 163 | You agree to indemnify, defend, and hold each Contributor harmless for any 164 | liability incurred by, or claims asserted against, such Contributor by 165 | reason of your accepting any such warranty or additional liability. 166 | 167 | END OF TERMS AND CONDITIONS 168 | 169 | APPENDIX: How to apply the Apache License to your work 170 | 171 | To apply the Apache License to your work, attach the following boilerplate 172 | notice, with the fields enclosed by brackets "[]" replaced with your own 173 | identifying information. (Don't include the brackets!) The text should be 174 | enclosed in the appropriate comment syntax for the file format. We also 175 | recommend that a file or class name and description of purpose be included 176 | on the same "printed page" as the copyright notice for easier 177 | identification within third-party archives. 178 | 179 | Copyright [yyyy] [name of copyright owner] 180 | 181 | Licensed under the Apache License, Version 2.0 (the "License"); you may 182 | not use this file except in compliance with the License. You may obtain a 183 | copy of the License at 184 | 185 | http://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable 188 | law or agreed to in writing, software distributed under the License is 189 | distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 190 | KIND, either express or implied. See the License for the specific language 191 | governing permissions and limitations under the License. 192 | -------------------------------------------------------------------------------- /licenses/vo-amrwbenc.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, and 10 | distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by the 13 | copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all other 16 | entities that control, are controlled by, or are under common control with 17 | that entity. For the purposes of this definition, "control" means (i) the 18 | power, direct or indirect, to cause the direction or management of such 19 | entity, whether by contract or otherwise, or (ii) ownership of fifty 20 | percent (50%) or more of the outstanding shares, or (iii) beneficial 21 | ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity exercising 24 | permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation source, 28 | and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical transformation 31 | or translation of a Source form, including but not limited to compiled 32 | object code, generated documentation, and conversions to other media types. 33 | 34 | "Work" shall mean the work of authorship, whether in Source or Object form, 35 | made available under the License, as indicated by a copyright notice that 36 | is included in or attached to the work (an example is provided in the 37 | Appendix below). 38 | 39 | "Derivative Works" shall mean any work, whether in Source or Object form, 40 | that is based on (or derived from) the Work and for which the editorial 41 | revisions, annotations, elaborations, or other modifications represent, as 42 | a whole, an original work of authorship. For the purposes of this License, 43 | Derivative Works shall not include works that remain separable from, or 44 | merely link (or bind by name) to the interfaces of, the Work and Derivative 45 | Works thereof. 46 | 47 | "Contribution" shall mean any work of authorship, including the original 48 | version of the Work and any modifications or additions to that Work or 49 | Derivative Works thereof, that is intentionally submitted to Licensor for 50 | inclusion in the Work by the copyright owner or by an individual or Legal 51 | Entity authorized to submit on behalf of the copyright owner. For the 52 | purposes of this definition, "submitted" means any form of electronic, 53 | verbal, or written communication sent to the Licensor or its 54 | representatives, including but not limited to communication on electronic 55 | mailing lists, source code control systems, and issue tracking systems that 56 | are managed by, or on behalf of, the Licensor for the purpose of discussing 57 | and improving the Work, but excluding communication that is conspicuously 58 | marked or otherwise designated in writing by the copyright owner as "Not a 59 | Contribution." 60 | 61 | "Contributor" shall mean Licensor and any individual or Legal Entity on 62 | behalf of whom a Contribution has been received by Licensor and 63 | subsequently incorporated within the Work. 64 | 65 | 2. Grant of Copyright License. Subject to the terms and conditions of this 66 | License, each Contributor hereby grants to You a perpetual, worldwide, 67 | non-exclusive, no-charge, royalty-free, irrevocable copyright license to 68 | reproduce, prepare Derivative Works of, publicly display, publicly perform, 69 | sublicense, and distribute the Work and such Derivative Works in Source or 70 | Object form. 71 | 72 | 3. Grant of Patent License. Subject to the terms and conditions of this 73 | License, each Contributor hereby grants to You a perpetual, worldwide, 74 | non-exclusive, no-charge, royalty-free, irrevocable (except as stated in 75 | this section) patent license to make, have made, use, offer to sell, sell, 76 | import, and otherwise transfer the Work, where such license applies only to 77 | those patent claims licensable by such Contributor that are necessarily 78 | infringed by their Contribution(s) alone or by combination of their 79 | Contribution(s) with the Work to which such Contribution(s) was submitted. 80 | If You institute patent litigation against any entity (including a 81 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a 82 | Contribution incorporated within the Work constitutes direct or 83 | contributory patent infringement, then any patent licenses granted to You 84 | under this License for that Work shall terminate as of the date such 85 | litigation is filed. 86 | 87 | 4. Redistribution. You may reproduce and distribute copies of the Work or 88 | Derivative Works thereof in any medium, with or without modifications, and 89 | in Source or Object form, provided that You meet the following conditions: 90 | 91 | 1. You must give any other recipients of the Work or Derivative Works a 92 | copy of this License; and 93 | 94 | 2. You must cause any modified files to carry prominent notices stating 95 | that You changed the files; and 96 | 97 | 3. You must retain, in the Source form of any Derivative Works that You 98 | distribute, all copyright, patent, trademark, and attribution notices from 99 | the Source form of the Work, excluding those notices that do not pertain to 100 | any part of the Derivative Works; and 101 | 102 | 4. If the Work includes a "NOTICE" text file as part of its 103 | distribution, then any Derivative Works that You distribute must include a 104 | readable copy of the attribution notices contained within such NOTICE file, 105 | excluding those notices that do not pertain to any part of the Derivative 106 | Works, in at least one of the following places: within a NOTICE text file 107 | distributed as part of the Derivative Works; within the Source form or 108 | documentation, if provided along with the Derivative Works; or, within a 109 | display generated by the Derivative Works, if and wherever such third-party 110 | notices normally appear. The contents of the NOTICE file are for 111 | informational purposes only and do not modify the License. You may add Your 112 | own attribution notices within Derivative Works that You distribute, 113 | alongside or as an addendum to the NOTICE text from the Work, provided that 114 | such additional attribution notices cannot be construed as modifying the 115 | License. 116 | 117 | You may add Your own copyright statement to Your modifications and may 118 | provide additional or different license terms and conditions for use, 119 | reproduction, or distribution of Your modifications, or for any such 120 | Derivative Works as a whole, provided Your use, reproduction, and 121 | distribution of the Work otherwise complies with the conditions stated in 122 | this License. 123 | 124 | 5. Submission of Contributions. Unless You explicitly state otherwise, any 125 | Contribution intentionally submitted for inclusion in the Work by You to 126 | the Licensor shall be under the terms and conditions of this License, 127 | without any additional terms or conditions. Notwithstanding the above, 128 | nothing herein shall supersede or modify the terms of any separate license 129 | agreement you may have executed with Licensor regarding such Contributions. 130 | 131 | 6. Trademarks. This License does not grant permission to use the trade 132 | names, trademarks, service marks, or product names of the Licensor, except 133 | as required for reasonable and customary use in describing the origin of 134 | the Work and reproducing the content of the NOTICE file. 135 | 136 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to 137 | in writing, Licensor provides the Work (and each Contributor provides its 138 | Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 139 | KIND, either express or implied, including, without limitation, any 140 | warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or 141 | FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for 142 | determining the appropriateness of using or redistributing the Work and 143 | assume any risks associated with Your exercise of permissions under this 144 | License. 145 | 146 | 8. Limitation of Liability. In no event and under no legal theory, whether 147 | in tort (including negligence), contract, or otherwise, unless required by 148 | applicable law (such as deliberate and grossly negligent acts) or agreed to 149 | in writing, shall any Contributor be liable to You for damages, including 150 | any direct, indirect, special, incidental, or consequential damages of any 151 | character arising as a result of this License or out of the use or 152 | inability to use the Work (including but not limited to damages for loss of 153 | goodwill, work stoppage, computer failure or malfunction, or any and all 154 | other commercial damages or losses), even if such Contributor has been 155 | advised of the possibility of such damages. 156 | 157 | 9. Accepting Warranty or Additional Liability. While redistributing the 158 | Work or Derivative Works thereof, You may choose to offer, and charge a fee 159 | for, acceptance of support, warranty, indemnity, or other liability 160 | obligations and/or rights consistent with this License. However, in 161 | accepting such obligations, You may act only on Your own behalf and on Your 162 | sole responsibility, not on behalf of any other Contributor, and only if 163 | You agree to indemnify, defend, and hold each Contributor harmless for any 164 | liability incurred by, or claims asserted against, such Contributor by 165 | reason of your accepting any such warranty or additional liability. 166 | 167 | END OF TERMS AND CONDITIONS 168 | 169 | APPENDIX: How to apply the Apache License to your work 170 | 171 | To apply the Apache License to your work, attach the following boilerplate 172 | notice, with the fields enclosed by brackets "[]" replaced with your own 173 | identifying information. (Don't include the brackets!) The text should be 174 | enclosed in the appropriate comment syntax for the file format. We also 175 | recommend that a file or class name and description of purpose be included 176 | on the same "printed page" as the copyright notice for easier 177 | identification within third-party archives. 178 | 179 | Copyright [yyyy] [name of copyright owner] 180 | 181 | Licensed under the Apache License, Version 2.0 (the "License"); you may 182 | not use this file except in compliance with the License. You may obtain a 183 | copy of the License at 184 | 185 | http://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable 188 | law or agreed to in writing, software distributed under the License is 189 | distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 190 | KIND, either express or implied. See the License for the specific language 191 | governing permissions and limitations under the License. 192 | -------------------------------------------------------------------------------- /licenses/wavpack.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 1998 - 2009 Conifer Software 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Conifer Software nor the names of its contributors 13 | may be used to endorse or promote products derived from this software 14 | without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /licenses/zlib.txt: -------------------------------------------------------------------------------- 1 | /* zlib.h -- interface of the 'zlib' general purpose compression library 2 | version 1.2.7, May 2nd, 2012 3 | 4 | Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler 5 | 6 | This software is provided 'as-is', without any express or implied 7 | warranty. In no event will the authors be held liable for any damages 8 | arising from the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, 11 | including commercial applications, and to alter it and redistribute it 12 | freely, subject to the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software 16 | in a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 3. This notice may not be removed or altered from any source distribution. 21 | 22 | Jean-loup Gailly Mark Adler 23 | jloup@gzip.org madler@alumni.caltech.edu 24 | 25 | */ 26 | 27 | --------------------------------------------------------------------------------