ソースを参照

zhao:上传

ZhangXueYang
耀 3年前
コミット
d9a1650869
100個のファイルの変更243481行の追加0行の削除
  1. 110
    0
      Common/AESHelper.cs
  2. 160
    0
      Common/Common.csproj
  3. 174
    0
      Common/Model/DownloadInfoModel.cs
  4. 39
    0
      Common/Properties/AssemblyInfo.cs
  5. バイナリ
      Common/dlls/ICSharpCode.SharpZipLib.dll
  6. バイナリ
      Common/dlls/NPOI.OOXML.dll
  7. バイナリ
      Common/dlls/NPOI.OpenXml4Net.dll
  8. バイナリ
      Common/dlls/NPOI.OpenXmlFormats.dll
  9. バイナリ
      Common/dlls/NPOI.dll
  10. バイナリ
      Common/dlls/Newtonsoft.Json.dll
  11. 9144
    0
      Common/dlls/Newtonsoft.Json.xml
  12. バイナリ
      Common/dlls/System.Data.SQLite.dll
  13. バイナリ
      Common/dlls/TStudy.DigitalPen.dll
  14. バイナリ
      Common/dlls/TStudyDigitalPen.dll
  15. バイナリ
      Common/dlls/TStudyDigitalPenInter.dll
  16. バイナリ
      Common/dlls/TStudyDigitalPenLic.dll
  17. バイナリ
      Common/dlls/ZYD_SDK_USB.dll
  18. バイナリ
      Common/dlls/log4net.dll
  19. 31814
    0
      Common/dlls/log4net.xml
  20. 674
    0
      Common/ffmpeg/LICENSE.txt
  21. 108
    0
      Common/ffmpeg/README.txt
  22. 5
    0
      Common/ffmpeg/doc/bootstrap.min.css
  23. 165
    0
      Common/ffmpeg/doc/default.css
  24. 976
    0
      Common/ffmpeg/doc/developer.html
  25. 839
    0
      Common/ffmpeg/doc/faq.html
  26. 339
    0
      Common/ffmpeg/doc/fate.html
  27. 50550
    0
      Common/ffmpeg/doc/ffmpeg-all.html
  28. 916
    0
      Common/ffmpeg/doc/ffmpeg-bitstream-filters.html
  29. 6084
    0
      Common/ffmpeg/doc/ffmpeg-codecs.html
  30. 2461
    0
      Common/ffmpeg/doc/ffmpeg-devices.html
  31. 30410
    0
      Common/ffmpeg/doc/ffmpeg-filters.html
  32. 4368
    0
      Common/ffmpeg/doc/ffmpeg-formats.html
  33. 2160
    0
      Common/ffmpeg/doc/ffmpeg-protocols.html
  34. 372
    0
      Common/ffmpeg/doc/ffmpeg-resampler.html
  35. 267
    0
      Common/ffmpeg/doc/ffmpeg-scaler.html
  36. 1500
    0
      Common/ffmpeg/doc/ffmpeg-utils.html
  37. 2729
    0
      Common/ffmpeg/doc/ffmpeg.html
  38. 41224
    0
      Common/ffmpeg/doc/ffplay-all.html
  39. 859
    0
      Common/ffmpeg/doc/ffplay.html
  40. 41564
    0
      Common/ffmpeg/doc/ffprobe-all.html
  41. 1199
    0
      Common/ffmpeg/doc/ffprobe.html
  42. 1262
    0
      Common/ffmpeg/doc/general.html
  43. 519
    0
      Common/ffmpeg/doc/git-howto.html
  44. 84
    0
      Common/ffmpeg/doc/libavcodec.html
  45. 81
    0
      Common/ffmpeg/doc/libavdevice.html
  46. 80
    0
      Common/ffmpeg/doc/libavfilter.html
  47. 84
    0
      Common/ffmpeg/doc/libavformat.html
  48. 103
    0
      Common/ffmpeg/doc/libavutil.html
  49. 106
    0
      Common/ffmpeg/doc/libswresample.html
  50. 99
    0
      Common/ffmpeg/doc/libswscale.html
  51. 502
    0
      Common/ffmpeg/doc/mailing-list-faq.html
  52. 219
    0
      Common/ffmpeg/doc/nut.html
  53. 406
    0
      Common/ffmpeg/doc/platform.html
  54. 23
    0
      Common/ffmpeg/doc/style.min.css
  55. 393
    0
      Common/ffmpeg/presets/ffprobe.xsd
  56. 19
    0
      Common/ffmpeg/presets/libvpx-1080p.ffpreset
  57. 19
    0
      Common/ffmpeg/presets/libvpx-1080p50_60.ffpreset
  58. 18
    0
      Common/ffmpeg/presets/libvpx-360p.ffpreset
  59. 19
    0
      Common/ffmpeg/presets/libvpx-720p.ffpreset
  60. 19
    0
      Common/ffmpeg/presets/libvpx-720p50_60.ffpreset
  61. 52
    0
      Common/log4net.config
  62. 10
    0
      Common/packages.config
  63. 508
    0
      Common/system/BlackboardNew.cs
  64. 701
    0
      Common/system/CLeopardZip.cs
  65. 148
    0
      Common/system/CameraHelper.cs
  66. 36
    0
      Common/system/DataConvertCommon.cs
  67. 48
    0
      Common/system/DataProvider.cs
  68. 411
    0
      Common/system/DownloadManager.cs
  69. 237
    0
      Common/system/DownloadService.cs
  70. 1316
    0
      Common/system/FFMpeg.cs
  71. 982
    0
      Common/system/FileToolsCommon.cs
  72. 60
    0
      Common/system/FreeMemoryHelper.cs
  73. 631
    0
      Common/system/HttpHelper.cs
  74. 938
    0
      Common/system/ImageHelper.cs
  75. 65
    0
      Common/system/JsonHelper.cs
  76. 208
    0
      Common/system/KeyboardHookCommon.cs
  77. 25
    0
      Common/system/LogHelper.cs
  78. 95
    0
      Common/system/MouseEventCommon.cs
  79. 88
    0
      Common/system/PdfTrunImage.cs
  80. 166
    0
      Common/system/PrimaryScreen.cs
  81. 92
    0
      Common/system/QueueSync.cs
  82. 104
    0
      Common/system/SplashScreen.cs
  83. 192
    0
      Common/system/XmlUtilHelper.cs
  84. 94
    0
      Common/system/ZJClippingBorder.cs
  85. 15
    0
      XHZB.Desktop/App.config
  86. 393
    0
      XHZB.Desktop/App.cs
  87. 9
    0
      XHZB.Desktop/App.xaml
  88. 17
    0
      XHZB.Desktop/App.xaml.cs
  89. 12
    0
      XHZB.Desktop/MainWindow.xaml
  90. 32
    0
      XHZB.Desktop/MainWindow.xaml.cs
  91. 37
    0
      XHZB.Desktop/MessageWindow.xaml
  92. 147
    0
      XHZB.Desktop/MessageWindow.xaml.cs
  93. 55
    0
      XHZB.Desktop/Properties/AssemblyInfo.cs
  94. 70
    0
      XHZB.Desktop/Properties/Resources.Designer.cs
  95. 117
    0
      XHZB.Desktop/Properties/Resources.resx
  96. 29
    0
      XHZB.Desktop/Properties/Settings.Designer.cs
  97. 7
    0
      XHZB.Desktop/Properties/Settings.settings
  98. 69
    0
      XHZB.Desktop/Properties/app.manifest
  99. バイナリ
      XHZB.Desktop/SSCR/Setup Screen Capturer Recorder v0.12.10.exe
  100. 0
    0
      XHZB.Desktop/XHZB.Desktop.csproj

+ 110
- 0
Common/AESHelper.cs ファイルの表示

@@ -0,0 +1,110 @@
1
+using System;
2
+using System.Security.Cryptography;
3
+using System.Text;
4
+
5
+namespace Common
6
+{
7
+    /// <summary>
8
+    /// AES加密
9
+    /// 创建人:赵耀
10
+    /// 创建时间:2020年9月7日
11
+    /// </summary>
12
+    public class AESHelper
13
+    {
14
+        public static string QrcodeLoginKey = "zyyxhlywkdatakey";
15
+
16
+        /// <summary>
17
+        /// AES 加密
18
+        /// </summary>
19
+        /// <param name="content">Need encrypted string</param>
20
+        /// <returns>Encrypted 16 hex string</returns>
21
+        public static string AESEncrypt(string Data)
22
+        {
23
+            string key = QrcodeLoginKey.PadRight(16, '0');
24
+            // 256-AES key      
25
+            byte[] keyArray = UTF8Encoding.ASCII.GetBytes(key);
26
+            byte[] toEncryptArray = UTF8Encoding.ASCII.GetBytes(Data);
27
+
28
+            RijndaelManaged rDel = new RijndaelManaged
29
+            {
30
+                Key = keyArray,
31
+                Mode = CipherMode.ECB,
32
+                Padding = PaddingMode.PKCS7
33
+            };
34
+
35
+            ICryptoTransform cTransform = rDel.CreateEncryptor();
36
+            byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0,
37
+                    toEncryptArray.Length);
38
+
39
+            return BytesToHexString(resultArray);
40
+        }
41
+
42
+        /// <summary>
43
+        /// AES 解密
44
+        /// </summary>
45
+        /// <param name="hexString">Encrypted 16 hex string</param>
46
+        /// <returns>Decrypted string</returns>
47
+        public static string AESDecrypt(string hexString)
48
+        {
49
+            string key = QrcodeLoginKey.PadRight(16, '0');
50
+            // 256-AES key      
51
+            byte[] keyArray = UTF8Encoding.ASCII.GetBytes(key);
52
+            byte[] toEncryptArray = HexStringToBytes(hexString);
53
+
54
+            RijndaelManaged rDel = new RijndaelManaged
55
+            {
56
+                Key = keyArray,
57
+                Mode = CipherMode.ECB,
58
+                Padding = PaddingMode.PKCS7
59
+            };
60
+
61
+            ICryptoTransform cTransform = rDel.CreateDecryptor();
62
+            byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0,
63
+                    toEncryptArray.Length);
64
+
65
+            return UTF8Encoding.ASCII.GetString(resultArray);
66
+        }
67
+
68
+        /// <summary>
69
+        /// Byte array to convert 16 hex string
70
+        /// </summary>
71
+        /// <param name="bytes">byte array</param>
72
+        /// <returns>16 hex string</returns>
73
+        public static string BytesToHexString(byte[] bytes)
74
+        {
75
+            StringBuilder returnStr = new StringBuilder();
76
+            if (bytes != null || bytes.Length == 0)
77
+            {
78
+                for (int i = 0; i < bytes.Length; i++)
79
+                {
80
+                    returnStr.Append(bytes[i].ToString("X2"));
81
+                }
82
+            }
83
+            return returnStr.ToString();
84
+        }
85
+
86
+        /// <summary>
87
+        /// 16 hex string converted to byte array
88
+        /// </summary>
89
+        /// <param name="hexString">16 hex string</param>
90
+        /// <returns>byte array</returns>
91
+        public static byte[] HexStringToBytes(string hexString)
92
+        {
93
+            if (hexString == null || hexString.Equals(""))
94
+            {
95
+                return null;
96
+            }
97
+            int length = hexString.Length / 2;
98
+            if (hexString.Length % 2 != 0)
99
+            {
100
+                return null;
101
+            }
102
+            byte[] d = new byte[length];
103
+            for (int i = 0; i < length; i++)
104
+            {
105
+                d[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
106
+            }
107
+            return d;
108
+        }
109
+    }
110
+}

+ 160
- 0
Common/Common.csproj ファイルの表示

@@ -0,0 +1,160 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{808A7075-5AF5-46B3-8EF6-514C0B5FA8D7}</ProjectGuid>
8
+    <OutputType>Library</OutputType>
9
+    <AppDesignerFolder>Properties</AppDesignerFolder>
10
+    <RootNamespace>Common</RootNamespace>
11
+    <AssemblyName>Common</AssemblyName>
12
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13
+    <FileAlignment>512</FileAlignment>
14
+    <Deterministic>true</Deterministic>
15
+  </PropertyGroup>
16
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17
+    <DebugSymbols>true</DebugSymbols>
18
+    <DebugType>full</DebugType>
19
+    <Optimize>false</Optimize>
20
+    <OutputPath>bin\Debug\</OutputPath>
21
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
22
+    <ErrorReport>prompt</ErrorReport>
23
+    <WarningLevel>4</WarningLevel>
24
+  </PropertyGroup>
25
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26
+    <DebugType>pdbonly</DebugType>
27
+    <Optimize>true</Optimize>
28
+    <OutputPath>bin\Release\</OutputPath>
29
+    <DefineConstants>TRACE</DefineConstants>
30
+    <ErrorReport>prompt</ErrorReport>
31
+    <WarningLevel>4</WarningLevel>
32
+  </PropertyGroup>
33
+  <ItemGroup>
34
+    <Reference Include="AForge, Version=2.2.5.0, Culture=neutral, PublicKeyToken=c1db6ff4eaa06aeb, processorArchitecture=MSIL">
35
+      <HintPath>..\packages\AForge.2.2.5\lib\AForge.dll</HintPath>
36
+    </Reference>
37
+    <Reference Include="AForge.Controls, Version=2.2.5.0, Culture=neutral, PublicKeyToken=a8ac264d1dc6b9d9, processorArchitecture=MSIL">
38
+      <HintPath>..\packages\AForge.Controls.2.2.5\lib\AForge.Controls.dll</HintPath>
39
+    </Reference>
40
+    <Reference Include="AForge.Imaging, Version=2.2.5.0, Culture=neutral, PublicKeyToken=ba8ddea9676ca48b, processorArchitecture=MSIL">
41
+      <HintPath>..\packages\AForge.Imaging.2.2.5\lib\AForge.Imaging.dll</HintPath>
42
+    </Reference>
43
+    <Reference Include="AForge.Math, Version=2.2.5.0, Culture=neutral, PublicKeyToken=abba2e25397ee8c9, processorArchitecture=MSIL">
44
+      <HintPath>..\packages\AForge.Math.2.2.5\lib\AForge.Math.dll</HintPath>
45
+    </Reference>
46
+    <Reference Include="AForge.Video, Version=2.2.5.0, Culture=neutral, PublicKeyToken=cbfb6e07d173c401, processorArchitecture=MSIL">
47
+      <HintPath>..\packages\AForge.Video.2.2.5\lib\AForge.Video.dll</HintPath>
48
+    </Reference>
49
+    <Reference Include="AForge.Video.DirectShow, Version=2.2.5.0, Culture=neutral, PublicKeyToken=61ea4348d43881b7, processorArchitecture=MSIL">
50
+      <HintPath>..\packages\AForge.Video.DirectShow.2.2.5\lib\AForge.Video.DirectShow.dll</HintPath>
51
+    </Reference>
52
+    <Reference Include="ICSharpCode.SharpZipLib">
53
+      <HintPath>dlls\ICSharpCode.SharpZipLib.dll</HintPath>
54
+    </Reference>
55
+    <Reference Include="log4net">
56
+      <HintPath>dlls\log4net.dll</HintPath>
57
+    </Reference>
58
+    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
59
+      <SpecificVersion>False</SpecificVersion>
60
+      <HintPath>dlls\Newtonsoft.Json.dll</HintPath>
61
+    </Reference>
62
+    <Reference Include="NPOI">
63
+      <HintPath>dlls\NPOI.dll</HintPath>
64
+    </Reference>
65
+    <Reference Include="NPOI.OOXML">
66
+      <HintPath>dlls\NPOI.OOXML.dll</HintPath>
67
+    </Reference>
68
+    <Reference Include="NPOI.OpenXml4Net">
69
+      <HintPath>dlls\NPOI.OpenXml4Net.dll</HintPath>
70
+    </Reference>
71
+    <Reference Include="NPOI.OpenXmlFormats">
72
+      <HintPath>dlls\NPOI.OpenXmlFormats.dll</HintPath>
73
+    </Reference>
74
+    <Reference Include="O2S.Components.PDFRender4NET">
75
+      <HintPath>..\dl\O2S.Components.PDFRender4NET.dll</HintPath>
76
+    </Reference>
77
+    <Reference Include="PresentationCore" />
78
+    <Reference Include="PresentationFramework" />
79
+    <Reference Include="System" />
80
+    <Reference Include="System.Configuration" />
81
+    <Reference Include="System.Core" />
82
+    <Reference Include="System.Data.SQLite">
83
+      <HintPath>dlls\System.Data.SQLite.dll</HintPath>
84
+    </Reference>
85
+    <Reference Include="System.Drawing" />
86
+    <Reference Include="System.Web" />
87
+    <Reference Include="System.Windows.Forms" />
88
+    <Reference Include="System.Xml.Linq" />
89
+    <Reference Include="System.Data.DataSetExtensions" />
90
+    <Reference Include="Microsoft.CSharp" />
91
+    <Reference Include="System.Data" />
92
+    <Reference Include="System.Net.Http" />
93
+    <Reference Include="System.Xml" />
94
+    <Reference Include="VisioForge.Controls, Version=12.0.56.0, Culture=neutral, PublicKeyToken=5873e863f1bcda5d, processorArchitecture=MSIL">
95
+      <HintPath>..\packages\VisioForge.DotNet.Core.TRIAL.12.0.56\lib\net45\VisioForge.Controls.dll</HintPath>
96
+    </Reference>
97
+    <Reference Include="VisioForge.Controls.UI, Version=12.0.56.0, Culture=neutral, PublicKeyToken=eafa6bd21aa991fd, processorArchitecture=MSIL">
98
+      <HintPath>..\packages\VisioForge.DotNet.Core.TRIAL.12.0.56\lib\net45\VisioForge.Controls.UI.dll</HintPath>
99
+    </Reference>
100
+    <Reference Include="VisioForge.Controls.UI.Dialogs, Version=12.0.56.0, Culture=neutral, PublicKeyToken=3d84672df68c33ac, processorArchitecture=MSIL">
101
+      <HintPath>..\packages\VisioForge.DotNet.Core.TRIAL.12.0.56\lib\net45\VisioForge.Controls.UI.Dialogs.dll</HintPath>
102
+    </Reference>
103
+    <Reference Include="VisioForge.MediaFramework, Version=12.0.56.0, Culture=neutral, PublicKeyToken=14e66dd726c53f11, processorArchitecture=MSIL">
104
+      <HintPath>..\packages\VisioForge.DotNet.Core.TRIAL.12.0.56\lib\net45\VisioForge.MediaFramework.dll</HintPath>
105
+    </Reference>
106
+    <Reference Include="VisioForge.Shared, Version=12.0.56.0, Culture=neutral, PublicKeyToken=4cb7f6778cad43a2, processorArchitecture=MSIL">
107
+      <HintPath>..\packages\VisioForge.DotNet.Core.TRIAL.12.0.56\lib\net45\VisioForge.Shared.dll</HintPath>
108
+    </Reference>
109
+    <Reference Include="VisioForge.Tools, Version=12.0.56.0, Culture=neutral, PublicKeyToken=33c6ded9724deec2, processorArchitecture=MSIL">
110
+      <HintPath>..\packages\VisioForge.DotNet.Core.TRIAL.12.0.56\lib\net45\VisioForge.Tools.dll</HintPath>
111
+    </Reference>
112
+    <Reference Include="VisioForge.Types, Version=12.0.56.0, Culture=neutral, PublicKeyToken=722de1c1c0a7f49e, processorArchitecture=MSIL">
113
+      <HintPath>..\packages\VisioForge.DotNet.Core.TRIAL.12.0.56\lib\net45\VisioForge.Types.dll</HintPath>
114
+    </Reference>
115
+    <Reference Include="WindowsBase" />
116
+    <Reference Include="WindowsFormsIntegration" />
117
+  </ItemGroup>
118
+  <ItemGroup>
119
+    <Compile Include="AESHelper.cs" />
120
+    <Compile Include="Model\DownloadInfoModel.cs" />
121
+    <Compile Include="system\DataProvider.cs" />
122
+    <Compile Include="system\KeyboardHookCommon.cs" />
123
+    <Compile Include="system\MouseEventCommon.cs" />
124
+    <Compile Include="system\PdfTrunImage.cs" />
125
+    <Compile Include="system\BlackboardNew.cs" />
126
+    <Compile Include="system\CameraHelper.cs" />
127
+    <Compile Include="system\CLeopardZip.cs" />
128
+    <Compile Include="system\DataConvertCommon.cs" />
129
+    <Compile Include="system\DownloadManager.cs" />
130
+    <Compile Include="system\DownloadService.cs" />
131
+    <Compile Include="system\FFMpeg.cs" />
132
+    <Compile Include="system\FileToolsCommon.cs" />
133
+    <Compile Include="system\FreeMemoryHelper.cs" />
134
+    <Compile Include="system\HttpHelper.cs" />
135
+    <Compile Include="system\ImageHelper.cs" />
136
+    <Compile Include="system\JsonHelper.cs" />
137
+    <Compile Include="system\LogHelper.cs" />
138
+    <Compile Include="system\PrimaryScreen.cs" />
139
+    <Compile Include="Properties\AssemblyInfo.cs" />
140
+    <Compile Include="system\SplashScreen.cs" />
141
+    <Compile Include="system\XmlUtilHelper.cs" />
142
+    <Compile Include="system\ZJClippingBorder.cs" />
143
+  </ItemGroup>
144
+  <ItemGroup>
145
+    <Folder Include="dlls\" />
146
+  </ItemGroup>
147
+  <ItemGroup>
148
+    <None Include="log4net.config">
149
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
150
+    </None>
151
+    <None Include="packages.config" />
152
+  </ItemGroup>
153
+  <ItemGroup>
154
+    <ProjectReference Include="..\XHWK.Model\XHWK.Model.csproj">
155
+      <Project>{445A4527-849B-4FA9-AA97-8ED1098D211E}</Project>
156
+      <Name>XHWK.Model</Name>
157
+    </ProjectReference>
158
+  </ItemGroup>
159
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
160
+</Project>

+ 174
- 0
Common/Model/DownloadInfoModel.cs ファイルの表示

@@ -0,0 +1,174 @@
1
+using System.Collections.Generic;
2
+
3
+namespace Common.Model
4
+{
5
+    /// <summary>
6
+    /// 下载模型
7
+    /// 创建人:赵耀
8
+    /// 创建时间:2018年10月30日
9
+    /// </summary>
10
+    public class DownloadInfoModel
11
+    {
12
+        /// <summary>
13
+        /// 子线程数量
14
+        /// </summary>
15
+        private int _taskCount = 1;
16
+
17
+        /// <summary>
18
+        /// 子线程数量
19
+        /// </summary>
20
+        public int taskCount
21
+        {
22
+            get => _taskCount;
23
+            set => _taskCount = value;
24
+        }
25
+        /// <summary>
26
+        /// 保存的临时文件名
27
+        /// </summary>
28
+        public string tempFileName { get; set; }
29
+        /// <summary>
30
+        /// 是否是新任务,如果不是新任务则通过配置去分配线程
31
+        /// 一开始要设为true,在初始化完成后会被设为true,此时可以对这个 DownloadInfo 进行序列化后保存,进而实现退出程序加载配置继续下载。
32
+        /// </summary>
33
+        private bool _isNewTask = true;
34
+
35
+        /// <summary>
36
+        /// 是否是新任务,如果不是新任务则通过配置去分配线程
37
+        /// 一开始要设为true,在初始化完成后会被设为true,此时可以对这个 DownloadInfo 进行序列化后保存,进而实现退出程序加载配置继续下载。
38
+        /// </summary>
39
+        public bool isNewTask
40
+        {
41
+            get => _isNewTask;
42
+            set => _isNewTask = value;
43
+        }
44
+        /// <summary>
45
+        /// 是否重新下载
46
+        /// </summary>
47
+        private bool _isReStart = false;
48
+
49
+        /// <summary>
50
+        /// 是否重新下载
51
+        /// </summary>
52
+        public bool isReStart
53
+        {
54
+            get => _isReStart;
55
+            set => _isReStart = value;
56
+        }
57
+        /// <summary>
58
+        /// 任务总大小
59
+        /// </summary>
60
+        public long count { get; set; }
61
+        /// <summary>
62
+        /// 保存的目录
63
+        /// </summary>
64
+        public string saveDir { get; set; }
65
+        /// <summary>
66
+        /// 请求方法
67
+        /// </summary>
68
+        private string _method = "get";
69
+
70
+        /// <summary>
71
+        /// 请求方法
72
+        /// </summary>
73
+        public string method
74
+        {
75
+            get => _method;
76
+            set => _method = value;
77
+        }
78
+        /// <summary>
79
+        /// 文件名
80
+        /// </summary>
81
+        public string fileName { get; set; }
82
+
83
+        public List<string> _downloadUrlList;
84
+        /// <summary>
85
+        /// 下载地址,
86
+        /// 这里是列表形式,如果同一个文件有不同来源则可以通过不同来源取数据
87
+        /// 来源的有消息需另外判断
88
+        /// </summary>
89
+        public List<string> downloadUrlList
90
+        {
91
+            get => _downloadUrlList;
92
+
93
+            set
94
+            {
95
+                List<string> UTF8ValueList = new List<string>();
96
+                foreach (string val in value)
97
+                {
98
+                    string path = val.Substring(0, val.LastIndexOf("/") + 1);
99
+                    string name = val.Substring(val.LastIndexOf("/") + 1);
100
+                    string UTF8Name = System.Web.HttpUtility.UrlEncode(name);
101
+                    string UTF8Url = path + UTF8Name;
102
+                    UTF8ValueList.Add(UTF8Url);
103
+                    _downloadUrlList = UTF8ValueList;
104
+                }
105
+                ;
106
+            }
107
+        }
108
+        /// <summary>
109
+        /// 是否支持断点续传
110
+        /// 在任务开始后,如果需要暂停,应先通过这个判断是否支持
111
+        /// 默认设为false
112
+        /// </summary>
113
+        private bool _IsSupportMultiThreading = false;
114
+        /// <summary>
115
+        /// 是否支持断点续传
116
+        /// 在任务开始后,如果需要暂停,应先通过这个判断是否支持
117
+        /// 默认设为false
118
+        /// </summary>
119
+        public bool IsSupportMultiThreading
120
+        {
121
+            get => _IsSupportMultiThreading;
122
+            set => _IsSupportMultiThreading = value;
123
+        }
124
+        /// <summary>
125
+        /// 线程任务列表
126
+        /// </summary>
127
+        public List<TaskInfoModel> TaskInfoList { get; set; }
128
+        /// <summary>
129
+        /// 保存文件名
130
+        /// </summary>
131
+        public string saveFileName { get; set; }
132
+    }
133
+
134
+    /// <summary>
135
+    /// 任务模型
136
+    /// </summary>
137
+    public class TaskInfoModel
138
+    {
139
+        /// <summary>
140
+        /// 请求方法
141
+        /// </summary>
142
+        public string method { get; set; }
143
+        public string downloadUrl { get; set; }
144
+        public string filePath { get; set; }
145
+        /// <summary>
146
+        /// 分片起点
147
+        /// </summary>
148
+        public long fromIndex { get; set; }
149
+        /// <summary>
150
+        /// 分片终点
151
+        /// </summary>
152
+        public long toIndex { get; set; }
153
+        /// <summary>
154
+        /// 分片的总大小
155
+        /// </summary>
156
+        public long count => toIndex - fromIndex + 1;
157
+    }
158
+
159
+    /// <summary>
160
+    /// 解压书模型
161
+    /// </summary>
162
+    public class BookDecompressionModel
163
+    {
164
+        /// <summary>
165
+        /// 书的文件名
166
+        /// </summary>
167
+        public string BookFileName { get; set; }
168
+
169
+        /// <summary>
170
+        /// 解压书籍的控件
171
+        /// </summary>
172
+        public object UcBookCover { get; set; }
173
+    }
174
+}

+ 39
- 0
Common/Properties/AssemblyInfo.cs ファイルの表示

@@ -0,0 +1,39 @@
1
+using System.Reflection;
2
+using System.Runtime.InteropServices;
3
+
4
+// 有关程序集的一般信息由以下
5
+// 控制。更改这些特性值可修改
6
+// 与程序集关联的信息。
7
+[assembly: AssemblyTitle("Common")]
8
+[assembly: AssemblyDescription("")]
9
+[assembly: AssemblyConfiguration("")]
10
+[assembly: AssemblyCompany("")]
11
+[assembly: AssemblyProduct("Common")]
12
+[assembly: AssemblyCopyright("Copyright ©  2020")]
13
+[assembly: AssemblyTrademark("")]
14
+[assembly: AssemblyCulture("")]
15
+
16
+// 将 ComVisible 设置为 false 会使此程序集中的类型
17
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
18
+//请将此类型的 ComVisible 特性设置为 true。
19
+[assembly: ComVisible(false)]
20
+
21
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
22
+[assembly: Guid("808a7075-5af5-46b3-8ef6-514c0b5fa8d7")]
23
+
24
+// 程序集的版本信息由下列四个值组成: 
25
+//
26
+//      主版本
27
+//      次版本
28
+//      生成号
29
+//      修订号
30
+//
31
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
32
+//通过使用 "*",如下所示:
33
+// [assembly: AssemblyVersion("1.0.*")]
34
+[assembly: AssemblyVersion("1.0.0.0")]
35
+[assembly: AssemblyFileVersion("1.0.0.0")]
36
+
37
+//Log4Net
38
+//[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
39
+[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", ConfigFileExtension = "config", Watch = true)]

バイナリ
Common/dlls/ICSharpCode.SharpZipLib.dll ファイルの表示


バイナリ
Common/dlls/NPOI.OOXML.dll ファイルの表示


バイナリ
Common/dlls/NPOI.OpenXml4Net.dll ファイルの表示


バイナリ
Common/dlls/NPOI.OpenXmlFormats.dll ファイルの表示


バイナリ
Common/dlls/NPOI.dll ファイルの表示


バイナリ
Common/dlls/Newtonsoft.Json.dll ファイルの表示


+ 9144
- 0
Common/dlls/Newtonsoft.Json.xml
ファイル差分が大きすぎるため省略します
ファイルの表示


バイナリ
Common/dlls/System.Data.SQLite.dll ファイルの表示


バイナリ
Common/dlls/TStudy.DigitalPen.dll ファイルの表示


バイナリ
Common/dlls/TStudyDigitalPen.dll ファイルの表示


バイナリ
Common/dlls/TStudyDigitalPenInter.dll ファイルの表示


バイナリ
Common/dlls/TStudyDigitalPenLic.dll ファイルの表示


バイナリ
Common/dlls/ZYD_SDK_USB.dll ファイルの表示


バイナリ
Common/dlls/log4net.dll ファイルの表示


+ 31814
- 0
Common/dlls/log4net.xml
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 674
- 0
Common/ffmpeg/LICENSE.txt ファイルの表示

@@ -0,0 +1,674 @@
1
+                    GNU GENERAL PUBLIC LICENSE
2
+                       Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+                            Preamble
9
+
10
+  The GNU General Public License is a free, copyleft license for
11
+software and other kinds of works.
12
+
13
+  The licenses for most software and other practical works are designed
14
+to take away your freedom to share and change the works.  By contrast,
15
+the GNU General Public License is intended to guarantee your freedom to
16
+share and change all versions of a program--to make sure it remains free
17
+software for all its users.  We, the Free Software Foundation, use the
18
+GNU General Public License for most of our software; it applies also to
19
+any other work released this way by its authors.  You can apply it to
20
+your programs, too.
21
+
22
+  When we speak of free software, we are referring to freedom, not
23
+price.  Our General Public Licenses are designed to make sure that you
24
+have the freedom to distribute copies of free software (and charge for
25
+them if you wish), that you receive source code or can get it if you
26
+want it, that you can change the software or use pieces of it in new
27
+free programs, and that you know you can do these things.
28
+
29
+  To protect your rights, we need to prevent others from denying you
30
+these rights or asking you to surrender the rights.  Therefore, you have
31
+certain responsibilities if you distribute copies of the software, or if
32
+you modify it: responsibilities to respect the freedom of others.
33
+
34
+  For example, if you distribute copies of such a program, whether
35
+gratis or for a fee, you must pass on to the recipients the same
36
+freedoms that you received.  You must make sure that they, too, receive
37
+or can get the source code.  And you must show them these terms so they
38
+know their rights.
39
+
40
+  Developers that use the GNU GPL protect your rights with two steps:
41
+(1) assert copyright on the software, and (2) offer you this License
42
+giving you legal permission to copy, distribute and/or modify it.
43
+
44
+  For the developers' and authors' protection, the GPL clearly explains
45
+that there is no warranty for this free software.  For both users' and
46
+authors' sake, the GPL requires that modified versions be marked as
47
+changed, so that their problems will not be attributed erroneously to
48
+authors of previous versions.
49
+
50
+  Some devices are designed to deny users access to install or run
51
+modified versions of the software inside them, although the manufacturer
52
+can do so.  This is fundamentally incompatible with the aim of
53
+protecting users' freedom to change the software.  The systematic
54
+pattern of such abuse occurs in the area of products for individuals to
55
+use, which is precisely where it is most unacceptable.  Therefore, we
56
+have designed this version of the GPL to prohibit the practice for those
57
+products.  If such problems arise substantially in other domains, we
58
+stand ready to extend this provision to those domains in future versions
59
+of the GPL, as needed to protect the freedom of users.
60
+
61
+  Finally, every program is threatened constantly by software patents.
62
+States should not allow patents to restrict development and use of
63
+software on general-purpose computers, but in those that do, we wish to
64
+avoid the special danger that patents applied to a free program could
65
+make it effectively proprietary.  To prevent this, the GPL assures that
66
+patents cannot be used to render the program non-free.
67
+
68
+  The precise terms and conditions for copying, distribution and
69
+modification follow.
70
+
71
+                       TERMS AND CONDITIONS
72
+
73
+  0. Definitions.
74
+
75
+  "This License" refers to version 3 of the GNU General Public License.
76
+
77
+  "Copyright" also means copyright-like laws that apply to other kinds of
78
+works, such as semiconductor masks.
79
+
80
+  "The Program" refers to any copyrightable work licensed under this
81
+License.  Each licensee is addressed as "you".  "Licensees" and
82
+"recipients" may be individuals or organizations.
83
+
84
+  To "modify" a work means to copy from or adapt all or part of the work
85
+in a fashion requiring copyright permission, other than the making of an
86
+exact copy.  The resulting work is called a "modified version" of the
87
+earlier work or a work "based on" the earlier work.
88
+
89
+  A "covered work" means either the unmodified Program or a work based
90
+on the Program.
91
+
92
+  To "propagate" a work means to do anything with it that, without
93
+permission, would make you directly or secondarily liable for
94
+infringement under applicable copyright law, except executing it on a
95
+computer or modifying a private copy.  Propagation includes copying,
96
+distribution (with or without modification), making available to the
97
+public, and in some countries other activities as well.
98
+
99
+  To "convey" a work means any kind of propagation that enables other
100
+parties to make or receive copies.  Mere interaction with a user through
101
+a computer network, with no transfer of a copy, is not conveying.
102
+
103
+  An interactive user interface displays "Appropriate Legal Notices"
104
+to the extent that it includes a convenient and prominently visible
105
+feature that (1) displays an appropriate copyright notice, and (2)
106
+tells the user that there is no warranty for the work (except to the
107
+extent that warranties are provided), that licensees may convey the
108
+work under this License, and how to view a copy of this License.  If
109
+the interface presents a list of user commands or options, such as a
110
+menu, a prominent item in the list meets this criterion.
111
+
112
+  1. Source Code.
113
+
114
+  The "source code" for a work means the preferred form of the work
115
+for making modifications to it.  "Object code" means any non-source
116
+form of a work.
117
+
118
+  A "Standard Interface" means an interface that either is an official
119
+standard defined by a recognized standards body, or, in the case of
120
+interfaces specified for a particular programming language, one that
121
+is widely used among developers working in that language.
122
+
123
+  The "System Libraries" of an executable work include anything, other
124
+than the work as a whole, that (a) is included in the normal form of
125
+packaging a Major Component, but which is not part of that Major
126
+Component, and (b) serves only to enable use of the work with that
127
+Major Component, or to implement a Standard Interface for which an
128
+implementation is available to the public in source code form.  A
129
+"Major Component", in this context, means a major essential component
130
+(kernel, window system, and so on) of the specific operating system
131
+(if any) on which the executable work runs, or a compiler used to
132
+produce the work, or an object code interpreter used to run it.
133
+
134
+  The "Corresponding Source" for a work in object code form means all
135
+the source code needed to generate, install, and (for an executable
136
+work) run the object code and to modify the work, including scripts to
137
+control those activities.  However, it does not include the work's
138
+System Libraries, or general-purpose tools or generally available free
139
+programs which are used unmodified in performing those activities but
140
+which are not part of the work.  For example, Corresponding Source
141
+includes interface definition files associated with source files for
142
+the work, and the source code for shared libraries and dynamically
143
+linked subprograms that the work is specifically designed to require,
144
+such as by intimate data communication or control flow between those
145
+subprograms and other parts of the work.
146
+
147
+  The Corresponding Source need not include anything that users
148
+can regenerate automatically from other parts of the Corresponding
149
+Source.
150
+
151
+  The Corresponding Source for a work in source code form is that
152
+same work.
153
+
154
+  2. Basic Permissions.
155
+
156
+  All rights granted under this License are granted for the term of
157
+copyright on the Program, and are irrevocable provided the stated
158
+conditions are met.  This License explicitly affirms your unlimited
159
+permission to run the unmodified Program.  The output from running a
160
+covered work is covered by this License only if the output, given its
161
+content, constitutes a covered work.  This License acknowledges your
162
+rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+  You may make, run and propagate covered works that you do not
165
+convey, without conditions so long as your license otherwise remains
166
+in force.  You may convey covered works to others for the sole purpose
167
+of having them make modifications exclusively for you, or provide you
168
+with facilities for running those works, provided that you comply with
169
+the terms of this License in conveying all material for which you do
170
+not control copyright.  Those thus making or running the covered works
171
+for you must do so exclusively on your behalf, under your direction
172
+and control, on terms that prohibit them from making any copies of
173
+your copyrighted material outside their relationship with you.
174
+
175
+  Conveying under any other circumstances is permitted solely under
176
+the conditions stated below.  Sublicensing is not allowed; section 10
177
+makes it unnecessary.
178
+
179
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+  No covered work shall be deemed part of an effective technological
182
+measure under any applicable law fulfilling obligations under article
183
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+similar laws prohibiting or restricting circumvention of such
185
+measures.
186
+
187
+  When you convey a covered work, you waive any legal power to forbid
188
+circumvention of technological measures to the extent such circumvention
189
+is effected by exercising rights under this License with respect to
190
+the covered work, and you disclaim any intention to limit operation or
191
+modification of the work as a means of enforcing, against the work's
192
+users, your or third parties' legal rights to forbid circumvention of
193
+technological measures.
194
+
195
+  4. Conveying Verbatim Copies.
196
+
197
+  You may convey verbatim copies of the Program's source code as you
198
+receive it, in any medium, provided that you conspicuously and
199
+appropriately publish on each copy an appropriate copyright notice;
200
+keep intact all notices stating that this License and any
201
+non-permissive terms added in accord with section 7 apply to the code;
202
+keep intact all notices of the absence of any warranty; and give all
203
+recipients a copy of this License along with the Program.
204
+
205
+  You may charge any price or no price for each copy that you convey,
206
+and you may offer support or warranty protection for a fee.
207
+
208
+  5. Conveying Modified Source Versions.
209
+
210
+  You may convey a work based on the Program, or the modifications to
211
+produce it from the Program, in the form of source code under the
212
+terms of section 4, provided that you also meet all of these conditions:
213
+
214
+    a) The work must carry prominent notices stating that you modified
215
+    it, and giving a relevant date.
216
+
217
+    b) The work must carry prominent notices stating that it is
218
+    released under this License and any conditions added under section
219
+    7.  This requirement modifies the requirement in section 4 to
220
+    "keep intact all notices".
221
+
222
+    c) You must license the entire work, as a whole, under this
223
+    License to anyone who comes into possession of a copy.  This
224
+    License will therefore apply, along with any applicable section 7
225
+    additional terms, to the whole of the work, and all its parts,
226
+    regardless of how they are packaged.  This License gives no
227
+    permission to license the work in any other way, but it does not
228
+    invalidate such permission if you have separately received it.
229
+
230
+    d) If the work has interactive user interfaces, each must display
231
+    Appropriate Legal Notices; however, if the Program has interactive
232
+    interfaces that do not display Appropriate Legal Notices, your
233
+    work need not make them do so.
234
+
235
+  A compilation of a covered work with other separate and independent
236
+works, which are not by their nature extensions of the covered work,
237
+and which are not combined with it such as to form a larger program,
238
+in or on a volume of a storage or distribution medium, is called an
239
+"aggregate" if the compilation and its resulting copyright are not
240
+used to limit the access or legal rights of the compilation's users
241
+beyond what the individual works permit.  Inclusion of a covered work
242
+in an aggregate does not cause this License to apply to the other
243
+parts of the aggregate.
244
+
245
+  6. Conveying Non-Source Forms.
246
+
247
+  You may convey a covered work in object code form under the terms
248
+of sections 4 and 5, provided that you also convey the
249
+machine-readable Corresponding Source under the terms of this License,
250
+in one of these ways:
251
+
252
+    a) Convey the object code in, or embodied in, a physical product
253
+    (including a physical distribution medium), accompanied by the
254
+    Corresponding Source fixed on a durable physical medium
255
+    customarily used for software interchange.
256
+
257
+    b) Convey the object code in, or embodied in, a physical product
258
+    (including a physical distribution medium), accompanied by a
259
+    written offer, valid for at least three years and valid for as
260
+    long as you offer spare parts or customer support for that product
261
+    model, to give anyone who possesses the object code either (1) a
262
+    copy of the Corresponding Source for all the software in the
263
+    product that is covered by this License, on a durable physical
264
+    medium customarily used for software interchange, for a price no
265
+    more than your reasonable cost of physically performing this
266
+    conveying of source, or (2) access to copy the
267
+    Corresponding Source from a network server at no charge.
268
+
269
+    c) Convey individual copies of the object code with a copy of the
270
+    written offer to provide the Corresponding Source.  This
271
+    alternative is allowed only occasionally and noncommercially, and
272
+    only if you received the object code with such an offer, in accord
273
+    with subsection 6b.
274
+
275
+    d) Convey the object code by offering access from a designated
276
+    place (gratis or for a charge), and offer equivalent access to the
277
+    Corresponding Source in the same way through the same place at no
278
+    further charge.  You need not require recipients to copy the
279
+    Corresponding Source along with the object code.  If the place to
280
+    copy the object code is a network server, the Corresponding Source
281
+    may be on a different server (operated by you or a third party)
282
+    that supports equivalent copying facilities, provided you maintain
283
+    clear directions next to the object code saying where to find the
284
+    Corresponding Source.  Regardless of what server hosts the
285
+    Corresponding Source, you remain obligated to ensure that it is
286
+    available for as long as needed to satisfy these requirements.
287
+
288
+    e) Convey the object code using peer-to-peer transmission, provided
289
+    you inform other peers where the object code and Corresponding
290
+    Source of the work are being offered to the general public at no
291
+    charge under subsection 6d.
292
+
293
+  A separable portion of the object code, whose source code is excluded
294
+from the Corresponding Source as a System Library, need not be
295
+included in conveying the object code work.
296
+
297
+  A "User Product" is either (1) a "consumer product", which means any
298
+tangible personal property which is normally used for personal, family,
299
+or household purposes, or (2) anything designed or sold for incorporation
300
+into a dwelling.  In determining whether a product is a consumer product,
301
+doubtful cases shall be resolved in favor of coverage.  For a particular
302
+product received by a particular user, "normally used" refers to a
303
+typical or common use of that class of product, regardless of the status
304
+of the particular user or of the way in which the particular user
305
+actually uses, or expects or is expected to use, the product.  A product
306
+is a consumer product regardless of whether the product has substantial
307
+commercial, industrial or non-consumer uses, unless such uses represent
308
+the only significant mode of use of the product.
309
+
310
+  "Installation Information" for a User Product means any methods,
311
+procedures, authorization keys, or other information required to install
312
+and execute modified versions of a covered work in that User Product from
313
+a modified version of its Corresponding Source.  The information must
314
+suffice to ensure that the continued functioning of the modified object
315
+code is in no case prevented or interfered with solely because
316
+modification has been made.
317
+
318
+  If you convey an object code work under this section in, or with, or
319
+specifically for use in, a User Product, and the conveying occurs as
320
+part of a transaction in which the right of possession and use of the
321
+User Product is transferred to the recipient in perpetuity or for a
322
+fixed term (regardless of how the transaction is characterized), the
323
+Corresponding Source conveyed under this section must be accompanied
324
+by the Installation Information.  But this requirement does not apply
325
+if neither you nor any third party retains the ability to install
326
+modified object code on the User Product (for example, the work has
327
+been installed in ROM).
328
+
329
+  The requirement to provide Installation Information does not include a
330
+requirement to continue to provide support service, warranty, or updates
331
+for a work that has been modified or installed by the recipient, or for
332
+the User Product in which it has been modified or installed.  Access to a
333
+network may be denied when the modification itself materially and
334
+adversely affects the operation of the network or violates the rules and
335
+protocols for communication across the network.
336
+
337
+  Corresponding Source conveyed, and Installation Information provided,
338
+in accord with this section must be in a format that is publicly
339
+documented (and with an implementation available to the public in
340
+source code form), and must require no special password or key for
341
+unpacking, reading or copying.
342
+
343
+  7. Additional Terms.
344
+
345
+  "Additional permissions" are terms that supplement the terms of this
346
+License by making exceptions from one or more of its conditions.
347
+Additional permissions that are applicable to the entire Program shall
348
+be treated as though they were included in this License, to the extent
349
+that they are valid under applicable law.  If additional permissions
350
+apply only to part of the Program, that part may be used separately
351
+under those permissions, but the entire Program remains governed by
352
+this License without regard to the additional permissions.
353
+
354
+  When you convey a copy of a covered work, you may at your option
355
+remove any additional permissions from that copy, or from any part of
356
+it.  (Additional permissions may be written to require their own
357
+removal in certain cases when you modify the work.)  You may place
358
+additional permissions on material, added by you to a covered work,
359
+for which you have or can give appropriate copyright permission.
360
+
361
+  Notwithstanding any other provision of this License, for material you
362
+add to a covered work, you may (if authorized by the copyright holders of
363
+that material) supplement the terms of this License with terms:
364
+
365
+    a) Disclaiming warranty or limiting liability differently from the
366
+    terms of sections 15 and 16 of this License; or
367
+
368
+    b) Requiring preservation of specified reasonable legal notices or
369
+    author attributions in that material or in the Appropriate Legal
370
+    Notices displayed by works containing it; or
371
+
372
+    c) Prohibiting misrepresentation of the origin of that material, or
373
+    requiring that modified versions of such material be marked in
374
+    reasonable ways as different from the original version; or
375
+
376
+    d) Limiting the use for publicity purposes of names of licensors or
377
+    authors of the material; or
378
+
379
+    e) Declining to grant rights under trademark law for use of some
380
+    trade names, trademarks, or service marks; or
381
+
382
+    f) Requiring indemnification of licensors and authors of that
383
+    material by anyone who conveys the material (or modified versions of
384
+    it) with contractual assumptions of liability to the recipient, for
385
+    any liability that these contractual assumptions directly impose on
386
+    those licensors and authors.
387
+
388
+  All other non-permissive additional terms are considered "further
389
+restrictions" within the meaning of section 10.  If the Program as you
390
+received it, or any part of it, contains a notice stating that it is
391
+governed by this License along with a term that is a further
392
+restriction, you may remove that term.  If a license document contains
393
+a further restriction but permits relicensing or conveying under this
394
+License, you may add to a covered work material governed by the terms
395
+of that license document, provided that the further restriction does
396
+not survive such relicensing or conveying.
397
+
398
+  If you add terms to a covered work in accord with this section, you
399
+must place, in the relevant source files, a statement of the
400
+additional terms that apply to those files, or a notice indicating
401
+where to find the applicable terms.
402
+
403
+  Additional terms, permissive or non-permissive, may be stated in the
404
+form of a separately written license, or stated as exceptions;
405
+the above requirements apply either way.
406
+
407
+  8. Termination.
408
+
409
+  You may not propagate or modify a covered work except as expressly
410
+provided under this License.  Any attempt otherwise to propagate or
411
+modify it is void, and will automatically terminate your rights under
412
+this License (including any patent licenses granted under the third
413
+paragraph of section 11).
414
+
415
+  However, if you cease all violation of this License, then your
416
+license from a particular copyright holder is reinstated (a)
417
+provisionally, unless and until the copyright holder explicitly and
418
+finally terminates your license, and (b) permanently, if the copyright
419
+holder fails to notify you of the violation by some reasonable means
420
+prior to 60 days after the cessation.
421
+
422
+  Moreover, your license from a particular copyright holder is
423
+reinstated permanently if the copyright holder notifies you of the
424
+violation by some reasonable means, this is the first time you have
425
+received notice of violation of this License (for any work) from that
426
+copyright holder, and you cure the violation prior to 30 days after
427
+your receipt of the notice.
428
+
429
+  Termination of your rights under this section does not terminate the
430
+licenses of parties who have received copies or rights from you under
431
+this License.  If your rights have been terminated and not permanently
432
+reinstated, you do not qualify to receive new licenses for the same
433
+material under section 10.
434
+
435
+  9. Acceptance Not Required for Having Copies.
436
+
437
+  You are not required to accept this License in order to receive or
438
+run a copy of the Program.  Ancillary propagation of a covered work
439
+occurring solely as a consequence of using peer-to-peer transmission
440
+to receive a copy likewise does not require acceptance.  However,
441
+nothing other than this License grants you permission to propagate or
442
+modify any covered work.  These actions infringe copyright if you do
443
+not accept this License.  Therefore, by modifying or propagating a
444
+covered work, you indicate your acceptance of this License to do so.
445
+
446
+  10. Automatic Licensing of Downstream Recipients.
447
+
448
+  Each time you convey a covered work, the recipient automatically
449
+receives a license from the original licensors, to run, modify and
450
+propagate that work, subject to this License.  You are not responsible
451
+for enforcing compliance by third parties with this License.
452
+
453
+  An "entity transaction" is a transaction transferring control of an
454
+organization, or substantially all assets of one, or subdividing an
455
+organization, or merging organizations.  If propagation of a covered
456
+work results from an entity transaction, each party to that
457
+transaction who receives a copy of the work also receives whatever
458
+licenses to the work the party's predecessor in interest had or could
459
+give under the previous paragraph, plus a right to possession of the
460
+Corresponding Source of the work from the predecessor in interest, if
461
+the predecessor has it or can get it with reasonable efforts.
462
+
463
+  You may not impose any further restrictions on the exercise of the
464
+rights granted or affirmed under this License.  For example, you may
465
+not impose a license fee, royalty, or other charge for exercise of
466
+rights granted under this License, and you may not initiate litigation
467
+(including a cross-claim or counterclaim in a lawsuit) alleging that
468
+any patent claim is infringed by making, using, selling, offering for
469
+sale, or importing the Program or any portion of it.
470
+
471
+  11. Patents.
472
+
473
+  A "contributor" is a copyright holder who authorizes use under this
474
+License of the Program or a work on which the Program is based.  The
475
+work thus licensed is called the contributor's "contributor version".
476
+
477
+  A contributor's "essential patent claims" are all patent claims
478
+owned or controlled by the contributor, whether already acquired or
479
+hereafter acquired, that would be infringed by some manner, permitted
480
+by this License, of making, using, or selling its contributor version,
481
+but do not include claims that would be infringed only as a
482
+consequence of further modification of the contributor version.  For
483
+purposes of this definition, "control" includes the right to grant
484
+patent sublicenses in a manner consistent with the requirements of
485
+this License.
486
+
487
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+patent license under the contributor's essential patent claims, to
489
+make, use, sell, offer for sale, import and otherwise run, modify and
490
+propagate the contents of its contributor version.
491
+
492
+  In the following three paragraphs, a "patent license" is any express
493
+agreement or commitment, however denominated, not to enforce a patent
494
+(such as an express permission to practice a patent or covenant not to
495
+sue for patent infringement).  To "grant" such a patent license to a
496
+party means to make such an agreement or commitment not to enforce a
497
+patent against the party.
498
+
499
+  If you convey a covered work, knowingly relying on a patent license,
500
+and the Corresponding Source of the work is not available for anyone
501
+to copy, free of charge and under the terms of this License, through a
502
+publicly available network server or other readily accessible means,
503
+then you must either (1) cause the Corresponding Source to be so
504
+available, or (2) arrange to deprive yourself of the benefit of the
505
+patent license for this particular work, or (3) arrange, in a manner
506
+consistent with the requirements of this License, to extend the patent
507
+license to downstream recipients.  "Knowingly relying" means you have
508
+actual knowledge that, but for the patent license, your conveying the
509
+covered work in a country, or your recipient's use of the covered work
510
+in a country, would infringe one or more identifiable patents in that
511
+country that you have reason to believe are valid.
512
+
513
+  If, pursuant to or in connection with a single transaction or
514
+arrangement, you convey, or propagate by procuring conveyance of, a
515
+covered work, and grant a patent license to some of the parties
516
+receiving the covered work authorizing them to use, propagate, modify
517
+or convey a specific copy of the covered work, then the patent license
518
+you grant is automatically extended to all recipients of the covered
519
+work and works based on it.
520
+
521
+  A patent license is "discriminatory" if it does not include within
522
+the scope of its coverage, prohibits the exercise of, or is
523
+conditioned on the non-exercise of one or more of the rights that are
524
+specifically granted under this License.  You may not convey a covered
525
+work if you are a party to an arrangement with a third party that is
526
+in the business of distributing software, under which you make payment
527
+to the third party based on the extent of your activity of conveying
528
+the work, and under which the third party grants, to any of the
529
+parties who would receive the covered work from you, a discriminatory
530
+patent license (a) in connection with copies of the covered work
531
+conveyed by you (or copies made from those copies), or (b) primarily
532
+for and in connection with specific products or compilations that
533
+contain the covered work, unless you entered into that arrangement,
534
+or that patent license was granted, prior to 28 March 2007.
535
+
536
+  Nothing in this License shall be construed as excluding or limiting
537
+any implied license or other defenses to infringement that may
538
+otherwise be available to you under applicable patent law.
539
+
540
+  12. No Surrender of Others' Freedom.
541
+
542
+  If conditions are imposed on you (whether by court order, agreement or
543
+otherwise) that contradict the conditions of this License, they do not
544
+excuse you from the conditions of this License.  If you cannot convey a
545
+covered work so as to satisfy simultaneously your obligations under this
546
+License and any other pertinent obligations, then as a consequence you may
547
+not convey it at all.  For example, if you agree to terms that obligate you
548
+to collect a royalty for further conveying from those to whom you convey
549
+the Program, the only way you could satisfy both those terms and this
550
+License would be to refrain entirely from conveying the Program.
551
+
552
+  13. Use with the GNU Affero General Public License.
553
+
554
+  Notwithstanding any other provision of this License, you have
555
+permission to link or combine any covered work with a work licensed
556
+under version 3 of the GNU Affero General Public License into a single
557
+combined work, and to convey the resulting work.  The terms of this
558
+License will continue to apply to the part which is the covered work,
559
+but the special requirements of the GNU Affero General Public License,
560
+section 13, concerning interaction through a network will apply to the
561
+combination as such.
562
+
563
+  14. Revised Versions of this License.
564
+
565
+  The Free Software Foundation may publish revised and/or new versions of
566
+the GNU General Public License from time to time.  Such new versions will
567
+be similar in spirit to the present version, but may differ in detail to
568
+address new problems or concerns.
569
+
570
+  Each version is given a distinguishing version number.  If the
571
+Program specifies that a certain numbered version of the GNU General
572
+Public License "or any later version" applies to it, you have the
573
+option of following the terms and conditions either of that numbered
574
+version or of any later version published by the Free Software
575
+Foundation.  If the Program does not specify a version number of the
576
+GNU General Public License, you may choose any version ever published
577
+by the Free Software Foundation.
578
+
579
+  If the Program specifies that a proxy can decide which future
580
+versions of the GNU General Public License can be used, that proxy's
581
+public statement of acceptance of a version permanently authorizes you
582
+to choose that version for the Program.
583
+
584
+  Later license versions may give you additional or different
585
+permissions.  However, no additional obligations are imposed on any
586
+author or copyright holder as a result of your choosing to follow a
587
+later version.
588
+
589
+  15. Disclaimer of Warranty.
590
+
591
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+  16. Limitation of Liability.
601
+
602
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+SUCH DAMAGES.
611
+
612
+  17. Interpretation of Sections 15 and 16.
613
+
614
+  If the disclaimer of warranty and limitation of liability provided
615
+above cannot be given local legal effect according to their terms,
616
+reviewing courts shall apply local law that most closely approximates
617
+an absolute waiver of all civil liability in connection with the
618
+Program, unless a warranty or assumption of liability accompanies a
619
+copy of the Program in return for a fee.
620
+
621
+                     END OF TERMS AND CONDITIONS
622
+
623
+            How to Apply These Terms to Your New Programs
624
+
625
+  If you develop a new program, and you want it to be of the greatest
626
+possible use to the public, the best way to achieve this is to make it
627
+free software which everyone can redistribute and change under these terms.
628
+
629
+  To do so, attach the following notices to the program.  It is safest
630
+to attach them to the start of each source file to most effectively
631
+state the exclusion of warranty; and each file should have at least
632
+the "copyright" line and a pointer to where the full notice is found.
633
+
634
+    <one line to give the program's name and a brief idea of what it does.>
635
+    Copyright (C) <year>  <name of author>
636
+
637
+    This program is free software: you can redistribute it and/or modify
638
+    it under the terms of the GNU General Public License as published by
639
+    the Free Software Foundation, either version 3 of the License, or
640
+    (at your option) any later version.
641
+
642
+    This program is distributed in the hope that it will be useful,
643
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
645
+    GNU General Public License for more details.
646
+
647
+    You should have received a copy of the GNU General Public License
648
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
649
+
650
+Also add information on how to contact you by electronic and paper mail.
651
+
652
+  If the program does terminal interaction, make it output a short
653
+notice like this when it starts in an interactive mode:
654
+
655
+    <program>  Copyright (C) <year>  <name of author>
656
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+    This is free software, and you are welcome to redistribute it
658
+    under certain conditions; type `show c' for details.
659
+
660
+The hypothetical commands `show w' and `show c' should show the appropriate
661
+parts of the General Public License.  Of course, your program's commands
662
+might be different; for a GUI interface, you would use an "about box".
663
+
664
+  You should also get your employer (if you work as a programmer) or school,
665
+if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+For more information on this, and how to apply and follow the GNU GPL, see
667
+<https://www.gnu.org/licenses/>.
668
+
669
+  The GNU General Public License does not permit incorporating your program
670
+into proprietary programs.  If your program is a subroutine library, you
671
+may consider it more useful to permit linking proprietary applications with
672
+the library.  If this is what you want to do, use the GNU Lesser General
673
+Public License instead of this License.  But first, please read
674
+<https://www.gnu.org/licenses/why-not-lgpl.html>.

+ 108
- 0
Common/ffmpeg/README.txt ファイルの表示

@@ -0,0 +1,108 @@
1
+Zeranoe FFmpeg Builds <http://ffmpeg.zeranoe.com/builds/>
2
+
3
+Build: ffmpeg-20200309-608b8a8-win64-static
4
+
5
+Configuration:
6
+  --enable-gpl
7
+  --enable-version3
8
+  --enable-sdl2
9
+  --enable-fontconfig
10
+  --enable-gnutls
11
+  --enable-iconv
12
+  --enable-libass
13
+  --enable-libdav1d
14
+  --enable-libbluray
15
+  --enable-libfreetype
16
+  --enable-libmp3lame
17
+  --enable-libopencore-amrnb
18
+  --enable-libopencore-amrwb
19
+  --enable-libopenjpeg
20
+  --enable-libopus
21
+  --enable-libshine
22
+  --enable-libsnappy
23
+  --enable-libsoxr
24
+  --enable-libtheora
25
+  --enable-libtwolame
26
+  --enable-libvpx
27
+  --enable-libwavpack
28
+  --enable-libwebp
29
+  --enable-libx264
30
+  --enable-libx265
31
+  --enable-libxml2
32
+  --enable-libzimg
33
+  --enable-lzma
34
+  --enable-zlib
35
+  --enable-gmp
36
+  --enable-libvidstab
37
+  --enable-libvorbis
38
+  --enable-libvo-amrwbenc
39
+  --enable-libmysofa
40
+  --enable-libspeex
41
+  --enable-libxvid
42
+  --enable-libaom
43
+  --enable-libmfx
44
+  --enable-ffnvcodec
45
+  --enable-cuda-llvm
46
+  --enable-cuvid
47
+  --enable-d3d11va
48
+  --enable-nvenc
49
+  --enable-nvdec
50
+  --enable-dxva2
51
+  --enable-avisynth
52
+  --enable-libopenmpt
53
+  --enable-amf
54
+
55
+Libraries:
56
+  SDL               20200120-cb4dae5  <https://libsdl.org>
57
+  Fontconfig        2.13.92           <http://freedesktop.org/wiki/Software/fontconfig>
58
+  GnuTLS            3.6.11.1          <https://gnutls.org/>
59
+  libiconv          1.16              <http://gnu.org/software/libiconv>
60
+  libass            0.14.0            <https://github.com/libass/libass>
61
+  dav1d             20200213-eb7077e  <https://code.videolan.org/videolan/dav1d>
62
+  libbluray         20191112-137974c  <https://www.videolan.org/developers/libbluray.html>
63
+  FreeType          2.10.1            <http://freetype.sourceforge.net>
64
+  LAME              3.100             <http://lame.sourceforge.net>
65
+  OpenCORE AMR      20170731-07a5be4  <https://sourceforge.net/projects/opencore-amr>
66
+  OpenJPEG          20200113-b63a433  <https://github.com/uclouvain/openjpeg>
67
+  Opus              20200214-be68a9a  <https://opus-codec.org>
68
+  shine             20190420-76ea4f0  <https://github.com/savonet/shine>
69
+  Snappy            1.1.7             <https://github.com/google/snappy>
70
+  libsoxr           20180224-945b592  <http://sourceforge.net/projects/soxr>
71
+  Theora            20171023-e5d205b  <http://theora.org>
72
+  TwoLAME           0.4.0             <http://twolame.org>
73
+  vpx               20200129-5be3781  <http://webmproject.org>
74
+  WavPack           5.2.0             <http://wavpack.com>
75
+  WebP              20200106-0fa56f3  <https://developers.google.com/speed/webp>
76
+  x264              20191127-1771b55  <https://www.videolan.org/developers/x264.html>
77
+  x265              20200125-fdbd4e4  <https://bitbucket.org/multicoreware/x265/wiki/Home>
78
+  libxml2           2.9.10            <http://xmlsoft.org>
79
+  z.lib             20200209-729bf11  <https://github.com/sekrit-twc/zimg>
80
+  XZ Utils          5.2.4             <http://tukaani.org/xz>
81
+  zlib              1.2.11            <http://zlib.net>
82
+  GMP               6.1.2             <https://gmplib.org>
83
+  vid.stab          20190213-aeabc8d  <http://public.hronopik.de/vid.stab>
84
+  Vorbis            20190128-9eadecc  <http://vorbis.com>
85
+  VisualOn AMR-WB   20141107-3b3fcd0  <https://sourceforge.net/projects/opencore-amr>
86
+  libmysofa         20190907-e07edb3  <https://github.com/hoene/libmysofa>
87
+  Speex             20190808-58ac1d4  <http://speex.org>
88
+  Xvid              1.3.5             <https://labs.xvid.com>
89
+  aom               20200214-d6a3d66  <https://aomedia.googlesource.com/aom>
90
+  libmfx            1.28              <https://software.intel.com/en-us/media-sdk>
91
+  nv-codec-headers  20191126-250292d  <https://git.videolan.org/?p=ffmpeg/nv-codec-headers.git>
92
+  OpenMPT           20191010-51cb021  <https://openmpt.org>
93
+  AMF               20191216-acbd877  <https://gpuopen.com/gaming-product/advanced-media-framework>
94
+
95
+Copyright (C) 2020 Kyle Schwarz
96
+
97
+This program is free software: you can redistribute it and/or modify
98
+it under the terms of the GNU General Public License as published by
99
+the Free Software Foundation, either version 3 of the License, or
100
+(at your option) any later version.
101
+
102
+This program is distributed in the hope that it will be useful,
103
+but WITHOUT ANY WARRANTY; without even the implied warranty of
104
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
105
+GNU General Public License for more details.
106
+
107
+You should have received a copy of the GNU General Public License
108
+along with this program.  If not, see <http://www.gnu.org/licenses/>.

+ 5
- 0
Common/ffmpeg/doc/bootstrap.min.css
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 165
- 0
Common/ffmpeg/doc/default.css ファイルの表示

@@ -0,0 +1,165 @@
1
+a.summary-letter {
2
+    text-decoration: none;
3
+}
4
+
5
+a {
6
+    color: #2D6198;
7
+}
8
+
9
+a:visited {
10
+    color: #884488;
11
+}
12
+
13
+#banner {
14
+    background-color: white;
15
+    position: relative;
16
+    text-align: center;
17
+}
18
+
19
+#banner img {
20
+    margin-bottom: 1px;
21
+    margin-top: 5px;
22
+}
23
+
24
+#body {
25
+    margin-left: 1em;
26
+    margin-right: 1em;
27
+}
28
+
29
+body {
30
+    background-color: #313131;
31
+    margin: 0;
32
+    text-align: justify;
33
+}
34
+
35
+.center {
36
+    margin-left: auto;
37
+    margin-right: auto;
38
+    text-align: center;
39
+}
40
+
41
+#container {
42
+    background-color: white;
43
+    color: #202020;
44
+    margin-left: 1em;
45
+    margin-right: 1em;
46
+}
47
+
48
+#footer {
49
+    text-align: center;
50
+}
51
+
52
+h1 a, h2 a, h3 a, h4 a {
53
+    text-decoration: inherit;
54
+    color: inherit;
55
+}
56
+
57
+h1, h2, h3, h4 {
58
+    padding-left: 0.4em;
59
+    border-radius: 4px;
60
+    padding-bottom: 0.25em;
61
+    padding-top: 0.25em;
62
+    border: 1px solid #6A996A;
63
+}
64
+
65
+h1 {
66
+    background-color: #7BB37B;
67
+    color: #151515;
68
+    font-size: 1.2em;
69
+    padding-bottom: 0.3em;
70
+    padding-top: 0.3em;
71
+}
72
+
73
+h2 {
74
+    color: #313131;
75
+    font-size: 1.0em;
76
+    background-color: #ABE3AB;
77
+}
78
+
79
+h3 {
80
+    color: #313131;
81
+    font-size: 0.9em;
82
+    margin-bottom: -6px;
83
+    background-color: #BBF3BB;
84
+}
85
+
86
+h4 {
87
+    color: #313131;
88
+    font-size: 0.8em;
89
+    margin-bottom: -8px;
90
+    background-color: #D1FDD1;
91
+}
92
+
93
+img {
94
+    border: 0;
95
+}
96
+
97
+#navbar {
98
+    background-color: #738073;
99
+    border-bottom: 1px solid #5C665C;
100
+    border-top: 1px solid #5C665C;
101
+    margin-top: 12px;
102
+    padding: 0.3em;
103
+    position: relative;
104
+    text-align: center;
105
+}
106
+
107
+#navbar a, #navbar_secondary a {
108
+    color: white;
109
+    padding: 0.3em;
110
+    text-decoration: none;
111
+}
112
+
113
+#navbar a:hover, #navbar_secondary a:hover {
114
+    background-color: #313131;
115
+    color: white;
116
+    text-decoration: none;
117
+}
118
+
119
+#navbar_secondary {
120
+    background-color: #738073;
121
+    border-bottom: 1px solid #5C665C;
122
+    border-left: 1px solid #5C665C;
123
+    border-right: 1px solid #5C665C;
124
+    padding: 0.3em;
125
+    position: relative;
126
+    text-align: center;
127
+}
128
+
129
+p {
130
+    margin-left: 1em;
131
+    margin-right: 1em;
132
+}
133
+
134
+pre {
135
+    margin-left: 3em;
136
+    margin-right: 3em;
137
+    padding: 0.3em;
138
+    border: 1px solid #bbb;
139
+    background-color: #f7f7f7;
140
+}
141
+
142
+dl dt {
143
+    font-weight: bold;
144
+}
145
+
146
+#proj_desc {
147
+    font-size: 1.2em;
148
+}
149
+
150
+#repos {
151
+    margin-left: 1em;
152
+    margin-right: 1em;
153
+    border-collapse: collapse;
154
+    border: solid 1px #6A996A;
155
+}
156
+
157
+#repos th {
158
+    background-color: #7BB37B;
159
+    border: solid 1px #6A996A;
160
+}
161
+
162
+#repos td {
163
+    padding: 0.2em;
164
+    border: solid 1px #6A996A;
165
+}

+ 976
- 0
Common/ffmpeg/doc/developer.html ファイルの表示

@@ -0,0 +1,976 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="Developer Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : Developer ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">Developer Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Notes-for-external-developers" href="#Notes-for-external-developers">1 Notes for external developers</a></li>
40
+  <li><a name="toc-Contributing" href="#Contributing">2 Contributing</a></li>
41
+  <li><a name="toc-Coding-Rules-1" href="#Coding-Rules-1">3 Coding Rules</a>
42
+  <ul class="no-bullet">
43
+    <li><a name="toc-Code-formatting-conventions" href="#Code-formatting-conventions">3.1 Code formatting conventions</a></li>
44
+    <li><a name="toc-Comments" href="#Comments">3.2 Comments</a></li>
45
+    <li><a name="toc-C-language-features" href="#C-language-features">3.3 C language features</a></li>
46
+    <li><a name="toc-Naming-conventions" href="#Naming-conventions">3.4 Naming conventions</a></li>
47
+    <li><a name="toc-Miscellaneous-conventions" href="#Miscellaneous-conventions">3.5 Miscellaneous conventions</a></li>
48
+    <li><a name="toc-Editor-configuration" href="#Editor-configuration">3.6 Editor configuration</a></li>
49
+  </ul></li>
50
+  <li><a name="toc-Development-Policy" href="#Development-Policy">4 Development Policy</a>
51
+  <ul class="no-bullet">
52
+    <li><a name="toc-Patches_002fCommitting" href="#Patches_002fCommitting">4.1 Patches/Committing</a></li>
53
+    <li><a name="toc-Code" href="#Code">4.2 Code</a></li>
54
+    <li><a name="toc-Documentation_002fOther" href="#Documentation_002fOther">4.3 Documentation/Other</a></li>
55
+  </ul></li>
56
+  <li><a name="toc-Code-of-conduct" href="#Code-of-conduct">5 Code of conduct</a></li>
57
+  <li><a name="toc-Submitting-patches-1" href="#Submitting-patches-1">6 Submitting patches</a></li>
58
+  <li><a name="toc-New-codecs-or-formats-checklist" href="#New-codecs-or-formats-checklist">7 New codecs or formats checklist</a></li>
59
+  <li><a name="toc-Patch-submission-checklist" href="#Patch-submission-checklist">8 Patch submission checklist</a></li>
60
+  <li><a name="toc-Patch-review-process" href="#Patch-review-process">9 Patch review process</a></li>
61
+  <li><a name="toc-Regression-tests-1" href="#Regression-tests-1">10 Regression tests</a>
62
+  <ul class="no-bullet">
63
+    <li><a name="toc-Adding-files-to-the-fate_002dsuite-dataset" href="#Adding-files-to-the-fate_002dsuite-dataset">10.1 Adding files to the fate-suite dataset</a></li>
64
+    <li><a name="toc-Visualizing-Test-Coverage" href="#Visualizing-Test-Coverage">10.2 Visualizing Test Coverage</a></li>
65
+    <li><a name="toc-Using-Valgrind" href="#Using-Valgrind">10.3 Using Valgrind</a></li>
66
+  </ul></li>
67
+  <li><a name="toc-Release-process-1" href="#Release-process-1">11 Release process</a>
68
+  <ul class="no-bullet">
69
+    <li><a name="toc-Criteria-for-Point-Releases-1" href="#Criteria-for-Point-Releases-1">11.1 Criteria for Point Releases</a></li>
70
+    <li><a name="toc-Release-Checklist" href="#Release-Checklist">11.2 Release Checklist</a></li>
71
+  </ul>
72
+</li>
73
+</ul>
74
+</div>
75
+
76
+
77
+<hr size="6">
78
+<a name="Notes-for-external-developers"></a>
79
+<h1 class="chapter"><a href="developer.html#toc-Notes-for-external-developers">1 Notes for external developers</a></h1>
80
+
81
+<p>This document is mostly useful for internal FFmpeg developers.
82
+External developers who need to use the API in their application should
83
+refer to the API doxygen documentation in the public headers, and
84
+check the examples in &lsquo;<tt>doc/examples</tt>&rsquo; and in the source code to
85
+see how the public API is employed.
86
+</p>
87
+<p>You can use the FFmpeg libraries in your commercial program, but you
88
+are encouraged to <em>publish any patch you make</em>. In this case the
89
+best way to proceed is to send your patches to the ffmpeg-devel
90
+mailing list following the guidelines illustrated in the remainder of
91
+this document.
92
+</p>
93
+<p>For more detailed legal information about the use of FFmpeg in
94
+external programs read the &lsquo;<tt>LICENSE</tt>&rsquo; file in the source tree and
95
+consult <a href="https://ffmpeg.org/legal.html">https://ffmpeg.org/legal.html</a>.
96
+</p>
97
+<a name="Contributing"></a>
98
+<h1 class="chapter"><a href="developer.html#toc-Contributing">2 Contributing</a></h1>
99
+
100
+<p>There are 2 ways by which code gets into FFmpeg:
101
+</p><ul>
102
+<li> Submitting patches to the ffmpeg-devel mailing list.
103
+      See <a href="#Submitting-patches">Submitting patches</a> for details.
104
+</li><li> Directly committing changes to the main tree.
105
+</li></ul>
106
+
107
+<p>Whichever way, changes should be reviewed by the maintainer of the code
108
+before they are committed. And they should follow the <a href="#Coding-Rules">Coding Rules</a>.
109
+The developer making the commit and the author are responsible for their changes
110
+and should try to fix issues their commit causes.
111
+</p>
112
+<p><a name="Coding-Rules"></a>
113
+</p><a name="Coding-Rules-1"></a>
114
+<h1 class="chapter"><a href="developer.html#toc-Coding-Rules-1">3 Coding Rules</a></h1>
115
+
116
+<a name="Code-formatting-conventions"></a>
117
+<h2 class="section"><a href="developer.html#toc-Code-formatting-conventions">3.1 Code formatting conventions</a></h2>
118
+
119
+<p>There are the following guidelines regarding the indentation in files:
120
+</p>
121
+<ul>
122
+<li>
123
+Indent size is 4.
124
+
125
+</li><li>
126
+The TAB character is forbidden outside of Makefiles as is any
127
+form of trailing whitespace. Commits containing either will be
128
+rejected by the git repository.
129
+
130
+</li><li>
131
+You should try to limit your code lines to 80 characters; however, do so if
132
+and only if this improves readability.
133
+
134
+</li><li>
135
+K&amp;R coding style is used.
136
+</li></ul>
137
+<p>The presentation is one inspired by &rsquo;indent -i4 -kr -nut&rsquo;.
138
+</p>
139
+<p>The main priority in FFmpeg is simplicity and small code size in order to
140
+minimize the bug count.
141
+</p>
142
+<a name="Comments"></a>
143
+<h2 class="section"><a href="developer.html#toc-Comments">3.2 Comments</a></h2>
144
+<p>Use the JavaDoc/Doxygen  format (see examples below) so that code documentation
145
+can be generated automatically. All nontrivial functions should have a comment
146
+above them explaining what the function does, even if it is just one sentence.
147
+All structures and their member variables should be documented, too.
148
+</p>
149
+<p>Avoid Qt-style and similar Doxygen syntax with <code>!</code> in it, i.e. replace
150
+<code>//!</code> with <code>///</code> and similar.  Also @ syntax should be employed
151
+for markup commands, i.e. use <code>@param</code> and not <code>\param</code>.
152
+</p>
153
+<div class="example">
154
+<pre class="example">/**
155
+ * @file
156
+ * MPEG codec.
157
+ * @author ...
158
+ */
159
+
160
+/**
161
+ * Summary sentence.
162
+ * more text ...
163
+ * ...
164
+ */
165
+typedef struct Foobar {
166
+    int var1; /**&lt; var1 description */
167
+    int var2; ///&lt; var2 description
168
+    /** var3 description */
169
+    int var3;
170
+} Foobar;
171
+
172
+/**
173
+ * Summary sentence.
174
+ * more text ...
175
+ * ...
176
+ * @param my_parameter description of my_parameter
177
+ * @return return value description
178
+ */
179
+int myfunc(int my_parameter)
180
+...
181
+</pre></div>
182
+
183
+<a name="C-language-features"></a>
184
+<h2 class="section"><a href="developer.html#toc-C-language-features">3.3 C language features</a></h2>
185
+
186
+<p>FFmpeg is programmed in the ISO C90 language with a few additional
187
+features from ISO C99, namely:
188
+</p>
189
+<ul>
190
+<li>
191
+the &lsquo;<samp>inline</samp>&rsquo; keyword;
192
+
193
+</li><li>
194
+&lsquo;<samp>//</samp>&rsquo; comments;
195
+
196
+</li><li>
197
+designated struct initializers (&lsquo;<samp>struct s x = { .i = 17 };</samp>&rsquo;);
198
+
199
+</li><li>
200
+compound literals (&lsquo;<samp>x = (struct s) { 17, 23 };</samp>&rsquo;).
201
+
202
+</li><li>
203
+for loops with variable definition (&lsquo;<samp>for (int i = 0; i &lt; 8; i++)</samp>&rsquo;);
204
+
205
+</li><li>
206
+Implementation defined behavior for signed integers is assumed to match the
207
+expected behavior for two&rsquo;s complement. Non representable values in integer
208
+casts are binary truncated. Shift right of signed values uses sign extension.
209
+</li></ul>
210
+
211
+<p>These features are supported by all compilers we care about, so we will not
212
+accept patches to remove their use unless they absolutely do not impair
213
+clarity and performance.
214
+</p>
215
+<p>All code must compile with recent versions of GCC and a number of other
216
+currently supported compilers. To ensure compatibility, please do not use
217
+additional C99 features or GCC extensions. Especially watch out for:
218
+</p>
219
+<ul>
220
+<li>
221
+mixing statements and declarations;
222
+
223
+</li><li>
224
+&lsquo;<samp>long long</samp>&rsquo; (use &lsquo;<samp>int64_t</samp>&rsquo; instead);
225
+
226
+</li><li>
227
+&lsquo;<samp>__attribute__</samp>&rsquo; not protected by &lsquo;<samp>#ifdef __GNUC__</samp>&rsquo; or similar;
228
+
229
+</li><li>
230
+GCC statement expressions (&lsquo;<samp>(x = ({ int y = 4; y; })</samp>&rsquo;).
231
+</li></ul>
232
+
233
+<a name="Naming-conventions"></a>
234
+<h2 class="section"><a href="developer.html#toc-Naming-conventions">3.4 Naming conventions</a></h2>
235
+<p>All names should be composed with underscores (_), not CamelCase. For example,
236
+&lsquo;<samp>avfilter_get_video_buffer</samp>&rsquo; is an acceptable function name and
237
+&lsquo;<samp>AVFilterGetVideo</samp>&rsquo; is not. The exception from this are type names, like
238
+for example structs and enums; they should always be in CamelCase.
239
+</p>
240
+<p>There are the following conventions for naming variables and functions:
241
+</p>
242
+<ul>
243
+<li>
244
+For local variables no prefix is required.
245
+
246
+</li><li>
247
+For file-scope variables and functions declared as <code>static</code>, no prefix
248
+is required.
249
+
250
+</li><li>
251
+For variables and functions visible outside of file scope, but only used
252
+internally by a library, an <code>ff_</code> prefix should be used,
253
+e.g. &lsquo;<samp>ff_w64_demuxer</samp>&rsquo;.
254
+
255
+</li><li>
256
+For variables and functions visible outside of file scope, used internally
257
+across multiple libraries, use <code>avpriv_</code> as prefix, for example,
258
+&lsquo;<samp>avpriv_report_missing_feature</samp>&rsquo;.
259
+
260
+</li><li>
261
+Each library has its own prefix for public symbols, in addition to the
262
+commonly used <code>av_</code> (<code>avformat_</code> for libavformat,
263
+<code>avcodec_</code> for libavcodec, <code>swr_</code> for libswresample, etc).
264
+Check the existing code and choose names accordingly.
265
+Note that some symbols without these prefixes are also exported for
266
+retro-compatibility reasons. These exceptions are declared in the
267
+<code>lib&lt;name&gt;/lib&lt;name&gt;.v</code> files.
268
+</li></ul>
269
+
270
+<p>Furthermore, name space reserved for the system should not be invaded.
271
+Identifiers ending in <code>_t</code> are reserved by
272
+<a href="http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html#tag_02_02_02">POSIX</a>.
273
+Also avoid names starting with <code>__</code> or <code>_</code> followed by an uppercase
274
+letter as they are reserved by the C standard. Names starting with <code>_</code>
275
+are reserved at the file level and may not be used for externally visible
276
+symbols. If in doubt, just avoid names starting with <code>_</code> altogether.
277
+</p>
278
+<a name="Miscellaneous-conventions"></a>
279
+<h2 class="section"><a href="developer.html#toc-Miscellaneous-conventions">3.5 Miscellaneous conventions</a></h2>
280
+
281
+<ul>
282
+<li>
283
+fprintf and printf are forbidden in libavformat and libavcodec,
284
+please use av_log() instead.
285
+
286
+</li><li>
287
+Casts should be used only when necessary. Unneeded parentheses
288
+should also be avoided if they don&rsquo;t make the code easier to understand.
289
+</li></ul>
290
+
291
+<a name="Editor-configuration"></a>
292
+<h2 class="section"><a href="developer.html#toc-Editor-configuration">3.6 Editor configuration</a></h2>
293
+<p>In order to configure Vim to follow FFmpeg formatting conventions, paste
294
+the following snippet into your &lsquo;<tt>.vimrc</tt>&rsquo;:
295
+</p><div class="example">
296
+<pre class="example">&quot; indentation rules for FFmpeg: 4 spaces, no tabs
297
+set expandtab
298
+set shiftwidth=4
299
+set softtabstop=4
300
+set cindent
301
+set cinoptions=(0
302
+&quot; Allow tabs in Makefiles.
303
+autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8
304
+&quot; Trailing whitespace and tabs are forbidden, so highlight them.
305
+highlight ForbiddenWhitespace ctermbg=red guibg=red
306
+match ForbiddenWhitespace /\s\+$\|\t/
307
+&quot; Do not highlight spaces at the end of line while typing on that line.
308
+autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@&lt;!$/
309
+</pre></div>
310
+
311
+<p>For Emacs, add these roughly equivalent lines to your &lsquo;<tt>.emacs.d/init.el</tt>&rsquo;:
312
+</p><div class="lisp">
313
+<pre class="lisp">(c-add-style &quot;ffmpeg&quot;
314
+             '(&quot;k&amp;r&quot;
315
+               (c-basic-offset . 4)
316
+               (indent-tabs-mode . nil)
317
+               (show-trailing-whitespace . t)
318
+               (c-offsets-alist
319
+                (statement-cont . (c-lineup-assignments +)))
320
+               )
321
+             )
322
+(setq c-default-style &quot;ffmpeg&quot;)
323
+</pre></div>
324
+
325
+<a name="Development-Policy"></a>
326
+<h1 class="chapter"><a href="developer.html#toc-Development-Policy">4 Development Policy</a></h1>
327
+
328
+<a name="Patches_002fCommitting"></a>
329
+<h2 class="section"><a href="developer.html#toc-Patches_002fCommitting">4.1 Patches/Committing</a></h2>
330
+<a name="Licenses-for-patches-must-be-compatible-with-FFmpeg_002e"></a>
331
+<h3 class="subheading">Licenses for patches must be compatible with FFmpeg.</h3>
332
+<p>Contributions should be licensed under the
333
+<a href="http://www.gnu.org/licenses/lgpl-2.1.html">LGPL 2.1</a>,
334
+including an &quot;or any later version&quot; clause, or, if you prefer
335
+a gift-style license, the
336
+<a href="http://opensource.org/licenses/isc-license.txt">ISC</a> or
337
+<a href="http://mit-license.org/">MIT</a> license.
338
+<a href="http://www.gnu.org/licenses/gpl-2.0.html">GPL 2</a> including
339
+an &quot;or any later version&quot; clause is also acceptable, but LGPL is
340
+preferred.
341
+If you add a new file, give it a proper license header. Do not copy and
342
+paste it from a random place, use an existing file as template.
343
+</p>
344
+<a name="You-must-not-commit-code-which-breaks-FFmpeg_0021"></a>
345
+<h3 class="subheading">You must not commit code which breaks FFmpeg!</h3>
346
+<p>This means unfinished code which is enabled and breaks compilation,
347
+or compiles but does not work/breaks the regression tests. Code which
348
+is unfinished but disabled may be permitted under-circumstances, like
349
+missing samples or an implementation with a small subset of features.
350
+Always check the mailing list for any reviewers with issues and test
351
+FATE before you push.
352
+</p>
353
+<a name="Keep-the-main-commit-message-short-with-an-extended-description-below_002e"></a>
354
+<h3 class="subheading">Keep the main commit message short with an extended description below.</h3>
355
+<p>The commit message should have a short first line in the form of
356
+a &lsquo;<samp>topic: short description</samp>&rsquo; as a header, separated by a newline
357
+from the body consisting of an explanation of why the change is necessary.
358
+If the commit fixes a known bug on the bug tracker, the commit message
359
+should include its bug ID. Referring to the issue on the bug tracker does
360
+not exempt you from writing an excerpt of the bug in the commit message.
361
+</p>
362
+<a name="Testing-must-be-adequate-but-not-excessive_002e"></a>
363
+<h3 class="subheading">Testing must be adequate but not excessive.</h3>
364
+<p>If it works for you, others, and passes FATE then it should be OK to commit
365
+it, provided it fits the other committing criteria. You should not worry about
366
+over-testing things. If your code has problems (portability, triggers
367
+compiler bugs, unusual environment etc) they will be reported and eventually
368
+fixed.
369
+</p>
370
+<a name="Do-not-commit-unrelated-changes-together_002e"></a>
371
+<h3 class="subheading">Do not commit unrelated changes together.</h3>
372
+<p>They should be split them into self-contained pieces. Also do not forget
373
+that if part B depends on part A, but A does not depend on B, then A can
374
+and should be committed first and separate from B. Keeping changes well
375
+split into self-contained parts makes reviewing and understanding them on
376
+the commit log mailing list easier. This also helps in case of debugging
377
+later on.
378
+Also if you have doubts about splitting or not splitting, do not hesitate to
379
+ask/discuss it on the developer mailing list.
380
+</p>
381
+<a name="Ask-before-you-change-the-build-system-_0028configure_002c-etc_0029_002e"></a>
382
+<h3 class="subheading">Ask before you change the build system (configure, etc).</h3>
383
+<p>Do not commit changes to the build system (Makefiles, configure script)
384
+which change behavior, defaults etc, without asking first. The same
385
+applies to compiler warning fixes, trivial looking fixes and to code
386
+maintained by other developers. We usually have a reason for doing things
387
+the way we do. Send your changes as patches to the ffmpeg-devel mailing
388
+list, and if the code maintainers say OK, you may commit. This does not
389
+apply to files you wrote and/or maintain.
390
+</p>
391
+<a name="Cosmetic-changes-should-be-kept-in-separate-patches_002e"></a>
392
+<h3 class="subheading">Cosmetic changes should be kept in separate patches.</h3>
393
+<p>We refuse source indentation and other cosmetic changes if they are mixed
394
+with functional changes, such commits will be rejected and removed. Every
395
+developer has his own indentation style, you should not change it. Of course
396
+if you (re)write something, you can use your own style, even though we would
397
+prefer if the indentation throughout FFmpeg was consistent (Many projects
398
+force a given indentation style - we do not.). If you really need to make
399
+indentation changes (try to avoid this), separate them strictly from real
400
+changes.
401
+</p>
402
+<p>NOTE: If you had to put if(){ .. } over a large (&gt; 5 lines) chunk of code,
403
+then either do NOT change the indentation of the inner part within (do not
404
+move it to the right)! or do so in a separate commit
405
+</p>
406
+<a name="Commit-messages-should-always-be-filled-out-properly_002e"></a>
407
+<h3 class="subheading">Commit messages should always be filled out properly.</h3>
408
+<p>Always fill out the commit log message. Describe in a few lines what you
409
+changed and why. You can refer to mailing list postings if you fix a
410
+particular bug. Comments such as &quot;fixed!&quot; or &quot;Changed it.&quot; are unacceptable.
411
+Recommended format:
412
+</p>
413
+<div class="example">
414
+<pre class="example">area changed: Short 1 line description
415
+
416
+details describing what and why and giving references.
417
+</pre></div>
418
+
419
+<a name="Credit-the-author-of-the-patch_002e"></a>
420
+<h3 class="subheading">Credit the author of the patch.</h3>
421
+<p>Make sure the author of the commit is set correctly. (see git commit &ndash;author)
422
+If you apply a patch, send an
423
+answer to ffmpeg-devel (or wherever you got the patch from) saying that
424
+you applied the patch.
425
+</p>
426
+<a name="Complex-patches-should-refer-to-discussion-surrounding-them_002e"></a>
427
+<h3 class="subheading">Complex patches should refer to discussion surrounding them.</h3>
428
+<p>When applying patches that have been discussed (at length) on the mailing
429
+list, reference the thread in the log message.
430
+</p>
431
+<a name="Always-wait-long-enough-before-pushing-changes"></a>
432
+<h3 class="subheading">Always wait long enough before pushing changes</h3>
433
+<p>Do NOT commit to code actively maintained by others without permission.
434
+Send a patch to ffmpeg-devel. If no one answers within a reasonable
435
+time-frame (12h for build failures and security fixes, 3 days small changes,
436
+1 week for big patches) then commit your patch if you think it is OK.
437
+Also note, the maintainer can simply ask for more time to review!
438
+</p>
439
+<a name="Code"></a>
440
+<h2 class="section"><a href="developer.html#toc-Code">4.2 Code</a></h2>
441
+<a name="API_002fABI-changes-should-be-discussed-before-they-are-made_002e"></a>
442
+<h3 class="subheading">API/ABI changes should be discussed before they are made.</h3>
443
+<p>Do not change behavior of the programs (renaming options etc) or public
444
+API or ABI without first discussing it on the ffmpeg-devel mailing list.
445
+Do not remove widely used functionality or features (redundant code can be removed).
446
+</p>
447
+<a name="Remember-to-check-if-you-need-to-bump-versions-for-libav_002a_002e"></a>
448
+<h3 class="subheading">Remember to check if you need to bump versions for libav*.</h3>
449
+<p>Depending on the change, you may need to change the version integer.
450
+Incrementing the first component means no backward compatibility to
451
+previous versions (e.g. removal of a function from the public API).
452
+Incrementing the second component means backward compatible change
453
+(e.g. addition of a function to the public API or extension of an
454
+existing data structure).
455
+Incrementing the third component means a noteworthy binary compatible
456
+change (e.g. encoder bug fix that matters for the decoder). The third
457
+component always starts at 100 to distinguish FFmpeg from Libav.
458
+</p>
459
+<a name="Warnings-for-correct-code-may-be-disabled-if-there-is-no-other-option_002e"></a>
460
+<h3 class="subheading">Warnings for correct code may be disabled if there is no other option.</h3>
461
+<p>Compiler warnings indicate potential bugs or code with bad style. If a type of
462
+warning always points to correct and clean code, that warning should
463
+be disabled, not the code changed.
464
+Thus the remaining warnings can either be bugs or correct code.
465
+If it is a bug, the bug has to be fixed. If it is not, the code should
466
+be changed to not generate a warning unless that causes a slowdown
467
+or obfuscates the code.
468
+</p>
469
+<a name="Check-untrusted-input-properly_002e"></a>
470
+<h3 class="subheading">Check untrusted input properly.</h3>
471
+<p>Never write to unallocated memory, never write over the end of arrays,
472
+always check values read from some untrusted source before using them
473
+as array index or other risky things.
474
+</p>
475
+<a name="Documentation_002fOther"></a>
476
+<h2 class="section"><a href="developer.html#toc-Documentation_002fOther">4.3 Documentation/Other</a></h2>
477
+<a name="Subscribe-to-the-ffmpeg_002ddevel-mailing-list_002e"></a>
478
+<h3 class="subheading">Subscribe to the ffmpeg-devel mailing list.</h3>
479
+<p>It is important to be subscribed to the
480
+<a href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel">ffmpeg-devel</a>
481
+mailing list. Almost any non-trivial patch is to be sent there for review.
482
+Other developers may have comments about your contribution. We expect you see
483
+those comments, and to improve it if requested. (N.B. Experienced committers
484
+have other channels, and may sometimes skip review for trivial fixes.) Also,
485
+discussion here about bug fixes and FFmpeg improvements by other developers may
486
+be helpful information for you. Finally, by being a list subscriber, your
487
+contribution will be posted immediately to the list, without the moderation
488
+hold which messages from non-subscribers experience.
489
+</p>
490
+<p>However, it is more important to the project that we receive your patch than
491
+that you be subscribed to the ffmpeg-devel list. If you have a patch, and don&rsquo;t
492
+want to subscribe and discuss the patch, then please do send it to the list
493
+anyway.
494
+</p>
495
+<a name="Subscribe-to-the-ffmpeg_002dcvslog-mailing-list_002e"></a>
496
+<h3 class="subheading">Subscribe to the ffmpeg-cvslog mailing list.</h3>
497
+<p>Diffs of all commits are sent to the
498
+<a href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-cvslog">ffmpeg-cvslog</a>
499
+mailing list. Some developers read this list to review all code base changes
500
+from all sources. Subscribing to this list is not mandatory.
501
+</p>
502
+<a name="Keep-the-documentation-up-to-date_002e"></a>
503
+<h3 class="subheading">Keep the documentation up to date.</h3>
504
+<p>Update the documentation if you change behavior or add features. If you are
505
+unsure how best to do this, send a patch to ffmpeg-devel, the documentation
506
+maintainer(s) will review and commit your stuff.
507
+</p>
508
+<a name="Important-discussions-should-be-accessible-to-all_002e"></a>
509
+<h3 class="subheading">Important discussions should be accessible to all.</h3>
510
+<p>Try to keep important discussions and requests (also) on the public
511
+developer mailing list, so that all developers can benefit from them.
512
+</p>
513
+<a name="Check-your-entries-in-MAINTAINERS_002e"></a>
514
+<h3 class="subheading">Check your entries in MAINTAINERS.</h3>
515
+<p>Make sure that no parts of the codebase that you maintain are missing from the
516
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; file. If something that you want to maintain is missing add it with
517
+your name after it.
518
+If at some point you no longer want to maintain some code, then please help in
519
+finding a new maintainer and also don&rsquo;t forget to update the &lsquo;<tt>MAINTAINERS</tt>&rsquo; file.
520
+</p>
521
+<p>We think our rules are not too hard. If you have comments, contact us.
522
+</p>
523
+<a name="Code-of-conduct"></a>
524
+<h1 class="chapter"><a href="developer.html#toc-Code-of-conduct">5 Code of conduct</a></h1>
525
+
526
+<p>Be friendly and respectful towards others and third parties.
527
+Treat others the way you yourself want to be treated.
528
+</p>
529
+<p>Be considerate. Not everyone shares the same viewpoint and priorities as you do.
530
+Different opinions and interpretations help the project.
531
+Looking at issues from a different perspective assists development.
532
+</p>
533
+<p>Do not assume malice for things that can be attributed to incompetence. Even if
534
+it is malice, it&rsquo;s rarely good to start with that as initial assumption.
535
+</p>
536
+<p>Stay friendly even if someone acts contrarily. Everyone has a bad day
537
+once in a while.
538
+If you yourself have a bad day or are angry then try to take a break and reply
539
+once you are calm and without anger if you have to.
540
+</p>
541
+<p>Try to help other team members and cooperate if you can.
542
+</p>
543
+<p>The goal of software development is to create technical excellence, not for any
544
+individual to be better and &quot;win&quot; against the others. Large software projects
545
+are only possible and successful through teamwork.
546
+</p>
547
+<p>If someone struggles do not put them down. Give them a helping hand
548
+instead and point them in the right direction.
549
+</p>
550
+<p>Finally, keep in mind the immortal words of Bill and Ted,
551
+&quot;Be excellent to each other.&quot;
552
+</p>
553
+<p><a name="Submitting-patches"></a>
554
+</p><a name="Submitting-patches-1"></a>
555
+<h1 class="chapter"><a href="developer.html#toc-Submitting-patches-1">6 Submitting patches</a></h1>
556
+
557
+<p>First, read the <a href="#Coding-Rules">Coding Rules</a> above if you did not yet, in particular
558
+the rules regarding patch submission.
559
+</p>
560
+<p>When you submit your patch, please use <code>git format-patch</code> or
561
+<code>git send-email</code>. We cannot read other diffs :-).
562
+</p>
563
+<p>Also please do not submit a patch which contains several unrelated changes.
564
+Split it into separate, self-contained pieces. This does not mean splitting
565
+file by file. Instead, make the patch as small as possible while still
566
+keeping it as a logical unit that contains an individual change, even
567
+if it spans multiple files. This makes reviewing your patches much easier
568
+for us and greatly increases your chances of getting your patch applied.
569
+</p>
570
+<p>Use the patcheck tool of FFmpeg to check your patch.
571
+The tool is located in the tools directory.
572
+</p>
573
+<p>Run the <a href="#Regression-tests">Regression tests</a> before submitting a patch in order to verify
574
+it does not cause unexpected problems.
575
+</p>
576
+<p>It also helps quite a bit if you tell us what the patch does (for example
577
+&rsquo;replaces lrint by lrintf&rsquo;), and why (for example &rsquo;*BSD isn&rsquo;t C99 compliant
578
+and has no lrint()&rsquo;)
579
+</p>
580
+<p>Also please if you send several patches, send each patch as a separate mail,
581
+do not attach several unrelated patches to the same mail.
582
+</p>
583
+<p>Patches should be posted to the
584
+<a href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel">ffmpeg-devel</a>
585
+mailing list. Use <code>git send-email</code> when possible since it will properly
586
+send patches without requiring extra care. If you cannot, then send patches
587
+as base64-encoded attachments, so your patch is not trashed during
588
+transmission. Also ensure the correct mime type is used
589
+(text/x-diff or text/x-patch or at least text/plain) and that only one
590
+patch is inline or attached per mail.
591
+You can check <a href="https://patchwork.ffmpeg.org">https://patchwork.ffmpeg.org</a>, if your patch does not show up, its mime type
592
+likely was wrong.
593
+</p>
594
+<p>Your patch will be reviewed on the mailing list. You will likely be asked
595
+to make some changes and are expected to send in an improved version that
596
+incorporates the requests from the review. This process may go through
597
+several iterations. Once your patch is deemed good enough, some developer
598
+will pick it up and commit it to the official FFmpeg tree.
599
+</p>
600
+<p>Give us a few days to react. But if some time passes without reaction,
601
+send a reminder by email. Your patch should eventually be dealt with.
602
+</p>
603
+
604
+<a name="New-codecs-or-formats-checklist"></a>
605
+<h1 class="chapter"><a href="developer.html#toc-New-codecs-or-formats-checklist">7 New codecs or formats checklist</a></h1>
606
+
607
+<ol>
608
+<li>
609
+Did you use av_cold for codec initialization and close functions?
610
+
611
+</li><li>
612
+Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or
613
+AVInputFormat/AVOutputFormat struct?
614
+
615
+</li><li>
616
+Did you bump the minor version number (and reset the micro version
617
+number) in &lsquo;<tt>libavcodec/version.h</tt>&rsquo; or &lsquo;<tt>libavformat/version.h</tt>&rsquo;?
618
+
619
+</li><li>
620
+Did you register it in &lsquo;<tt>allcodecs.c</tt>&rsquo; or &lsquo;<tt>allformats.c</tt>&rsquo;?
621
+
622
+</li><li>
623
+Did you add the AVCodecID to &lsquo;<tt>avcodec.h</tt>&rsquo;?
624
+When adding new codec IDs, also add an entry to the codec descriptor
625
+list in &lsquo;<tt>libavcodec/codec_desc.c</tt>&rsquo;.
626
+
627
+</li><li>
628
+If it has a FourCC, did you add it to &lsquo;<tt>libavformat/riff.c</tt>&rsquo;,
629
+even if it is only a decoder?
630
+
631
+</li><li>
632
+Did you add a rule to compile the appropriate files in the Makefile?
633
+Remember to do this even if you&rsquo;re just adding a format to a file that is
634
+already being compiled by some other rule, like a raw demuxer.
635
+
636
+</li><li>
637
+Did you add an entry to the table of supported formats or codecs in
638
+&lsquo;<tt>doc/general.texi</tt>&rsquo;?
639
+
640
+</li><li>
641
+Did you add an entry in the Changelog?
642
+
643
+</li><li>
644
+If it depends on a parser or a library, did you add that dependency in
645
+configure?
646
+
647
+</li><li>
648
+Did you <code>git add</code> the appropriate files before committing?
649
+
650
+</li><li>
651
+Did you make sure it compiles standalone, i.e. with
652
+<code>configure --disable-everything --enable-decoder=foo</code>
653
+(or <code>--enable-demuxer</code> or whatever your component is)?
654
+</li></ol>
655
+
656
+
657
+<a name="Patch-submission-checklist"></a>
658
+<h1 class="chapter"><a href="developer.html#toc-Patch-submission-checklist">8 Patch submission checklist</a></h1>
659
+
660
+<ol>
661
+<li>
662
+Does <code>make fate</code> pass with the patch applied?
663
+
664
+</li><li>
665
+Was the patch generated with git format-patch or send-email?
666
+
667
+</li><li>
668
+Did you sign-off your patch? (<code>git commit -s</code>)
669
+See <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/process/submitting-patches.rst">Sign your work</a> for the meaning
670
+of <em>sign-off</em>.
671
+
672
+</li><li>
673
+Did you provide a clear git commit log message?
674
+
675
+</li><li>
676
+Is the patch against latest FFmpeg git master branch?
677
+
678
+</li><li>
679
+Are you subscribed to ffmpeg-devel?
680
+(the list is subscribers only due to spam)
681
+
682
+</li><li>
683
+Have you checked that the changes are minimal, so that the same cannot be
684
+achieved with a smaller patch and/or simpler final code?
685
+
686
+</li><li>
687
+If the change is to speed critical code, did you benchmark it?
688
+
689
+</li><li>
690
+If you did any benchmarks, did you provide them in the mail?
691
+
692
+</li><li>
693
+Have you checked that the patch does not introduce buffer overflows or
694
+other security issues?
695
+
696
+</li><li>
697
+Did you test your decoder or demuxer against damaged data? If no, see
698
+tools/trasher, the noise bitstream filter, and
699
+<a href="http://caca.zoy.org/wiki/zzuf">zzuf</a>. Your decoder or demuxer
700
+should not crash, end in a (near) infinite loop, or allocate ridiculous
701
+amounts of memory when fed damaged data.
702
+
703
+</li><li>
704
+Did you test your decoder or demuxer against sample files?
705
+Samples may be obtained at <a href="https://samples.ffmpeg.org">https://samples.ffmpeg.org</a>.
706
+
707
+</li><li>
708
+Does the patch not mix functional and cosmetic changes?
709
+
710
+</li><li>
711
+Did you add tabs or trailing whitespace to the code? Both are forbidden.
712
+
713
+</li><li>
714
+Is the patch attached to the email you send?
715
+
716
+</li><li>
717
+Is the mime type of the patch correct? It should be text/x-diff or
718
+text/x-patch or at least text/plain and not application/octet-stream.
719
+
720
+</li><li>
721
+If the patch fixes a bug, did you provide a verbose analysis of the bug?
722
+
723
+</li><li>
724
+If the patch fixes a bug, did you provide enough information, including
725
+a sample, so the bug can be reproduced and the fix can be verified?
726
+Note please do not attach samples &gt;100k to mails but rather provide a
727
+URL, you can upload to ftp://upload.ffmpeg.org.
728
+
729
+</li><li>
730
+Did you provide a verbose summary about what the patch does change?
731
+
732
+</li><li>
733
+Did you provide a verbose explanation why it changes things like it does?
734
+
735
+</li><li>
736
+Did you provide a verbose summary of the user visible advantages and
737
+disadvantages if the patch is applied?
738
+
739
+</li><li>
740
+Did you provide an example so we can verify the new feature added by the
741
+patch easily?
742
+
743
+</li><li>
744
+If you added a new file, did you insert a license header? It should be
745
+taken from FFmpeg, not randomly copied and pasted from somewhere else.
746
+
747
+</li><li>
748
+You should maintain alphabetical order in alphabetically ordered lists as
749
+long as doing so does not break API/ABI compatibility.
750
+
751
+</li><li>
752
+Lines with similar content should be aligned vertically when doing so
753
+improves readability.
754
+
755
+</li><li>
756
+Consider adding a regression test for your code.
757
+
758
+</li><li>
759
+If you added YASM code please check that things still work with &ndash;disable-yasm.
760
+
761
+</li><li>
762
+Make sure you check the return values of function and return appropriate
763
+error codes. Especially memory allocation functions like <code>av_malloc()</code>
764
+are notoriously left unchecked, which is a serious problem.
765
+
766
+</li><li>
767
+Test your code with valgrind and or Address Sanitizer to ensure it&rsquo;s free
768
+of leaks, out of array accesses, etc.
769
+</li></ol>
770
+
771
+<a name="Patch-review-process"></a>
772
+<h1 class="chapter"><a href="developer.html#toc-Patch-review-process">9 Patch review process</a></h1>
773
+
774
+<p>All patches posted to ffmpeg-devel will be reviewed, unless they contain a
775
+clear note that the patch is not for the git master branch.
776
+Reviews and comments will be posted as replies to the patch on the
777
+mailing list. The patch submitter then has to take care of every comment,
778
+that can be by resubmitting a changed patch or by discussion. Resubmitted
779
+patches will themselves be reviewed like any other patch. If at some point
780
+a patch passes review with no comments then it is approved, that can for
781
+simple and small patches happen immediately while large patches will generally
782
+have to be changed and reviewed many times before they are approved.
783
+After a patch is approved it will be committed to the repository.
784
+</p>
785
+<p>We will review all submitted patches, but sometimes we are quite busy so
786
+especially for large patches this can take several weeks.
787
+</p>
788
+<p>If you feel that the review process is too slow and you are willing to try to
789
+take over maintainership of the area of code you change then just clone
790
+git master and maintain the area of code there. We will merge each area from
791
+where its best maintained.
792
+</p>
793
+<p>When resubmitting patches, please do not make any significant changes
794
+not related to the comments received during review. Such patches will
795
+be rejected. Instead, submit significant changes or new features as
796
+separate patches.
797
+</p>
798
+<p>Everyone is welcome to review patches. Also if you are waiting for your patch
799
+to be reviewed, please consider helping to review other patches, that is a great
800
+way to get everyone&rsquo;s patches reviewed sooner.
801
+</p>
802
+<p><a name="Regression-tests"></a>
803
+</p><a name="Regression-tests-1"></a>
804
+<h1 class="chapter"><a href="developer.html#toc-Regression-tests-1">10 Regression tests</a></h1>
805
+
806
+<p>Before submitting a patch (or committing to the repository), you should at least
807
+test that you did not break anything.
808
+</p>
809
+<p>Running &rsquo;make fate&rsquo; accomplishes this, please see <a href="fate.html">fate.html</a> for details.
810
+</p>
811
+<p>[Of course, some patches may change the results of the regression tests. In
812
+this case, the reference results of the regression tests shall be modified
813
+accordingly].
814
+</p>
815
+<a name="Adding-files-to-the-fate_002dsuite-dataset"></a>
816
+<h2 class="section"><a href="developer.html#toc-Adding-files-to-the-fate_002dsuite-dataset">10.1 Adding files to the fate-suite dataset</a></h2>
817
+
818
+<p>When there is no muxer or encoder available to generate test media for a
819
+specific test then the media has to be included in the fate-suite.
820
+First please make sure that the sample file is as small as possible to test the
821
+respective decoder or demuxer sufficiently. Large files increase network
822
+bandwidth and disk space requirements.
823
+Once you have a working fate test and fate sample, provide in the commit
824
+message or introductory message for the patch series that you post to
825
+the ffmpeg-devel mailing list, a direct link to download the sample media.
826
+</p>
827
+<a name="Visualizing-Test-Coverage"></a>
828
+<h2 class="section"><a href="developer.html#toc-Visualizing-Test-Coverage">10.2 Visualizing Test Coverage</a></h2>
829
+
830
+<p>The FFmpeg build system allows visualizing the test coverage in an easy
831
+manner with the coverage tools <code>gcov</code>/<code>lcov</code>.  This involves
832
+the following steps:
833
+</p>
834
+<ol>
835
+<li>
836
+    Configure to compile with instrumentation enabled:
837
+    <code>configure --toolchain=gcov</code>.
838
+
839
+</li><li>
840
+    Run your test case, either manually or via FATE. This can be either
841
+    the full FATE regression suite, or any arbitrary invocation of any
842
+    front-end tool provided by FFmpeg, in any combination.
843
+
844
+</li><li>
845
+    Run <code>make lcov</code> to generate coverage data in HTML format.
846
+
847
+</li><li>
848
+    View <code>lcov/index.html</code> in your preferred HTML viewer.
849
+</li></ol>
850
+
851
+<p>You can use the command <code>make lcov-reset</code> to reset the coverage
852
+measurements. You will need to rerun <code>make lcov</code> after running a
853
+new test.
854
+</p>
855
+<a name="Using-Valgrind"></a>
856
+<h2 class="section"><a href="developer.html#toc-Using-Valgrind">10.3 Using Valgrind</a></h2>
857
+
858
+<p>The configure script provides a shortcut for using valgrind to spot bugs
859
+related to memory handling. Just add the option
860
+<code>--toolchain=valgrind-memcheck</code> or <code>--toolchain=valgrind-massif</code>
861
+to your configure line, and reasonable defaults will be set for running
862
+FATE under the supervision of either the <strong>memcheck</strong> or the
863
+<strong>massif</strong> tool of the valgrind suite.
864
+</p>
865
+<p>In case you need finer control over how valgrind is invoked, use the
866
+<code>--target-exec='valgrind &lt;your_custom_valgrind_options&gt;</code> option in
867
+your configure line instead.
868
+</p>
869
+<p><a name="Release-process"></a>
870
+</p><a name="Release-process-1"></a>
871
+<h1 class="chapter"><a href="developer.html#toc-Release-process-1">11 Release process</a></h1>
872
+
873
+<p>FFmpeg maintains a set of <strong>release branches</strong>, which are the
874
+recommended deliverable for system integrators and distributors (such as
875
+Linux distributions, etc.). At regular times, a <strong>release
876
+manager</strong> prepares, tests and publishes tarballs on the
877
+<a href="https://ffmpeg.org">https://ffmpeg.org</a> website.
878
+</p>
879
+<p>There are two kinds of releases:
880
+</p>
881
+<ol>
882
+<li>
883
+<strong>Major releases</strong> always include the latest and greatest
884
+features and functionality.
885
+
886
+</li><li>
887
+<strong>Point releases</strong> are cut from <strong>release</strong> branches,
888
+which are named <code>release/X</code>, with <code>X</code> being the release
889
+version number.
890
+</li></ol>
891
+
892
+<p>Note that we promise to our users that shared libraries from any FFmpeg
893
+release never break programs that have been <strong>compiled</strong> against
894
+previous versions of <strong>the same release series</strong> in any case!
895
+</p>
896
+<p>However, from time to time, we do make API changes that require adaptations
897
+in applications. Such changes are only allowed in (new) major releases and
898
+require further steps such as bumping library version numbers and/or
899
+adjustments to the symbol versioning file. Please discuss such changes
900
+on the <strong>ffmpeg-devel</strong> mailing list in time to allow forward planning.
901
+</p>
902
+<p><a name="Criteria-for-Point-Releases"></a>
903
+</p><a name="Criteria-for-Point-Releases-1"></a>
904
+<h2 class="section"><a href="developer.html#toc-Criteria-for-Point-Releases-1">11.1 Criteria for Point Releases</a></h2>
905
+
906
+<p>Changes that match the following criteria are valid candidates for
907
+inclusion into a point release:
908
+</p>
909
+<ol>
910
+<li>
911
+Fixes a security issue, preferably identified by a <strong>CVE
912
+number</strong> issued by <a href="http://cve.mitre.org/">http://cve.mitre.org/</a>.
913
+
914
+</li><li>
915
+Fixes a documented bug in <a href="https://trac.ffmpeg.org">https://trac.ffmpeg.org</a>.
916
+
917
+</li><li>
918
+Improves the included documentation.
919
+
920
+</li><li>
921
+Retains both source code and binary compatibility with previous
922
+point releases of the same release branch.
923
+</li></ol>
924
+
925
+<p>The order for checking the rules is (1 OR 2 OR 3) AND 4.
926
+</p>
927
+
928
+<a name="Release-Checklist"></a>
929
+<h2 class="section"><a href="developer.html#toc-Release-Checklist">11.2 Release Checklist</a></h2>
930
+
931
+<p>The release process involves the following steps:
932
+</p>
933
+<ol>
934
+<li>
935
+Ensure that the &lsquo;<tt>RELEASE</tt>&rsquo; file contains the version number for
936
+the upcoming release.
937
+
938
+</li><li>
939
+Add the release at <a href="https://trac.ffmpeg.org/admin/ticket/versions">https://trac.ffmpeg.org/admin/ticket/versions</a>.
940
+
941
+</li><li>
942
+Announce the intent to do a release to the mailing list.
943
+
944
+</li><li>
945
+Make sure all relevant security fixes have been backported. See
946
+<a href="https://ffmpeg.org/security.html">https://ffmpeg.org/security.html</a>.
947
+
948
+</li><li>
949
+Ensure that the FATE regression suite still passes in the release
950
+branch on at least <strong>i386</strong> and <strong>amd64</strong>
951
+(cf. <a href="#Regression-tests">Regression tests</a>).
952
+
953
+</li><li>
954
+Prepare the release tarballs in <code>bz2</code> and <code>gz</code> formats, and
955
+supplementing files that contain <code>gpg</code> signatures
956
+
957
+</li><li>
958
+Publish the tarballs at <a href="https://ffmpeg.org/releases">https://ffmpeg.org/releases</a>. Create and
959
+push an annotated tag in the form <code>nX</code>, with <code>X</code>
960
+containing the version number.
961
+
962
+</li><li>
963
+Propose and send a patch to the <strong>ffmpeg-devel</strong> mailing list
964
+with a news entry for the website.
965
+
966
+</li><li>
967
+Publish the news entry.
968
+
969
+</li><li>
970
+Send an announcement to the mailing list.
971
+</li></ol>
972
+
973
+    </div>
974
+  </body>
975
+</html>
976
+

+ 839
- 0
Common/ffmpeg/doc/faq.html ファイルの表示

@@ -0,0 +1,839 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="FFmpeg FAQ: ">
11
+<meta name="keywords" content="FFmpeg documentation : FFmpeg FAQ: ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">FFmpeg FAQ</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-General-Questions" href="#General-Questions">1 General Questions</a>
40
+  <ul class="no-bullet">
41
+    <li><a name="toc-Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f" href="#Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f">1.1 Why doesn&rsquo;t FFmpeg support feature [xyz]?</a></li>
42
+    <li><a name="toc-FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f" href="#FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f">1.2 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?</a></li>
43
+    <li><a name="toc-I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e" href="#I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e">1.3 I cannot read this file although this format seems to be supported by ffmpeg.</a></li>
44
+    <li><a name="toc-Which-codecs-are-supported-by-Windows_003f" href="#Which-codecs-are-supported-by-Windows_003f">1.4 Which codecs are supported by Windows?</a></li>
45
+  </ul></li>
46
+  <li><a name="toc-Compilation" href="#Compilation">2 Compilation</a>
47
+  <ul class="no-bullet">
48
+    <li><a name="toc-error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027" href="#error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027">2.1 <code>error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'</code></a></li>
49
+    <li><a name="toc-I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f" href="#I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f">2.2 I have installed this library with my distro&rsquo;s package manager. Why does <code>configure</code> not see it?</a></li>
50
+    <li><a name="toc-How-do-I-make-pkg_002dconfig-find-my-libraries_003f" href="#How-do-I-make-pkg_002dconfig-find-my-libraries_003f">2.3 How do I make <code>pkg-config</code> find my libraries?</a></li>
51
+    <li><a name="toc-How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f" href="#How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f">2.4 How do I use <code>pkg-config</code> when cross-compiling?</a></li>
52
+  </ul></li>
53
+  <li><a name="toc-Usage" href="#Usage">3 Usage</a>
54
+  <ul class="no-bullet">
55
+    <li><a name="toc-ffmpeg-does-not-work_003b-what-is-wrong_003f" href="#ffmpeg-does-not-work_003b-what-is-wrong_003f">3.1 ffmpeg does not work; what is wrong?</a></li>
56
+    <li><a name="toc-How-do-I-encode-single-pictures-into-movies_003f" href="#How-do-I-encode-single-pictures-into-movies_003f">3.2 How do I encode single pictures into movies?</a></li>
57
+    <li><a name="toc-How-do-I-encode-movie-to-single-pictures_003f" href="#How-do-I-encode-movie-to-single-pictures_003f">3.3 How do I encode movie to single pictures?</a></li>
58
+    <li><a name="toc-Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f" href="#Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f">3.4 Why do I see a slight quality degradation with multithreaded MPEG* encoding?</a></li>
59
+    <li><a name="toc-How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f" href="#How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f">3.5 How can I read from the standard input or write to the standard output?</a></li>
60
+    <li><a name="toc-_002df-jpeg-doesn_0027t-work_002e" href="#g_t_002df-jpeg-doesn_0027t-work_002e">3.6 -f jpeg doesn&rsquo;t work.</a></li>
61
+    <li><a name="toc-Why-can-I-not-change-the-frame-rate_003f" href="#Why-can-I-not-change-the-frame-rate_003f">3.7 Why can I not change the frame rate?</a></li>
62
+    <li><a name="toc-How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f" href="#How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f">3.8 How do I encode Xvid or DivX video with ffmpeg?</a></li>
63
+    <li><a name="toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f">3.9 Which are good parameters for encoding high quality MPEG-4?</a></li>
64
+    <li><a name="toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f">3.10 Which are good parameters for encoding high quality MPEG-1/MPEG-2?</a></li>
65
+    <li><a name="toc-Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f" href="#Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f">3.11 Interlaced video looks very bad when encoded with ffmpeg, what is wrong?</a></li>
66
+    <li><a name="toc-How-can-I-read-DirectShow-files_003f" href="#How-can-I-read-DirectShow-files_003f">3.12 How can I read DirectShow files?</a></li>
67
+    <li><a name="toc-How-can-I-join-video-files_003f" href="#How-can-I-join-video-files_003f">3.13 How can I join video files?</a></li>
68
+    <li><a name="toc-How-can-I-concatenate-video-files_003f" href="#How-can-I-concatenate-video-files_003f">3.14 How can I concatenate video files?</a>
69
+    <ul class="no-bullet">
70
+      <li><a name="toc-Concatenating-using-the-concat-filter" href="#Concatenating-using-the-concat-filter">3.14.1 Concatenating using the concat <em>filter</em></a></li>
71
+      <li><a name="toc-Concatenating-using-the-concat-demuxer" href="#Concatenating-using-the-concat-demuxer">3.14.2 Concatenating using the concat <em>demuxer</em></a></li>
72
+      <li><a name="toc-Concatenating-using-the-concat-protocol-_0028file-level_0029" href="#Concatenating-using-the-concat-protocol-_0028file-level_0029">3.14.3 Concatenating using the concat <em>protocol</em> (file level)</a></li>
73
+      <li><a name="toc-Concatenating-using-raw-audio-and-video" href="#Concatenating-using-raw-audio-and-video">3.14.4 Concatenating using raw audio and video</a></li>
74
+    </ul></li>
75
+    <li><a name="toc-Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e" href="#Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e">3.15 Using &lsquo;<samp>-f lavfi</samp>&rsquo;, audio becomes mono for no apparent reason.</a></li>
76
+    <li><a name="toc-Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f" href="#Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f">3.16 Why does FFmpeg not see the subtitles in my VOB file?</a></li>
77
+    <li><a name="toc-Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f" href="#Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f">3.17 Why was the <code>ffmpeg</code> &lsquo;<samp>-sameq</samp>&rsquo; option removed? What to use instead?</a></li>
78
+    <li><a name="toc-I-have-a-stretched-video_002c-why-does-scaling-does-not-fix-it_003f" href="#I-have-a-stretched-video_002c-why-does-scaling-does-not-fix-it_003f">3.18 I have a stretched video, why does scaling does not fix it?</a></li>
79
+    <li><a name="toc-How-do-I-run-ffmpeg-as-a-background-task_003f" href="#How-do-I-run-ffmpeg-as-a-background-task_003f">3.19 How do I run ffmpeg as a background task?</a></li>
80
+    <li><a name="toc-How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f" href="#How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f">3.20 How do I prevent ffmpeg from suspending with a message like <em>suspended (tty output)</em>?</a></li>
81
+  </ul></li>
82
+  <li><a name="toc-Development" href="#Development">4 Development</a>
83
+  <ul class="no-bullet">
84
+    <li><a name="toc-Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f" href="#Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f">4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?</a></li>
85
+    <li><a name="toc-Can-you-support-my-C-compiler-XXX_003f" href="#Can-you-support-my-C-compiler-XXX_003f">4.2 Can you support my C compiler XXX?</a></li>
86
+    <li><a name="toc-Is-Microsoft-Visual-C_002b_002b-supported_003f" href="#Is-Microsoft-Visual-C_002b_002b-supported_003f">4.3 Is Microsoft Visual C++ supported?</a></li>
87
+    <li><a name="toc-Can-you-add-automake_002c-libtool-or-autoconf-support_003f" href="#Can-you-add-automake_002c-libtool-or-autoconf-support_003f">4.4 Can you add automake, libtool or autoconf support?</a></li>
88
+    <li><a name="toc-Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f" href="#Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f">4.5 Why not rewrite FFmpeg in object-oriented C++?</a></li>
89
+    <li><a name="toc-Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f" href="#Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f">4.6 Why are the ffmpeg programs devoid of debugging symbols?</a></li>
90
+    <li><a name="toc-I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f" href="#I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f">4.7 I do not like the LGPL, can I contribute code under the GPL instead?</a></li>
91
+    <li><a name="toc-I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e" href="#I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e">4.8 I&rsquo;m using FFmpeg from within my C application but the linker complains about missing symbols from the libraries themselves.</a></li>
92
+    <li><a name="toc-I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e" href="#I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e">4.9 I&rsquo;m using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.</a></li>
93
+    <li><a name="toc-I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope" href="#I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope">4.10 I&rsquo;m using libavutil from within my C++ application but the compiler complains about &rsquo;UINT64_C&rsquo; was not declared in this scope</a></li>
94
+    <li><a name="toc-I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f" href="#I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f">4.11 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?</a></li>
95
+    <li><a name="toc-Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f" href="#Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f">4.12 Where is the documentation about ffv1, msmpeg4, asv1, 4xm?</a></li>
96
+    <li><a name="toc-How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f" href="#How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f">4.13 How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?</a></li>
97
+    <li><a name="toc-AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e" href="#AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e">4.14 AVStream.r_frame_rate is wrong, it is much larger than the frame rate.</a></li>
98
+    <li><a name="toc-Why-is-make-fate-not-running-all-tests_003f" href="#Why-is-make-fate-not-running-all-tests_003f">4.15 Why is <code>make fate</code> not running all tests?</a></li>
99
+    <li><a name="toc-Why-is-make-fate-not-finding-the-samples_003f" href="#Why-is-make-fate-not-finding-the-samples_003f">4.16 Why is <code>make fate</code> not finding the samples?</a></li>
100
+  </ul>
101
+</li>
102
+</ul>
103
+</div>
104
+
105
+
106
+<hr size="6">
107
+<a name="General-Questions"></a>
108
+<h1 class="chapter"><a href="faq.html#toc-General-Questions">1 General Questions</a></h1>
109
+
110
+<a name="Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f"></a>
111
+<h2 class="section"><a href="faq.html#toc-Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f">1.1 Why doesn&rsquo;t FFmpeg support feature [xyz]?</a></h2>
112
+
113
+<p>Because no one has taken on that task yet. FFmpeg development is
114
+driven by the tasks that are important to the individual developers.
115
+If there is a feature that is important to you, the best way to get
116
+it implemented is to undertake the task yourself or sponsor a developer.
117
+</p>
118
+<a name="FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f"></a>
119
+<h2 class="section"><a href="faq.html#toc-FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f">1.2 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?</a></h2>
120
+
121
+<p>No. Windows DLLs are not portable, bloated and often slow.
122
+Moreover FFmpeg strives to support all codecs natively.
123
+A DLL loader is not conducive to that goal.
124
+</p>
125
+<a name="I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e"></a>
126
+<h2 class="section"><a href="faq.html#toc-I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e">1.3 I cannot read this file although this format seems to be supported by ffmpeg.</a></h2>
127
+
128
+<p>Even if ffmpeg can read the container format, it may not support all its
129
+codecs. Please consult the supported codec list in the ffmpeg
130
+documentation.
131
+</p>
132
+<a name="Which-codecs-are-supported-by-Windows_003f"></a>
133
+<h2 class="section"><a href="faq.html#toc-Which-codecs-are-supported-by-Windows_003f">1.4 Which codecs are supported by Windows?</a></h2>
134
+
135
+<p>Windows does not support standard formats like MPEG very well, unless you
136
+install some additional codecs.
137
+</p>
138
+<p>The following list of video codecs should work on most Windows systems:
139
+</p><dl compact="compact">
140
+<dt>&lsquo;<samp>msmpeg4v2</samp>&rsquo;</dt>
141
+<dd><p>.avi/.asf
142
+</p></dd>
143
+<dt>&lsquo;<samp>msmpeg4</samp>&rsquo;</dt>
144
+<dd><p>.asf only
145
+</p></dd>
146
+<dt>&lsquo;<samp>wmv1</samp>&rsquo;</dt>
147
+<dd><p>.asf only
148
+</p></dd>
149
+<dt>&lsquo;<samp>wmv2</samp>&rsquo;</dt>
150
+<dd><p>.asf only
151
+</p></dd>
152
+<dt>&lsquo;<samp>mpeg4</samp>&rsquo;</dt>
153
+<dd><p>Only if you have some MPEG-4 codec like ffdshow or Xvid installed.
154
+</p></dd>
155
+<dt>&lsquo;<samp>mpeg1video</samp>&rsquo;</dt>
156
+<dd><p>.mpg only
157
+</p></dd>
158
+</dl>
159
+<p>Note, ASF files often have .wmv or .wma extensions in Windows. It should also
160
+be mentioned that Microsoft claims a patent on the ASF format, and may sue
161
+or threaten users who create ASF files with non-Microsoft software. It is
162
+strongly advised to avoid ASF where possible.
163
+</p>
164
+<p>The following list of audio codecs should work on most Windows systems:
165
+</p><dl compact="compact">
166
+<dt>&lsquo;<samp>adpcm_ima_wav</samp>&rsquo;</dt>
167
+<dt>&lsquo;<samp>adpcm_ms</samp>&rsquo;</dt>
168
+<dt>&lsquo;<samp>pcm_s16le</samp>&rsquo;</dt>
169
+<dd><p>always
170
+</p></dd>
171
+<dt>&lsquo;<samp>libmp3lame</samp>&rsquo;</dt>
172
+<dd><p>If some MP3 codec like LAME is installed.
173
+</p></dd>
174
+</dl>
175
+
176
+
177
+<a name="Compilation"></a>
178
+<h1 class="chapter"><a href="faq.html#toc-Compilation">2 Compilation</a></h1>
179
+
180
+<a name="error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027"></a>
181
+<h2 class="section"><a href="faq.html#toc-error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027">2.1 <code>error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'</code></a></h2>
182
+
183
+<p>This is a bug in gcc. Do not report it to us. Instead, please report it to
184
+the gcc developers. Note that we will not add workarounds for gcc bugs.
185
+</p>
186
+<p>Also note that (some of) the gcc developers believe this is not a bug or
187
+not a bug they should fix:
188
+<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203</a>.
189
+Then again, some of them do not know the difference between an undecidable
190
+problem and an NP-hard problem...
191
+</p>
192
+<a name="I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f"></a>
193
+<h2 class="section"><a href="faq.html#toc-I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f">2.2 I have installed this library with my distro&rsquo;s package manager. Why does <code>configure</code> not see it?</a></h2>
194
+
195
+<p>Distributions usually split libraries in several packages. The main package
196
+contains the files necessary to run programs using the library. The
197
+development package contains the files necessary to build programs using the
198
+library. Sometimes, docs and/or data are in a separate package too.
199
+</p>
200
+<p>To build FFmpeg, you need to install the development package. It is usually
201
+called &lsquo;<tt>libfoo-dev</tt>&rsquo; or &lsquo;<tt>libfoo-devel</tt>&rsquo;. You can remove it after the
202
+build is finished, but be sure to keep the main package.
203
+</p>
204
+<a name="How-do-I-make-pkg_002dconfig-find-my-libraries_003f"></a>
205
+<h2 class="section"><a href="faq.html#toc-How-do-I-make-pkg_002dconfig-find-my-libraries_003f">2.3 How do I make <code>pkg-config</code> find my libraries?</a></h2>
206
+
207
+<p>Somewhere along with your libraries, there is a &lsquo;<tt>.pc</tt>&rsquo; file (or several)
208
+in a &lsquo;<tt>pkgconfig</tt>&rsquo; directory. You need to set environment variables to
209
+point <code>pkg-config</code> to these files.
210
+</p>
211
+<p>If you need to <em>add</em> directories to <code>pkg-config</code>&rsquo;s search list
212
+(typical use case: library installed separately), add it to
213
+<code>$PKG_CONFIG_PATH</code>:
214
+</p>
215
+<div class="example">
216
+<pre class="example">export PKG_CONFIG_PATH=/opt/x264/lib/pkgconfig:/opt/opus/lib/pkgconfig
217
+</pre></div>
218
+
219
+<p>If you need to <em>replace</em> <code>pkg-config</code>&rsquo;s search list
220
+(typical use case: cross-compiling), set it in
221
+<code>$PKG_CONFIG_LIBDIR</code>:
222
+</p>
223
+<div class="example">
224
+<pre class="example">export PKG_CONFIG_LIBDIR=/home/me/cross/usr/lib/pkgconfig:/home/me/cross/usr/local/lib/pkgconfig
225
+</pre></div>
226
+
227
+<p>If you need to know the library&rsquo;s internal dependencies (typical use: static
228
+linking), add the <code>--static</code> option to <code>pkg-config</code>:
229
+</p>
230
+<div class="example">
231
+<pre class="example">./configure --pkg-config-flags=--static
232
+</pre></div>
233
+
234
+<a name="How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f"></a>
235
+<h2 class="section"><a href="faq.html#toc-How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f">2.4 How do I use <code>pkg-config</code> when cross-compiling?</a></h2>
236
+
237
+<p>The best way is to install <code>pkg-config</code> in your cross-compilation
238
+environment. It will automatically use the cross-compilation libraries.
239
+</p>
240
+<p>You can also use <code>pkg-config</code> from the host environment by
241
+specifying explicitly <code>--pkg-config=pkg-config</code> to <code>configure</code>.
242
+In that case, you must point <code>pkg-config</code> to the correct directories
243
+using the <code>PKG_CONFIG_LIBDIR</code>, as explained in the previous entry.
244
+</p>
245
+<p>As an intermediate solution, you can place in your cross-compilation
246
+environment a script that calls the host <code>pkg-config</code> with
247
+<code>PKG_CONFIG_LIBDIR</code> set. That script can look like that:
248
+</p>
249
+<div class="example">
250
+<pre class="example">#!/bin/sh
251
+PKG_CONFIG_LIBDIR=/path/to/cross/lib/pkgconfig
252
+export PKG_CONFIG_LIBDIR
253
+exec /usr/bin/pkg-config &quot;$@&quot;
254
+</pre></div>
255
+
256
+<a name="Usage"></a>
257
+<h1 class="chapter"><a href="faq.html#toc-Usage">3 Usage</a></h1>
258
+
259
+<a name="ffmpeg-does-not-work_003b-what-is-wrong_003f"></a>
260
+<h2 class="section"><a href="faq.html#toc-ffmpeg-does-not-work_003b-what-is-wrong_003f">3.1 ffmpeg does not work; what is wrong?</a></h2>
261
+
262
+<p>Try a <code>make distclean</code> in the ffmpeg source directory before the build.
263
+If this does not help see
264
+(<a href="https://ffmpeg.org/bugreports.html">https://ffmpeg.org/bugreports.html</a>).
265
+</p>
266
+<a name="How-do-I-encode-single-pictures-into-movies_003f"></a>
267
+<h2 class="section"><a href="faq.html#toc-How-do-I-encode-single-pictures-into-movies_003f">3.2 How do I encode single pictures into movies?</a></h2>
268
+
269
+<p>First, rename your pictures to follow a numerical sequence.
270
+For example, img1.jpg, img2.jpg, img3.jpg,...
271
+Then you may run:
272
+</p>
273
+<div class="example">
274
+<pre class="example">ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
275
+</pre></div>
276
+
277
+<p>Notice that &lsquo;<samp>%d</samp>&rsquo; is replaced by the image number.
278
+</p>
279
+<p>&lsquo;<tt>img%03d.jpg</tt>&rsquo; means the sequence &lsquo;<tt>img001.jpg</tt>&rsquo;, &lsquo;<tt>img002.jpg</tt>&rsquo;, etc.
280
+</p>
281
+<p>Use the &lsquo;<samp>-start_number</samp>&rsquo; option to declare a starting number for
282
+the sequence. This is useful if your sequence does not start with
283
+&lsquo;<tt>img001.jpg</tt>&rsquo; but is still in a numerical order. The following
284
+example will start with &lsquo;<tt>img100.jpg</tt>&rsquo;:
285
+</p>
286
+<div class="example">
287
+<pre class="example">ffmpeg -f image2 -start_number 100 -i img%d.jpg /tmp/a.mpg
288
+</pre></div>
289
+
290
+<p>If you have large number of pictures to rename, you can use the
291
+following command to ease the burden. The command, using the bourne
292
+shell syntax, symbolically links all files in the current directory
293
+that match <code>*jpg</code> to the &lsquo;<tt>/tmp</tt>&rsquo; directory in the sequence of
294
+&lsquo;<tt>img001.jpg</tt>&rsquo;, &lsquo;<tt>img002.jpg</tt>&rsquo; and so on.
295
+</p>
296
+<div class="example">
297
+<pre class="example">x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s &quot;$i&quot; /tmp/img&quot;$counter&quot;.jpg; x=$(($x+1)); done
298
+</pre></div>
299
+
300
+<p>If you want to sequence them by oldest modified first, substitute
301
+<code>$(ls -r -t *jpg)</code> in place of <code>*jpg</code>.
302
+</p>
303
+<p>Then run:
304
+</p>
305
+<div class="example">
306
+<pre class="example">ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
307
+</pre></div>
308
+
309
+<p>The same logic is used for any image format that ffmpeg reads.
310
+</p>
311
+<p>You can also use <code>cat</code> to pipe images to ffmpeg:
312
+</p>
313
+<div class="example">
314
+<pre class="example">cat *.jpg | ffmpeg -f image2pipe -c:v mjpeg -i - output.mpg
315
+</pre></div>
316
+
317
+<a name="How-do-I-encode-movie-to-single-pictures_003f"></a>
318
+<h2 class="section"><a href="faq.html#toc-How-do-I-encode-movie-to-single-pictures_003f">3.3 How do I encode movie to single pictures?</a></h2>
319
+
320
+<p>Use:
321
+</p>
322
+<div class="example">
323
+<pre class="example">ffmpeg -i movie.mpg movie%d.jpg
324
+</pre></div>
325
+
326
+<p>The &lsquo;<tt>movie.mpg</tt>&rsquo; used as input will be converted to
327
+&lsquo;<tt>movie1.jpg</tt>&rsquo;, &lsquo;<tt>movie2.jpg</tt>&rsquo;, etc...
328
+</p>
329
+<p>Instead of relying on file format self-recognition, you may also use
330
+</p><dl compact="compact">
331
+<dt>&lsquo;<samp>-c:v ppm</samp>&rsquo;</dt>
332
+<dt>&lsquo;<samp>-c:v png</samp>&rsquo;</dt>
333
+<dt>&lsquo;<samp>-c:v mjpeg</samp>&rsquo;</dt>
334
+</dl>
335
+<p>to force the encoding.
336
+</p>
337
+<p>Applying that to the previous example:
338
+</p><div class="example">
339
+<pre class="example">ffmpeg -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
340
+</pre></div>
341
+
342
+<p>Beware that there is no &quot;jpeg&quot; codec. Use &quot;mjpeg&quot; instead.
343
+</p>
344
+<a name="Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f"></a>
345
+<h2 class="section"><a href="faq.html#toc-Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f">3.4 Why do I see a slight quality degradation with multithreaded MPEG* encoding?</a></h2>
346
+
347
+<p>For multithreaded MPEG* encoding, the encoded slices must be independent,
348
+otherwise thread n would practically have to wait for n-1 to finish, so it&rsquo;s
349
+quite logical that there is a small reduction of quality. This is not a bug.
350
+</p>
351
+<a name="How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f"></a>
352
+<h2 class="section"><a href="faq.html#toc-How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f">3.5 How can I read from the standard input or write to the standard output?</a></h2>
353
+
354
+<p>Use &lsquo;<tt>-</tt>&rsquo; as file name.
355
+</p>
356
+<a name="g_t_002df-jpeg-doesn_0027t-work_002e"></a>
357
+<h2 class="section"><a href="faq.html#toc-_002df-jpeg-doesn_0027t-work_002e">3.6 -f jpeg doesn&rsquo;t work.</a></h2>
358
+
359
+<p>Try &rsquo;-f image2 test%d.jpg&rsquo;.
360
+</p>
361
+<a name="Why-can-I-not-change-the-frame-rate_003f"></a>
362
+<h2 class="section"><a href="faq.html#toc-Why-can-I-not-change-the-frame-rate_003f">3.7 Why can I not change the frame rate?</a></h2>
363
+
364
+<p>Some codecs, like MPEG-1/2, only allow a small number of fixed frame rates.
365
+Choose a different codec with the -c:v command line option.
366
+</p>
367
+<a name="How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f"></a>
368
+<h2 class="section"><a href="faq.html#toc-How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f">3.8 How do I encode Xvid or DivX video with ffmpeg?</a></h2>
369
+
370
+<p>Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
371
+standard (note that there are many other coding formats that use this
372
+same standard). Thus, use &rsquo;-c:v mpeg4&rsquo; to encode in these formats. The
373
+default fourcc stored in an MPEG-4-coded file will be &rsquo;FMP4&rsquo;. If you want
374
+a different fourcc, use the &rsquo;-vtag&rsquo; option. E.g., &rsquo;-vtag xvid&rsquo; will
375
+force the fourcc &rsquo;xvid&rsquo; to be stored as the video fourcc rather than the
376
+default.
377
+</p>
378
+<a name="Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f"></a>
379
+<h2 class="section"><a href="faq.html#toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f">3.9 Which are good parameters for encoding high quality MPEG-4?</a></h2>
380
+
381
+<p>&rsquo;-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2&rsquo;,
382
+things to try: &rsquo;-bf 2&rsquo;, &rsquo;-mpv_flags qp_rd&rsquo;, &rsquo;-mpv_flags mv0&rsquo;, &rsquo;-mpv_flags skip_rd&rsquo;.
383
+</p>
384
+<a name="Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f"></a>
385
+<h2 class="section"><a href="faq.html#toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f">3.10 Which are good parameters for encoding high quality MPEG-1/MPEG-2?</a></h2>
386
+
387
+<p>&rsquo;-mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 100 -pass 1/2&rsquo;
388
+but beware the &rsquo;-g 100&rsquo; might cause problems with some decoders.
389
+Things to try: &rsquo;-bf 2&rsquo;, &rsquo;-mpv_flags qp_rd&rsquo;, &rsquo;-mpv_flags mv0&rsquo;, &rsquo;-mpv_flags skip_rd&rsquo;.
390
+</p>
391
+<a name="Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f"></a>
392
+<h2 class="section"><a href="faq.html#toc-Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f">3.11 Interlaced video looks very bad when encoded with ffmpeg, what is wrong?</a></h2>
393
+
394
+<p>You should use &rsquo;-flags +ilme+ildct&rsquo; and maybe &rsquo;-flags +alt&rsquo; for interlaced
395
+material, and try &rsquo;-top 0/1&rsquo; if the result looks really messed-up.
396
+</p>
397
+<a name="How-can-I-read-DirectShow-files_003f"></a>
398
+<h2 class="section"><a href="faq.html#toc-How-can-I-read-DirectShow-files_003f">3.12 How can I read DirectShow files?</a></h2>
399
+
400
+<p>If you have built FFmpeg with <code>./configure --enable-avisynth</code>
401
+(only possible on MinGW/Cygwin platforms),
402
+then you may use any file that DirectShow can read as input.
403
+</p>
404
+<p>Just create an &quot;input.avs&quot; text file with this single line ...
405
+</p><div class="example">
406
+<pre class="example">DirectShowSource(&quot;C:\path to your file\yourfile.asf&quot;)
407
+</pre></div>
408
+<p>... and then feed that text file to ffmpeg:
409
+</p><div class="example">
410
+<pre class="example">ffmpeg -i input.avs
411
+</pre></div>
412
+
413
+<p>For ANY other help on AviSynth, please visit the
414
+<a href="http://www.avisynth.org/">AviSynth homepage</a>.
415
+</p>
416
+<a name="How-can-I-join-video-files_003f"></a>
417
+<h2 class="section"><a href="faq.html#toc-How-can-I-join-video-files_003f">3.13 How can I join video files?</a></h2>
418
+
419
+<p>To &quot;join&quot; video files is quite ambiguous. The following list explains the
420
+different kinds of &quot;joining&quot; and points out how those are addressed in
421
+FFmpeg. To join video files may mean:
422
+</p>
423
+<ul>
424
+<li>
425
+To put them one after the other: this is called to <em>concatenate</em> them
426
+(in short: concat) and is addressed
427
+<a href="#How-can-I-concatenate-video-files">in this very faq</a>.
428
+
429
+</li><li>
430
+To put them together in the same file, to let the user choose between the
431
+different versions (example: different audio languages): this is called to
432
+<em>multiplex</em> them together (in short: mux), and is done by simply
433
+invoking ffmpeg with several &lsquo;<samp>-i</samp>&rsquo; options.
434
+
435
+</li><li>
436
+For audio, to put all channels together in a single stream (example: two
437
+mono streams into one stereo stream): this is sometimes called to
438
+<em>merge</em> them, and can be done using the
439
+<a href="ffmpeg-filters.html#amerge"><code>amerge</code></a> filter.
440
+
441
+</li><li>
442
+For audio, to play one on top of the other: this is called to <em>mix</em>
443
+them, and can be done by first merging them into a single stream and then
444
+using the <a href="ffmpeg-filters.html#pan"><code>pan</code></a> filter to mix
445
+the channels at will.
446
+
447
+</li><li>
448
+For video, to display both together, side by side or one on top of a part of
449
+the other; it can be done using the
450
+<a href="ffmpeg-filters.html#overlay"><code>overlay</code></a> video filter.
451
+
452
+</li></ul>
453
+
454
+<p><a name="How-can-I-concatenate-video-files"></a>
455
+</p><a name="How-can-I-concatenate-video-files_003f"></a>
456
+<h2 class="section"><a href="faq.html#toc-How-can-I-concatenate-video-files_003f">3.14 How can I concatenate video files?</a></h2>
457
+
458
+<p>There are several solutions, depending on the exact circumstances.
459
+</p>
460
+<a name="Concatenating-using-the-concat-filter"></a>
461
+<h3 class="subsection"><a href="faq.html#toc-Concatenating-using-the-concat-filter">3.14.1 Concatenating using the concat <em>filter</em></a></h3>
462
+
463
+<p>FFmpeg has a <a href="ffmpeg-filters.html#concat"><code>concat</code></a> filter designed specifically for that, with examples in the
464
+documentation. This operation is recommended if you need to re-encode.
465
+</p>
466
+<a name="Concatenating-using-the-concat-demuxer"></a>
467
+<h3 class="subsection"><a href="faq.html#toc-Concatenating-using-the-concat-demuxer">3.14.2 Concatenating using the concat <em>demuxer</em></a></h3>
468
+
469
+<p>FFmpeg has a <a href="ffmpeg-formats.html#concat"><code>concat</code></a> demuxer which you can use when you want to avoid a re-encode and
470
+your format doesn&rsquo;t support file level concatenation.
471
+</p>
472
+<a name="Concatenating-using-the-concat-protocol-_0028file-level_0029"></a>
473
+<h3 class="subsection"><a href="faq.html#toc-Concatenating-using-the-concat-protocol-_0028file-level_0029">3.14.3 Concatenating using the concat <em>protocol</em> (file level)</a></h3>
474
+
475
+<p>FFmpeg has a <a href="ffmpeg-protocols.html#concat"><code>concat</code></a> protocol designed specifically for that, with examples in the
476
+documentation.
477
+</p>
478
+<p>A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow one to concatenate
479
+video by merely concatenating the files containing them.
480
+</p>
481
+<p>Hence you may concatenate your multimedia files by first transcoding them to
482
+these privileged formats, then using the humble <code>cat</code> command (or the
483
+equally humble <code>copy</code> under Windows), and finally transcoding back to your
484
+format of choice.
485
+</p>
486
+<div class="example">
487
+<pre class="example">ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
488
+ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
489
+cat intermediate1.mpg intermediate2.mpg &gt; intermediate_all.mpg
490
+ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
491
+</pre></div>
492
+
493
+<p>Additionally, you can use the <code>concat</code> protocol instead of <code>cat</code> or
494
+<code>copy</code> which will avoid creation of a potentially huge intermediate file.
495
+</p>
496
+<div class="example">
497
+<pre class="example">ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
498
+ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
499
+ffmpeg -i concat:&quot;intermediate1.mpg|intermediate2.mpg&quot; -c copy intermediate_all.mpg
500
+ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
501
+</pre></div>
502
+
503
+<p>Note that you may need to escape the character &quot;|&quot; which is special for many
504
+shells.
505
+</p>
506
+<p>Another option is usage of named pipes, should your platform support it:
507
+</p>
508
+<div class="example">
509
+<pre class="example">mkfifo intermediate1.mpg
510
+mkfifo intermediate2.mpg
511
+ffmpeg -i input1.avi -qscale:v 1 -y intermediate1.mpg &lt; /dev/null &amp;
512
+ffmpeg -i input2.avi -qscale:v 1 -y intermediate2.mpg &lt; /dev/null &amp;
513
+cat intermediate1.mpg intermediate2.mpg |\
514
+ffmpeg -f mpeg -i - -c:v mpeg4 -c:a libmp3lame output.avi
515
+</pre></div>
516
+
517
+<a name="Concatenating-using-raw-audio-and-video"></a>
518
+<h3 class="subsection"><a href="faq.html#toc-Concatenating-using-raw-audio-and-video">3.14.4 Concatenating using raw audio and video</a></h3>
519
+
520
+<p>Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
521
+allow concatenation, and the transcoding step is almost lossless.
522
+When using multiple yuv4mpegpipe(s), the first line needs to be discarded
523
+from all but the first stream. This can be accomplished by piping through
524
+<code>tail</code> as seen below. Note that when piping through <code>tail</code> you
525
+must use command grouping, <code>{  ;}</code>, to background properly.
526
+</p>
527
+<p>For example, let&rsquo;s say we want to concatenate two FLV files into an
528
+output.flv file:
529
+</p>
530
+<div class="example">
531
+<pre class="example">mkfifo temp1.a
532
+mkfifo temp1.v
533
+mkfifo temp2.a
534
+mkfifo temp2.v
535
+mkfifo all.a
536
+mkfifo all.v
537
+ffmpeg -i input1.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - &gt; temp1.a &lt; /dev/null &amp;
538
+ffmpeg -i input2.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - &gt; temp2.a &lt; /dev/null &amp;
539
+ffmpeg -i input1.flv -an -f yuv4mpegpipe - &gt; temp1.v &lt; /dev/null &amp;
540
+{ ffmpeg -i input2.flv -an -f yuv4mpegpipe - &lt; /dev/null | tail -n +2 &gt; temp2.v ; } &amp;
541
+cat temp1.a temp2.a &gt; all.a &amp;
542
+cat temp1.v temp2.v &gt; all.v &amp;
543
+ffmpeg -f u16le -c:a pcm_s16le -ac 2 -ar 44100 -i all.a \
544
+       -f yuv4mpegpipe -i all.v \
545
+       -y output.flv
546
+rm temp[12].[av] all.[av]
547
+</pre></div>
548
+
549
+<a name="Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e"></a>
550
+<h2 class="section"><a href="faq.html#toc-Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e">3.15 Using &lsquo;<samp>-f lavfi</samp>&rsquo;, audio becomes mono for no apparent reason.</a></h2>
551
+
552
+<p>Use &lsquo;<samp>-dumpgraph -</samp>&rsquo; to find out exactly where the channel layout is
553
+lost.
554
+</p>
555
+<p>Most likely, it is through <code>auto-inserted aresample</code>. Try to understand
556
+why the converting filter was needed at that place.
557
+</p>
558
+<p>Just before the output is a likely place, as &lsquo;<samp>-f lavfi</samp>&rsquo; currently
559
+only support packed S16.
560
+</p>
561
+<p>Then insert the correct <code>aformat</code> explicitly in the filtergraph,
562
+specifying the exact format.
563
+</p>
564
+<div class="example">
565
+<pre class="example">aformat=sample_fmts=s16:channel_layouts=stereo
566
+</pre></div>
567
+
568
+<a name="Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f"></a>
569
+<h2 class="section"><a href="faq.html#toc-Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f">3.16 Why does FFmpeg not see the subtitles in my VOB file?</a></h2>
570
+
571
+<p>VOB and a few other formats do not have a global header that describes
572
+everything present in the file. Instead, applications are supposed to scan
573
+the file to see what it contains. Since VOB files are frequently large, only
574
+the beginning is scanned. If the subtitles happen only later in the file,
575
+they will not be initially detected.
576
+</p>
577
+<p>Some applications, including the <code>ffmpeg</code> command-line tool, can only
578
+work with streams that were detected during the initial scan; streams that
579
+are detected later are ignored.
580
+</p>
581
+<p>The size of the initial scan is controlled by two options: <code>probesize</code>
582
+(default ~5 Mo) and <code>analyzeduration</code> (default 5,000,000 µs = 5 s). For
583
+the subtitle stream to be detected, both values must be large enough.
584
+</p>
585
+<a name="Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f"></a>
586
+<h2 class="section"><a href="faq.html#toc-Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f">3.17 Why was the <code>ffmpeg</code> &lsquo;<samp>-sameq</samp>&rsquo; option removed? What to use instead?</a></h2>
587
+
588
+<p>The &lsquo;<samp>-sameq</samp>&rsquo; option meant &quot;same quantizer&quot;, and made sense only in a
589
+very limited set of cases. Unfortunately, a lot of people mistook it for
590
+&quot;same quality&quot; and used it in places where it did not make sense: it had
591
+roughly the expected visible effect, but achieved it in a very inefficient
592
+way.
593
+</p>
594
+<p>Each encoder has its own set of options to set the quality-vs-size balance,
595
+use the options for the encoder you are using to set the quality level to a
596
+point acceptable for your tastes. The most common options to do that are
597
+&lsquo;<samp>-qscale</samp>&rsquo; and &lsquo;<samp>-qmax</samp>&rsquo;, but you should peruse the documentation
598
+of the encoder you chose.
599
+</p>
600
+<a name="I-have-a-stretched-video_002c-why-does-scaling-does-not-fix-it_003f"></a>
601
+<h2 class="section"><a href="faq.html#toc-I-have-a-stretched-video_002c-why-does-scaling-does-not-fix-it_003f">3.18 I have a stretched video, why does scaling does not fix it?</a></h2>
602
+
603
+<p>A lot of video codecs and formats can store the <em>aspect ratio</em> of the
604
+video: this is the ratio between the width and the height of either the full
605
+image (DAR, display aspect ratio) or individual pixels (SAR, sample aspect
606
+ratio). For example, EGA screens at resolution 640×350 had 4:3 DAR and 35:48
607
+SAR.
608
+</p>
609
+<p>Most still image processing work with square pixels, i.e. 1:1 SAR, but a lot
610
+of video standards, especially from the analogic-numeric transition era, use
611
+non-square pixels.
612
+</p>
613
+<p>Most processing filters in FFmpeg handle the aspect ratio to avoid
614
+stretching the image: cropping adjusts the DAR to keep the SAR constant,
615
+scaling adjusts the SAR to keep the DAR constant.
616
+</p>
617
+<p>If you want to stretch, or “unstretch”, the image, you need to override the
618
+information with the
619
+<a href="ffmpeg-filters.html#setdar_002c-setsar"><code>setdar or setsar filters</code></a>.
620
+</p>
621
+<p>Do not forget to examine carefully the original video to check whether the
622
+stretching comes from the image or from the aspect ratio information.
623
+</p>
624
+<p>For example, to fix a badly encoded EGA capture, use the following commands,
625
+either the first one to upscale to square pixels or the second one to set
626
+the correct aspect ratio or the third one to avoid transcoding (may not work
627
+depending on the format / codec / player / phase of the moon):
628
+</p>
629
+<div class="example">
630
+<pre class="example">ffmpeg -i ega_screen.nut -vf scale=640:480,setsar=1 ega_screen_scaled.nut
631
+ffmpeg -i ega_screen.nut -vf setdar=4/3 ega_screen_anamorphic.nut
632
+ffmpeg -i ega_screen.nut -aspect 4/3 -c copy ega_screen_overridden.nut
633
+</pre></div>
634
+
635
+<p><a name="background-task"></a>
636
+</p><a name="How-do-I-run-ffmpeg-as-a-background-task_003f"></a>
637
+<h2 class="section"><a href="faq.html#toc-How-do-I-run-ffmpeg-as-a-background-task_003f">3.19 How do I run ffmpeg as a background task?</a></h2>
638
+
639
+<p>ffmpeg normally checks the console input, for entries like &quot;q&quot; to stop
640
+and &quot;?&quot; to give help, while performing operations. ffmpeg does not have a way of
641
+detecting when it is running as a background task.
642
+When it checks the console input, that can cause the process running ffmpeg
643
+in the background to suspend.
644
+</p>
645
+<p>To prevent those input checks, allowing ffmpeg to run as a background task,
646
+use the <a href="ffmpeg.html#stdin-option"><code>-nostdin</code> option</a>
647
+in the ffmpeg invocation. This is effective whether you run ffmpeg in a shell
648
+or invoke ffmpeg in its own process via an operating system API.
649
+</p>
650
+<p>As an alternative, when you are running ffmpeg in a shell, you can redirect
651
+standard input to <code>/dev/null</code> (on Linux and macOS)
652
+or <code>NUL</code> (on Windows). You can do this redirect either
653
+on the ffmpeg invocation, or from a shell script which calls ffmpeg.
654
+</p>
655
+<p>For example:
656
+</p>
657
+<div class="example">
658
+<pre class="example">ffmpeg -nostdin -i INPUT OUTPUT
659
+</pre></div>
660
+
661
+<p>or (on Linux, macOS, and other UNIX-like shells):
662
+</p>
663
+<div class="example">
664
+<pre class="example">ffmpeg -i INPUT OUTPUT &lt;/dev/null
665
+</pre></div>
666
+
667
+<p>or (on Windows):
668
+</p>
669
+<div class="example">
670
+<pre class="example">ffmpeg -i INPUT OUTPUT &lt;NUL
671
+</pre></div>
672
+
673
+<a name="How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f"></a>
674
+<h2 class="section"><a href="faq.html#toc-How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f">3.20 How do I prevent ffmpeg from suspending with a message like <em>suspended (tty output)</em>?</a></h2>
675
+
676
+<p>If you run ffmpeg in the background, you may find that its process suspends.
677
+There may be a message like <em>suspended (tty output)</em>. The question is how
678
+to prevent the process from being suspended.
679
+</p>
680
+<p>For example:
681
+</p>
682
+<div class="example">
683
+<pre class="example">% ffmpeg -i INPUT OUTPUT &amp;&gt; ~/tmp/log.txt &amp;
684
+[1] 93352
685
+%
686
+[1]  + suspended (tty output)  ffmpeg -i INPUT OUTPUT &amp;&gt;
687
+</pre></div>
688
+
689
+<p>The message &quot;tty output&quot; notwithstanding, the problem here is that
690
+ffmpeg normally checks the console input when it runs. The operating system
691
+detects this, and suspends the process until you can bring it to the
692
+foreground and attend to it.
693
+</p>
694
+<p>The solution is to use the right techniques to tell ffmpeg not to consult
695
+console input. You can use the
696
+<a href="ffmpeg.html#stdin-option"><code>-nostdin</code> option</a>,
697
+or redirect standard input with <code>&lt; /dev/null</code>.
698
+See FAQ
699
+<a href="#background-task"><em>How do I run ffmpeg as a background task?</em></a>
700
+for details.
701
+</p>
702
+<a name="Development"></a>
703
+<h1 class="chapter"><a href="faq.html#toc-Development">4 Development</a></h1>
704
+
705
+<a name="Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f"></a>
706
+<h2 class="section"><a href="faq.html#toc-Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f">4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?</a></h2>
707
+
708
+<p>Yes. Check the &lsquo;<tt>doc/examples</tt>&rsquo; directory in the source
709
+repository, also available online at:
710
+<a href="https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples">https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples</a>.
711
+</p>
712
+<p>Examples are also installed by default, usually in
713
+<code>$PREFIX/share/ffmpeg/examples</code>.
714
+</p>
715
+<p>Also you may read the Developers Guide of the FFmpeg documentation. Alternatively,
716
+examine the source code for one of the many open source projects that
717
+already incorporate FFmpeg at (<a href="projects.html">projects.html</a>).
718
+</p>
719
+<a name="Can-you-support-my-C-compiler-XXX_003f"></a>
720
+<h2 class="section"><a href="faq.html#toc-Can-you-support-my-C-compiler-XXX_003f">4.2 Can you support my C compiler XXX?</a></h2>
721
+
722
+<p>It depends. If your compiler is C99-compliant, then patches to support
723
+it are likely to be welcome if they do not pollute the source code
724
+with <code>#ifdef</code>s related to the compiler.
725
+</p>
726
+<a name="Is-Microsoft-Visual-C_002b_002b-supported_003f"></a>
727
+<h2 class="section"><a href="faq.html#toc-Is-Microsoft-Visual-C_002b_002b-supported_003f">4.3 Is Microsoft Visual C++ supported?</a></h2>
728
+
729
+<p>Yes. Please see the <a href="platform.html">Microsoft Visual C++</a>
730
+section in the FFmpeg documentation.
731
+</p>
732
+<a name="Can-you-add-automake_002c-libtool-or-autoconf-support_003f"></a>
733
+<h2 class="section"><a href="faq.html#toc-Can-you-add-automake_002c-libtool-or-autoconf-support_003f">4.4 Can you add automake, libtool or autoconf support?</a></h2>
734
+
735
+<p>No. These tools are too bloated and they complicate the build.
736
+</p>
737
+<a name="Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f"></a>
738
+<h2 class="section"><a href="faq.html#toc-Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f">4.5 Why not rewrite FFmpeg in object-oriented C++?</a></h2>
739
+
740
+<p>FFmpeg is already organized in a highly modular manner and does not need to
741
+be rewritten in a formal object language. Further, many of the developers
742
+favor straight C; it works for them. For more arguments on this matter,
743
+read <a href="https://web.archive.org/web/20111004021423/http://kernel.org/pub/linux/docs/lkml/#s15">&quot;Programming Religion&quot;</a>.
744
+</p>
745
+<a name="Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f"></a>
746
+<h2 class="section"><a href="faq.html#toc-Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f">4.6 Why are the ffmpeg programs devoid of debugging symbols?</a></h2>
747
+
748
+<p>The build process creates <code>ffmpeg_g</code>, <code>ffplay_g</code>, etc. which
749
+contain full debug information. Those binaries are stripped to create
750
+<code>ffmpeg</code>, <code>ffplay</code>, etc. If you need the debug information, use
751
+the *_g versions.
752
+</p>
753
+<a name="I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f"></a>
754
+<h2 class="section"><a href="faq.html#toc-I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f">4.7 I do not like the LGPL, can I contribute code under the GPL instead?</a></h2>
755
+
756
+<p>Yes, as long as the code is optional and can easily and cleanly be placed
757
+under #if CONFIG_GPL without breaking anything. So, for example, a new codec
758
+or filter would be OK under GPL while a bug fix to LGPL code would not.
759
+</p>
760
+<a name="I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e"></a>
761
+<h2 class="section"><a href="faq.html#toc-I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e">4.8 I&rsquo;m using FFmpeg from within my C application but the linker complains about missing symbols from the libraries themselves.</a></h2>
762
+
763
+<p>FFmpeg builds static libraries by default. In static libraries, dependencies
764
+are not handled. That has two consequences. First, you must specify the
765
+libraries in dependency order: <code>-lavdevice</code> must come before
766
+<code>-lavformat</code>, <code>-lavutil</code> must come after everything else, etc.
767
+Second, external libraries that are used in FFmpeg have to be specified too.
768
+</p>
769
+<p>An easy way to get the full list of required libraries in dependency order
770
+is to use <code>pkg-config</code>.
771
+</p>
772
+<div class="example">
773
+<pre class="example">c99 -o program program.c $(pkg-config --cflags --libs libavformat libavcodec)
774
+</pre></div>
775
+
776
+<p>See &lsquo;<tt>doc/example/Makefile</tt>&rsquo; and &lsquo;<tt>doc/example/pc-uninstalled</tt>&rsquo; for
777
+more details.
778
+</p>
779
+<a name="I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e"></a>
780
+<h2 class="section"><a href="faq.html#toc-I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e">4.9 I&rsquo;m using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.</a></h2>
781
+
782
+<p>FFmpeg is a pure C project, so to use the libraries within your C++ application
783
+you need to explicitly state that you are using a C library. You can do this by
784
+encompassing your FFmpeg includes using <code>extern &quot;C&quot;</code>.
785
+</p>
786
+<p>See <a href="http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3">http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3</a>
787
+</p>
788
+<a name="I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope"></a>
789
+<h2 class="section"><a href="faq.html#toc-I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope">4.10 I&rsquo;m using libavutil from within my C++ application but the compiler complains about &rsquo;UINT64_C&rsquo; was not declared in this scope</a></h2>
790
+
791
+<p>FFmpeg is a pure C project using C99 math features, in order to enable C++
792
+to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
793
+</p>
794
+<a name="I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f"></a>
795
+<h2 class="section"><a href="faq.html#toc-I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f">4.11 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?</a></h2>
796
+
797
+<p>You have to create a custom AVIOContext using <code>avio_alloc_context</code>,
798
+see &lsquo;<tt>libavformat/aviobuf.c</tt>&rsquo; in FFmpeg and &lsquo;<tt>libmpdemux/demux_lavf.c</tt>&rsquo; in MPlayer or MPlayer2 sources.
799
+</p>
800
+<a name="Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f"></a>
801
+<h2 class="section"><a href="faq.html#toc-Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f">4.12 Where is the documentation about ffv1, msmpeg4, asv1, 4xm?</a></h2>
802
+
803
+<p>see <a href="https://www.ffmpeg.org/~michael/">https://www.ffmpeg.org/~michael/</a>
804
+</p>
805
+<a name="How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f"></a>
806
+<h2 class="section"><a href="faq.html#toc-How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f">4.13 How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?</a></h2>
807
+
808
+<p>Even if peculiar since it is network oriented, RTP is a container like any
809
+other. You have to <em>demux</em> RTP before feeding the payload to libavcodec.
810
+In this specific case please look at RFC 4629 to see how it should be done.
811
+</p>
812
+<a name="AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e"></a>
813
+<h2 class="section"><a href="faq.html#toc-AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e">4.14 AVStream.r_frame_rate is wrong, it is much larger than the frame rate.</a></h2>
814
+
815
+<p><code>r_frame_rate</code> is NOT the average frame rate, it is the smallest frame rate
816
+that can accurately represent all timestamps. So no, it is not
817
+wrong if it is larger than the average!
818
+For example, if you have mixed 25 and 30 fps content, then <code>r_frame_rate</code>
819
+will be 150 (it is the least common multiple).
820
+If you are looking for the average frame rate, see <code>AVStream.avg_frame_rate</code>.
821
+</p>
822
+<a name="Why-is-make-fate-not-running-all-tests_003f"></a>
823
+<h2 class="section"><a href="faq.html#toc-Why-is-make-fate-not-running-all-tests_003f">4.15 Why is <code>make fate</code> not running all tests?</a></h2>
824
+
825
+<p>Make sure you have the fate-suite samples and the <code>SAMPLES</code> Make variable
826
+or <code>FATE_SAMPLES</code> environment variable or the <code>--samples</code>
827
+<code>configure</code> option is set to the right path.
828
+</p>
829
+<a name="Why-is-make-fate-not-finding-the-samples_003f"></a>
830
+<h2 class="section"><a href="faq.html#toc-Why-is-make-fate-not-finding-the-samples_003f">4.16 Why is <code>make fate</code> not finding the samples?</a></h2>
831
+
832
+<p>Do you happen to have a <code>~</code> character in the samples path to indicate a
833
+home directory? The value is used in ways where the shell cannot expand it,
834
+causing FATE to not find files. Just replace <code>~</code> by the full path.
835
+</p>
836
+    </div>
837
+  </body>
838
+</html>
839
+

+ 339
- 0
Common/ffmpeg/doc/fate.html ファイルの表示

@@ -0,0 +1,339 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="FFmpeg Automated Testing Environment: ">
11
+<meta name="keywords" content="FFmpeg documentation : FFmpeg Automated Testing Environment: ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">FFmpeg Automated Testing Environment</h1>
30
+<hr>
31
+<a name="Top"></a>
32
+<a name="SEC_Top"></a>
33
+
34
+<a name="SEC_Contents"></a>
35
+<h1>Table of Contents</h1>
36
+
37
+<div class="contents">
38
+
39
+<ul class="no-bullet">
40
+  <li><a name="toc-Introduction" href="#Introduction">1 Introduction</a></li>
41
+  <li><a name="toc-Using-FATE-from-your-FFmpeg-source-directory" href="#Using-FATE-from-your-FFmpeg-source-directory">2 Using FATE from your FFmpeg source directory</a></li>
42
+  <li><a name="toc-Submitting-the-results-to-the-FFmpeg-result-aggregation-server" href="#Submitting-the-results-to-the-FFmpeg-result-aggregation-server">3 Submitting the results to the FFmpeg result aggregation server</a></li>
43
+  <li><a name="toc-Uploading-new-samples-to-the-fate-suite" href="#Uploading-new-samples-to-the-fate-suite">4 Uploading new samples to the fate suite</a></li>
44
+  <li><a name="toc-FATE-makefile-targets-and-variables" href="#FATE-makefile-targets-and-variables">5 FATE makefile targets and variables</a>
45
+  <ul class="no-bullet">
46
+    <li><a name="toc-Makefile-targets" href="#Makefile-targets">5.1 Makefile targets</a></li>
47
+    <li><a name="toc-Makefile-variables" href="#Makefile-variables">5.2 Makefile variables</a></li>
48
+    <li><a name="toc-Examples" href="#Examples">5.3 Examples</a></li>
49
+  </ul>
50
+</li>
51
+</ul>
52
+</div>
53
+
54
+
55
+<hr size="6">
56
+<a name="Introduction"></a>
57
+<h1 class="chapter"><a href="fate.html#toc-Introduction">1 Introduction</a></h1>
58
+
59
+<p>FATE is an extended regression suite on the client-side and a means
60
+for results aggregation and presentation on the server-side.
61
+</p>
62
+<p>The first part of this document explains how you can use FATE from
63
+your FFmpeg source directory to test your ffmpeg binary. The second
64
+part describes how you can run FATE to submit the results to FFmpeg&rsquo;s
65
+FATE server.
66
+</p>
67
+<p>In any way you can have a look at the publicly viewable FATE results
68
+by visiting this website:
69
+</p>
70
+<p><a href="http://fate.ffmpeg.org/">http://fate.ffmpeg.org/</a>
71
+</p>
72
+<p>This is especially recommended for all people contributing source
73
+code to FFmpeg, as it can be seen if some test on some platform broke
74
+with their recent contribution. This usually happens on the platforms
75
+the developers could not test on.
76
+</p>
77
+<p>The second part of this document describes how you can run FATE to
78
+submit your results to FFmpeg&rsquo;s FATE server. If you want to submit your
79
+results be sure to check that your combination of CPU, OS and compiler
80
+is not already listed on the above mentioned website.
81
+</p>
82
+<p>In the third part you can find a comprehensive listing of FATE makefile
83
+targets and variables.
84
+</p>
85
+
86
+<a name="Using-FATE-from-your-FFmpeg-source-directory"></a>
87
+<h1 class="chapter"><a href="fate.html#toc-Using-FATE-from-your-FFmpeg-source-directory">2 Using FATE from your FFmpeg source directory</a></h1>
88
+
89
+<p>If you want to run FATE on your machine you need to have the samples
90
+in place. You can get the samples via the build target fate-rsync.
91
+Use this command from the top-level source directory:
92
+</p>
93
+<div class="example">
94
+<pre class="example">make fate-rsync SAMPLES=fate-suite/
95
+make fate       SAMPLES=fate-suite/
96
+</pre></div>
97
+
98
+<p>The above commands set the samples location by passing a makefile
99
+variable via command line. It is also possible to set the samples
100
+location at source configuration time by invoking configure with
101
+&lsquo;<samp>--samples=&lt;path to the samples directory&gt;</samp>&rsquo;. Afterwards you can
102
+invoke the makefile targets without setting the <var>SAMPLES</var> makefile
103
+variable. This is illustrated by the following commands:
104
+</p>
105
+<div class="example">
106
+<pre class="example">./configure --samples=fate-suite/
107
+make fate-rsync
108
+make fate
109
+</pre></div>
110
+
111
+<p>Yet another way to tell FATE about the location of the sample
112
+directory is by making sure the environment variable FATE_SAMPLES
113
+contains the path to your samples directory. This can be achieved
114
+by e.g. putting that variable in your shell profile or by setting
115
+it in your interactive session.
116
+</p>
117
+<div class="example">
118
+<pre class="example">FATE_SAMPLES=fate-suite/ make fate
119
+</pre></div>
120
+
121
+<div class="float alert alert-info">
122
+<p>Do not put a &rsquo;~&rsquo; character in the samples path to indicate a home
123
+directory. Because of shell nuances, this will cause FATE to fail.
124
+</p></div>
125
+<p>To use a custom wrapper to run the test, pass &lsquo;<samp>--target-exec</samp>&rsquo; to
126
+<code>configure</code> or set the <var>TARGET_EXEC</var> Make variable.
127
+</p>
128
+
129
+<a name="Submitting-the-results-to-the-FFmpeg-result-aggregation-server"></a>
130
+<h1 class="chapter"><a href="fate.html#toc-Submitting-the-results-to-the-FFmpeg-result-aggregation-server">3 Submitting the results to the FFmpeg result aggregation server</a></h1>
131
+
132
+<p>To submit your results to the server you should run fate through the
133
+shell script &lsquo;<tt>tests/fate.sh</tt>&rsquo; from the FFmpeg sources. This script needs
134
+to be invoked with a configuration file as its first argument.
135
+</p>
136
+<div class="example">
137
+<pre class="example">tests/fate.sh /path/to/fate_config
138
+</pre></div>
139
+
140
+<p>A configuration file template with comments describing the individual
141
+configuration variables can be found at &lsquo;<tt>doc/fate_config.sh.template</tt>&rsquo;.
142
+</p>
143
+<p>The mentioned configuration template is also available here:
144
+</p><pre class="verbatim">slot=                                    # some unique identifier
145
+repo=git://source.ffmpeg.org/ffmpeg.git  # the source repository
146
+#branch=release/2.6                       # the branch to test
147
+samples=                                 # path to samples directory
148
+workdir=                                 # directory in which to do all the work
149
+#fate_recv=&quot;ssh -T fate@fate.ffmpeg.org&quot; # command to submit report
150
+comment=                                 # optional description
151
+build_only=     # set to &quot;yes&quot; for a compile-only instance that skips tests
152
+ignore_tests=
153
+
154
+# the following are optional and map to configure options
155
+arch=
156
+cpu=
157
+cross_prefix=
158
+as=
159
+cc=
160
+ld=
161
+target_os=
162
+sysroot=
163
+target_exec=
164
+target_path=
165
+target_samples=
166
+extra_cflags=
167
+extra_ldflags=
168
+extra_libs=
169
+extra_conf=     # extra configure options not covered above
170
+
171
+#make=          # name of GNU make if not 'make'
172
+makeopts=       # extra options passed to 'make'
173
+#makeopts_fate= # extra options passed to 'make' when running tests,
174
+                # defaulting to makeopts above if this is not set
175
+#tar=           # command to create a tar archive from its arguments on stdout,
176
+                # defaults to 'tar c'
177
+</pre>
178
+<p>Create a configuration that suits your needs, based on the configuration
179
+template. The <code>slot</code> configuration variable can be any string that is not
180
+yet used, but it is suggested that you name it adhering to the following
181
+pattern &lsquo;<samp><var>arch</var>-<var>os</var>-<var>compiler</var>-<var>compiler version</var></samp>&rsquo;. The
182
+configuration file itself will be sourced in a shell script, therefore all
183
+shell features may be used. This enables you to setup the environment as you
184
+need it for your build.
185
+</p>
186
+<p>For your first test runs the <code>fate_recv</code> variable should be empty or
187
+commented out. This will run everything as normal except that it will omit
188
+the submission of the results to the server. The following files should be
189
+present in $workdir as specified in the configuration file:
190
+</p>
191
+<ul>
192
+<li> configure.log
193
+    </li><li> compile.log
194
+    </li><li> test.log
195
+    </li><li> report
196
+    </li><li> version
197
+</li></ul>
198
+
199
+<p>When you have everything working properly you can create an SSH key pair
200
+and send the public key to the FATE server administrator who can be contacted
201
+at the email address <a href="mailto:fate-admin@ffmpeg.org">fate-admin@ffmpeg.org</a>.
202
+</p>
203
+<p>Configure your SSH client to use public key authentication with that key
204
+when connecting to the FATE server. Also do not forget to check the identity
205
+of the server and to accept its host key. This can usually be achieved by
206
+running your SSH client manually and killing it after you accepted the key.
207
+The FATE server&rsquo;s fingerprint is:
208
+</p>
209
+<dl compact="compact">
210
+<dt>&lsquo;<samp>RSA</samp>&rsquo;</dt>
211
+<dd><p>   d3:f1:83:97:a4:75:2b:a6:fb:d6:e8:aa:81:93:97:51
212
+</p></dd>
213
+<dt>&lsquo;<samp>ECDSA</samp>&rsquo;</dt>
214
+<dd><p>   76:9f:68:32:04:1e:d5:d4:ec:47:3f:dc:fc:18:17:86
215
+</p></dd>
216
+</dl>
217
+
218
+<p>If you have problems connecting to the FATE server, it may help to try out
219
+the <code>ssh</code> command with one or more &lsquo;<samp>-v</samp>&rsquo; options. You should
220
+get detailed output concerning your SSH configuration and the authentication
221
+process.
222
+</p>
223
+<p>The only thing left is to automate the execution of the fate.sh script and
224
+the synchronisation of the samples directory.
225
+</p>
226
+<a name="Uploading-new-samples-to-the-fate-suite"></a>
227
+<h1 class="chapter"><a href="fate.html#toc-Uploading-new-samples-to-the-fate-suite">4 Uploading new samples to the fate suite</a></h1>
228
+
229
+<p>If you need a sample uploaded send a mail to samples-request.
230
+</p>
231
+<p>This is for developers who have an account on the fate suite server.
232
+If you upload new samples, please make sure they are as small as possible,
233
+space on each client, network bandwidth and so on benefit from smaller test cases.
234
+Also keep in mind older checkouts use existing sample files, that means in
235
+practice generally do not replace, remove or overwrite files as it likely would
236
+break older checkouts or releases.
237
+Also all needed samples for a commit should be uploaded, ideally 24
238
+hours, before the push.
239
+If you need an account for frequently uploading samples or you wish to help
240
+others by doing that send a mail to ffmpeg-devel.
241
+</p>
242
+<div class="example">
243
+<pre class="example">#First update your local samples copy:
244
+rsync -vauL --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X fate-suite.ffmpeg.org:/home/samples/fate-suite/ ~/fate-suite
245
+
246
+#Then do a dry run checking what would be uploaded:
247
+rsync -vanL --no-g --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X ~/fate-suite/ fate-suite.ffmpeg.org:/home/samples/fate-suite
248
+
249
+#Upload the files:
250
+rsync -vaL  --no-g --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X ~/fate-suite/ fate-suite.ffmpeg.org:/home/samples/fate-suite
251
+</pre></div>
252
+
253
+
254
+<a name="FATE-makefile-targets-and-variables"></a>
255
+<h1 class="chapter"><a href="fate.html#toc-FATE-makefile-targets-and-variables">5 FATE makefile targets and variables</a></h1>
256
+
257
+<a name="Makefile-targets"></a>
258
+<h2 class="section"><a href="fate.html#toc-Makefile-targets">5.1 Makefile targets</a></h2>
259
+
260
+<dl compact="compact">
261
+<dt>&lsquo;<samp>fate-rsync</samp>&rsquo;</dt>
262
+<dd><p>Download/synchronize sample files to the configured samples directory.
263
+</p>
264
+</dd>
265
+<dt>&lsquo;<samp>fate-list</samp>&rsquo;</dt>
266
+<dd><p>Will list all fate/regression test targets.
267
+</p>
268
+</dd>
269
+<dt>&lsquo;<samp>fate</samp>&rsquo;</dt>
270
+<dd><p>Run the FATE test suite (requires the fate-suite dataset).
271
+</p></dd>
272
+</dl>
273
+
274
+<a name="Makefile-variables"></a>
275
+<h2 class="section"><a href="fate.html#toc-Makefile-variables">5.2 Makefile variables</a></h2>
276
+
277
+<dl compact="compact">
278
+<dt><code>V</code></dt>
279
+<dd><p>Verbosity level, can be set to 0, 1 or 2.
280
+    </p><ul>
281
+<li> 0: show just the test arguments
282
+        </li><li> 1: show just the command used in the test
283
+        </li><li> 2: show everything
284
+    </li></ul>
285
+
286
+</dd>
287
+<dt><code>SAMPLES</code></dt>
288
+<dd><p>Specify or override the path to the FATE samples at make time, it has a
289
+meaning only while running the regression tests.
290
+</p>
291
+</dd>
292
+<dt><code>THREADS</code></dt>
293
+<dd><p>Specify how many threads to use while running regression tests, it is
294
+quite useful to detect thread-related regressions.
295
+</p>
296
+</dd>
297
+<dt><code>THREAD_TYPE</code></dt>
298
+<dd><p>Specify which threading strategy test, either &lsquo;<samp>slice</samp>&rsquo; or &lsquo;<samp>frame</samp>&rsquo;,
299
+by default &lsquo;<samp>slice+frame</samp>&rsquo;
300
+</p>
301
+</dd>
302
+<dt><code>CPUFLAGS</code></dt>
303
+<dd><p>Specify CPU flags.
304
+</p>
305
+</dd>
306
+<dt><code>TARGET_EXEC</code></dt>
307
+<dd><p>Specify or override the wrapper used to run the tests.
308
+The <code>TARGET_EXEC</code> option provides a way to run FATE wrapped in
309
+<code>valgrind</code>, <code>qemu-user</code> or <code>wine</code> or on remote targets
310
+through <code>ssh</code>.
311
+</p>
312
+</dd>
313
+<dt><code>GEN</code></dt>
314
+<dd><p>Set to &lsquo;<samp>1</samp>&rsquo; to generate the missing or mismatched references.
315
+</p>
316
+</dd>
317
+<dt><code>HWACCEL</code></dt>
318
+<dd><p>Specify which hardware acceleration to use while running regression tests,
319
+by default &lsquo;<samp>none</samp>&rsquo; is used.
320
+</p>
321
+</dd>
322
+<dt><code>KEEP</code></dt>
323
+<dd><p>Set to &lsquo;<samp>1</samp>&rsquo; to keep temp files generated by fate test(s) when test is successful.
324
+Default is &lsquo;<samp>0</samp>&rsquo;, which removes these files. Files are always kept when a test
325
+fails.
326
+</p>
327
+</dd>
328
+</dl>
329
+
330
+<a name="Examples"></a>
331
+<h2 class="section"><a href="fate.html#toc-Examples">5.3 Examples</a></h2>
332
+
333
+<div class="example">
334
+<pre class="example">make V=1 SAMPLES=/var/fate/samples THREADS=2 CPUFLAGS=mmx fate
335
+</pre></div>
336
+    </div>
337
+  </body>
338
+</html>
339
+

+ 50550
- 0
Common/ffmpeg/doc/ffmpeg-all.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 916
- 0
Common/ffmpeg/doc/ffmpeg-bitstream-filters.html ファイルの表示

@@ -0,0 +1,916 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="FFmpeg Bitstream Filters Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : FFmpeg Bitstream Filters ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">FFmpeg Bitstream Filters Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">2 Bitstream Filters</a>
41
+  <ul class="no-bullet">
42
+    <li><a name="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">2.1 aac_adtstoasc</a></li>
43
+    <li><a name="toc-av1_005fmetadata" href="#av1_005fmetadata">2.2 av1_metadata</a></li>
44
+    <li><a name="toc-chomp" href="#chomp">2.3 chomp</a></li>
45
+    <li><a name="toc-dca_005fcore" href="#dca_005fcore">2.4 dca_core</a></li>
46
+    <li><a name="toc-dump_005fextra" href="#dump_005fextra">2.5 dump_extra</a></li>
47
+    <li><a name="toc-eac3_005fcore" href="#eac3_005fcore">2.6 eac3_core</a></li>
48
+    <li><a name="toc-extract_005fextradata" href="#extract_005fextradata">2.7 extract_extradata</a></li>
49
+    <li><a name="toc-filter_005funits" href="#filter_005funits">2.8 filter_units</a></li>
50
+    <li><a name="toc-hapqa_005fextract" href="#hapqa_005fextract">2.9 hapqa_extract</a></li>
51
+    <li><a name="toc-h264_005fmetadata" href="#h264_005fmetadata">2.10 h264_metadata</a></li>
52
+    <li><a name="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">2.11 h264_mp4toannexb</a></li>
53
+    <li><a name="toc-h264_005fredundant_005fpps" href="#h264_005fredundant_005fpps">2.12 h264_redundant_pps</a></li>
54
+    <li><a name="toc-hevc_005fmetadata" href="#hevc_005fmetadata">2.13 hevc_metadata</a></li>
55
+    <li><a name="toc-hevc_005fmp4toannexb" href="#hevc_005fmp4toannexb">2.14 hevc_mp4toannexb</a></li>
56
+    <li><a name="toc-imxdump" href="#imxdump">2.15 imxdump</a></li>
57
+    <li><a name="toc-mjpeg2jpeg" href="#mjpeg2jpeg">2.16 mjpeg2jpeg</a></li>
58
+    <li><a name="toc-mjpegadump" href="#mjpegadump">2.17 mjpegadump</a></li>
59
+    <li><a name="toc-mov2textsub-1" href="#mov2textsub-1">2.18 mov2textsub</a></li>
60
+    <li><a name="toc-mp3decomp" href="#mp3decomp">2.19 mp3decomp</a></li>
61
+    <li><a name="toc-mpeg2_005fmetadata" href="#mpeg2_005fmetadata">2.20 mpeg2_metadata</a></li>
62
+    <li><a name="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">2.21 mpeg4_unpack_bframes</a></li>
63
+    <li><a name="toc-noise" href="#noise">2.22 noise</a></li>
64
+    <li><a name="toc-null" href="#null">2.23 null</a></li>
65
+    <li><a name="toc-prores_005fmetadata" href="#prores_005fmetadata">2.24 prores_metadata</a></li>
66
+    <li><a name="toc-remove_005fextra" href="#remove_005fextra">2.25 remove_extra</a></li>
67
+    <li><a name="toc-text2movsub-1" href="#text2movsub-1">2.26 text2movsub</a></li>
68
+    <li><a name="toc-trace_005fheaders" href="#trace_005fheaders">2.27 trace_headers</a></li>
69
+    <li><a name="toc-truehd_005fcore" href="#truehd_005fcore">2.28 truehd_core</a></li>
70
+    <li><a name="toc-vp9_005fmetadata" href="#vp9_005fmetadata">2.29 vp9_metadata</a></li>
71
+    <li><a name="toc-vp9_005fsuperframe" href="#vp9_005fsuperframe">2.30 vp9_superframe</a></li>
72
+    <li><a name="toc-vp9_005fsuperframe_005fsplit" href="#vp9_005fsuperframe_005fsplit">2.31 vp9_superframe_split</a></li>
73
+    <li><a name="toc-vp9_005fraw_005freorder" href="#vp9_005fraw_005freorder">2.32 vp9_raw_reorder</a></li>
74
+  </ul></li>
75
+  <li><a name="toc-See-Also" href="#See-Also">3 See Also</a></li>
76
+  <li><a name="toc-Authors" href="#Authors">4 Authors</a></li>
77
+</ul>
78
+</div>
79
+
80
+
81
+<hr size="6">
82
+<a name="Description"></a>
83
+<h1 class="chapter"><a href="ffmpeg-bitstream-filters.html#toc-Description">1 Description</a></h1>
84
+
85
+<p>This document describes the bitstream filters provided by the
86
+libavcodec library.
87
+</p>
88
+<p>A bitstream filter operates on the encoded stream data, and performs
89
+bitstream level modifications without performing decoding.
90
+</p>
91
+
92
+<a name="Bitstream-Filters"></a>
93
+<h1 class="chapter"><a href="ffmpeg-bitstream-filters.html#toc-Bitstream-Filters">2 Bitstream Filters</a></h1>
94
+
95
+<p>When you configure your FFmpeg build, all the supported bitstream
96
+filters are enabled by default. You can list all available ones using
97
+the configure option <code>--list-bsfs</code>.
98
+</p>
99
+<p>You can disable all the bitstream filters using the configure option
100
+<code>--disable-bsfs</code>, and selectively enable any bitstream filter using
101
+the option <code>--enable-bsf=BSF</code>, or you can disable a particular
102
+bitstream filter using the option <code>--disable-bsf=BSF</code>.
103
+</p>
104
+<p>The option <code>-bsfs</code> of the ff* tools will display the list of
105
+all the supported bitstream filters included in your build.
106
+</p>
107
+<p>The ff* tools have a -bsf option applied per stream, taking a
108
+comma-separated list of filters, whose parameters follow the filter
109
+name after a &rsquo;=&rsquo;.
110
+</p>
111
+<div class="example">
112
+<pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
113
+</pre></div>
114
+
115
+<p>Below is a description of the currently available bitstream filters,
116
+with their parameters, if any.
117
+</p>
118
+<a name="aac_005fadtstoasc"></a>
119
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-aac_005fadtstoasc">2.1 aac_adtstoasc</a></h2>
120
+
121
+<p>Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
122
+bitstream.
123
+</p>
124
+<p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
125
+ADTS header and removes the ADTS header.
126
+</p>
127
+<p>This filter is required for example when copying an AAC stream from a
128
+raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
129
+to MOV/MP4 files and related formats such as 3GP or M4A. Please note
130
+that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
131
+</p>
132
+<a name="av1_005fmetadata"></a>
133
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-av1_005fmetadata">2.2 av1_metadata</a></h2>
134
+
135
+<p>Modify metadata embedded in an AV1 stream.
136
+</p>
137
+<dl compact="compact">
138
+<dt>&lsquo;<samp>td</samp>&rsquo;</dt>
139
+<dd><p>Insert or remove temporal delimiter OBUs in all temporal units of the
140
+stream.
141
+</p>
142
+<dl compact="compact">
143
+<dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
144
+<dd><p>Insert a TD at the beginning of every TU which does not already have one.
145
+</p></dd>
146
+<dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
147
+<dd><p>Remove the TD from the beginning of every TU which has one.
148
+</p></dd>
149
+</dl>
150
+
151
+</dd>
152
+<dt>&lsquo;<samp>color_primaries</samp>&rsquo;</dt>
153
+<dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
154
+<dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
155
+<dd><p>Set the color description fields in the stream (see AV1 section 6.4.2).
156
+</p>
157
+</dd>
158
+<dt>&lsquo;<samp>color_range</samp>&rsquo;</dt>
159
+<dd><p>Set the color range in the stream (see AV1 section 6.4.2; note that
160
+this cannot be set for streams using BT.709 primaries, sRGB transfer
161
+characteristic and identity (RGB) matrix coefficients).
162
+</p><dl compact="compact">
163
+<dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
164
+<dd><p>Limited range.
165
+</p></dd>
166
+<dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
167
+<dd><p>Full range.
168
+</p></dd>
169
+</dl>
170
+
171
+</dd>
172
+<dt>&lsquo;<samp>chroma_sample_position</samp>&rsquo;</dt>
173
+<dd><p>Set the chroma sample location in the stream (see AV1 section 6.4.2).
174
+This can only be set for 4:2:0 streams.
175
+</p>
176
+<dl compact="compact">
177
+<dt>&lsquo;<samp>vertical</samp>&rsquo;</dt>
178
+<dd><p>Left position (matching the default in MPEG-2 and H.264).
179
+</p></dd>
180
+<dt>&lsquo;<samp>colocated</samp>&rsquo;</dt>
181
+<dd><p>Top-left position.
182
+</p></dd>
183
+</dl>
184
+
185
+</dd>
186
+<dt>&lsquo;<samp>tick_rate</samp>&rsquo;</dt>
187
+<dd><p>Set the tick rate (<em>num_units_in_display_tick / time_scale</em>) in
188
+the timing info in the sequence header.
189
+</p></dd>
190
+<dt>&lsquo;<samp>num_ticks_per_picture</samp>&rsquo;</dt>
191
+<dd><p>Set the number of ticks in each picture, to indicate that the stream
192
+has a fixed framerate.  Ignored if &lsquo;<samp>tick_rate</samp>&rsquo; is not also set.
193
+</p>
194
+</dd>
195
+<dt>&lsquo;<samp>delete_padding</samp>&rsquo;</dt>
196
+<dd><p>Deletes Padding OBUs.
197
+</p>
198
+</dd>
199
+</dl>
200
+
201
+<a name="chomp"></a>
202
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-chomp">2.3 chomp</a></h2>
203
+
204
+<p>Remove zero padding at the end of a packet.
205
+</p>
206
+<a name="dca_005fcore"></a>
207
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-dca_005fcore">2.4 dca_core</a></h2>
208
+
209
+<p>Extract the core from a DCA/DTS stream, dropping extensions such as
210
+DTS-HD.
211
+</p>
212
+<a name="dump_005fextra"></a>
213
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-dump_005fextra">2.5 dump_extra</a></h2>
214
+
215
+<p>Add extradata to the beginning of the filtered packets except when
216
+said packets already exactly begin with the extradata that is intended
217
+to be added.
218
+</p>
219
+<dl compact="compact">
220
+<dt>&lsquo;<samp>freq</samp>&rsquo;</dt>
221
+<dd><p>The additional argument specifies which packets should be filtered.
222
+It accepts the values:
223
+</p><dl compact="compact">
224
+<dt>&lsquo;<samp>k</samp>&rsquo;</dt>
225
+<dt>&lsquo;<samp>keyframe</samp>&rsquo;</dt>
226
+<dd><p>add extradata to all key packets
227
+</p>
228
+</dd>
229
+<dt>&lsquo;<samp>e</samp>&rsquo;</dt>
230
+<dt>&lsquo;<samp>all</samp>&rsquo;</dt>
231
+<dd><p>add extradata to all packets
232
+</p></dd>
233
+</dl>
234
+</dd>
235
+</dl>
236
+
237
+<p>If not specified it is assumed &lsquo;<samp>k</samp>&rsquo;.
238
+</p>
239
+<p>For example the following <code>ffmpeg</code> command forces a global
240
+header (thus disabling individual packet headers) in the H.264 packets
241
+generated by the <code>libx264</code> encoder, but corrects them by adding
242
+the header stored in extradata to the key packets:
243
+</p><div class="example">
244
+<pre class="example">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
245
+</pre></div>
246
+
247
+<a name="eac3_005fcore"></a>
248
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-eac3_005fcore">2.6 eac3_core</a></h2>
249
+
250
+<p>Extract the core from a E-AC-3 stream, dropping extra channels.
251
+</p>
252
+<a name="extract_005fextradata"></a>
253
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-extract_005fextradata">2.7 extract_extradata</a></h2>
254
+
255
+<p>Extract the in-band extradata.
256
+</p>
257
+<p>Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
258
+or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either &quot;in-band&quot; (i.e. as a part
259
+of the bitstream containing the coded frames) or &quot;out of band&quot; (e.g. on the
260
+container level). This latter form is called &quot;extradata&quot; in FFmpeg terminology.
261
+</p>
262
+<p>This bitstream filter detects the in-band headers and makes them available as
263
+extradata.
264
+</p>
265
+<dl compact="compact">
266
+<dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
267
+<dd><p>When this option is enabled, the long-term headers are removed from the
268
+bitstream after extraction.
269
+</p></dd>
270
+</dl>
271
+
272
+<a name="filter_005funits"></a>
273
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-filter_005funits">2.8 filter_units</a></h2>
274
+
275
+<p>Remove units with types in or not in a given set from the stream.
276
+</p>
277
+<dl compact="compact">
278
+<dt>&lsquo;<samp>pass_types</samp>&rsquo;</dt>
279
+<dd><p>List of unit types or ranges of unit types to pass through while removing
280
+all others.  This is specified as a &rsquo;|&rsquo;-separated list of unit type values
281
+or ranges of values with &rsquo;-&rsquo;.
282
+</p>
283
+</dd>
284
+<dt>&lsquo;<samp>remove_types</samp>&rsquo;</dt>
285
+<dd><p>Identical to &lsquo;<samp>pass_types</samp>&rsquo;, except the units in the given set
286
+removed and all others passed through.
287
+</p></dd>
288
+</dl>
289
+
290
+<p>Extradata is unchanged by this transformation, but note that if the stream
291
+contains inline parameter sets then the output may be unusable if they are
292
+removed.
293
+</p>
294
+<p>For example, to remove all non-VCL NAL units from an H.264 stream:
295
+</p><div class="example">
296
+<pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
297
+</pre></div>
298
+
299
+<p>To remove all AUDs, SEI and filler from an H.265 stream:
300
+</p><div class="example">
301
+<pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
302
+</pre></div>
303
+
304
+<a name="hapqa_005fextract"></a>
305
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-hapqa_005fextract">2.9 hapqa_extract</a></h2>
306
+
307
+<p>Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.
308
+</p>
309
+<dl compact="compact">
310
+<dt>&lsquo;<samp>texture</samp>&rsquo;</dt>
311
+<dd><p>Specifies the texture to keep.
312
+</p>
313
+<dl compact="compact">
314
+<dt>&lsquo;<samp>color</samp>&rsquo;</dt>
315
+<dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
316
+</dl>
317
+
318
+</dd>
319
+</dl>
320
+
321
+<p>Convert HAPQA to HAPQ
322
+</p><div class="example">
323
+<pre class="example">ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder=&quot;HAPQ&quot; hapq_file.mov
324
+</pre></div>
325
+
326
+<p>Convert HAPQA to HAPAlphaOnly
327
+</p><div class="example">
328
+<pre class="example">ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder=&quot;HAPAlpha Only&quot; hapalphaonly_file.mov
329
+</pre></div>
330
+
331
+<a name="h264_005fmetadata"></a>
332
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-h264_005fmetadata">2.10 h264_metadata</a></h2>
333
+
334
+<p>Modify metadata embedded in an H.264 stream.
335
+</p>
336
+<dl compact="compact">
337
+<dt>&lsquo;<samp>aud</samp>&rsquo;</dt>
338
+<dd><p>Insert or remove AUD NAL units in all access units of the stream.
339
+</p>
340
+<dl compact="compact">
341
+<dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
342
+<dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
343
+</dl>
344
+
345
+</dd>
346
+<dt>&lsquo;<samp>sample_aspect_ratio</samp>&rsquo;</dt>
347
+<dd><p>Set the sample aspect ratio of the stream in the VUI parameters.
348
+</p>
349
+</dd>
350
+<dt>&lsquo;<samp>overscan_appropriate_flag</samp>&rsquo;</dt>
351
+<dd><p>Set whether the stream is suitable for display using overscan
352
+or not (see H.264 section E.2.1).
353
+</p>
354
+</dd>
355
+<dt>&lsquo;<samp>video_format</samp>&rsquo;</dt>
356
+<dt>&lsquo;<samp>video_full_range_flag</samp>&rsquo;</dt>
357
+<dd><p>Set the video format in the stream (see H.264 section E.2.1 and
358
+table E-2).
359
+</p>
360
+</dd>
361
+<dt>&lsquo;<samp>colour_primaries</samp>&rsquo;</dt>
362
+<dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
363
+<dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
364
+<dd><p>Set the colour description in the stream (see H.264 section E.2.1
365
+and tables E-3, E-4 and E-5).
366
+</p>
367
+</dd>
368
+<dt>&lsquo;<samp>chroma_sample_loc_type</samp>&rsquo;</dt>
369
+<dd><p>Set the chroma sample location in the stream (see H.264 section
370
+E.2.1 and figure E-1).
371
+</p>
372
+</dd>
373
+<dt>&lsquo;<samp>tick_rate</samp>&rsquo;</dt>
374
+<dd><p>Set the tick rate (num_units_in_tick / time_scale) in the VUI
375
+parameters.  This is the smallest time unit representable in the
376
+stream, and in many cases represents the field rate of the stream
377
+(double the frame rate).
378
+</p></dd>
379
+<dt>&lsquo;<samp>fixed_frame_rate_flag</samp>&rsquo;</dt>
380
+<dd><p>Set whether the stream has fixed framerate - typically this indicates
381
+that the framerate is exactly half the tick rate, but the exact
382
+meaning is dependent on interlacing and the picture structure (see
383
+H.264 section E.2.1 and table E-6).
384
+</p>
385
+</dd>
386
+<dt>&lsquo;<samp>crop_left</samp>&rsquo;</dt>
387
+<dt>&lsquo;<samp>crop_right</samp>&rsquo;</dt>
388
+<dt>&lsquo;<samp>crop_top</samp>&rsquo;</dt>
389
+<dt>&lsquo;<samp>crop_bottom</samp>&rsquo;</dt>
390
+<dd><p>Set the frame cropping offsets in the SPS.  These values will replace
391
+the current ones if the stream is already cropped.
392
+</p>
393
+<p>These fields are set in pixels.  Note that some sizes may not be
394
+representable if the chroma is subsampled or the stream is interlaced
395
+(see H.264 section 7.4.2.1.1).
396
+</p>
397
+</dd>
398
+<dt>&lsquo;<samp>sei_user_data</samp>&rsquo;</dt>
399
+<dd><p>Insert a string as SEI unregistered user data.  The argument must
400
+be of the form <em>UUID+string</em>, where the UUID is as hex digits
401
+possibly separated by hyphens, and the string can be anything.
402
+</p>
403
+<p>For example, &lsquo;<samp>086f3693-b7b3-4f2c-9653-21492feee5b8+hello</samp>&rsquo; will
404
+insert the string &ldquo;hello&rdquo; associated with the given UUID.
405
+</p>
406
+</dd>
407
+<dt>&lsquo;<samp>delete_filler</samp>&rsquo;</dt>
408
+<dd><p>Deletes both filler NAL units and filler SEI messages.
409
+</p>
410
+</dd>
411
+<dt>&lsquo;<samp>level</samp>&rsquo;</dt>
412
+<dd><p>Set the level in the SPS.  Refer to H.264 section A.3 and tables A-1
413
+to A-5.
414
+</p>
415
+<p>The argument must be the name of a level (for example, &lsquo;<samp>4.2</samp>&rsquo;), a
416
+level_idc value (for example, &lsquo;<samp>42</samp>&rsquo;), or the special name &lsquo;<samp>auto</samp>&rsquo;
417
+indicating that the filter should attempt to guess the level from the
418
+input stream properties.
419
+</p>
420
+</dd>
421
+</dl>
422
+
423
+<a name="h264_005fmp4toannexb"></a>
424
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-h264_005fmp4toannexb">2.11 h264_mp4toannexb</a></h2>
425
+
426
+<p>Convert an H.264 bitstream from length prefixed mode to start code
427
+prefixed mode (as defined in the Annex B of the ITU-T H.264
428
+specification).
429
+</p>
430
+<p>This is required by some streaming formats, typically the MPEG-2
431
+transport stream format (muxer <code>mpegts</code>).
432
+</p>
433
+<p>For example to remux an MP4 file containing an H.264 stream to mpegts
434
+format with <code>ffmpeg</code>, you can use the command:
435
+</p>
436
+<div class="example">
437
+<pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
438
+</pre></div>
439
+
440
+<p>Please note that this filter is auto-inserted for MPEG-TS (muxer
441
+<code>mpegts</code>) and raw H.264 (muxer <code>h264</code>) output formats.
442
+</p>
443
+<a name="h264_005fredundant_005fpps"></a>
444
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-h264_005fredundant_005fpps">2.12 h264_redundant_pps</a></h2>
445
+
446
+<p>This applies a specific fixup to some Blu-ray streams which contain
447
+redundant PPSs modifying irrelevant parameters of the stream which
448
+confuse other transformations which require correct extradata.
449
+</p>
450
+<p>A new single global PPS is created, and all of the redundant PPSs
451
+within the stream are removed.
452
+</p>
453
+<a name="hevc_005fmetadata"></a>
454
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-hevc_005fmetadata">2.13 hevc_metadata</a></h2>
455
+
456
+<p>Modify metadata embedded in an HEVC stream.
457
+</p>
458
+<dl compact="compact">
459
+<dt>&lsquo;<samp>aud</samp>&rsquo;</dt>
460
+<dd><p>Insert or remove AUD NAL units in all access units of the stream.
461
+</p>
462
+<dl compact="compact">
463
+<dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
464
+<dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
465
+</dl>
466
+
467
+</dd>
468
+<dt>&lsquo;<samp>sample_aspect_ratio</samp>&rsquo;</dt>
469
+<dd><p>Set the sample aspect ratio in the stream in the VUI parameters.
470
+</p>
471
+</dd>
472
+<dt>&lsquo;<samp>video_format</samp>&rsquo;</dt>
473
+<dt>&lsquo;<samp>video_full_range_flag</samp>&rsquo;</dt>
474
+<dd><p>Set the video format in the stream (see H.265 section E.3.1 and
475
+table E.2).
476
+</p>
477
+</dd>
478
+<dt>&lsquo;<samp>colour_primaries</samp>&rsquo;</dt>
479
+<dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
480
+<dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
481
+<dd><p>Set the colour description in the stream (see H.265 section E.3.1
482
+and tables E.3, E.4 and E.5).
483
+</p>
484
+</dd>
485
+<dt>&lsquo;<samp>chroma_sample_loc_type</samp>&rsquo;</dt>
486
+<dd><p>Set the chroma sample location in the stream (see H.265 section
487
+E.3.1 and figure E.1).
488
+</p>
489
+</dd>
490
+<dt>&lsquo;<samp>tick_rate</samp>&rsquo;</dt>
491
+<dd><p>Set the tick rate in the VPS and VUI parameters (num_units_in_tick /
492
+time_scale).  Combined with &lsquo;<samp>num_ticks_poc_diff_one</samp>&rsquo;, this can
493
+set a constant framerate in the stream.  Note that it is likely to be
494
+overridden by container parameters when the stream is in a container.
495
+</p>
496
+</dd>
497
+<dt>&lsquo;<samp>num_ticks_poc_diff_one</samp>&rsquo;</dt>
498
+<dd><p>Set poc_proportional_to_timing_flag in VPS and VUI and use this value
499
+to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
500
+E.3.1).  Ignored if &lsquo;<samp>tick_rate</samp>&rsquo; is not also set.
501
+</p>
502
+</dd>
503
+<dt>&lsquo;<samp>crop_left</samp>&rsquo;</dt>
504
+<dt>&lsquo;<samp>crop_right</samp>&rsquo;</dt>
505
+<dt>&lsquo;<samp>crop_top</samp>&rsquo;</dt>
506
+<dt>&lsquo;<samp>crop_bottom</samp>&rsquo;</dt>
507
+<dd><p>Set the conformance window cropping offsets in the SPS.  These values
508
+will replace the current ones if the stream is already cropped.
509
+</p>
510
+<p>These fields are set in pixels.  Note that some sizes may not be
511
+representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
512
+</p>
513
+</dd>
514
+<dt>&lsquo;<samp>level</samp>&rsquo;</dt>
515
+<dd><p>Set the level in the VPS and SPS.  See H.265 section A.4 and tables
516
+A.6 and A.7.
517
+</p>
518
+<p>The argument must be the name of a level (for example, &lsquo;<samp>5.1</samp>&rsquo;), a
519
+<em>general_level_idc</em> value (for example, &lsquo;<samp>153</samp>&rsquo; for level 5.1),
520
+or the special name &lsquo;<samp>auto</samp>&rsquo; indicating that the filter should
521
+attempt to guess the level from the input stream properties.
522
+</p>
523
+</dd>
524
+</dl>
525
+
526
+<a name="hevc_005fmp4toannexb"></a>
527
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-hevc_005fmp4toannexb">2.14 hevc_mp4toannexb</a></h2>
528
+
529
+<p>Convert an HEVC/H.265 bitstream from length prefixed mode to start code
530
+prefixed mode (as defined in the Annex B of the ITU-T H.265
531
+specification).
532
+</p>
533
+<p>This is required by some streaming formats, typically the MPEG-2
534
+transport stream format (muxer <code>mpegts</code>).
535
+</p>
536
+<p>For example to remux an MP4 file containing an HEVC stream to mpegts
537
+format with <code>ffmpeg</code>, you can use the command:
538
+</p>
539
+<div class="example">
540
+<pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
541
+</pre></div>
542
+
543
+<p>Please note that this filter is auto-inserted for MPEG-TS (muxer
544
+<code>mpegts</code>) and raw HEVC/H.265 (muxer <code>h265</code> or
545
+<code>hevc</code>) output formats.
546
+</p>
547
+<a name="imxdump"></a>
548
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-imxdump">2.15 imxdump</a></h2>
549
+
550
+<p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
551
+Pro decoder. This filter only applies to the mpeg2video codec, and is
552
+likely not needed for Final Cut Pro 7 and newer with the appropriate
553
+&lsquo;<samp>-tag:v</samp>&rsquo;.
554
+</p>
555
+<p>For example, to remux 30 MB/sec NTSC IMX to MOV:
556
+</p>
557
+<div class="example">
558
+<pre class="example">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
559
+</pre></div>
560
+
561
+<a name="mjpeg2jpeg"></a>
562
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-mjpeg2jpeg">2.16 mjpeg2jpeg</a></h2>
563
+
564
+<p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
565
+</p>
566
+<p>MJPEG is a video codec wherein each video frame is essentially a
567
+JPEG image. The individual frames can be extracted without loss,
568
+e.g. by
569
+</p>
570
+<div class="example">
571
+<pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
572
+</pre></div>
573
+
574
+<p>Unfortunately, these chunks are incomplete JPEG images, because
575
+they lack the DHT segment required for decoding. Quoting from
576
+<a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
577
+</p>
578
+<p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
579
+commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
580
+MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
581
+Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
582
+and it must use basic Huffman encoding, not arithmetic or
583
+progressive. . . . You can indeed extract the MJPEG frames and
584
+decode them with a regular JPEG decoder, but you have to prepend
585
+the DHT segment to them, or else the decoder won&rsquo;t have any idea
586
+how to decompress the data. The exact table necessary is given in
587
+the OpenDML spec.&quot;
588
+</p>
589
+<p>This bitstream filter patches the header of frames extracted from an MJPEG
590
+stream (carrying the AVI1 header ID and lacking a DHT segment) to
591
+produce fully qualified JPEG images.
592
+</p>
593
+<div class="example">
594
+<pre class="example">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
595
+exiftran -i -9 frame*.jpg
596
+ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
597
+</pre></div>
598
+
599
+<a name="mjpegadump"></a>
600
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-mjpegadump">2.17 mjpegadump</a></h2>
601
+
602
+<p>Add an MJPEG A header to the bitstream, to enable decoding by
603
+Quicktime.
604
+</p>
605
+<p><a name="mov2textsub"></a>
606
+</p><a name="mov2textsub-1"></a>
607
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-mov2textsub-1">2.18 mov2textsub</a></h2>
608
+
609
+<p>Extract a representable text file from MOV subtitles, stripping the
610
+metadata header from each subtitle packet.
611
+</p>
612
+<p>See also the <a href="#text2movsub">text2movsub</a> filter.
613
+</p>
614
+<a name="mp3decomp"></a>
615
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-mp3decomp">2.19 mp3decomp</a></h2>
616
+
617
+<p>Decompress non-standard compressed MP3 audio headers.
618
+</p>
619
+<a name="mpeg2_005fmetadata"></a>
620
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-mpeg2_005fmetadata">2.20 mpeg2_metadata</a></h2>
621
+
622
+<p>Modify metadata embedded in an MPEG-2 stream.
623
+</p>
624
+<dl compact="compact">
625
+<dt>&lsquo;<samp>display_aspect_ratio</samp>&rsquo;</dt>
626
+<dd><p>Set the display aspect ratio in the stream.
627
+</p>
628
+<p>The following fixed values are supported:
629
+</p><dl compact="compact">
630
+<dt>&lsquo;<samp>4/3</samp>&rsquo;</dt>
631
+<dt>&lsquo;<samp>16/9</samp>&rsquo;</dt>
632
+<dt>&lsquo;<samp>221/100</samp>&rsquo;</dt>
633
+</dl>
634
+<p>Any other value will result in square pixels being signalled instead
635
+(see H.262 section 6.3.3 and table 6-3).
636
+</p>
637
+</dd>
638
+<dt>&lsquo;<samp>frame_rate</samp>&rsquo;</dt>
639
+<dd><p>Set the frame rate in the stream.  This is constructed from a table
640
+of known values combined with a small multiplier and divisor - if
641
+the supplied value is not exactly representable, the nearest
642
+representable value will be used instead (see H.262 section 6.3.3
643
+and table 6-4).
644
+</p>
645
+</dd>
646
+<dt>&lsquo;<samp>video_format</samp>&rsquo;</dt>
647
+<dd><p>Set the video format in the stream (see H.262 section 6.3.6 and
648
+table 6-6).
649
+</p>
650
+</dd>
651
+<dt>&lsquo;<samp>colour_primaries</samp>&rsquo;</dt>
652
+<dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
653
+<dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
654
+<dd><p>Set the colour description in the stream (see H.262 section 6.3.6
655
+and tables 6-7, 6-8 and 6-9).
656
+</p>
657
+</dd>
658
+</dl>
659
+
660
+<a name="mpeg4_005funpack_005fbframes"></a>
661
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-mpeg4_005funpack_005fbframes">2.21 mpeg4_unpack_bframes</a></h2>
662
+
663
+<p>Unpack DivX-style packed B-frames.
664
+</p>
665
+<p>DivX-style packed B-frames are not valid MPEG-4 and were only a
666
+workaround for the broken Video for Windows subsystem.
667
+They use more space, can cause minor AV sync issues, require more
668
+CPU power to decode (unless the player has some decoded picture queue
669
+to compensate the 2,0,2,0 frame per packet style) and cause
670
+trouble if copied into a standard container like mp4 or mpeg-ps/ts,
671
+because MPEG-4 decoders may not be able to decode them, since they are
672
+not valid MPEG-4.
673
+</p>
674
+<p>For example to fix an AVI file containing an MPEG-4 stream with
675
+DivX-style packed B-frames using <code>ffmpeg</code>, you can use the command:
676
+</p>
677
+<div class="example">
678
+<pre class="example">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
679
+</pre></div>
680
+
681
+<a name="noise"></a>
682
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-noise">2.22 noise</a></h2>
683
+
684
+<p>Damages the contents of packets or simply drops them without damaging the
685
+container. Can be used for fuzzing or testing error resilience/concealment.
686
+</p>
687
+<p>Parameters:
688
+</p><dl compact="compact">
689
+<dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
690
+<dd><p>A numeral string, whose value is related to how often output bytes will
691
+be modified. Therefore, values below or equal to 0 are forbidden, and
692
+the lower the more frequent bytes will be modified, with 1 meaning
693
+every byte is modified.
694
+</p></dd>
695
+<dt>&lsquo;<samp>dropamount</samp>&rsquo;</dt>
696
+<dd><p>A numeral string, whose value is related to how often packets will be dropped.
697
+Therefore, values below or equal to 0 are forbidden, and the lower the more
698
+frequent packets will be dropped, with 1 meaning every packet is dropped.
699
+</p></dd>
700
+</dl>
701
+
702
+<p>The following example applies the modification to every byte but does not drop
703
+any packets.
704
+</p><div class="example">
705
+<pre class="example">ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
706
+</pre></div>
707
+
708
+<a name="null"></a>
709
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-null">2.23 null</a></h2>
710
+<p>This bitstream filter passes the packets through unchanged.
711
+</p>
712
+<a name="prores_005fmetadata"></a>
713
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-prores_005fmetadata">2.24 prores_metadata</a></h2>
714
+
715
+<p>Modify color property metadata embedded in prores stream.
716
+</p>
717
+<dl compact="compact">
718
+<dt>&lsquo;<samp>color_primaries</samp>&rsquo;</dt>
719
+<dd><p>Set the color primaries.
720
+Available values are:
721
+</p>
722
+<dl compact="compact">
723
+<dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
724
+<dd><p>Keep the same color primaries property (default).
725
+</p>
726
+</dd>
727
+<dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
728
+<dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
729
+<dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
730
+<dd><p>BT601 625
731
+</p>
732
+</dd>
733
+<dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
734
+<dd><p>BT601 525
735
+</p>
736
+</dd>
737
+<dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
738
+<dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
739
+<dd><p>DCI P3
740
+</p>
741
+</dd>
742
+<dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
743
+<dd><p>P3 D65
744
+</p>
745
+</dd>
746
+</dl>
747
+
748
+</dd>
749
+<dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
750
+<dd><p>Set the color transfer.
751
+Available values are:
752
+</p>
753
+<dl compact="compact">
754
+<dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
755
+<dd><p>Keep the same transfer characteristics property (default).
756
+</p>
757
+</dd>
758
+<dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
759
+<dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
760
+<dd><p>BT 601, BT 709, BT 2020
761
+</p></dd>
762
+</dl>
763
+
764
+
765
+</dd>
766
+<dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
767
+<dd><p>Set the matrix coefficient.
768
+Available values are:
769
+</p>
770
+<dl compact="compact">
771
+<dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
772
+<dd><p>Keep the same colorspace property (default).
773
+</p>
774
+</dd>
775
+<dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
776
+<dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
777
+<dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
778
+<dd><p>BT 601
779
+</p>
780
+</dd>
781
+<dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
782
+</dl>
783
+</dd>
784
+</dl>
785
+
786
+<p>Set Rec709 colorspace for each frame of the file
787
+</p><div class="example">
788
+<pre class="example">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
789
+</pre></div>
790
+
791
+<a name="remove_005fextra"></a>
792
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-remove_005fextra">2.25 remove_extra</a></h2>
793
+
794
+<p>Remove extradata from packets.
795
+</p>
796
+<p>It accepts the following parameter:
797
+</p><dl compact="compact">
798
+<dt>&lsquo;<samp>freq</samp>&rsquo;</dt>
799
+<dd><p>Set which frame types to remove extradata from.
800
+</p>
801
+<dl compact="compact">
802
+<dt>&lsquo;<samp>k</samp>&rsquo;</dt>
803
+<dd><p>Remove extradata from non-keyframes only.
804
+</p>
805
+</dd>
806
+<dt>&lsquo;<samp>keyframe</samp>&rsquo;</dt>
807
+<dd><p>Remove extradata from keyframes only.
808
+</p>
809
+</dd>
810
+<dt>&lsquo;<samp>e, all</samp>&rsquo;</dt>
811
+<dd><p>Remove extradata from all frames.
812
+</p>
813
+</dd>
814
+</dl>
815
+</dd>
816
+</dl>
817
+
818
+<p><a name="text2movsub"></a>
819
+</p><a name="text2movsub-1"></a>
820
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-text2movsub-1">2.26 text2movsub</a></h2>
821
+
822
+<p>Convert text subtitles to MOV subtitles (as used by the <code>mov_text</code>
823
+codec) with metadata headers.
824
+</p>
825
+<p>See also the <a href="#mov2textsub">mov2textsub</a> filter.
826
+</p>
827
+<a name="trace_005fheaders"></a>
828
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-trace_005fheaders">2.27 trace_headers</a></h2>
829
+
830
+<p>Log trace output containing all syntax elements in the coded stream
831
+headers (everything above the level of individual coded blocks).
832
+This can be useful for debugging low-level stream issues.
833
+</p>
834
+<p>Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending
835
+on the build only a subset of these may be available.
836
+</p>
837
+<a name="truehd_005fcore"></a>
838
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-truehd_005fcore">2.28 truehd_core</a></h2>
839
+
840
+<p>Extract the core from a TrueHD stream, dropping ATMOS data.
841
+</p>
842
+<a name="vp9_005fmetadata"></a>
843
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-vp9_005fmetadata">2.29 vp9_metadata</a></h2>
844
+
845
+<p>Modify metadata embedded in a VP9 stream.
846
+</p>
847
+<dl compact="compact">
848
+<dt>&lsquo;<samp>color_space</samp>&rsquo;</dt>
849
+<dd><p>Set the color space value in the frame header.  Note that any frame
850
+set to RGB will be implicitly set to PC range and that RGB is
851
+incompatible with profiles 0 and 2.
852
+</p><dl compact="compact">
853
+<dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
854
+<dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
855
+<dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
856
+<dt>&lsquo;<samp>smpte170</samp>&rsquo;</dt>
857
+<dt>&lsquo;<samp>smpte240</samp>&rsquo;</dt>
858
+<dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
859
+<dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
860
+</dl>
861
+
862
+</dd>
863
+<dt>&lsquo;<samp>color_range</samp>&rsquo;</dt>
864
+<dd><p>Set the color range value in the frame header.  Note that any value
865
+imposed by the color space will take precedence over this value.
866
+</p><dl compact="compact">
867
+<dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
868
+<dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
869
+</dl>
870
+</dd>
871
+</dl>
872
+
873
+<a name="vp9_005fsuperframe"></a>
874
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-vp9_005fsuperframe">2.30 vp9_superframe</a></h2>
875
+
876
+<p>Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
877
+fixes merging of split/segmented VP9 streams where the alt-ref frame
878
+was split from its visible counterpart.
879
+</p>
880
+<a name="vp9_005fsuperframe_005fsplit"></a>
881
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-vp9_005fsuperframe_005fsplit">2.31 vp9_superframe_split</a></h2>
882
+
883
+<p>Split VP9 superframes into single frames.
884
+</p>
885
+<a name="vp9_005fraw_005freorder"></a>
886
+<h2 class="section"><a href="ffmpeg-bitstream-filters.html#toc-vp9_005fraw_005freorder">2.32 vp9_raw_reorder</a></h2>
887
+
888
+<p>Given a VP9 stream with correct timestamps but possibly out of order,
889
+insert additional show-existing-frame packets to correct the ordering.
890
+</p>
891
+
892
+<a name="See-Also"></a>
893
+<h1 class="chapter"><a href="ffmpeg-bitstream-filters.html#toc-See-Also">3 See Also</a></h1>
894
+
895
+<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
896
+<a href="libavcodec.html">libavcodec</a>
897
+</p>
898
+
899
+<a name="Authors"></a>
900
+<h1 class="chapter"><a href="ffmpeg-bitstream-filters.html#toc-Authors">4 Authors</a></h1>
901
+
902
+<p>The FFmpeg developers.
903
+</p>
904
+<p>For details about the authorship, see the Git history of the project
905
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
906
+<code>git log</code> in the FFmpeg source directory, or browsing the
907
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
908
+</p>
909
+<p>Maintainers for the specific components are listed in the file
910
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
911
+</p>
912
+
913
+    </div>
914
+  </body>
915
+</html>
916
+

+ 6084
- 0
Common/ffmpeg/doc/ffmpeg-codecs.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 2461
- 0
Common/ffmpeg/doc/ffmpeg-devices.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 30410
- 0
Common/ffmpeg/doc/ffmpeg-filters.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 4368
- 0
Common/ffmpeg/doc/ffmpeg-formats.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 2160
- 0
Common/ffmpeg/doc/ffmpeg-protocols.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 372
- 0
Common/ffmpeg/doc/ffmpeg-resampler.html ファイルの表示

@@ -0,0 +1,372 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="FFmpeg Resampler Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : FFmpeg Resampler ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">FFmpeg Resampler Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-Resampler-Options" href="#Resampler-Options">2 Resampler Options</a></li>
41
+  <li><a name="toc-See-Also" href="#See-Also">3 See Also</a></li>
42
+  <li><a name="toc-Authors" href="#Authors">4 Authors</a></li>
43
+</ul>
44
+</div>
45
+
46
+
47
+<hr size="6">
48
+<a name="Description"></a>
49
+<h1 class="chapter"><a href="ffmpeg-resampler.html#toc-Description">1 Description</a></h1>
50
+
51
+<p>The FFmpeg resampler provides a high-level interface to the
52
+libswresample library audio resampling utilities. In particular it
53
+allows one to perform audio resampling, audio channel layout rematrixing,
54
+and convert audio format and packing layout.
55
+</p>
56
+
57
+<a name="Resampler-Options"></a>
58
+<h1 class="chapter"><a href="ffmpeg-resampler.html#toc-Resampler-Options">2 Resampler Options</a></h1>
59
+
60
+<p>The audio resampler supports the following named options.
61
+</p>
62
+<p>Options may be set by specifying -<var>option</var> <var>value</var> in the
63
+FFmpeg tools, <var>option</var>=<var>value</var> for the aresample filter,
64
+by setting the value explicitly in the
65
+<code>SwrContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API for
66
+programmatic use.
67
+</p>
68
+<dl compact="compact">
69
+<dt>&lsquo;<samp>ich, in_channel_count</samp>&rsquo;</dt>
70
+<dd><p>Set the number of input channels. Default value is 0. Setting this
71
+value is not mandatory if the corresponding channel layout
72
+&lsquo;<samp>in_channel_layout</samp>&rsquo; is set.
73
+</p>
74
+</dd>
75
+<dt>&lsquo;<samp>och, out_channel_count</samp>&rsquo;</dt>
76
+<dd><p>Set the number of output channels. Default value is 0. Setting this
77
+value is not mandatory if the corresponding channel layout
78
+&lsquo;<samp>out_channel_layout</samp>&rsquo; is set.
79
+</p>
80
+</dd>
81
+<dt>&lsquo;<samp>uch, used_channel_count</samp>&rsquo;</dt>
82
+<dd><p>Set the number of used input channels. Default value is 0. This option is
83
+only used for special remapping.
84
+</p>
85
+</dd>
86
+<dt>&lsquo;<samp>isr, in_sample_rate</samp>&rsquo;</dt>
87
+<dd><p>Set the input sample rate. Default value is 0.
88
+</p>
89
+</dd>
90
+<dt>&lsquo;<samp>osr, out_sample_rate</samp>&rsquo;</dt>
91
+<dd><p>Set the output sample rate. Default value is 0.
92
+</p>
93
+</dd>
94
+<dt>&lsquo;<samp>isf, in_sample_fmt</samp>&rsquo;</dt>
95
+<dd><p>Specify the input sample format. It is set by default to <code>none</code>.
96
+</p>
97
+</dd>
98
+<dt>&lsquo;<samp>osf, out_sample_fmt</samp>&rsquo;</dt>
99
+<dd><p>Specify the output sample format. It is set by default to <code>none</code>.
100
+</p>
101
+</dd>
102
+<dt>&lsquo;<samp>tsf, internal_sample_fmt</samp>&rsquo;</dt>
103
+<dd><p>Set the internal sample format. Default value is <code>none</code>.
104
+This will automatically be chosen when it is not explicitly set.
105
+</p>
106
+</dd>
107
+<dt>&lsquo;<samp>icl, in_channel_layout</samp>&rsquo;</dt>
108
+<dt>&lsquo;<samp>ocl, out_channel_layout</samp>&rsquo;</dt>
109
+<dd><p>Set the input/output channel layout.
110
+</p>
111
+<p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
112
+for the required syntax.
113
+</p>
114
+</dd>
115
+<dt>&lsquo;<samp>clev, center_mix_level</samp>&rsquo;</dt>
116
+<dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
117
+in the interval [-32,32].
118
+</p>
119
+</dd>
120
+<dt>&lsquo;<samp>slev, surround_mix_level</samp>&rsquo;</dt>
121
+<dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
122
+be in the interval [-32,32].
123
+</p>
124
+</dd>
125
+<dt>&lsquo;<samp>lfe_mix_level</samp>&rsquo;</dt>
126
+<dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
127
+LFE output. It is a value expressed in deciBel, and must
128
+be in the interval [-32,32].
129
+</p>
130
+</dd>
131
+<dt>&lsquo;<samp>rmvol, rematrix_volume</samp>&rsquo;</dt>
132
+<dd><p>Set rematrix volume. Default value is 1.0.
133
+</p>
134
+</dd>
135
+<dt>&lsquo;<samp>rematrix_maxval</samp>&rsquo;</dt>
136
+<dd><p>Set maximum output value for rematrixing.
137
+This can be used to prevent clipping vs. preventing volume reduction.
138
+A value of 1.0 prevents clipping.
139
+</p>
140
+</dd>
141
+<dt>&lsquo;<samp>flags, swr_flags</samp>&rsquo;</dt>
142
+<dd><p>Set flags used by the converter. Default value is 0.
143
+</p>
144
+<p>It supports the following individual flags:
145
+</p><dl compact="compact">
146
+<dt>&lsquo;<samp>res</samp>&rsquo;</dt>
147
+<dd><p>force resampling, this flag forces resampling to be used even when the
148
+input and output sample rates match.
149
+</p></dd>
150
+</dl>
151
+
152
+</dd>
153
+<dt>&lsquo;<samp>dither_scale</samp>&rsquo;</dt>
154
+<dd><p>Set the dither scale. Default value is 1.
155
+</p>
156
+</dd>
157
+<dt>&lsquo;<samp>dither_method</samp>&rsquo;</dt>
158
+<dd><p>Set dither method. Default value is 0.
159
+</p>
160
+<p>Supported values:
161
+</p><dl compact="compact">
162
+<dt>&lsquo;<samp>rectangular</samp>&rsquo;</dt>
163
+<dd><p>select rectangular dither
164
+</p></dd>
165
+<dt>&lsquo;<samp>triangular</samp>&rsquo;</dt>
166
+<dd><p>select triangular dither
167
+</p></dd>
168
+<dt>&lsquo;<samp>triangular_hp</samp>&rsquo;</dt>
169
+<dd><p>select triangular dither with high pass
170
+</p></dd>
171
+<dt>&lsquo;<samp>lipshitz</samp>&rsquo;</dt>
172
+<dd><p>select Lipshitz noise shaping dither.
173
+</p></dd>
174
+<dt>&lsquo;<samp>shibata</samp>&rsquo;</dt>
175
+<dd><p>select Shibata noise shaping dither.
176
+</p></dd>
177
+<dt>&lsquo;<samp>low_shibata</samp>&rsquo;</dt>
178
+<dd><p>select low Shibata noise shaping dither.
179
+</p></dd>
180
+<dt>&lsquo;<samp>high_shibata</samp>&rsquo;</dt>
181
+<dd><p>select high Shibata noise shaping dither.
182
+</p></dd>
183
+<dt>&lsquo;<samp>f_weighted</samp>&rsquo;</dt>
184
+<dd><p>select f-weighted noise shaping dither
185
+</p></dd>
186
+<dt>&lsquo;<samp>modified_e_weighted</samp>&rsquo;</dt>
187
+<dd><p>select modified-e-weighted noise shaping dither
188
+</p></dd>
189
+<dt>&lsquo;<samp>improved_e_weighted</samp>&rsquo;</dt>
190
+<dd><p>select improved-e-weighted noise shaping dither
191
+</p>
192
+</dd>
193
+</dl>
194
+
195
+</dd>
196
+<dt>&lsquo;<samp>resampler</samp>&rsquo;</dt>
197
+<dd><p>Set resampling engine. Default value is swr.
198
+</p>
199
+<p>Supported values:
200
+</p><dl compact="compact">
201
+<dt>&lsquo;<samp>swr</samp>&rsquo;</dt>
202
+<dd><p>select the native SW Resampler; filter options precision and cheby are not
203
+applicable in this case.
204
+</p></dd>
205
+<dt>&lsquo;<samp>soxr</samp>&rsquo;</dt>
206
+<dd><p>select the SoX Resampler (where available); compensation, and filter options
207
+filter_size, phase_shift, exact_rational, filter_type &amp; kaiser_beta, are not
208
+applicable in this case.
209
+</p></dd>
210
+</dl>
211
+
212
+</dd>
213
+<dt>&lsquo;<samp>filter_size</samp>&rsquo;</dt>
214
+<dd><p>For swr only, set resampling filter size, default value is 32.
215
+</p>
216
+</dd>
217
+<dt>&lsquo;<samp>phase_shift</samp>&rsquo;</dt>
218
+<dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
219
+the interval [0,30].
220
+</p>
221
+</dd>
222
+<dt>&lsquo;<samp>linear_interp</samp>&rsquo;</dt>
223
+<dd><p>Use linear interpolation when enabled (the default). Disable it if you want
224
+to preserve speed instead of quality when exact_rational fails.
225
+</p>
226
+</dd>
227
+<dt>&lsquo;<samp>exact_rational</samp>&rsquo;</dt>
228
+<dd><p>For swr only, when enabled, try to use exact phase_count based on input and
229
+output sample rate. However, if it is larger than <code>1 &lt;&lt; phase_shift</code>,
230
+the phase_count will be <code>1 &lt;&lt; phase_shift</code> as fallback. Default is enabled.
231
+</p>
232
+</dd>
233
+<dt>&lsquo;<samp>cutoff</samp>&rsquo;</dt>
234
+<dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
235
+value between 0 and 1.  Default value is 0.97 with swr, and 0.91 with soxr
236
+(which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
237
+</p>
238
+</dd>
239
+<dt>&lsquo;<samp>precision</samp>&rsquo;</dt>
240
+<dd><p>For soxr only, the precision in bits to which the resampled signal will be
241
+calculated.  The default value of 20 (which, with suitable dithering, is
242
+appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
243
+value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
244
+</p>
245
+</dd>
246
+<dt>&lsquo;<samp>cheby</samp>&rsquo;</dt>
247
+<dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
248
+approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
249
+</p>
250
+</dd>
251
+<dt>&lsquo;<samp>async</samp>&rsquo;</dt>
252
+<dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
253
+squeezing, filling and trimming. Setting this to 1 will enable filling and
254
+trimming, larger values represent the maximum amount in samples that the data
255
+may be stretched or squeezed for each second.
256
+Default value is 0, thus no compensation is applied to make the samples match
257
+the audio timestamps.
258
+</p>
259
+</dd>
260
+<dt>&lsquo;<samp>first_pts</samp>&rsquo;</dt>
261
+<dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
262
+This allows for padding/trimming at the start of stream. By default, no
263
+assumption is made about the first frame&rsquo;s expected pts, so no padding or
264
+trimming is done. For example, this could be set to 0 to pad the beginning with
265
+silence if an audio stream starts after the video stream or to trim any samples
266
+with a negative pts due to encoder delay.
267
+</p>
268
+</dd>
269
+<dt>&lsquo;<samp>min_comp</samp>&rsquo;</dt>
270
+<dd><p>For swr only, set the minimum difference between timestamps and audio data (in
271
+seconds) to trigger stretching/squeezing/filling or trimming of the
272
+data to make it match the timestamps. The default is that
273
+stretching/squeezing/filling and trimming is disabled
274
+(&lsquo;<samp>min_comp</samp>&rsquo; = <code>FLT_MAX</code>).
275
+</p>
276
+</dd>
277
+<dt>&lsquo;<samp>min_hard_comp</samp>&rsquo;</dt>
278
+<dd><p>For swr only, set the minimum difference between timestamps and audio data (in
279
+seconds) to trigger adding/dropping samples to make it match the
280
+timestamps.  This option effectively is a threshold to select between
281
+hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
282
+all compensation is by default disabled through &lsquo;<samp>min_comp</samp>&rsquo;.
283
+The default is 0.1.
284
+</p>
285
+</dd>
286
+<dt>&lsquo;<samp>comp_duration</samp>&rsquo;</dt>
287
+<dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
288
+to make it match the timestamps. Must be a non-negative double float value,
289
+default value is 1.0.
290
+</p>
291
+</dd>
292
+<dt>&lsquo;<samp>max_soft_comp</samp>&rsquo;</dt>
293
+<dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
294
+match the timestamps. Must be a non-negative double float value, default value
295
+is 0.
296
+</p>
297
+</dd>
298
+<dt>&lsquo;<samp>matrix_encoding</samp>&rsquo;</dt>
299
+<dd><p>Select matrixed stereo encoding.
300
+</p>
301
+<p>It accepts the following values:
302
+</p><dl compact="compact">
303
+<dt>&lsquo;<samp>none</samp>&rsquo;</dt>
304
+<dd><p>select none
305
+</p></dd>
306
+<dt>&lsquo;<samp>dolby</samp>&rsquo;</dt>
307
+<dd><p>select Dolby
308
+</p></dd>
309
+<dt>&lsquo;<samp>dplii</samp>&rsquo;</dt>
310
+<dd><p>select Dolby Pro Logic II
311
+</p></dd>
312
+</dl>
313
+
314
+<p>Default value is <code>none</code>.
315
+</p>
316
+</dd>
317
+<dt>&lsquo;<samp>filter_type</samp>&rsquo;</dt>
318
+<dd><p>For swr only, select resampling filter type. This only affects resampling
319
+operations.
320
+</p>
321
+<p>It accepts the following values:
322
+</p><dl compact="compact">
323
+<dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
324
+<dd><p>select cubic
325
+</p></dd>
326
+<dt>&lsquo;<samp>blackman_nuttall</samp>&rsquo;</dt>
327
+<dd><p>select Blackman Nuttall windowed sinc
328
+</p></dd>
329
+<dt>&lsquo;<samp>kaiser</samp>&rsquo;</dt>
330
+<dd><p>select Kaiser windowed sinc
331
+</p></dd>
332
+</dl>
333
+
334
+</dd>
335
+<dt>&lsquo;<samp>kaiser_beta</samp>&rsquo;</dt>
336
+<dd><p>For swr only, set Kaiser window beta value. Must be a double float value in the
337
+interval [2,16], default value is 9.
338
+</p>
339
+</dd>
340
+<dt>&lsquo;<samp>output_sample_bits</samp>&rsquo;</dt>
341
+<dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
342
+interval [0,64], default value is 0, which means it&rsquo;s not used.
343
+</p>
344
+</dd>
345
+</dl>
346
+
347
+
348
+<a name="See-Also"></a>
349
+<h1 class="chapter"><a href="ffmpeg-resampler.html#toc-See-Also">3 See Also</a></h1>
350
+
351
+<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
352
+<a href="libswresample.html">libswresample</a>
353
+</p>
354
+
355
+<a name="Authors"></a>
356
+<h1 class="chapter"><a href="ffmpeg-resampler.html#toc-Authors">4 Authors</a></h1>
357
+
358
+<p>The FFmpeg developers.
359
+</p>
360
+<p>For details about the authorship, see the Git history of the project
361
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
362
+<code>git log</code> in the FFmpeg source directory, or browsing the
363
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
364
+</p>
365
+<p>Maintainers for the specific components are listed in the file
366
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
367
+</p>
368
+
369
+    </div>
370
+  </body>
371
+</html>
372
+

+ 267
- 0
Common/ffmpeg/doc/ffmpeg-scaler.html ファイルの表示

@@ -0,0 +1,267 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="FFmpeg Scaler Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : FFmpeg Scaler ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">FFmpeg Scaler Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-Scaler-Options" href="#Scaler-Options">2 Scaler Options</a></li>
41
+  <li><a name="toc-See-Also" href="#See-Also">3 See Also</a></li>
42
+  <li><a name="toc-Authors" href="#Authors">4 Authors</a></li>
43
+</ul>
44
+</div>
45
+
46
+
47
+<hr size="6">
48
+<a name="Description"></a>
49
+<h1 class="chapter"><a href="ffmpeg-scaler.html#toc-Description">1 Description</a></h1>
50
+
51
+<p>The FFmpeg rescaler provides a high-level interface to the libswscale
52
+library image conversion utilities. In particular it allows one to perform
53
+image rescaling and pixel format conversion.
54
+</p>
55
+
56
+<p><a name="scaler_005foptions"></a>
57
+</p><a name="Scaler-Options"></a>
58
+<h1 class="chapter"><a href="ffmpeg-scaler.html#toc-Scaler-Options">2 Scaler Options</a></h1>
59
+
60
+<p>The video scaler supports the following named options.
61
+</p>
62
+<p>Options may be set by specifying -<var>option</var> <var>value</var> in the
63
+FFmpeg tools, with a few API-only exceptions noted below.
64
+For programmatic use, they can be set explicitly in the
65
+<code>SwsContext</code> options or through the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API.
66
+</p>
67
+<dl compact="compact">
68
+<dd>
69
+<p><a name="sws_005fflags"></a>
70
+</p></dd>
71
+<dt>&lsquo;<samp>sws_flags</samp>&rsquo;</dt>
72
+<dd><p>Set the scaler flags. This is also used to set the scaling
73
+algorithm. Only a single algorithm should be selected. Default
74
+value is &lsquo;<samp>bicubic</samp>&rsquo;.
75
+</p>
76
+<p>It accepts the following values:
77
+</p><dl compact="compact">
78
+<dt>&lsquo;<samp>fast_bilinear</samp>&rsquo;</dt>
79
+<dd><p>Select fast bilinear scaling algorithm.
80
+</p>
81
+</dd>
82
+<dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
83
+<dd><p>Select bilinear scaling algorithm.
84
+</p>
85
+</dd>
86
+<dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
87
+<dd><p>Select bicubic scaling algorithm.
88
+</p>
89
+</dd>
90
+<dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
91
+<dd><p>Select experimental scaling algorithm.
92
+</p>
93
+</dd>
94
+<dt>&lsquo;<samp>neighbor</samp>&rsquo;</dt>
95
+<dd><p>Select nearest neighbor rescaling algorithm.
96
+</p>
97
+</dd>
98
+<dt>&lsquo;<samp>area</samp>&rsquo;</dt>
99
+<dd><p>Select averaging area rescaling algorithm.
100
+</p>
101
+</dd>
102
+<dt>&lsquo;<samp>bicublin</samp>&rsquo;</dt>
103
+<dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
104
+chroma components.
105
+</p>
106
+</dd>
107
+<dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
108
+<dd><p>Select Gaussian rescaling algorithm.
109
+</p>
110
+</dd>
111
+<dt>&lsquo;<samp>sinc</samp>&rsquo;</dt>
112
+<dd><p>Select sinc rescaling algorithm.
113
+</p>
114
+</dd>
115
+<dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
116
+<dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
117
+changed by setting <code>param0</code>.
118
+</p>
119
+</dd>
120
+<dt>&lsquo;<samp>spline</samp>&rsquo;</dt>
121
+<dd><p>Select natural bicubic spline rescaling algorithm.
122
+</p>
123
+</dd>
124
+<dt>&lsquo;<samp>print_info</samp>&rsquo;</dt>
125
+<dd><p>Enable printing/debug logging.
126
+</p>
127
+</dd>
128
+<dt>&lsquo;<samp>accurate_rnd</samp>&rsquo;</dt>
129
+<dd><p>Enable accurate rounding.
130
+</p>
131
+</dd>
132
+<dt>&lsquo;<samp>full_chroma_int</samp>&rsquo;</dt>
133
+<dd><p>Enable full chroma interpolation.
134
+</p>
135
+</dd>
136
+<dt>&lsquo;<samp>full_chroma_inp</samp>&rsquo;</dt>
137
+<dd><p>Select full chroma input.
138
+</p>
139
+</dd>
140
+<dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
141
+<dd><p>Enable bitexact output.
142
+</p></dd>
143
+</dl>
144
+
145
+</dd>
146
+<dt>&lsquo;<samp>srcw <var>(API only)</var></samp>&rsquo;</dt>
147
+<dd><p>Set source width.
148
+</p>
149
+</dd>
150
+<dt>&lsquo;<samp>srch <var>(API only)</var></samp>&rsquo;</dt>
151
+<dd><p>Set source height.
152
+</p>
153
+</dd>
154
+<dt>&lsquo;<samp>dstw <var>(API only)</var></samp>&rsquo;</dt>
155
+<dd><p>Set destination width.
156
+</p>
157
+</dd>
158
+<dt>&lsquo;<samp>dsth <var>(API only)</var></samp>&rsquo;</dt>
159
+<dd><p>Set destination height.
160
+</p>
161
+</dd>
162
+<dt>&lsquo;<samp>src_format <var>(API only)</var></samp>&rsquo;</dt>
163
+<dd><p>Set source pixel format (must be expressed as an integer).
164
+</p>
165
+</dd>
166
+<dt>&lsquo;<samp>dst_format <var>(API only)</var></samp>&rsquo;</dt>
167
+<dd><p>Set destination pixel format (must be expressed as an integer).
168
+</p>
169
+</dd>
170
+<dt>&lsquo;<samp>src_range <var>(boolean)</var></samp>&rsquo;</dt>
171
+<dd><p>If value is set to <code>1</code>, indicates source is full range. Default value is
172
+<code>0</code>, which indicates source is limited range.
173
+</p>
174
+</dd>
175
+<dt>&lsquo;<samp>dst_range <var>(boolean)</var></samp>&rsquo;</dt>
176
+<dd><p>If value is set to <code>1</code>, enable full range for destination. Default value
177
+is <code>0</code>, which enables limited range.
178
+</p>
179
+<p><a name="sws_005fparams"></a>
180
+</p></dd>
181
+<dt>&lsquo;<samp>param0, param1</samp>&rsquo;</dt>
182
+<dd><p>Set scaling algorithm parameters. The specified values are specific of
183
+some scaling algorithms and ignored by others. The specified values
184
+are floating point number values.
185
+</p>
186
+</dd>
187
+<dt>&lsquo;<samp>sws_dither</samp>&rsquo;</dt>
188
+<dd><p>Set the dithering algorithm. Accepts one of the following
189
+values. Default value is &lsquo;<samp>auto</samp>&rsquo;.
190
+</p>
191
+<dl compact="compact">
192
+<dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
193
+<dd><p>automatic choice
194
+</p>
195
+</dd>
196
+<dt>&lsquo;<samp>none</samp>&rsquo;</dt>
197
+<dd><p>no dithering
198
+</p>
199
+</dd>
200
+<dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
201
+<dd><p>bayer dither
202
+</p>
203
+</dd>
204
+<dt>&lsquo;<samp>ed</samp>&rsquo;</dt>
205
+<dd><p>error diffusion dither
206
+</p>
207
+</dd>
208
+<dt>&lsquo;<samp>a_dither</samp>&rsquo;</dt>
209
+<dd><p>arithmetic dither, based using addition
210
+</p>
211
+</dd>
212
+<dt>&lsquo;<samp>x_dither</samp>&rsquo;</dt>
213
+<dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
214
+a_dither).
215
+</p>
216
+</dd>
217
+</dl>
218
+
219
+</dd>
220
+<dt>&lsquo;<samp>alphablend</samp>&rsquo;</dt>
221
+<dd><p>Set the alpha blending to use when the input has alpha but the output does not.
222
+Default value is &lsquo;<samp>none</samp>&rsquo;.
223
+</p>
224
+<dl compact="compact">
225
+<dt>&lsquo;<samp>uniform_color</samp>&rsquo;</dt>
226
+<dd><p>Blend onto a uniform background color
227
+</p>
228
+</dd>
229
+<dt>&lsquo;<samp>checkerboard</samp>&rsquo;</dt>
230
+<dd><p>Blend onto a checkerboard
231
+</p>
232
+</dd>
233
+<dt>&lsquo;<samp>none</samp>&rsquo;</dt>
234
+<dd><p>No blending
235
+</p>
236
+</dd>
237
+</dl>
238
+
239
+</dd>
240
+</dl>
241
+
242
+
243
+<a name="See-Also"></a>
244
+<h1 class="chapter"><a href="ffmpeg-scaler.html#toc-See-Also">3 See Also</a></h1>
245
+
246
+<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
247
+<a href="libswscale.html">libswscale</a>
248
+</p>
249
+
250
+<a name="Authors"></a>
251
+<h1 class="chapter"><a href="ffmpeg-scaler.html#toc-Authors">4 Authors</a></h1>
252
+
253
+<p>The FFmpeg developers.
254
+</p>
255
+<p>For details about the authorship, see the Git history of the project
256
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
257
+<code>git log</code> in the FFmpeg source directory, or browsing the
258
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
259
+</p>
260
+<p>Maintainers for the specific components are listed in the file
261
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
262
+</p>
263
+
264
+    </div>
265
+  </body>
266
+</html>
267
+

+ 1500
- 0
Common/ffmpeg/doc/ffmpeg-utils.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 2729
- 0
Common/ffmpeg/doc/ffmpeg.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 41224
- 0
Common/ffmpeg/doc/ffplay-all.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 859
- 0
Common/ffmpeg/doc/ffplay.html ファイルの表示

@@ -0,0 +1,859 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="ffplay Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : ffplay ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">ffplay Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
40
+  <li><a name="toc-Description" href="#Description">2 Description</a></li>
41
+  <li><a name="toc-Options" href="#Options">3 Options</a>
42
+  <ul class="no-bullet">
43
+    <li><a name="toc-Stream-specifiers-1" href="#Stream-specifiers-1">3.1 Stream specifiers</a></li>
44
+    <li><a name="toc-Generic-options" href="#Generic-options">3.2 Generic options</a></li>
45
+    <li><a name="toc-AVOptions" href="#AVOptions">3.3 AVOptions</a></li>
46
+    <li><a name="toc-Main-options" href="#Main-options">3.4 Main options</a></li>
47
+    <li><a name="toc-Advanced-options" href="#Advanced-options">3.5 Advanced options</a></li>
48
+    <li><a name="toc-While-playing" href="#While-playing">3.6 While playing</a></li>
49
+  </ul></li>
50
+  <li><a name="toc-See-Also" href="#See-Also">4 See Also</a></li>
51
+  <li><a name="toc-Authors" href="#Authors">5 Authors</a></li>
52
+</ul>
53
+</div>
54
+
55
+
56
+<hr size="6">
57
+<a name="Synopsis"></a>
58
+<h1 class="chapter"><a href="ffplay.html#toc-Synopsis">1 Synopsis</a></h1>
59
+
60
+<p>ffplay [<var>options</var>] [&lsquo;<tt>input_url</tt>&rsquo;]
61
+</p>
62
+<a name="Description"></a>
63
+<h1 class="chapter"><a href="ffplay.html#toc-Description">2 Description</a></h1>
64
+
65
+<p>FFplay is a very simple and portable media player using the FFmpeg
66
+libraries and the SDL library. It is mostly used as a testbed for the
67
+various FFmpeg APIs.
68
+</p>
69
+<a name="Options"></a>
70
+<h1 class="chapter"><a href="ffplay.html#toc-Options">3 Options</a></h1>
71
+
72
+<p>All the numerical options, if not specified otherwise, accept a string
73
+representing a number as input, which may be followed by one of the SI
74
+unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
75
+</p>
76
+<p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
77
+interpreted as a unit prefix for binary multiples, which are based on
78
+powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
79
+prefix multiplies the value by 8. This allows using, for example:
80
+&rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
81
+</p>
82
+<p>Options which do not take arguments are boolean options, and set the
83
+corresponding value to true. They can be set to false by prefixing
84
+the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
85
+will set the boolean option with name &quot;foo&quot; to false.
86
+</p>
87
+<p><a name="Stream-specifiers"></a>
88
+</p><a name="Stream-specifiers-1"></a>
89
+<h2 class="section"><a href="ffplay.html#toc-Stream-specifiers-1">3.1 Stream specifiers</a></h2>
90
+<p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
91
+are used to precisely specify which stream(s) a given option belongs to.
92
+</p>
93
+<p>A stream specifier is a string generally appended to the option name and
94
+separated from it by a colon. E.g. <code>-codec:a:1 ac3</code> contains the
95
+<code>a:1</code> stream specifier, which matches the second audio stream. Therefore, it
96
+would select the ac3 codec for the second audio stream.
97
+</p>
98
+<p>A stream specifier can match several streams, so that the option is applied to all
99
+of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
100
+streams.
101
+</p>
102
+<p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
103
+or <code>-codec: copy</code> would copy all the streams without reencoding.
104
+</p>
105
+<p>Possible forms of stream specifiers are:
106
+</p><dl compact="compact">
107
+<dt>&lsquo;<samp><var>stream_index</var></samp>&rsquo;</dt>
108
+<dd><p>Matches the stream with this index. E.g. <code>-threads:1 4</code> would set the
109
+thread count for the second stream to 4. If <var>stream_index</var> is used as an
110
+additional stream specifier (see below), then it selects stream number
111
+<var>stream_index</var> from the matching streams. Stream numbering is based on the
112
+order of the streams as detected by libavformat except when a program ID is
113
+also specified. In this case it is based on the ordering of the streams in the
114
+program.
115
+</p></dd>
116
+<dt>&lsquo;<samp><var>stream_type</var>[:<var>additional_stream_specifier</var>]</samp>&rsquo;</dt>
117
+<dd><p><var>stream_type</var> is one of following: &rsquo;v&rsquo; or &rsquo;V&rsquo; for video, &rsquo;a&rsquo; for audio, &rsquo;s&rsquo;
118
+for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. &rsquo;v&rsquo; matches all video
119
+streams, &rsquo;V&rsquo; only matches video streams which are not attached pictures, video
120
+thumbnails or cover arts. If <var>additional_stream_specifier</var> is used, then
121
+it matches streams which both have this type and match the
122
+<var>additional_stream_specifier</var>. Otherwise, it matches all streams of the
123
+specified type.
124
+</p></dd>
125
+<dt>&lsquo;<samp>p:<var>program_id</var>[:<var>additional_stream_specifier</var>]</samp>&rsquo;</dt>
126
+<dd><p>Matches streams which are in the program with the id <var>program_id</var>. If
127
+<var>additional_stream_specifier</var> is used, then it matches streams which both
128
+are part of the program and match the <var>additional_stream_specifier</var>.
129
+</p>
130
+</dd>
131
+<dt>&lsquo;<samp>#<var>stream_id</var> or i:<var>stream_id</var></samp>&rsquo;</dt>
132
+<dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
133
+</p></dd>
134
+<dt>&lsquo;<samp>m:<var>key</var>[:<var>value</var>]</samp>&rsquo;</dt>
135
+<dd><p>Matches streams with the metadata tag <var>key</var> having the specified value. If
136
+<var>value</var> is not given, matches streams that contain the given tag with any
137
+value.
138
+</p></dd>
139
+<dt>&lsquo;<samp>u</samp>&rsquo;</dt>
140
+<dd><p>Matches streams with usable configuration, the codec must be defined and the
141
+essential information such as video dimension or audio sample rate must be present.
142
+</p>
143
+<p>Note that in <code>ffmpeg</code>, matching by metadata will only work properly for
144
+input files.
145
+</p></dd>
146
+</dl>
147
+
148
+<a name="Generic-options"></a>
149
+<h2 class="section"><a href="ffplay.html#toc-Generic-options">3.2 Generic options</a></h2>
150
+
151
+<p>These options are shared amongst the ff* tools.
152
+</p>
153
+<dl compact="compact">
154
+<dt>&lsquo;<samp>-L</samp>&rsquo;</dt>
155
+<dd><p>Show license.
156
+</p>
157
+</dd>
158
+<dt>&lsquo;<samp>-h, -?, -help, --help [<var>arg</var>]</samp>&rsquo;</dt>
159
+<dd><p>Show help. An optional parameter may be specified to print help about a specific
160
+item. If no argument is specified, only basic (non advanced) tool
161
+options are shown.
162
+</p>
163
+<p>Possible values of <var>arg</var> are:
164
+</p><dl compact="compact">
165
+<dt>&lsquo;<samp>long</samp>&rsquo;</dt>
166
+<dd><p>Print advanced tool options in addition to the basic tool options.
167
+</p>
168
+</dd>
169
+<dt>&lsquo;<samp>full</samp>&rsquo;</dt>
170
+<dd><p>Print complete list of options, including shared and private options
171
+for encoders, decoders, demuxers, muxers, filters, etc.
172
+</p>
173
+</dd>
174
+<dt>&lsquo;<samp>decoder=<var>decoder_name</var></samp>&rsquo;</dt>
175
+<dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
176
+&lsquo;<samp>-decoders</samp>&rsquo; option to get a list of all decoders.
177
+</p>
178
+</dd>
179
+<dt>&lsquo;<samp>encoder=<var>encoder_name</var></samp>&rsquo;</dt>
180
+<dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
181
+&lsquo;<samp>-encoders</samp>&rsquo; option to get a list of all encoders.
182
+</p>
183
+</dd>
184
+<dt>&lsquo;<samp>demuxer=<var>demuxer_name</var></samp>&rsquo;</dt>
185
+<dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
186
+&lsquo;<samp>-formats</samp>&rsquo; option to get a list of all demuxers and muxers.
187
+</p>
188
+</dd>
189
+<dt>&lsquo;<samp>muxer=<var>muxer_name</var></samp>&rsquo;</dt>
190
+<dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
191
+&lsquo;<samp>-formats</samp>&rsquo; option to get a list of all muxers and demuxers.
192
+</p>
193
+</dd>
194
+<dt>&lsquo;<samp>filter=<var>filter_name</var></samp>&rsquo;</dt>
195
+<dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
196
+&lsquo;<samp>-filters</samp>&rsquo; option to get a list of all filters.
197
+</p>
198
+</dd>
199
+<dt>&lsquo;<samp>bsf=<var>bitstream_filter_name</var></samp>&rsquo;</dt>
200
+<dd><p>Print detailed information about the bitstream filter name <var>bitstream_filter_name</var>.
201
+Use the &lsquo;<samp>-bsfs</samp>&rsquo; option to get a list of all bitstream filters.
202
+</p></dd>
203
+</dl>
204
+
205
+</dd>
206
+<dt>&lsquo;<samp>-version</samp>&rsquo;</dt>
207
+<dd><p>Show version.
208
+</p>
209
+</dd>
210
+<dt>&lsquo;<samp>-formats</samp>&rsquo;</dt>
211
+<dd><p>Show available formats (including devices).
212
+</p>
213
+</dd>
214
+<dt>&lsquo;<samp>-demuxers</samp>&rsquo;</dt>
215
+<dd><p>Show available demuxers.
216
+</p>
217
+</dd>
218
+<dt>&lsquo;<samp>-muxers</samp>&rsquo;</dt>
219
+<dd><p>Show available muxers.
220
+</p>
221
+</dd>
222
+<dt>&lsquo;<samp>-devices</samp>&rsquo;</dt>
223
+<dd><p>Show available devices.
224
+</p>
225
+</dd>
226
+<dt>&lsquo;<samp>-codecs</samp>&rsquo;</dt>
227
+<dd><p>Show all codecs known to libavcodec.
228
+</p>
229
+<p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
230
+for what is more correctly called a media bitstream format.
231
+</p>
232
+</dd>
233
+<dt>&lsquo;<samp>-decoders</samp>&rsquo;</dt>
234
+<dd><p>Show available decoders.
235
+</p>
236
+</dd>
237
+<dt>&lsquo;<samp>-encoders</samp>&rsquo;</dt>
238
+<dd><p>Show all available encoders.
239
+</p>
240
+</dd>
241
+<dt>&lsquo;<samp>-bsfs</samp>&rsquo;</dt>
242
+<dd><p>Show available bitstream filters.
243
+</p>
244
+</dd>
245
+<dt>&lsquo;<samp>-protocols</samp>&rsquo;</dt>
246
+<dd><p>Show available protocols.
247
+</p>
248
+</dd>
249
+<dt>&lsquo;<samp>-filters</samp>&rsquo;</dt>
250
+<dd><p>Show available libavfilter filters.
251
+</p>
252
+</dd>
253
+<dt>&lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
254
+<dd><p>Show available pixel formats.
255
+</p>
256
+</dd>
257
+<dt>&lsquo;<samp>-sample_fmts</samp>&rsquo;</dt>
258
+<dd><p>Show available sample formats.
259
+</p>
260
+</dd>
261
+<dt>&lsquo;<samp>-layouts</samp>&rsquo;</dt>
262
+<dd><p>Show channel names and standard channel layouts.
263
+</p>
264
+</dd>
265
+<dt>&lsquo;<samp>-colors</samp>&rsquo;</dt>
266
+<dd><p>Show recognized color names.
267
+</p>
268
+</dd>
269
+<dt>&lsquo;<samp>-sources <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp>&rsquo;</dt>
270
+<dd><p>Show autodetected sources of the input device.
271
+Some devices may provide system-dependent source names that cannot be autodetected.
272
+The returned list cannot be assumed to be always complete.
273
+</p><div class="example">
274
+<pre class="example">ffmpeg -sources pulse,server=192.168.0.4
275
+</pre></div>
276
+
277
+</dd>
278
+<dt>&lsquo;<samp>-sinks <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp>&rsquo;</dt>
279
+<dd><p>Show autodetected sinks of the output device.
280
+Some devices may provide system-dependent sink names that cannot be autodetected.
281
+The returned list cannot be assumed to be always complete.
282
+</p><div class="example">
283
+<pre class="example">ffmpeg -sinks pulse,server=192.168.0.4
284
+</pre></div>
285
+
286
+</dd>
287
+<dt>&lsquo;<samp>-loglevel [<var>flags</var>+]<var>loglevel</var> | -v [<var>flags</var>+]<var>loglevel</var></samp>&rsquo;</dt>
288
+<dd><p>Set logging level and flags used by the library.
289
+</p>
290
+<p>The optional <var>flags</var> prefix can consist of the following values:
291
+</p><dl compact="compact">
292
+<dt>&lsquo;<samp>repeat</samp>&rsquo;</dt>
293
+<dd><p>Indicates that repeated log output should not be compressed to the first line
294
+and the &quot;Last message repeated n times&quot; line will be omitted.
295
+</p></dd>
296
+<dt>&lsquo;<samp>level</samp>&rsquo;</dt>
297
+<dd><p>Indicates that log output should add a <code>[level]</code> prefix to each message
298
+line. This can be used as an alternative to log coloring, e.g. when dumping the
299
+log to file.
300
+</p></dd>
301
+</dl>
302
+<p>Flags can also be used alone by adding a &rsquo;+&rsquo;/&rsquo;-&rsquo; prefix to set/reset a single
303
+flag without affecting other <var>flags</var> or changing <var>loglevel</var>. When
304
+setting both <var>flags</var> and <var>loglevel</var>, a &rsquo;+&rsquo; separator is expected
305
+between the last <var>flags</var> value and before <var>loglevel</var>.
306
+</p>
307
+<p><var>loglevel</var> is a string or a number containing one of the following values:
308
+</p><dl compact="compact">
309
+<dt>&lsquo;<samp>quiet, -8</samp>&rsquo;</dt>
310
+<dd><p>Show nothing at all; be silent.
311
+</p></dd>
312
+<dt>&lsquo;<samp>panic, 0</samp>&rsquo;</dt>
313
+<dd><p>Only show fatal errors which could lead the process to crash, such as
314
+an assertion failure. This is not currently used for anything.
315
+</p></dd>
316
+<dt>&lsquo;<samp>fatal, 8</samp>&rsquo;</dt>
317
+<dd><p>Only show fatal errors. These are errors after which the process absolutely
318
+cannot continue.
319
+</p></dd>
320
+<dt>&lsquo;<samp>error, 16</samp>&rsquo;</dt>
321
+<dd><p>Show all errors, including ones which can be recovered from.
322
+</p></dd>
323
+<dt>&lsquo;<samp>warning, 24</samp>&rsquo;</dt>
324
+<dd><p>Show all warnings and errors. Any message related to possibly
325
+incorrect or unexpected events will be shown.
326
+</p></dd>
327
+<dt>&lsquo;<samp>info, 32</samp>&rsquo;</dt>
328
+<dd><p>Show informative messages during processing. This is in addition to
329
+warnings and errors. This is the default value.
330
+</p></dd>
331
+<dt>&lsquo;<samp>verbose, 40</samp>&rsquo;</dt>
332
+<dd><p>Same as <code>info</code>, except more verbose.
333
+</p></dd>
334
+<dt>&lsquo;<samp>debug, 48</samp>&rsquo;</dt>
335
+<dd><p>Show everything, including debugging information.
336
+</p></dd>
337
+<dt>&lsquo;<samp>trace, 56</samp>&rsquo;</dt>
338
+</dl>
339
+
340
+<p>For example to enable repeated log output, add the <code>level</code> prefix, and set
341
+<var>loglevel</var> to <code>verbose</code>:
342
+</p><div class="example">
343
+<pre class="example">ffmpeg -loglevel repeat+level+verbose -i input output
344
+</pre></div>
345
+<p>Another example that enables repeated log output without affecting current
346
+state of <code>level</code> prefix flag or <var>loglevel</var>:
347
+</p><div class="example">
348
+<pre class="example">ffmpeg [...] -loglevel +repeat
349
+</pre></div>
350
+
351
+<p>By default the program logs to stderr. If coloring is supported by the
352
+terminal, colors are used to mark errors and warnings. Log coloring
353
+can be disabled setting the environment variable
354
+<code>AV_LOG_FORCE_NOCOLOR</code>, or can be forced setting
355
+the environment variable <code>AV_LOG_FORCE_COLOR</code>.
356
+</p>
357
+</dd>
358
+<dt>&lsquo;<samp>-report</samp>&rsquo;</dt>
359
+<dd><p>Dump full command line and log output to a file named
360
+<code><var>program</var>-<var>YYYYMMDD</var>-<var>HHMMSS</var>.log</code> in the current
361
+directory.
362
+This file can be useful for bug reports.
363
+It also implies <code>-loglevel debug</code>.
364
+</p>
365
+<p>Setting the environment variable <code>FFREPORT</code> to any value has the
366
+same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
367
+options will affect the report; option values must be escaped if they
368
+contain special characters or the options delimiter &rsquo;:&rsquo; (see the
369
+&ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
370
+</p>
371
+<p>The following options are recognized:
372
+</p><dl compact="compact">
373
+<dt>&lsquo;<samp>file</samp>&rsquo;</dt>
374
+<dd><p>set the file name to use for the report; <code>%p</code> is expanded to the name
375
+of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
376
+to a plain <code>%</code>
377
+</p></dd>
378
+<dt>&lsquo;<samp>level</samp>&rsquo;</dt>
379
+<dd><p>set the log verbosity level using a numerical value (see <code>-loglevel</code>).
380
+</p></dd>
381
+</dl>
382
+
383
+<p>For example, to output a report to a file named &lsquo;<tt>ffreport.log</tt>&rsquo;
384
+using a log level of <code>32</code> (alias for log level <code>info</code>):
385
+</p>
386
+<div class="example">
387
+<pre class="example">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
388
+</pre></div>
389
+
390
+<p>Errors in parsing the environment variable are not fatal, and will not
391
+appear in the report.
392
+</p>
393
+</dd>
394
+<dt>&lsquo;<samp>-hide_banner</samp>&rsquo;</dt>
395
+<dd><p>Suppress printing banner.
396
+</p>
397
+<p>All FFmpeg tools will normally show a copyright notice, build options
398
+and library versions. This option can be used to suppress printing
399
+this information.
400
+</p>
401
+</dd>
402
+<dt>&lsquo;<samp>-cpuflags flags (<em>global</em>)</samp>&rsquo;</dt>
403
+<dd><p>Allows setting and clearing cpu flags. This option is intended
404
+for testing. Do not use it unless you know what you&rsquo;re doing.
405
+</p><div class="example">
406
+<pre class="example">ffmpeg -cpuflags -sse+mmx ...
407
+ffmpeg -cpuflags mmx ...
408
+ffmpeg -cpuflags 0 ...
409
+</pre></div>
410
+<p>Possible flags for this option are:
411
+</p><dl compact="compact">
412
+<dt>&lsquo;<samp>x86</samp>&rsquo;</dt>
413
+<dd><dl compact="compact">
414
+<dt>&lsquo;<samp>mmx</samp>&rsquo;</dt>
415
+<dt>&lsquo;<samp>mmxext</samp>&rsquo;</dt>
416
+<dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
417
+<dt>&lsquo;<samp>sse2</samp>&rsquo;</dt>
418
+<dt>&lsquo;<samp>sse2slow</samp>&rsquo;</dt>
419
+<dt>&lsquo;<samp>sse3</samp>&rsquo;</dt>
420
+<dt>&lsquo;<samp>sse3slow</samp>&rsquo;</dt>
421
+<dt>&lsquo;<samp>ssse3</samp>&rsquo;</dt>
422
+<dt>&lsquo;<samp>atom</samp>&rsquo;</dt>
423
+<dt>&lsquo;<samp>sse4.1</samp>&rsquo;</dt>
424
+<dt>&lsquo;<samp>sse4.2</samp>&rsquo;</dt>
425
+<dt>&lsquo;<samp>avx</samp>&rsquo;</dt>
426
+<dt>&lsquo;<samp>avx2</samp>&rsquo;</dt>
427
+<dt>&lsquo;<samp>xop</samp>&rsquo;</dt>
428
+<dt>&lsquo;<samp>fma3</samp>&rsquo;</dt>
429
+<dt>&lsquo;<samp>fma4</samp>&rsquo;</dt>
430
+<dt>&lsquo;<samp>3dnow</samp>&rsquo;</dt>
431
+<dt>&lsquo;<samp>3dnowext</samp>&rsquo;</dt>
432
+<dt>&lsquo;<samp>bmi1</samp>&rsquo;</dt>
433
+<dt>&lsquo;<samp>bmi2</samp>&rsquo;</dt>
434
+<dt>&lsquo;<samp>cmov</samp>&rsquo;</dt>
435
+</dl>
436
+</dd>
437
+<dt>&lsquo;<samp>ARM</samp>&rsquo;</dt>
438
+<dd><dl compact="compact">
439
+<dt>&lsquo;<samp>armv5te</samp>&rsquo;</dt>
440
+<dt>&lsquo;<samp>armv6</samp>&rsquo;</dt>
441
+<dt>&lsquo;<samp>armv6t2</samp>&rsquo;</dt>
442
+<dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
443
+<dt>&lsquo;<samp>vfpv3</samp>&rsquo;</dt>
444
+<dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
445
+<dt>&lsquo;<samp>setend</samp>&rsquo;</dt>
446
+</dl>
447
+</dd>
448
+<dt>&lsquo;<samp>AArch64</samp>&rsquo;</dt>
449
+<dd><dl compact="compact">
450
+<dt>&lsquo;<samp>armv8</samp>&rsquo;</dt>
451
+<dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
452
+<dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
453
+</dl>
454
+</dd>
455
+<dt>&lsquo;<samp>PowerPC</samp>&rsquo;</dt>
456
+<dd><dl compact="compact">
457
+<dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
458
+</dl>
459
+</dd>
460
+<dt>&lsquo;<samp>Specific Processors</samp>&rsquo;</dt>
461
+<dd><dl compact="compact">
462
+<dt>&lsquo;<samp>pentium2</samp>&rsquo;</dt>
463
+<dt>&lsquo;<samp>pentium3</samp>&rsquo;</dt>
464
+<dt>&lsquo;<samp>pentium4</samp>&rsquo;</dt>
465
+<dt>&lsquo;<samp>k6</samp>&rsquo;</dt>
466
+<dt>&lsquo;<samp>k62</samp>&rsquo;</dt>
467
+<dt>&lsquo;<samp>athlon</samp>&rsquo;</dt>
468
+<dt>&lsquo;<samp>athlonxp</samp>&rsquo;</dt>
469
+<dt>&lsquo;<samp>k8</samp>&rsquo;</dt>
470
+</dl>
471
+</dd>
472
+</dl>
473
+</dd>
474
+</dl>
475
+
476
+<a name="AVOptions"></a>
477
+<h2 class="section"><a href="ffplay.html#toc-AVOptions">3.3 AVOptions</a></h2>
478
+
479
+<p>These options are provided directly by the libavformat, libavdevice and
480
+libavcodec libraries. To see the list of available AVOptions, use the
481
+&lsquo;<samp>-help</samp>&rsquo; option. They are separated into two categories:
482
+</p><dl compact="compact">
483
+<dt>&lsquo;<samp>generic</samp>&rsquo;</dt>
484
+<dd><p>These options can be set for any container, codec or device. Generic options
485
+are listed under AVFormatContext options for containers/devices and under
486
+AVCodecContext options for codecs.
487
+</p></dd>
488
+<dt>&lsquo;<samp>private</samp>&rsquo;</dt>
489
+<dd><p>These options are specific to the given container, device or codec. Private
490
+options are listed under their corresponding containers/devices/codecs.
491
+</p></dd>
492
+</dl>
493
+
494
+<p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
495
+an MP3 file, use the &lsquo;<samp>id3v2_version</samp>&rsquo; private option of the MP3
496
+muxer:
497
+</p><div class="example">
498
+<pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
499
+</pre></div>
500
+
501
+<p>All codec AVOptions are per-stream, and thus a stream specifier
502
+should be attached to them:
503
+</p><div class="example">
504
+<pre class="example">ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
505
+</pre></div>
506
+
507
+<p>In the above example, a multichannel audio stream is mapped twice for output.
508
+The first instance is encoded with codec ac3 and bitrate 640k.
509
+The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
510
+absolute index of the output stream.
511
+</p>
512
+<p>Note: the &lsquo;<samp>-nooption</samp>&rsquo; syntax cannot be used for boolean
513
+AVOptions, use &lsquo;<samp>-option 0</samp>&rsquo;/&lsquo;<samp>-option 1</samp>&rsquo;.
514
+</p>
515
+<p>Note: the old undocumented way of specifying per-stream AVOptions by
516
+prepending v/a/s to the options name is now obsolete and will be
517
+removed soon.
518
+</p>
519
+<a name="Main-options"></a>
520
+<h2 class="section"><a href="ffplay.html#toc-Main-options">3.4 Main options</a></h2>
521
+
522
+<dl compact="compact">
523
+<dt>&lsquo;<samp>-x <var>width</var></samp>&rsquo;</dt>
524
+<dd><p>Force displayed width.
525
+</p></dd>
526
+<dt>&lsquo;<samp>-y <var>height</var></samp>&rsquo;</dt>
527
+<dd><p>Force displayed height.
528
+</p></dd>
529
+<dt>&lsquo;<samp>-s <var>size</var></samp>&rsquo;</dt>
530
+<dd><p>Set frame size (WxH or abbreviation), needed for videos which do
531
+not contain a header with the frame size like raw YUV.  This option
532
+has been deprecated in favor of private options, try -video_size.
533
+</p></dd>
534
+<dt>&lsquo;<samp>-fs</samp>&rsquo;</dt>
535
+<dd><p>Start in fullscreen mode.
536
+</p></dd>
537
+<dt>&lsquo;<samp>-an</samp>&rsquo;</dt>
538
+<dd><p>Disable audio.
539
+</p></dd>
540
+<dt>&lsquo;<samp>-vn</samp>&rsquo;</dt>
541
+<dd><p>Disable video.
542
+</p></dd>
543
+<dt>&lsquo;<samp>-sn</samp>&rsquo;</dt>
544
+<dd><p>Disable subtitles.
545
+</p></dd>
546
+<dt>&lsquo;<samp>-ss <var>pos</var></samp>&rsquo;</dt>
547
+<dd><p>Seek to <var>pos</var>. Note that in most formats it is not possible to seek
548
+exactly, so <code>ffplay</code> will seek to the nearest seek point to
549
+<var>pos</var>.
550
+</p>
551
+<p><var>pos</var> must be a time duration specification,
552
+see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
553
+</p></dd>
554
+<dt>&lsquo;<samp>-t <var>duration</var></samp>&rsquo;</dt>
555
+<dd><p>Play <var>duration</var> seconds of audio/video.
556
+</p>
557
+<p><var>duration</var> must be a time duration specification,
558
+see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
559
+</p></dd>
560
+<dt>&lsquo;<samp>-bytes</samp>&rsquo;</dt>
561
+<dd><p>Seek by bytes.
562
+</p></dd>
563
+<dt>&lsquo;<samp>-seek_interval</samp>&rsquo;</dt>
564
+<dd><p>Set custom interval, in seconds, for seeking using left/right keys. Default is 10 seconds.
565
+</p></dd>
566
+<dt>&lsquo;<samp>-nodisp</samp>&rsquo;</dt>
567
+<dd><p>Disable graphical display.
568
+</p></dd>
569
+<dt>&lsquo;<samp>-noborder</samp>&rsquo;</dt>
570
+<dd><p>Borderless window.
571
+</p></dd>
572
+<dt>&lsquo;<samp>-alwaysontop</samp>&rsquo;</dt>
573
+<dd><p>Window always on top. Available on: X11 with SDL &gt;= 2.0.5, Windows SDL &gt;= 2.0.6.
574
+</p></dd>
575
+<dt>&lsquo;<samp>-volume</samp>&rsquo;</dt>
576
+<dd><p>Set the startup volume. 0 means silence, 100 means no volume reduction or
577
+amplification. Negative values are treated as 0, values above 100 are treated
578
+as 100.
579
+</p></dd>
580
+<dt>&lsquo;<samp>-f <var>fmt</var></samp>&rsquo;</dt>
581
+<dd><p>Force format.
582
+</p></dd>
583
+<dt>&lsquo;<samp>-window_title <var>title</var></samp>&rsquo;</dt>
584
+<dd><p>Set window title (default is the input filename).
585
+</p></dd>
586
+<dt>&lsquo;<samp>-left <var>title</var></samp>&rsquo;</dt>
587
+<dd><p>Set the x position for the left of the window (default is a centered window).
588
+</p></dd>
589
+<dt>&lsquo;<samp>-top <var>title</var></samp>&rsquo;</dt>
590
+<dd><p>Set the y position for the top of the window (default is a centered window).
591
+</p></dd>
592
+<dt>&lsquo;<samp>-loop <var>number</var></samp>&rsquo;</dt>
593
+<dd><p>Loops movie playback &lt;number&gt; times. 0 means forever.
594
+</p></dd>
595
+<dt>&lsquo;<samp>-showmode <var>mode</var></samp>&rsquo;</dt>
596
+<dd><p>Set the show mode to use.
597
+Available values for <var>mode</var> are:
598
+</p><dl compact="compact">
599
+<dt>&lsquo;<samp>0, video</samp>&rsquo;</dt>
600
+<dd><p>show video
601
+</p></dd>
602
+<dt>&lsquo;<samp>1, waves</samp>&rsquo;</dt>
603
+<dd><p>show audio waves
604
+</p></dd>
605
+<dt>&lsquo;<samp>2, rdft</samp>&rsquo;</dt>
606
+<dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
607
+</p></dd>
608
+</dl>
609
+
610
+<p>Default value is &quot;video&quot;, if video is not present or cannot be played
611
+&quot;rdft&quot; is automatically selected.
612
+</p>
613
+<p>You can interactively cycle through the available show modes by
614
+pressing the key &lt;w&gt;.
615
+</p>
616
+</dd>
617
+<dt>&lsquo;<samp>-vf <var>filtergraph</var></samp>&rsquo;</dt>
618
+<dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
619
+filter the video stream.
620
+</p>
621
+<p><var>filtergraph</var> is a description of the filtergraph to apply to
622
+the stream, and must have a single video input and a single video
623
+output. In the filtergraph, the input is associated to the label
624
+<code>in</code>, and the output to the label <code>out</code>. See the
625
+ffmpeg-filters manual for more information about the filtergraph
626
+syntax.
627
+</p>
628
+<p>You can specify this parameter multiple times and cycle through the specified
629
+filtergraphs along with the show modes by pressing the key &lt;w&gt;.
630
+</p>
631
+</dd>
632
+<dt>&lsquo;<samp>-af <var>filtergraph</var></samp>&rsquo;</dt>
633
+<dd><p><var>filtergraph</var> is a description of the filtergraph to apply to
634
+the input audio.
635
+Use the option &quot;-filters&quot; to show all the available filters (including
636
+sources and sinks).
637
+</p>
638
+</dd>
639
+<dt>&lsquo;<samp>-i <var>input_url</var></samp>&rsquo;</dt>
640
+<dd><p>Read <var>input_url</var>.
641
+</p></dd>
642
+</dl>
643
+
644
+<a name="Advanced-options"></a>
645
+<h2 class="section"><a href="ffplay.html#toc-Advanced-options">3.5 Advanced options</a></h2>
646
+<dl compact="compact">
647
+<dt>&lsquo;<samp>-pix_fmt <var>format</var></samp>&rsquo;</dt>
648
+<dd><p>Set pixel format.
649
+This option has been deprecated in favor of private options, try -pixel_format.
650
+</p>
651
+</dd>
652
+<dt>&lsquo;<samp>-stats</samp>&rsquo;</dt>
653
+<dd><p>Print several playback statistics, in particular show the stream
654
+duration, the codec parameters, the current position in the stream and
655
+the audio/video synchronisation drift. It is on by default, to
656
+explicitly disable it you need to specify <code>-nostats</code>.
657
+</p>
658
+</dd>
659
+<dt>&lsquo;<samp>-fast</samp>&rsquo;</dt>
660
+<dd><p>Non-spec-compliant optimizations.
661
+</p></dd>
662
+<dt>&lsquo;<samp>-genpts</samp>&rsquo;</dt>
663
+<dd><p>Generate pts.
664
+</p></dd>
665
+<dt>&lsquo;<samp>-sync <var>type</var></samp>&rsquo;</dt>
666
+<dd><p>Set the master clock to audio (<code>type=audio</code>), video
667
+(<code>type=video</code>) or external (<code>type=ext</code>). Default is audio. The
668
+master clock is used to control audio-video synchronization. Most media
669
+players use audio as master clock, but in some cases (streaming or high
670
+quality broadcast) it is necessary to change that. This option is mainly
671
+used for debugging purposes.
672
+</p></dd>
673
+<dt>&lsquo;<samp>-ast <var>audio_stream_specifier</var></samp>&rsquo;</dt>
674
+<dd><p>Select the desired audio stream using the given stream specifier. The stream
675
+specifiers are described in the <a href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
676
+is not specified, the &quot;best&quot; audio stream is selected in the program of the
677
+already selected video stream.
678
+</p></dd>
679
+<dt>&lsquo;<samp>-vst <var>video_stream_specifier</var></samp>&rsquo;</dt>
680
+<dd><p>Select the desired video stream using the given stream specifier. The stream
681
+specifiers are described in the <a href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
682
+is not specified, the &quot;best&quot; video stream is selected.
683
+</p></dd>
684
+<dt>&lsquo;<samp>-sst <var>subtitle_stream_specifier</var></samp>&rsquo;</dt>
685
+<dd><p>Select the desired subtitle stream using the given stream specifier. The stream
686
+specifiers are described in the <a href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
687
+is not specified, the &quot;best&quot; subtitle stream is selected in the program of the
688
+already selected video or audio stream.
689
+</p></dd>
690
+<dt>&lsquo;<samp>-autoexit</samp>&rsquo;</dt>
691
+<dd><p>Exit when video is done playing.
692
+</p></dd>
693
+<dt>&lsquo;<samp>-exitonkeydown</samp>&rsquo;</dt>
694
+<dd><p>Exit if any key is pressed.
695
+</p></dd>
696
+<dt>&lsquo;<samp>-exitonmousedown</samp>&rsquo;</dt>
697
+<dd><p>Exit if any mouse button is pressed.
698
+</p>
699
+</dd>
700
+<dt>&lsquo;<samp>-codec:<var>media_specifier</var> <var>codec_name</var></samp>&rsquo;</dt>
701
+<dd><p>Force a specific decoder implementation for the stream identified by
702
+<var>media_specifier</var>, which can assume the values <code>a</code> (audio),
703
+<code>v</code> (video), and <code>s</code> subtitle.
704
+</p>
705
+</dd>
706
+<dt>&lsquo;<samp>-acodec <var>codec_name</var></samp>&rsquo;</dt>
707
+<dd><p>Force a specific audio decoder.
708
+</p>
709
+</dd>
710
+<dt>&lsquo;<samp>-vcodec <var>codec_name</var></samp>&rsquo;</dt>
711
+<dd><p>Force a specific video decoder.
712
+</p>
713
+</dd>
714
+<dt>&lsquo;<samp>-scodec <var>codec_name</var></samp>&rsquo;</dt>
715
+<dd><p>Force a specific subtitle decoder.
716
+</p>
717
+</dd>
718
+<dt>&lsquo;<samp>-autorotate</samp>&rsquo;</dt>
719
+<dd><p>Automatically rotate the video according to file metadata. Enabled by
720
+default, use &lsquo;<samp>-noautorotate</samp>&rsquo; to disable it.
721
+</p>
722
+</dd>
723
+<dt>&lsquo;<samp>-framedrop</samp>&rsquo;</dt>
724
+<dd><p>Drop video frames if video is out of sync. Enabled by default if the master
725
+clock is not set to video. Use this option to enable frame dropping for all
726
+master clock sources, use &lsquo;<samp>-noframedrop</samp>&rsquo; to disable it.
727
+</p>
728
+</dd>
729
+<dt>&lsquo;<samp>-infbuf</samp>&rsquo;</dt>
730
+<dd><p>Do not limit the input buffer size, read as much data as possible from the
731
+input as soon as possible. Enabled by default for realtime streams, where data
732
+may be dropped if not read in time. Use this option to enable infinite buffers
733
+for all inputs, use &lsquo;<samp>-noinfbuf</samp>&rsquo; to disable it.
734
+</p>
735
+</dd>
736
+<dt>&lsquo;<samp>-filter_threads <var>nb_threads</var></samp>&rsquo;</dt>
737
+<dd><p>Defines how many threads are used to process a filter pipeline. Each pipeline
738
+will produce a thread pool with this many threads available for parallel
739
+processing. The default is 0 which means that the thread count will be
740
+determined by the number of available CPUs.
741
+</p>
742
+</dd>
743
+</dl>
744
+
745
+<a name="While-playing"></a>
746
+<h2 class="section"><a href="ffplay.html#toc-While-playing">3.6 While playing</a></h2>
747
+
748
+<dl compact="compact">
749
+<dt>&lt;q, ESC&gt;</dt>
750
+<dd><p>Quit.
751
+</p>
752
+</dd>
753
+<dt>&lt;f&gt;</dt>
754
+<dd><p>Toggle full screen.
755
+</p>
756
+</dd>
757
+<dt>&lt;p, SPC&gt;</dt>
758
+<dd><p>Pause.
759
+</p>
760
+</dd>
761
+<dt>&lt;m&gt;</dt>
762
+<dd><p>Toggle mute.
763
+</p>
764
+</dd>
765
+<dt>&lt;9, 0&gt;</dt>
766
+<dd><p>Decrease and increase volume respectively.
767
+</p>
768
+</dd>
769
+<dt>&lt;/, *&gt;</dt>
770
+<dd><p>Decrease and increase volume respectively.
771
+</p>
772
+</dd>
773
+<dt>&lt;a&gt;</dt>
774
+<dd><p>Cycle audio channel in the current program.
775
+</p>
776
+</dd>
777
+<dt>&lt;v&gt;</dt>
778
+<dd><p>Cycle video channel.
779
+</p>
780
+</dd>
781
+<dt>&lt;t&gt;</dt>
782
+<dd><p>Cycle subtitle channel in the current program.
783
+</p>
784
+</dd>
785
+<dt>&lt;c&gt;</dt>
786
+<dd><p>Cycle program.
787
+</p>
788
+</dd>
789
+<dt>&lt;w&gt;</dt>
790
+<dd><p>Cycle video filters or show modes.
791
+</p>
792
+</dd>
793
+<dt>&lt;s&gt;</dt>
794
+<dd><p>Step to the next frame.
795
+</p>
796
+<p>Pause if the stream is not already paused, step to the next video
797
+frame, and pause.
798
+</p>
799
+</dd>
800
+<dt>&lt;left/right&gt;</dt>
801
+<dd><p>Seek backward/forward 10 seconds.
802
+</p>
803
+</dd>
804
+<dt>&lt;down/up&gt;</dt>
805
+<dd><p>Seek backward/forward 1 minute.
806
+</p>
807
+</dd>
808
+<dt>&lt;page down/page up&gt;</dt>
809
+<dd><p>Seek to the previous/next chapter.
810
+or if there are no chapters
811
+Seek backward/forward 10 minutes.
812
+</p>
813
+</dd>
814
+<dt>&lt;right mouse click&gt;</dt>
815
+<dd><p>Seek to percentage in file corresponding to fraction of width.
816
+</p>
817
+</dd>
818
+<dt>&lt;left mouse double-click&gt;</dt>
819
+<dd><p>Toggle full screen.
820
+</p>
821
+</dd>
822
+</dl>
823
+
824
+
825
+
826
+<a name="See-Also"></a>
827
+<h1 class="chapter"><a href="ffplay.html#toc-See-Also">4 See Also</a></h1>
828
+
829
+<p><a href="ffplay-all.html">ffmpeg-all</a>,
830
+<a href="ffmpeg.html">ffmpeg</a>, <a href="ffprobe.html">ffprobe</a>,
831
+<a href="ffmpeg-utils.html">ffmpeg-utils</a>,
832
+<a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
833
+<a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
834
+<a href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
835
+<a href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
836
+<a href="ffmpeg-formats.html">ffmpeg-formats</a>,
837
+<a href="ffmpeg-devices.html">ffmpeg-devices</a>,
838
+<a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
839
+<a href="ffmpeg-filters.html">ffmpeg-filters</a>
840
+</p>
841
+
842
+<a name="Authors"></a>
843
+<h1 class="chapter"><a href="ffplay.html#toc-Authors">5 Authors</a></h1>
844
+
845
+<p>The FFmpeg developers.
846
+</p>
847
+<p>For details about the authorship, see the Git history of the project
848
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
849
+<code>git log</code> in the FFmpeg source directory, or browsing the
850
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
851
+</p>
852
+<p>Maintainers for the specific components are listed in the file
853
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
854
+</p>
855
+
856
+    </div>
857
+  </body>
858
+</html>
859
+

+ 41564
- 0
Common/ffmpeg/doc/ffprobe-all.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1199
- 0
Common/ffmpeg/doc/ffprobe.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1262
- 0
Common/ffmpeg/doc/general.html
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 519
- 0
Common/ffmpeg/doc/git-howto.html ファイルの表示

@@ -0,0 +1,519 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="Using Git to develop FFmpeg: ">
11
+<meta name="keywords" content="FFmpeg documentation : Using Git to develop FFmpeg: ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">Using Git to develop FFmpeg</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Introduction" href="#Introduction">1 Introduction</a></li>
40
+  <li><a name="toc-Basics-Usage" href="#Basics-Usage">2 Basics Usage</a>
41
+  <ul class="no-bullet">
42
+    <li><a name="toc-Get-Git" href="#Get-Git">2.1 Get Git</a></li>
43
+    <li><a name="toc-Cloning-the-source-tree" href="#Cloning-the-source-tree">2.2 Cloning the source tree</a></li>
44
+    <li><a name="toc-Updating-the-source-tree-to-the-latest-revision-1" href="#Updating-the-source-tree-to-the-latest-revision-1">2.3 Updating the source tree to the latest revision</a></li>
45
+    <li><a name="toc-Rebasing-your-local-branches" href="#Rebasing-your-local-branches">2.4 Rebasing your local branches</a></li>
46
+    <li><a name="toc-Adding_002fremoving-files_002fdirectories" href="#Adding_002fremoving-files_002fdirectories">2.5 Adding/removing files/directories</a></li>
47
+    <li><a name="toc-Showing-modifications" href="#Showing-modifications">2.6 Showing modifications</a></li>
48
+    <li><a name="toc-Inspecting-the-changelog" href="#Inspecting-the-changelog">2.7 Inspecting the changelog</a></li>
49
+    <li><a name="toc-Checking-source-tree-status" href="#Checking-source-tree-status">2.8 Checking source tree status</a></li>
50
+    <li><a name="toc-Committing" href="#Committing">2.9 Committing</a></li>
51
+    <li><a name="toc-Preparing-a-patchset" href="#Preparing-a-patchset">2.10 Preparing a patchset</a></li>
52
+    <li><a name="toc-Sending-patches-for-review" href="#Sending-patches-for-review">2.11 Sending patches for review</a></li>
53
+    <li><a name="toc-Renaming_002fmoving_002fcopying-files-or-contents-of-files" href="#Renaming_002fmoving_002fcopying-files-or-contents-of-files">2.12 Renaming/moving/copying files or contents of files</a></li>
54
+  </ul></li>
55
+  <li><a name="toc-Git-configuration" href="#Git-configuration">3 Git configuration</a>
56
+  <ul class="no-bullet">
57
+    <li><a name="toc-Personal-Git-installation" href="#Personal-Git-installation">3.1 Personal Git installation</a></li>
58
+    <li><a name="toc-Repository-configuration" href="#Repository-configuration">3.2 Repository configuration</a></li>
59
+  </ul></li>
60
+  <li><a name="toc-FFmpeg-specific" href="#FFmpeg-specific">4 FFmpeg specific</a>
61
+  <ul class="no-bullet">
62
+    <li><a name="toc-Reverting-broken-commits" href="#Reverting-broken-commits">4.1 Reverting broken commits</a></li>
63
+    <li><a name="toc-Pushing-changes-to-remote-trees" href="#Pushing-changes-to-remote-trees">4.2 Pushing changes to remote trees</a></li>
64
+    <li><a name="toc-Finding-a-specific-svn-revision" href="#Finding-a-specific-svn-revision">4.3 Finding a specific svn revision</a></li>
65
+  </ul></li>
66
+  <li><a name="toc-Pre_002dpush-checklist" href="#Pre_002dpush-checklist">5 Pre-push checklist</a></li>
67
+  <li><a name="toc-Server-Issues" href="#Server-Issues">6 Server Issues</a></li>
68
+</ul>
69
+</div>
70
+
71
+
72
+<hr size="6">
73
+<a name="Introduction"></a>
74
+<h1 class="chapter"><a href="git-howto.html#toc-Introduction">1 Introduction</a></h1>
75
+
76
+<p>This document aims in giving some quick references on a set of useful Git
77
+commands. You should always use the extensive and detailed documentation
78
+provided directly by Git:
79
+</p>
80
+<div class="example">
81
+<pre class="example">git --help
82
+man git
83
+</pre></div>
84
+
85
+<p>shows you the available subcommands,
86
+</p>
87
+<div class="example">
88
+<pre class="example">git &lt;command&gt; --help
89
+man git-&lt;command&gt;
90
+</pre></div>
91
+
92
+<p>shows information about the subcommand &lt;command&gt;.
93
+</p>
94
+<p>Additional information could be found on the
95
+<a href="http://gitref.org">Git Reference</a> website.
96
+</p>
97
+<p>For more information about the Git project, visit the
98
+<a href="http://git-scm.com/">Git website</a>.
99
+</p>
100
+<p>Consult these resources whenever you have problems, they are quite exhaustive.
101
+</p>
102
+<p>What follows now is a basic introduction to Git and some FFmpeg-specific
103
+guidelines to ease the contribution to the project.
104
+</p>
105
+<a name="Basics-Usage"></a>
106
+<h1 class="chapter"><a href="git-howto.html#toc-Basics-Usage">2 Basics Usage</a></h1>
107
+
108
+<a name="Get-Git"></a>
109
+<h2 class="section"><a href="git-howto.html#toc-Get-Git">2.1 Get Git</a></h2>
110
+
111
+<p>You can get Git from <a href="http://git-scm.com/">http://git-scm.com/</a>
112
+Most distribution and operating system provide a package for it.
113
+</p>
114
+
115
+<a name="Cloning-the-source-tree"></a>
116
+<h2 class="section"><a href="git-howto.html#toc-Cloning-the-source-tree">2.2 Cloning the source tree</a></h2>
117
+
118
+<div class="example">
119
+<pre class="example">git clone git://source.ffmpeg.org/ffmpeg &lt;target&gt;
120
+</pre></div>
121
+
122
+<p>This will put the FFmpeg sources into the directory <var>&lt;target&gt;</var>.
123
+</p>
124
+<div class="example">
125
+<pre class="example">git clone git@source.ffmpeg.org:ffmpeg &lt;target&gt;
126
+</pre></div>
127
+
128
+<p>This will put the FFmpeg sources into the directory <var>&lt;target&gt;</var> and let
129
+you push back your changes to the remote repository.
130
+</p>
131
+<div class="example">
132
+<pre class="example">git clone gil@ffmpeg.org:ffmpeg-web &lt;target&gt;
133
+</pre></div>
134
+
135
+<p>This will put the source of the FFmpeg website into the directory
136
+<var>&lt;target&gt;</var> and let you push back your changes to the remote repository.
137
+(Note that <var>gil</var> stands for GItoLite and is not a typo of <var>git</var>.)
138
+</p>
139
+<p>If you don&rsquo;t have write-access to the ffmpeg-web repository, you can
140
+create patches after making a read-only ffmpeg-web clone:
141
+</p>
142
+<div class="example">
143
+<pre class="example">git clone git://ffmpeg.org/ffmpeg-web &lt;target&gt;
144
+</pre></div>
145
+
146
+<p>Make sure that you do not have Windows line endings in your checkouts,
147
+otherwise you may experience spurious compilation failures. One way to
148
+achieve this is to run
149
+</p>
150
+<div class="example">
151
+<pre class="example">git config --global core.autocrlf false
152
+</pre></div>
153
+
154
+
155
+<p><a name="Updating-the-source-tree-to-the-latest-revision"></a>
156
+</p><a name="Updating-the-source-tree-to-the-latest-revision-1"></a>
157
+<h2 class="section"><a href="git-howto.html#toc-Updating-the-source-tree-to-the-latest-revision-1">2.3 Updating the source tree to the latest revision</a></h2>
158
+
159
+<div class="example">
160
+<pre class="example">git pull (--rebase)
161
+</pre></div>
162
+
163
+<p>pulls in the latest changes from the tracked branch. The tracked branch
164
+can be remote. By default the master branch tracks the branch master in
165
+the remote origin.
166
+</p>
167
+<div class="float alert alert-warning">
168
+<p><code>--rebase</code> (see below) is recommended.
169
+</p></div>
170
+<a name="Rebasing-your-local-branches"></a>
171
+<h2 class="section"><a href="git-howto.html#toc-Rebasing-your-local-branches">2.4 Rebasing your local branches</a></h2>
172
+
173
+<div class="example">
174
+<pre class="example">git pull --rebase
175
+</pre></div>
176
+
177
+<p>fetches the changes from the main repository and replays your local commits
178
+over it. This is required to keep all your local changes at the top of
179
+FFmpeg&rsquo;s master tree. The master tree will reject pushes with merge commits.
180
+</p>
181
+
182
+<a name="Adding_002fremoving-files_002fdirectories"></a>
183
+<h2 class="section"><a href="git-howto.html#toc-Adding_002fremoving-files_002fdirectories">2.5 Adding/removing files/directories</a></h2>
184
+
185
+<div class="example">
186
+<pre class="example">git add [-A] &lt;filename/dirname&gt;
187
+git rm [-r] &lt;filename/dirname&gt;
188
+</pre></div>
189
+
190
+<p>Git needs to get notified of all changes you make to your working
191
+directory that makes files appear or disappear.
192
+Line moves across files are automatically tracked.
193
+</p>
194
+
195
+<a name="Showing-modifications"></a>
196
+<h2 class="section"><a href="git-howto.html#toc-Showing-modifications">2.6 Showing modifications</a></h2>
197
+
198
+<div class="example">
199
+<pre class="example">git diff &lt;filename(s)&gt;
200
+</pre></div>
201
+
202
+<p>will show all local modifications in your working directory as unified diff.
203
+</p>
204
+
205
+<a name="Inspecting-the-changelog"></a>
206
+<h2 class="section"><a href="git-howto.html#toc-Inspecting-the-changelog">2.7 Inspecting the changelog</a></h2>
207
+
208
+<div class="example">
209
+<pre class="example">git log &lt;filename(s)&gt;
210
+</pre></div>
211
+
212
+<p>You may also use the graphical tools like <code>gitview</code> or <code>gitk</code>
213
+or the web interface available at <a href="http://source.ffmpeg.org/">http://source.ffmpeg.org/</a>.
214
+</p>
215
+<a name="Checking-source-tree-status"></a>
216
+<h2 class="section"><a href="git-howto.html#toc-Checking-source-tree-status">2.8 Checking source tree status</a></h2>
217
+
218
+<div class="example">
219
+<pre class="example">git status
220
+</pre></div>
221
+
222
+<p>detects all the changes you made and lists what actions will be taken in case
223
+of a commit (additions, modifications, deletions, etc.).
224
+</p>
225
+
226
+<a name="Committing"></a>
227
+<h2 class="section"><a href="git-howto.html#toc-Committing">2.9 Committing</a></h2>
228
+
229
+<div class="example">
230
+<pre class="example">git diff --check
231
+</pre></div>
232
+
233
+<p>to double check your changes before committing them to avoid trouble later
234
+on. All experienced developers do this on each and every commit, no matter
235
+how small.
236
+</p>
237
+<p>Every one of them has been saved from looking like a fool by this many times.
238
+It&rsquo;s very easy for stray debug output or cosmetic modifications to slip in,
239
+please avoid problems through this extra level of scrutiny.
240
+</p>
241
+<p>For cosmetics-only commits you should get (almost) empty output from
242
+</p>
243
+<div class="example">
244
+<pre class="example">git diff -w -b &lt;filename(s)&gt;
245
+</pre></div>
246
+
247
+<p>Also check the output of
248
+</p>
249
+<div class="example">
250
+<pre class="example">git status
251
+</pre></div>
252
+
253
+<p>to make sure you don&rsquo;t have untracked files or deletions.
254
+</p>
255
+<div class="example">
256
+<pre class="example">git add [-i|-p|-A] &lt;filenames/dirnames&gt;
257
+</pre></div>
258
+
259
+<p>Make sure you have told Git your name and email address
260
+</p>
261
+<div class="example">
262
+<pre class="example">git config --global user.name &quot;My Name&quot;
263
+git config --global user.email my@email.invalid
264
+</pre></div>
265
+
266
+<p>Use &lsquo;<samp>--global</samp>&rsquo; to set the global configuration for all your Git checkouts.
267
+</p>
268
+<p>Git will select the changes to the files for commit. Optionally you can use
269
+the interactive or the patch mode to select hunk by hunk what should be
270
+added to the commit.
271
+</p>
272
+
273
+<div class="example">
274
+<pre class="example">git commit
275
+</pre></div>
276
+
277
+<p>Git will commit the selected changes to your current local branch.
278
+</p>
279
+<p>You will be prompted for a log message in an editor, which is either
280
+set in your personal configuration file through
281
+</p>
282
+<div class="example">
283
+<pre class="example">git config --global core.editor
284
+</pre></div>
285
+
286
+<p>or set by one of the following environment variables:
287
+<var>GIT_EDITOR</var>, <var>VISUAL</var> or <var>EDITOR</var>.
288
+</p>
289
+<p>Log messages should be concise but descriptive. Explain why you made a change,
290
+what you did will be obvious from the changes themselves most of the time.
291
+Saying just &quot;bug fix&quot; or &quot;10l&quot; is bad. Remember that people of varying skill
292
+levels look at and educate themselves while reading through your code. Don&rsquo;t
293
+include filenames in log messages, Git provides that information.
294
+</p>
295
+<p>Possibly make the commit message have a terse, descriptive first line, an
296
+empty line and then a full description. The first line will be used to name
297
+the patch by <code>git format-patch</code>.
298
+</p>
299
+<a name="Preparing-a-patchset"></a>
300
+<h2 class="section"><a href="git-howto.html#toc-Preparing-a-patchset">2.10 Preparing a patchset</a></h2>
301
+
302
+<div class="example">
303
+<pre class="example">git format-patch &lt;commit&gt; [-o directory]
304
+</pre></div>
305
+
306
+<p>will generate a set of patches for each commit between <var>&lt;commit&gt;</var> and
307
+current <var>HEAD</var>. E.g.
308
+</p>
309
+<div class="example">
310
+<pre class="example">git format-patch origin/master
311
+</pre></div>
312
+
313
+<p>will generate patches for all commits on current branch which are not
314
+present in upstream.
315
+A useful shortcut is also
316
+</p>
317
+<div class="example">
318
+<pre class="example">git format-patch -n
319
+</pre></div>
320
+
321
+<p>which will generate patches from last <var>n</var> commits.
322
+By default the patches are created in the current directory.
323
+</p>
324
+<a name="Sending-patches-for-review"></a>
325
+<h2 class="section"><a href="git-howto.html#toc-Sending-patches-for-review">2.11 Sending patches for review</a></h2>
326
+
327
+<div class="example">
328
+<pre class="example">git send-email &lt;commit list|directory&gt;
329
+</pre></div>
330
+
331
+<p>will send the patches created by <code>git format-patch</code> or directly
332
+generates them. All the email fields can be configured in the global/local
333
+configuration or overridden by command line.
334
+Note that this tool must often be installed separately (e.g. <var>git-email</var>
335
+package on Debian-based distros).
336
+</p>
337
+
338
+<a name="Renaming_002fmoving_002fcopying-files-or-contents-of-files"></a>
339
+<h2 class="section"><a href="git-howto.html#toc-Renaming_002fmoving_002fcopying-files-or-contents-of-files">2.12 Renaming/moving/copying files or contents of files</a></h2>
340
+
341
+<p>Git automatically tracks such changes, making those normal commits.
342
+</p>
343
+<div class="example">
344
+<pre class="example">mv/cp path/file otherpath/otherfile
345
+git add [-A] .
346
+git commit
347
+</pre></div>
348
+
349
+
350
+<a name="Git-configuration"></a>
351
+<h1 class="chapter"><a href="git-howto.html#toc-Git-configuration">3 Git configuration</a></h1>
352
+
353
+<p>In order to simplify a few workflows, it is advisable to configure both
354
+your personal Git installation and your local FFmpeg repository.
355
+</p>
356
+<a name="Personal-Git-installation"></a>
357
+<h2 class="section"><a href="git-howto.html#toc-Personal-Git-installation">3.1 Personal Git installation</a></h2>
358
+
359
+<p>Add the following to your &lsquo;<tt>~/.gitconfig</tt>&rsquo; to help <code>git send-email</code>
360
+and <code>git format-patch</code> detect renames:
361
+</p>
362
+<div class="example">
363
+<pre class="example">[diff]
364
+        renames = copy
365
+</pre></div>
366
+
367
+<a name="Repository-configuration"></a>
368
+<h2 class="section"><a href="git-howto.html#toc-Repository-configuration">3.2 Repository configuration</a></h2>
369
+
370
+<p>In order to have <code>git send-email</code> automatically send patches
371
+to the ffmpeg-devel mailing list, add the following stanza
372
+to &lsquo;<tt>/path/to/ffmpeg/repository/.git/config</tt>&rsquo;:
373
+</p>
374
+<div class="example">
375
+<pre class="example">[sendemail]
376
+        to = ffmpeg-devel@ffmpeg.org
377
+</pre></div>
378
+
379
+<a name="FFmpeg-specific"></a>
380
+<h1 class="chapter"><a href="git-howto.html#toc-FFmpeg-specific">4 FFmpeg specific</a></h1>
381
+
382
+<a name="Reverting-broken-commits"></a>
383
+<h2 class="section"><a href="git-howto.html#toc-Reverting-broken-commits">4.1 Reverting broken commits</a></h2>
384
+
385
+<div class="example">
386
+<pre class="example">git reset &lt;commit&gt;
387
+</pre></div>
388
+
389
+<p><code>git reset</code> will uncommit the changes till <var>&lt;commit&gt;</var> rewriting
390
+the current branch history.
391
+</p>
392
+<div class="example">
393
+<pre class="example">git commit --amend
394
+</pre></div>
395
+
396
+<p>allows one to amend the last commit details quickly.
397
+</p>
398
+<div class="example">
399
+<pre class="example">git rebase -i origin/master
400
+</pre></div>
401
+
402
+<p>will replay local commits over the main repository allowing to edit, merge
403
+or remove some of them in the process.
404
+</p>
405
+<div class="float alert alert-info">
406
+<p><code>git reset</code>, <code>git commit --amend</code> and <code>git rebase</code>
407
+rewrite history, so you should use them ONLY on your local or topic branches.
408
+The main repository will reject those changes.
409
+</p></div>
410
+<div class="example">
411
+<pre class="example">git revert &lt;commit&gt;
412
+</pre></div>
413
+
414
+<p><code>git revert</code> will generate a revert commit. This will not make the
415
+faulty commit disappear from the history.
416
+</p>
417
+<a name="Pushing-changes-to-remote-trees"></a>
418
+<h2 class="section"><a href="git-howto.html#toc-Pushing-changes-to-remote-trees">4.2 Pushing changes to remote trees</a></h2>
419
+
420
+<div class="example">
421
+<pre class="example">git push origin master --dry-run
422
+</pre></div>
423
+
424
+<p>Will simulate a push of the local master branch to the default remote
425
+(<var>origin</var>). And list which branches and ranges or commits would have been
426
+pushed.
427
+Git will prevent you from pushing changes if the local and remote trees are
428
+out of sync. Refer to <a href="#Updating-the-source-tree-to-the-latest-revision">Updating the source tree to the latest revision</a>.
429
+</p>
430
+<div class="example">
431
+<pre class="example">git remote add &lt;name&gt; &lt;url&gt;
432
+</pre></div>
433
+
434
+<p>Will add additional remote with a name reference, it is useful if you want
435
+to push your local branch for review on a remote host.
436
+</p>
437
+<div class="example">
438
+<pre class="example">git push &lt;remote&gt; &lt;refspec&gt;
439
+</pre></div>
440
+
441
+<p>Will push the changes to the <var>&lt;remote&gt;</var> repository.
442
+Omitting <var>&lt;refspec&gt;</var> makes <code>git push</code> update all the remote
443
+branches matching the local ones.
444
+</p>
445
+<a name="Finding-a-specific-svn-revision"></a>
446
+<h2 class="section"><a href="git-howto.html#toc-Finding-a-specific-svn-revision">4.3 Finding a specific svn revision</a></h2>
447
+
448
+<p>Since version 1.7.1 Git supports &lsquo;<samp>:/foo</samp>&rsquo; syntax for specifying commits
449
+based on a regular expression. see man gitrevisions
450
+</p>
451
+<div class="example">
452
+<pre class="example">git show :/'as revision 23456'
453
+</pre></div>
454
+
455
+<p>will show the svn changeset &lsquo;<samp>r23456</samp>&rsquo;. With older Git versions searching in
456
+the <code>git log</code> output is the easiest option (especially if a pager with
457
+search capabilities is used).
458
+</p>
459
+<p>This commit can be checked out with
460
+</p>
461
+<div class="example">
462
+<pre class="example">git checkout -b svn_23456 :/'as revision 23456'
463
+</pre></div>
464
+
465
+<p>or for Git &lt; 1.7.1 with
466
+</p>
467
+<div class="example">
468
+<pre class="example">git checkout -b svn_23456 $SHA1
469
+</pre></div>
470
+
471
+<p>where <var>$SHA1</var> is the commit hash from the <code>git log</code> output.
472
+</p>
473
+
474
+<a name="Pre_002dpush-checklist"></a>
475
+<h1 class="chapter"><a href="git-howto.html#toc-Pre_002dpush-checklist">5 Pre-push checklist</a></h1>
476
+
477
+<p>Once you have a set of commits that you feel are ready for pushing,
478
+work through the following checklist to doublecheck everything is in
479
+proper order. This list tries to be exhaustive. In case you are just
480
+pushing a typo in a comment, some of the steps may be unnecessary.
481
+Apply your common sense, but if in doubt, err on the side of caution.
482
+</p>
483
+<p>First, make sure that the commits and branches you are going to push
484
+match what you want pushed and that nothing is missing, extraneous or
485
+wrong. You can see what will be pushed by running the git push command
486
+with &lsquo;<samp>--dry-run</samp>&rsquo; first. And then inspecting the commits listed with
487
+<code>git log -p 1234567..987654</code>. The <code>git status</code> command
488
+may help in finding local changes that have been forgotten to be added.
489
+</p>
490
+<p>Next let the code pass through a full run of our test suite.
491
+</p>
492
+<ul>
493
+<li> <code>make distclean</code>
494
+</li><li> <code>/path/to/ffmpeg/configure</code>
495
+</li><li> <code>make fate</code>
496
+</li><li> if fate fails due to missing samples run <code>make fate-rsync</code> and retry
497
+</li></ul>
498
+
499
+<p>Make sure all your changes have been checked before pushing them, the
500
+test suite only checks against regressions and that only to some extend. It does
501
+obviously not check newly added features/code to be working unless you have
502
+added a test for that (which is recommended).
503
+</p>
504
+<p>Also note that every single commit should pass the test suite, not just
505
+the result of a series of patches.
506
+</p>
507
+<p>Once everything passed, push the changes to your public ffmpeg clone and post a
508
+merge request to ffmpeg-devel. You can also push them directly but this is not
509
+recommended.
510
+</p>
511
+<a name="Server-Issues"></a>
512
+<h1 class="chapter"><a href="git-howto.html#toc-Server-Issues">6 Server Issues</a></h1>
513
+
514
+<p>Contact the project admins at <a href="mailto:root@ffmpeg.org">root@ffmpeg.org</a> if you have technical
515
+problems with the Git server.
516
+</p>    </div>
517
+  </body>
518
+</html>
519
+

+ 84
- 0
Common/ffmpeg/doc/libavcodec.html ファイルの表示

@@ -0,0 +1,84 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="Libavcodec Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : Libavcodec ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">Libavcodec Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-See-Also" href="#See-Also">2 See Also</a></li>
41
+  <li><a name="toc-Authors" href="#Authors">3 Authors</a></li>
42
+</ul>
43
+</div>
44
+
45
+
46
+<hr size="6">
47
+<a name="Description"></a>
48
+<h1 class="chapter"><a href="libavcodec.html#toc-Description">1 Description</a></h1>
49
+
50
+<p>The libavcodec library provides a generic encoding/decoding framework
51
+and contains multiple decoders and encoders for audio, video and
52
+subtitle streams, and several bitstream filters.
53
+</p>
54
+<p>The shared architecture provides various services ranging from bit
55
+stream I/O to DSP optimizations, and makes it suitable for
56
+implementing robust and fast codecs as well as for experimentation.
57
+</p>
58
+
59
+<a name="See-Also"></a>
60
+<h1 class="chapter"><a href="libavcodec.html#toc-See-Also">2 See Also</a></h1>
61
+
62
+<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
63
+<a href="ffmpeg-codecs.html">ffmpeg-codecs</a>, <a href="ffmpeg-bitstream-filters.html">bitstream-filters</a>,
64
+<a href="libavutil.html">libavutil</a>
65
+</p>
66
+
67
+<a name="Authors"></a>
68
+<h1 class="chapter"><a href="libavcodec.html#toc-Authors">3 Authors</a></h1>
69
+
70
+<p>The FFmpeg developers.
71
+</p>
72
+<p>For details about the authorship, see the Git history of the project
73
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
74
+<code>git log</code> in the FFmpeg source directory, or browsing the
75
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
76
+</p>
77
+<p>Maintainers for the specific components are listed in the file
78
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
79
+</p>
80
+
81
+    </div>
82
+  </body>
83
+</html>
84
+

+ 81
- 0
Common/ffmpeg/doc/libavdevice.html ファイルの表示

@@ -0,0 +1,81 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="Libavdevice Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : Libavdevice ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">Libavdevice Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-See-Also" href="#See-Also">2 See Also</a></li>
41
+  <li><a name="toc-Authors" href="#Authors">3 Authors</a></li>
42
+</ul>
43
+</div>
44
+
45
+
46
+<hr size="6">
47
+<a name="Description"></a>
48
+<h1 class="chapter"><a href="libavdevice.html#toc-Description">1 Description</a></h1>
49
+
50
+<p>The libavdevice library provides a generic framework for grabbing from
51
+and rendering to many common multimedia input/output devices, and
52
+supports several input and output devices, including Video4Linux2,
53
+VfW, DShow, and ALSA.
54
+</p>
55
+
56
+<a name="See-Also"></a>
57
+<h1 class="chapter"><a href="libavdevice.html#toc-See-Also">2 See Also</a></h1>
58
+
59
+<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
60
+<a href="ffmpeg-devices.html">ffmpeg-devices</a>,
61
+<a href="libavutil.html">libavutil</a>, <a href="libavcodec.html">libavcodec</a>, <a href="libavformat.html">libavformat</a>
62
+</p>
63
+
64
+<a name="Authors"></a>
65
+<h1 class="chapter"><a href="libavdevice.html#toc-Authors">3 Authors</a></h1>
66
+
67
+<p>The FFmpeg developers.
68
+</p>
69
+<p>For details about the authorship, see the Git history of the project
70
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
71
+<code>git log</code> in the FFmpeg source directory, or browsing the
72
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
73
+</p>
74
+<p>Maintainers for the specific components are listed in the file
75
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
76
+</p>
77
+
78
+    </div>
79
+  </body>
80
+</html>
81
+

+ 80
- 0
Common/ffmpeg/doc/libavfilter.html ファイルの表示

@@ -0,0 +1,80 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="Libavfilter Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : Libavfilter ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">Libavfilter Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-See-Also" href="#See-Also">2 See Also</a></li>
41
+  <li><a name="toc-Authors" href="#Authors">3 Authors</a></li>
42
+</ul>
43
+</div>
44
+
45
+
46
+<hr size="6">
47
+<a name="Description"></a>
48
+<h1 class="chapter"><a href="libavfilter.html#toc-Description">1 Description</a></h1>
49
+
50
+<p>The libavfilter library provides a generic audio/video filtering
51
+framework containing several filters, sources and sinks.
52
+</p>
53
+
54
+<a name="See-Also"></a>
55
+<h1 class="chapter"><a href="libavfilter.html#toc-See-Also">2 See Also</a></h1>
56
+
57
+<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
58
+<a href="ffmpeg-filters.html">ffmpeg-filters</a>,
59
+<a href="libavutil.html">libavutil</a>, <a href="libswscale.html">libswscale</a>, <a href="libswresample.html">libswresample</a>,
60
+<a href="libavcodec.html">libavcodec</a>, <a href="libavformat.html">libavformat</a>, <a href="libavdevice.html">libavdevice</a>
61
+</p>
62
+
63
+<a name="Authors"></a>
64
+<h1 class="chapter"><a href="libavfilter.html#toc-Authors">3 Authors</a></h1>
65
+
66
+<p>The FFmpeg developers.
67
+</p>
68
+<p>For details about the authorship, see the Git history of the project
69
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
70
+<code>git log</code> in the FFmpeg source directory, or browsing the
71
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
72
+</p>
73
+<p>Maintainers for the specific components are listed in the file
74
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
75
+</p>
76
+
77
+    </div>
78
+  </body>
79
+</html>
80
+

+ 84
- 0
Common/ffmpeg/doc/libavformat.html ファイルの表示

@@ -0,0 +1,84 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="Libavformat Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : Libavformat ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">Libavformat Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-See-Also" href="#See-Also">2 See Also</a></li>
41
+  <li><a name="toc-Authors" href="#Authors">3 Authors</a></li>
42
+</ul>
43
+</div>
44
+
45
+
46
+<hr size="6">
47
+<a name="Description"></a>
48
+<h1 class="chapter"><a href="libavformat.html#toc-Description">1 Description</a></h1>
49
+
50
+<p>The libavformat library provides a generic framework for multiplexing
51
+and demultiplexing (muxing and demuxing) audio, video and subtitle
52
+streams. It encompasses multiple muxers and demuxers for multimedia
53
+container formats.
54
+</p>
55
+<p>It also supports several input and output protocols to access a media
56
+resource.
57
+</p>
58
+
59
+<a name="See-Also"></a>
60
+<h1 class="chapter"><a href="libavformat.html#toc-See-Also">2 See Also</a></h1>
61
+
62
+<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
63
+<a href="ffmpeg-formats.html">ffmpeg-formats</a>, <a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
64
+<a href="libavutil.html">libavutil</a>, <a href="libavcodec.html">libavcodec</a>
65
+</p>
66
+
67
+<a name="Authors"></a>
68
+<h1 class="chapter"><a href="libavformat.html#toc-Authors">3 Authors</a></h1>
69
+
70
+<p>The FFmpeg developers.
71
+</p>
72
+<p>For details about the authorship, see the Git history of the project
73
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
74
+<code>git log</code> in the FFmpeg source directory, or browsing the
75
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
76
+</p>
77
+<p>Maintainers for the specific components are listed in the file
78
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
79
+</p>
80
+
81
+    </div>
82
+  </body>
83
+</html>
84
+

+ 103
- 0
Common/ffmpeg/doc/libavutil.html ファイルの表示

@@ -0,0 +1,103 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="Libavutil Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : Libavutil ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">Libavutil Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-See-Also" href="#See-Also">2 See Also</a></li>
41
+  <li><a name="toc-Authors" href="#Authors">3 Authors</a></li>
42
+</ul>
43
+</div>
44
+
45
+
46
+<hr size="6">
47
+<a name="Description"></a>
48
+<h1 class="chapter"><a href="libavutil.html#toc-Description">1 Description</a></h1>
49
+
50
+<p>The libavutil library is a utility library to aid portable
51
+multimedia programming. It contains safe portable string functions,
52
+random number generators, data structures, additional mathematics
53
+functions, cryptography and multimedia related functionality (like
54
+enumerations for pixel and sample formats). It is not a library for
55
+code needed by both libavcodec and libavformat.
56
+</p>
57
+<p>The goals for this library is to be:
58
+</p>
59
+<dl compact="compact">
60
+<dt><strong>Modular</strong></dt>
61
+<dd><p>It should have few interdependencies and the possibility of disabling individual
62
+parts during <code>./configure</code>.
63
+</p>
64
+</dd>
65
+<dt><strong>Small</strong></dt>
66
+<dd><p>Both sources and objects should be small.
67
+</p>
68
+</dd>
69
+<dt><strong>Efficient</strong></dt>
70
+<dd><p>It should have low CPU and memory usage.
71
+</p>
72
+</dd>
73
+<dt><strong>Useful</strong></dt>
74
+<dd><p>It should avoid useless features that almost no one needs.
75
+</p></dd>
76
+</dl>
77
+
78
+
79
+<a name="See-Also"></a>
80
+<h1 class="chapter"><a href="libavutil.html#toc-See-Also">2 See Also</a></h1>
81
+
82
+<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
83
+<a href="ffmpeg-utils.html">ffmpeg-utils</a>
84
+</p>
85
+
86
+<a name="Authors"></a>
87
+<h1 class="chapter"><a href="libavutil.html#toc-Authors">3 Authors</a></h1>
88
+
89
+<p>The FFmpeg developers.
90
+</p>
91
+<p>For details about the authorship, see the Git history of the project
92
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
93
+<code>git log</code> in the FFmpeg source directory, or browsing the
94
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
95
+</p>
96
+<p>Maintainers for the specific components are listed in the file
97
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
98
+</p>
99
+
100
+    </div>
101
+  </body>
102
+</html>
103
+

+ 106
- 0
Common/ffmpeg/doc/libswresample.html ファイルの表示

@@ -0,0 +1,106 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="Libswresample Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : Libswresample ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">Libswresample Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-See-Also" href="#See-Also">2 See Also</a></li>
41
+  <li><a name="toc-Authors" href="#Authors">3 Authors</a></li>
42
+</ul>
43
+</div>
44
+
45
+
46
+<hr size="6">
47
+<a name="Description"></a>
48
+<h1 class="chapter"><a href="libswresample.html#toc-Description">1 Description</a></h1>
49
+
50
+<p>The libswresample library performs highly optimized audio resampling,
51
+rematrixing and sample format conversion operations.
52
+</p>
53
+<p>Specifically, this library performs the following conversions:
54
+</p>
55
+<ul>
56
+<li>
57
+<em>Resampling</em>: is the process of changing the audio rate, for
58
+example from a high sample rate of 44100Hz to 8000Hz. Audio
59
+conversion from high to low sample rate is a lossy process. Several
60
+resampling options and algorithms are available.
61
+
62
+</li><li>
63
+<em>Format conversion</em>: is the process of converting the type of
64
+samples, for example from 16-bit signed samples to unsigned 8-bit or
65
+float samples. It also handles packing conversion, when passing from
66
+packed layout (all samples belonging to distinct channels interleaved
67
+in the same buffer), to planar layout (all samples belonging to the
68
+same channel stored in a dedicated buffer or &quot;plane&quot;).
69
+
70
+</li><li>
71
+<em>Rematrixing</em>: is the process of changing the channel layout, for
72
+example from stereo to mono. When the input channels cannot be mapped
73
+to the output streams, the process is lossy, since it involves
74
+different gain factors and mixing.
75
+</li></ul>
76
+
77
+<p>Various other audio conversions (e.g. stretching and padding) are
78
+enabled through dedicated options.
79
+</p>
80
+
81
+<a name="See-Also"></a>
82
+<h1 class="chapter"><a href="libswresample.html#toc-See-Also">2 See Also</a></h1>
83
+
84
+<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
85
+<a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
86
+<a href="libavutil.html">libavutil</a>
87
+</p>
88
+
89
+<a name="Authors"></a>
90
+<h1 class="chapter"><a href="libswresample.html#toc-Authors">3 Authors</a></h1>
91
+
92
+<p>The FFmpeg developers.
93
+</p>
94
+<p>For details about the authorship, see the Git history of the project
95
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
96
+<code>git log</code> in the FFmpeg source directory, or browsing the
97
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
98
+</p>
99
+<p>Maintainers for the specific components are listed in the file
100
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
101
+</p>
102
+
103
+    </div>
104
+  </body>
105
+</html>
106
+

+ 99
- 0
Common/ffmpeg/doc/libswscale.html ファイルの表示

@@ -0,0 +1,99 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="Libswscale Documentation: ">
11
+<meta name="keywords" content="FFmpeg documentation : Libswscale ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">Libswscale Documentation</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-See-Also" href="#See-Also">2 See Also</a></li>
41
+  <li><a name="toc-Authors" href="#Authors">3 Authors</a></li>
42
+</ul>
43
+</div>
44
+
45
+
46
+<hr size="6">
47
+<a name="Description"></a>
48
+<h1 class="chapter"><a href="libswscale.html#toc-Description">1 Description</a></h1>
49
+
50
+<p>The libswscale library performs highly optimized image scaling and
51
+colorspace and pixel format conversion operations.
52
+</p>
53
+<p>Specifically, this library performs the following conversions:
54
+</p>
55
+<ul>
56
+<li>
57
+<em>Rescaling</em>: is the process of changing the video size. Several
58
+rescaling options and algorithms are available. This is usually a
59
+lossy process.
60
+
61
+</li><li>
62
+<em>Pixel format conversion</em>: is the process of converting the image
63
+format and colorspace of the image, for example from planar YUV420P to
64
+RGB24 packed. It also handles packing conversion, that is converts
65
+from packed layout (all pixels belonging to distinct planes
66
+interleaved in the same buffer), to planar layout (all samples
67
+belonging to the same plane stored in a dedicated buffer or &quot;plane&quot;).
68
+
69
+<p>This is usually a lossy process in case the source and destination
70
+colorspaces differ.
71
+</p></li></ul>
72
+
73
+
74
+<a name="See-Also"></a>
75
+<h1 class="chapter"><a href="libswscale.html#toc-See-Also">2 See Also</a></h1>
76
+
77
+<p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
78
+<a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
79
+<a href="libavutil.html">libavutil</a>
80
+</p>
81
+
82
+<a name="Authors"></a>
83
+<h1 class="chapter"><a href="libswscale.html#toc-Authors">3 Authors</a></h1>
84
+
85
+<p>The FFmpeg developers.
86
+</p>
87
+<p>For details about the authorship, see the Git history of the project
88
+(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
89
+<code>git log</code> in the FFmpeg source directory, or browsing the
90
+online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
91
+</p>
92
+<p>Maintainers for the specific components are listed in the file
93
+&lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
94
+</p>
95
+
96
+    </div>
97
+  </body>
98
+</html>
99
+

+ 502
- 0
Common/ffmpeg/doc/mailing-list-faq.html ファイルの表示

@@ -0,0 +1,502 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="FFmpeg Mailing List FAQ: ">
11
+<meta name="keywords" content="FFmpeg documentation : FFmpeg Mailing List FAQ: ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">FFmpeg Mailing List FAQ</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-General-Questions" href="#General-Questions">1 General Questions</a>
40
+  <ul class="no-bullet">
41
+    <li><a name="toc-What-is-a-mailing-list_003f" href="#What-is-a-mailing-list_003f">1.1 What is a mailing list?</a></li>
42
+    <li><a name="toc-What-type-of-questions-can-I-ask_003f" href="#What-type-of-questions-can-I-ask_003f">1.2 What type of questions can I ask?</a></li>
43
+    <li><a name="toc-How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f-1" href="#How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f-1">1.3 How do I ask a question or send a message to a mailing list?</a></li>
44
+  </ul></li>
45
+  <li><a name="toc-Subscribing-_002f-Unsubscribing" href="#Subscribing-_002f-Unsubscribing">2 Subscribing / Unsubscribing</a>
46
+  <ul class="no-bullet">
47
+    <li><a name="toc-How-do-I-subscribe_003f-1" href="#How-do-I-subscribe_003f-1">2.1 How do I subscribe?</a></li>
48
+    <li><a name="toc-How-do-I-unsubscribe_003f" href="#How-do-I-unsubscribe_003f">2.2 How do I unsubscribe?</a></li>
49
+  </ul></li>
50
+  <li><a name="toc-Moderation-Queue" href="#Moderation-Queue">3 Moderation Queue</a>
51
+  <ul class="no-bullet">
52
+    <li><a name="toc-Why-is-my-message-awaiting-moderator-approval_003f-1" href="#Why-is-my-message-awaiting-moderator-approval_003f-1">3.1 Why is my message awaiting moderator approval?</a></li>
53
+    <li><a name="toc-How-long-does-it-take-for-my-message-in-the-moderation-queue-to-be-approved_003f" href="#How-long-does-it-take-for-my-message-in-the-moderation-queue-to-be-approved_003f">3.2 How long does it take for my message in the moderation queue to be approved?</a></li>
54
+    <li><a name="toc-How-do-I-delete-my-message-in-the-moderation-queue_003f-1" href="#How-do-I-delete-my-message-in-the-moderation-queue_003f-1">3.3 How do I delete my message in the moderation queue?</a></li>
55
+  </ul></li>
56
+  <li><a name="toc-Archives" href="#Archives">4 Archives</a>
57
+  <ul class="no-bullet">
58
+    <li><a name="toc-Where-are-the-archives_003f-1" href="#Where-are-the-archives_003f-1">4.1 Where are the archives?</a></li>
59
+    <li><a name="toc-How-do-I-reply-to-a-message-in-the-archives_003f" href="#How-do-I-reply-to-a-message-in-the-archives_003f">4.2 How do I reply to a message in the archives?</a></li>
60
+    <li><a name="toc-How-do-I-search-the-archives_003f" href="#How-do-I-search-the-archives_003f">4.3 How do I search the archives?</a></li>
61
+  </ul></li>
62
+  <li><a name="toc-Other" href="#Other">5 Other</a>
63
+  <ul class="no-bullet">
64
+    <li><a name="toc-Is-there-an-alternative-to-the-mailing-list_003f" href="#Is-there-an-alternative-to-the-mailing-list_003f">5.1 Is there an alternative to the mailing list?</a></li>
65
+    <li><a name="toc-What-is-top_002dposting_003f-1" href="#What-is-top_002dposting_003f-1">5.2 What is top-posting?</a></li>
66
+    <li><a name="toc-What-is-the-message-size-limit_003f-1" href="#What-is-the-message-size-limit_003f-1">5.3 What is the message size limit?</a></li>
67
+    <li><a name="toc-Where-can-I-upload-sample-files_003f" href="#Where-can-I-upload-sample-files_003f">5.4 Where can I upload sample files?</a></li>
68
+    <li><a name="toc-Will-I-receive-spam-if-I-send-and_002for-subscribe-to-a-mailing-list_003f" href="#Will-I-receive-spam-if-I-send-and_002for-subscribe-to-a-mailing-list_003f">5.5 Will I receive spam if I send and/or subscribe to a mailing list?</a></li>
69
+    <li><a name="toc-How-do-I-filter-mailing-list-messages_003f" href="#How-do-I-filter-mailing-list-messages_003f">5.6 How do I filter mailing list messages?</a></li>
70
+    <li><a name="toc-How-do-I-disable-mail-delivery-without-unsubscribing_003f-1" href="#How-do-I-disable-mail-delivery-without-unsubscribing_003f-1">5.7 How do I disable mail delivery without unsubscribing?</a></li>
71
+    <li><a name="toc-Why-is-the-mailing-list-munging-my-address_003f-1" href="#Why-is-the-mailing-list-munging-my-address_003f-1">5.8 Why is the mailing list munging my address?</a></li>
72
+  </ul></li>
73
+  <li><a name="toc-Rules-and-Etiquette" href="#Rules-and-Etiquette">6 Rules and Etiquette</a>
74
+  <ul class="no-bullet">
75
+    <li><a name="toc-What-are-the-rules-and-the-proper-etiquette_003f" href="#What-are-the-rules-and-the-proper-etiquette_003f">6.1 What are the rules and the proper etiquette?</a></li>
76
+  </ul></li>
77
+  <li><a name="toc-Help" href="#Help">7 Help</a>
78
+  <ul class="no-bullet">
79
+    <li><a name="toc-Why-am-I-not-receiving-any-messages_003f" href="#Why-am-I-not-receiving-any-messages_003f">7.1 Why am I not receiving any messages?</a></li>
80
+    <li><a name="toc-Why-are-my-sent-messages-not-showing-up_003f" href="#Why-are-my-sent-messages-not-showing-up_003f">7.2 Why are my sent messages not showing up?</a></li>
81
+    <li><a name="toc-Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f-1" href="#Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f-1">7.3 Why do I keep getting unsubscribed from ffmpeg-devel?</a></li>
82
+    <li><a name="toc-Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f-1" href="#Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f-1">7.4 Who do I contact if I have a problem with the mailing list?</a></li>
83
+  </ul>
84
+</li>
85
+</ul>
86
+</div>
87
+
88
+
89
+<hr size="6">
90
+<a name="General-Questions"></a>
91
+<h1 class="chapter"><a href="mailing-list-faq.html#toc-General-Questions">1 General Questions</a></h1>
92
+
93
+<a name="What-is-a-mailing-list_003f"></a>
94
+<h2 class="section"><a href="mailing-list-faq.html#toc-What-is-a-mailing-list_003f">1.1 What is a mailing list?</a></h2>
95
+
96
+<p>A mailing list is not much different than emailing someone, but the
97
+main difference is that your message is received by everyone who
98
+subscribes to the list. It is somewhat like a forum but in email form.
99
+</p>
100
+<p>See the <a href="https://lists.ffmpeg.org/pipermail/ffmpeg-user/">ffmpeg-user archives</a>
101
+for examples.
102
+</p>
103
+<a name="What-type-of-questions-can-I-ask_003f"></a>
104
+<h2 class="section"><a href="mailing-list-faq.html#toc-What-type-of-questions-can-I-ask_003f">1.2 What type of questions can I ask?</a></h2>
105
+
106
+<ul>
107
+<li>
108
+<a href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-user/">ffmpeg-user</a>:
109
+For questions involving unscripted usage or compilation of the FFmpeg
110
+command-line tools (<code>ffmpeg</code>, <code>ffprobe</code>, <code>ffplay</code>).
111
+
112
+</li><li>
113
+<a href="https://lists.ffmpeg.org/mailman/listinfo/libav-user/">libav-user</a>:
114
+For questions involving the FFmpeg libav* libraries (libavcodec,
115
+libavformat, libavfilter, etc).
116
+
117
+</li><li>
118
+<a href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel/">ffmpeg-devel</a>:
119
+For discussions involving the development of FFmpeg and for submitting
120
+patches. User questions should be asked at ffmpeg-user or libav-user.
121
+</li></ul>
122
+
123
+<p>To report a bug see <a href="https://ffmpeg.org/bugreports.html">https://ffmpeg.org/bugreports.html</a>.
124
+</p>
125
+<p>We cannot provide help for scripts and/or third-party tools.
126
+</p>
127
+<p><a name="How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f"></a>
128
+</p><a name="How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f-1"></a>
129
+<h2 class="section"><a href="mailing-list-faq.html#toc-How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f-1">1.3 How do I ask a question or send a message to a mailing list?</a></h2>
130
+
131
+<p>First you must <a href="#How-do-I-subscribe_003f">subscribe</a>. Then all you have to do is
132
+send an email:
133
+</p>
134
+<ul>
135
+<li>
136
+Email <a href="mailto:ffmpeg-user@ffmpeg.org">ffmpeg-user@ffmpeg.org</a> to send a message to the
137
+ffmpeg-user mailing list.
138
+
139
+</li><li>
140
+Email <a href="mailto:libav-user@ffmpeg.org">libav-user@ffmpeg.org</a> to send a message to the
141
+libav-user mailing list.
142
+
143
+</li><li>
144
+Email <a href="mailto:ffmpeg-devel@ffmpeg.org">ffmpeg-devel@ffmpeg.org</a> to send a message to the
145
+ffmpeg-devel mailing list.
146
+</li></ul>
147
+
148
+<a name="Subscribing-_002f-Unsubscribing"></a>
149
+<h1 class="chapter"><a href="mailing-list-faq.html#toc-Subscribing-_002f-Unsubscribing">2 Subscribing / Unsubscribing</a></h1>
150
+
151
+<p><a name="How-do-I-subscribe_003f"></a>
152
+</p><a name="How-do-I-subscribe_003f-1"></a>
153
+<h2 class="section"><a href="mailing-list-faq.html#toc-How-do-I-subscribe_003f-1">2.1 How do I subscribe?</a></h2>
154
+
155
+<p>Email <a href="mailto:ffmpeg-user-request@ffmpeg.org">ffmpeg-user-request@ffmpeg.org</a> with the subject
156
+<em>subscribe</em>.
157
+</p>
158
+<p>Or visit the <a href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-user/">ffmpeg-user mailing list info page</a>
159
+and refer to the <em>Subscribing to ffmpeg-user</em> section.
160
+</p>
161
+<p>The process is the same for the other mailing lists.
162
+</p>
163
+<a name="How-do-I-unsubscribe_003f"></a>
164
+<h2 class="section"><a href="mailing-list-faq.html#toc-How-do-I-unsubscribe_003f">2.2 How do I unsubscribe?</a></h2>
165
+
166
+<p>Email <a href="mailto:ffmpeg-user-request@ffmpeg.org">ffmpeg-user-request@ffmpeg.org</a> with subject <em>unsubscribe</em>.
167
+</p>
168
+<p>Or visit the <a href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-user/">ffmpeg-user mailing list info page</a>,
169
+scroll to bottom of page, enter your email address in the box, and click
170
+the <em>Unsubscribe or edit options</em> button.
171
+</p>
172
+<p>The process is the same for the other mailing lists.
173
+</p>
174
+<p>Please avoid asking a mailing list admin to unsubscribe you unless you
175
+are absolutely unable to do so by yourself. See <a href="#Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f">Who do I contact if I have a problem with the mailing list?</a>
176
+</p>
177
+<p>Note that it is possible to temporarily halt message delivery (vacation mode).
178
+See <a href="#How-do-I-disable-mail-delivery-without-unsubscribing_003f">How do I disable mail delivery without unsubscribing?</a>
179
+</p>
180
+<a name="Moderation-Queue"></a>
181
+<h1 class="chapter"><a href="mailing-list-faq.html#toc-Moderation-Queue">3 Moderation Queue</a></h1>
182
+<p><a name="Why-is-my-message-awaiting-moderator-approval_003f"></a>
183
+</p><a name="Why-is-my-message-awaiting-moderator-approval_003f-1"></a>
184
+<h2 class="section"><a href="mailing-list-faq.html#toc-Why-is-my-message-awaiting-moderator-approval_003f-1">3.1 Why is my message awaiting moderator approval?</a></h2>
185
+
186
+<p>Some messages are automatically held in the <em>moderation queue</em> and
187
+must be manually approved by a mailing list admin:
188
+</p>
189
+<p>These are:
190
+</p>
191
+<ul>
192
+<li>
193
+Messages that exceed the <a href="#What-is-the-message-size-limit_003f">message size limit</a>.
194
+
195
+</li><li>
196
+Messages from users whose accounts have been set with the <em>moderation flag</em>
197
+(very rarely occurs, but may if a user repeatedly ignores the rules
198
+or is abusive towards others).
199
+</li></ul>
200
+
201
+<a name="How-long-does-it-take-for-my-message-in-the-moderation-queue-to-be-approved_003f"></a>
202
+<h2 class="section"><a href="mailing-list-faq.html#toc-How-long-does-it-take-for-my-message-in-the-moderation-queue-to-be-approved_003f">3.2 How long does it take for my message in the moderation queue to be approved?</a></h2>
203
+
204
+<p>The queue is not checked on a regular basis. You can ask on the
205
+<tt>#ffmpeg-devel</tt> IRC channel on Freenode for someone to approve your message.
206
+</p>
207
+<p><a name="How-do-I-delete-my-message-in-the-moderation-queue_003f"></a>
208
+</p><a name="How-do-I-delete-my-message-in-the-moderation-queue_003f-1"></a>
209
+<h2 class="section"><a href="mailing-list-faq.html#toc-How-do-I-delete-my-message-in-the-moderation-queue_003f-1">3.3 How do I delete my message in the moderation queue?</a></h2>
210
+
211
+<p>You should have received an email with the subject <em>Your message to &lt;mailing list name&gt; awaits moderator approval</em>.
212
+A link is in the message that will allow you to delete your message
213
+unless a mailing list admin already approved or rejected it.
214
+</p>
215
+<a name="Archives"></a>
216
+<h1 class="chapter"><a href="mailing-list-faq.html#toc-Archives">4 Archives</a></h1>
217
+
218
+<p><a name="Where-are-the-archives_003f"></a>
219
+</p><a name="Where-are-the-archives_003f-1"></a>
220
+<h2 class="section"><a href="mailing-list-faq.html#toc-Where-are-the-archives_003f-1">4.1 Where are the archives?</a></h2>
221
+
222
+<p>See the <em>Archives</em> section on the <a href="https://ffmpeg.org/contact.html">FFmpeg Contact</a>
223
+page for links to all FFmpeg mailing list archives.
224
+</p>
225
+<p>Note that the archives are split by month. Discussions that span
226
+several months will be split into separate months in the archives.
227
+</p>
228
+<a name="How-do-I-reply-to-a-message-in-the-archives_003f"></a>
229
+<h2 class="section"><a href="mailing-list-faq.html#toc-How-do-I-reply-to-a-message-in-the-archives_003f">4.2 How do I reply to a message in the archives?</a></h2>
230
+
231
+<p>Click the email link at the top of the message just under the subject
232
+title. The link will provide the proper headers to keep the message
233
+within the thread.
234
+</p>
235
+<p>Note that you must be subscribed to send a message to the ffmpeg-user or
236
+libav-user mailing lists.
237
+</p>
238
+<a name="How-do-I-search-the-archives_003f"></a>
239
+<h2 class="section"><a href="mailing-list-faq.html#toc-How-do-I-search-the-archives_003f">4.3 How do I search the archives?</a></h2>
240
+
241
+<p>Perform a site search using your favorite search engine. Example:
242
+</p>
243
+<p><tt>site:lists.ffmpeg.org/pipermail/ffmpeg-user/ &quot;search term&quot;</tt>
244
+</p>
245
+<a name="Other"></a>
246
+<h1 class="chapter"><a href="mailing-list-faq.html#toc-Other">5 Other</a></h1>
247
+
248
+<a name="Is-there-an-alternative-to-the-mailing-list_003f"></a>
249
+<h2 class="section"><a href="mailing-list-faq.html#toc-Is-there-an-alternative-to-the-mailing-list_003f">5.1 Is there an alternative to the mailing list?</a></h2>
250
+
251
+<p>You can ask for help in the official <tt>#ffmpeg</tt> IRC channel on Freenode.
252
+</p>
253
+<p>Some users prefer the third-party <a href="http://www.ffmpeg-archive.org/">Nabble</a>
254
+interface which presents the mailing lists in a typical forum layout.
255
+</p>
256
+<p>There are also numerous third-party help sites such as
257
+<a href="https://superuser.com/tags/ffmpeg">Super User</a> and
258
+<a href="https://www.reddit.com/r/ffmpeg/">r/ffmpeg on reddit</a>.
259
+</p>
260
+<p><a name="What-is-top_002dposting_003f"></a>
261
+</p><a name="What-is-top_002dposting_003f-1"></a>
262
+<h2 class="section"><a href="mailing-list-faq.html#toc-What-is-top_002dposting_003f-1">5.2 What is top-posting?</a></h2>
263
+
264
+<p>See <a href="https://en.wikipedia.org/wiki/Posting_style#Top-posting">https://en.wikipedia.org/wiki/Posting_style#Top-posting</a>.
265
+</p>
266
+<p>Instead, use trimmed interleaved/inline replies (<a href="https://lists.ffmpeg.org/pipermail/ffmpeg-user/2017-April/035849.html">example</a>).
267
+</p>
268
+<p><a name="What-is-the-message-size-limit_003f"></a>
269
+</p><a name="What-is-the-message-size-limit_003f-1"></a>
270
+<h2 class="section"><a href="mailing-list-faq.html#toc-What-is-the-message-size-limit_003f-1">5.3 What is the message size limit?</a></h2>
271
+
272
+<p>The message size limit is 1000 kilobytes. Please provide links to larger files
273
+instead of attaching them.
274
+</p>
275
+<a name="Where-can-I-upload-sample-files_003f"></a>
276
+<h2 class="section"><a href="mailing-list-faq.html#toc-Where-can-I-upload-sample-files_003f">5.4 Where can I upload sample files?</a></h2>
277
+
278
+<p>Anywhere that is not too annoying for us to use.
279
+</p>
280
+<p>Google Drive and Dropbox are acceptable if you need a file host, and
281
+<a href="https://0x0.st/">0x0.st</a> is good for files under 256 MiB.
282
+</p>
283
+<p>Small, short samples are preferred if possible.
284
+</p>
285
+<a name="Will-I-receive-spam-if-I-send-and_002for-subscribe-to-a-mailing-list_003f"></a>
286
+<h2 class="section"><a href="mailing-list-faq.html#toc-Will-I-receive-spam-if-I-send-and_002for-subscribe-to-a-mailing-list_003f">5.5 Will I receive spam if I send and/or subscribe to a mailing list?</a></h2>
287
+
288
+<p>Highly unlikely.
289
+</p>
290
+<ul>
291
+<li>
292
+The list of subscribed users is not public.
293
+
294
+</li><li>
295
+Email addresses in the archives are obfuscated.
296
+
297
+</li><li>
298
+Several unique test email accounts were utilized and none have yet
299
+received any spam.
300
+</li></ul>
301
+
302
+<p>However, you may see a spam in the mailing lists on rare occasions:
303
+</p>
304
+<ul>
305
+<li>
306
+Spam in the moderation queue may be accidentally approved due to human
307
+error.
308
+
309
+</li><li>
310
+There have been a few messages from subscribed users who had their own
311
+email addresses hacked and spam messages from (or appearing to be from)
312
+the hacked account were sent to their contacts (a mailing list being a
313
+contact in these cases).
314
+
315
+</li><li>
316
+If you are subscribed to the bug tracker mailing list (ffmpeg-trac) you
317
+may see the occasional spam as a false bug report, but we take measures
318
+to try to prevent this.
319
+</li></ul>
320
+
321
+<a name="How-do-I-filter-mailing-list-messages_003f"></a>
322
+<h2 class="section"><a href="mailing-list-faq.html#toc-How-do-I-filter-mailing-list-messages_003f">5.6 How do I filter mailing list messages?</a></h2>
323
+
324
+<p>Use the <em>List-Id</em>. For example, the ffmpeg-user mailing list is
325
+<tt>ffmpeg-user.ffmpeg.org</tt>. You can view the List-Id in the raw message
326
+or headers.
327
+</p>
328
+<p>You can then filter the mailing list messages to their own folder.
329
+</p>
330
+<p><a name="How-do-I-disable-mail-delivery-without-unsubscribing_003f"></a>
331
+</p><a name="How-do-I-disable-mail-delivery-without-unsubscribing_003f-1"></a>
332
+<h2 class="section"><a href="mailing-list-faq.html#toc-How-do-I-disable-mail-delivery-without-unsubscribing_003f-1">5.7 How do I disable mail delivery without unsubscribing?</a></h2>
333
+
334
+<p>Sometimes you may want to temporarily stop receiving all mailing list
335
+messages. This &quot;vacation mode&quot; is simple to do:
336
+</p>
337
+<ol>
338
+<li>
339
+Go to the <a href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-user/">ffmpeg-user mailing list info page</a>
340
+
341
+</li><li>
342
+Enter your email address in the box at very bottom of the page and click the
343
+<em>Unsubscribe or edit options</em> box.
344
+
345
+</li><li>
346
+Enter your password and click the <em>Log in</em> button.
347
+
348
+</li><li>
349
+Look for the <em>Mail delivery</em> option. Here you can disable/enable mail
350
+delivery. If you check <em>Set globally</em> it will apply your choice to all
351
+other FFmpeg mailing lists you are subscribed to.
352
+</li></ol>
353
+
354
+<p>Alternatively, from your subscribed address, send a message to <a href="mailto:ffmpeg-user-request@ffmpeg.org">ffmpeg-user-request@ffmpeg.org</a>
355
+with the subject <em>set delivery off</em>. To re-enable mail delivery send a
356
+message to <a href="mailto:ffmpeg-user-request@ffmpeg.org">ffmpeg-user-request@ffmpeg.org</a> with the subject
357
+<em>set delivery on</em>.
358
+</p>
359
+<p><a name="Why-is-the-mailing-list-munging-my-address_003f"></a>
360
+</p><a name="Why-is-the-mailing-list-munging-my-address_003f-1"></a>
361
+<h2 class="section"><a href="mailing-list-faq.html#toc-Why-is-the-mailing-list-munging-my-address_003f-1">5.8 Why is the mailing list munging my address?</a></h2>
362
+
363
+<p>This is due to subscribers that use an email service with a DMARC reject policy
364
+which adds difficulties to mailing list operators.
365
+</p>
366
+<p>The mailing list must re-write (munge) the <em>From:</em> header for such users;
367
+otherwise their email service will reject and bounce the message resulting in
368
+automatic unsubscribing from the mailing list.
369
+</p>
370
+<p>When sending a message these users will see <em>via &lt;mailing list name&gt;</em>
371
+added to their name and the <em>From:</em> address munged to the address of
372
+the particular mailing list.
373
+</p>
374
+<p>If you want to avoid this then please use a different email service.
375
+</p>
376
+<p>Note that ffmpeg-devel does not apply any munging as it causes issues with
377
+patch authorship. As a result users with an email service with a DMARC reject
378
+policy may be automatically unsubscribed due to rejected and bounced messages.
379
+</p>
380
+<a name="Rules-and-Etiquette"></a>
381
+<h1 class="chapter"><a href="mailing-list-faq.html#toc-Rules-and-Etiquette">6 Rules and Etiquette</a></h1>
382
+
383
+<a name="What-are-the-rules-and-the-proper-etiquette_003f"></a>
384
+<h2 class="section"><a href="mailing-list-faq.html#toc-What-are-the-rules-and-the-proper-etiquette_003f">6.1 What are the rules and the proper etiquette?</a></h2>
385
+
386
+<p>There may seem to be many things to remember, but we want to help and
387
+following these guidelines will allow you to get answers more quickly
388
+and help avoid getting ignored.
389
+</p>
390
+<ul>
391
+<li>
392
+Always show your actual, unscripted <code>ffmpeg</code> command and the
393
+complete, uncut console output from your command.
394
+
395
+</li><li>
396
+Use the most simple and minimal command that still shows the issue you
397
+are encountering.
398
+
399
+</li><li>
400
+Provide all necessary information so others can attempt to duplicate
401
+your issue. This includes the actual command, complete uncut console
402
+output, and any inputs that are required to duplicate the issue.
403
+
404
+</li><li>
405
+Use the latest <code>ffmpeg</code> build you can get. See the <a href="https://ffmpeg.org/download.html">FFmpeg Download</a>
406
+page for links to recent builds for Linux, macOS, and Windows. Or
407
+compile from the current git master branch.
408
+
409
+</li><li>
410
+Avoid <a href="https://en.wikipedia.org/wiki/Posting_style#Top-posting">top-posting</a>.
411
+Also see <a href="#What-is-top_002dposting_003f">What is top-posting?</a>
412
+
413
+</li><li>
414
+Avoid hijacking threads. Thread hijacking is replying to a message and
415
+changing the subject line to something unrelated to the original thread.
416
+Most email clients will still show the renamed message under the
417
+original thread. This can be confusing and these types of messages are
418
+often ignored.
419
+
420
+</li><li>
421
+Do not send screenshots. Copy and paste console text instead of making
422
+screenshots of the text.
423
+
424
+</li><li>
425
+Avoid sending email disclaimers and legalese if possible as this is a
426
+public list.
427
+
428
+</li><li>
429
+Avoid using the <code>-loglevel debug</code>, <code>-loglevel quiet</code>, and
430
+<code>-hide_banner</code> options unless requested to do so.
431
+
432
+</li><li>
433
+If you attach files avoid compressing small files. Uncompressed is
434
+preferred.
435
+
436
+</li><li>
437
+Please do not send HTML-only messages. The mailing list will ignore the
438
+HTML component of your message. Most mail clients will automatically
439
+include a text component: this is what the mailing list will use.
440
+
441
+</li><li>
442
+Configuring your mail client to break lines after 70 or so characters is
443
+recommended.
444
+
445
+</li><li>
446
+Avoid sending the same message to multiple mailing lists.
447
+
448
+</li><li>
449
+Please follow our <a href="https://ffmpeg.org/developer.html#Code-of-conduct">Code of Conduct</a>.
450
+</li></ul>
451
+
452
+<a name="Help"></a>
453
+<h1 class="chapter"><a href="mailing-list-faq.html#toc-Help">7 Help</a></h1>
454
+
455
+<a name="Why-am-I-not-receiving-any-messages_003f"></a>
456
+<h2 class="section"><a href="mailing-list-faq.html#toc-Why-am-I-not-receiving-any-messages_003f">7.1 Why am I not receiving any messages?</a></h2>
457
+
458
+<p>Some email providers have blacklists or spam filters that block or mark
459
+the mailing list messages as false positives. Unfortunately, the user is
460
+often not aware of this and is often out of their control.
461
+</p>
462
+<p>When possible we attempt to notify the provider to be removed from the
463
+blacklists or filters.
464
+</p>
465
+<a name="Why-are-my-sent-messages-not-showing-up_003f"></a>
466
+<h2 class="section"><a href="mailing-list-faq.html#toc-Why-are-my-sent-messages-not-showing-up_003f">7.2 Why are my sent messages not showing up?</a></h2>
467
+
468
+<p>Excluding <a href="#Why-is-my-message-awaiting-moderator-approval_003f">messages that are held in the moderation queue</a>
469
+there are a few other reasons why your messages may fail to appear:
470
+</p>
471
+<ul>
472
+<li>
473
+HTML-only messages are ignored by the mailing lists. Most mail clients
474
+automatically include a text component alongside HTML email: this is what
475
+the mailing list will use. If it does not then consider your client to be
476
+broken, because sending a text component along with the HTML component to
477
+form a multi-part message is recommended by email standards.
478
+
479
+</li><li>
480
+Check your spam folder.
481
+</li></ul>
482
+
483
+<p><a name="Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f"></a>
484
+</p><a name="Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f-1"></a>
485
+<h2 class="section"><a href="mailing-list-faq.html#toc-Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f-1">7.3 Why do I keep getting unsubscribed from ffmpeg-devel?</a></h2>
486
+
487
+<p>Users with an email service that has a DMARC reject or quarantine policy may be
488
+automatically unsubscribed from the ffmpeg-devel mailing list due to the mailing
489
+list messages being continuously rejected and bounced back.
490
+</p>
491
+<p>Consider using a different email service.
492
+</p>
493
+<p><a name="Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f"></a>
494
+</p><a name="Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f-1"></a>
495
+<h2 class="section"><a href="mailing-list-faq.html#toc-Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f-1">7.4 Who do I contact if I have a problem with the mailing list?</a></h2>
496
+
497
+<p>Send a message to <a href="mailto:ffmpeg-user-owner@ffmpeg.org">ffmpeg-user-owner@ffmpeg.org</a>.
498
+</p>
499
+    </div>
500
+  </body>
501
+</html>
502
+

+ 219
- 0
Common/ffmpeg/doc/nut.html ファイルの表示

@@ -0,0 +1,219 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="NUT: ">
11
+<meta name="keywords" content="FFmpeg documentation : NUT: ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">NUT</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Description" href="#Description">1 Description</a></li>
40
+  <li><a name="toc-Modes" href="#Modes">2 Modes</a>
41
+  <ul class="no-bullet">
42
+    <li><a name="toc-BROADCAST" href="#BROADCAST">2.1 BROADCAST</a></li>
43
+    <li><a name="toc-PIPE" href="#PIPE">2.2 PIPE</a></li>
44
+  </ul></li>
45
+  <li><a name="toc-Container_002dspecific-codec-tags" href="#Container_002dspecific-codec-tags">3 Container-specific codec tags</a>
46
+  <ul class="no-bullet">
47
+    <li><a name="toc-Generic-raw-YUVA-formats" href="#Generic-raw-YUVA-formats">3.1 Generic raw YUVA formats</a></li>
48
+    <li><a name="toc-Raw-Audio" href="#Raw-Audio">3.2 Raw Audio</a></li>
49
+    <li><a name="toc-Subtitles" href="#Subtitles">3.3 Subtitles</a></li>
50
+    <li><a name="toc-Raw-Data" href="#Raw-Data">3.4 Raw Data</a></li>
51
+    <li><a name="toc-Codecs" href="#Codecs">3.5 Codecs</a></li>
52
+  </ul>
53
+</li>
54
+</ul>
55
+</div>
56
+
57
+
58
+<hr size="6">
59
+<a name="Description"></a>
60
+<h1 class="chapter"><a href="nut.html#toc-Description">1 Description</a></h1>
61
+<p>NUT is a low overhead generic container format. It stores audio, video,
62
+subtitle and user-defined streams in a simple, yet efficient, way.
63
+</p>
64
+<p>It was created by a group of FFmpeg and MPlayer developers in 2003
65
+and was finalized in 2008.
66
+</p>
67
+<p>The official nut specification is at svn://svn.mplayerhq.hu/nut
68
+In case of any differences between this text and the official specification,
69
+the official specification shall prevail.
70
+</p>
71
+<a name="Modes"></a>
72
+<h1 class="chapter"><a href="nut.html#toc-Modes">2 Modes</a></h1>
73
+<p>NUT has some variants signaled by using the flags field in its main header.
74
+</p>
75
+<table>
76
+<tr><td width="40%">BROADCAST</td><td width="40%">Extend the syncpoint to report the sender wallclock</td></tr>
77
+<tr><td width="40%">PIPE</td><td width="40%">Omit completely the syncpoint</td></tr>
78
+</table>
79
+
80
+<a name="BROADCAST"></a>
81
+<h2 class="section"><a href="nut.html#toc-BROADCAST">2.1 BROADCAST</a></h2>
82
+
83
+<p>The BROADCAST variant provides a secondary time reference to facilitate
84
+detecting endpoint latency and network delays.
85
+It assumes all the endpoint clocks are synchronized.
86
+To be used in real-time scenarios.
87
+</p>
88
+<a name="PIPE"></a>
89
+<h2 class="section"><a href="nut.html#toc-PIPE">2.2 PIPE</a></h2>
90
+
91
+<p>The PIPE variant assumes NUT is used as non-seekable intermediate container,
92
+by not using syncpoint removes unneeded overhead and reduces the overall
93
+memory usage.
94
+</p>
95
+<a name="Container_002dspecific-codec-tags"></a>
96
+<h1 class="chapter"><a href="nut.html#toc-Container_002dspecific-codec-tags">3 Container-specific codec tags</a></h1>
97
+
98
+<a name="Generic-raw-YUVA-formats"></a>
99
+<h2 class="section"><a href="nut.html#toc-Generic-raw-YUVA-formats">3.1 Generic raw YUVA formats</a></h2>
100
+
101
+<p>Since many exotic planar YUVA pixel formats are not considered by
102
+the AVI/QuickTime FourCC lists, the following scheme is adopted for
103
+representing them.
104
+</p>
105
+<p>The first two bytes can contain the values:
106
+Y1 = only Y
107
+Y2 = Y+A
108
+Y3 = YUV
109
+Y4 = YUVA
110
+</p>
111
+<p>The third byte represents the width and height chroma subsampling
112
+values for the UV planes, that is the amount to shift the luma
113
+width/height right to find the chroma width/height.
114
+</p>
115
+<p>The fourth byte is the number of bits used (8, 16, ...).
116
+</p>
117
+<p>If the order of bytes is inverted, that means that each component has
118
+to be read big-endian.
119
+</p>
120
+<a name="Raw-Audio"></a>
121
+<h2 class="section"><a href="nut.html#toc-Raw-Audio">3.2 Raw Audio</a></h2>
122
+
123
+<table>
124
+<tr><td width="40%">ALAW</td><td width="40%">A-LAW</td></tr>
125
+<tr><td width="40%">ULAW</td><td width="40%">MU-LAW</td></tr>
126
+<tr><td width="40%">P&lt;type&gt;&lt;interleaving&gt;&lt;bits&gt;</td><td width="40%">little-endian PCM</td></tr>
127
+<tr><td width="40%">&lt;bits&gt;&lt;interleaving&gt;&lt;type&gt;P</td><td width="40%">big-endian PCM</td></tr>
128
+</table>
129
+
130
+<p>&lt;type&gt; is S for signed integer, U for unsigned integer, F for IEEE float
131
+&lt;interleaving&gt; is D for default, P is for planar.
132
+&lt;bits&gt; is 8/16/24/32
133
+</p>
134
+<div class="example">
135
+<pre class="example">PFD[32]   would for example be signed 32 bit little-endian IEEE float
136
+</pre></div>
137
+
138
+<a name="Subtitles"></a>
139
+<h2 class="section"><a href="nut.html#toc-Subtitles">3.3 Subtitles</a></h2>
140
+
141
+<table>
142
+<tr><td width="40%">UTF8</td><td width="40%">Raw UTF-8</td></tr>
143
+<tr><td width="40%">SSA[0]</td><td width="40%">SubStation Alpha</td></tr>
144
+<tr><td width="40%">DVDS</td><td width="40%">DVD subtitles</td></tr>
145
+<tr><td width="40%">DVBS</td><td width="40%">DVB subtitles</td></tr>
146
+</table>
147
+
148
+<a name="Raw-Data"></a>
149
+<h2 class="section"><a href="nut.html#toc-Raw-Data">3.4 Raw Data</a></h2>
150
+
151
+<table>
152
+<tr><td width="40%">UTF8</td><td width="40%">Raw UTF-8</td></tr>
153
+</table>
154
+
155
+<a name="Codecs"></a>
156
+<h2 class="section"><a href="nut.html#toc-Codecs">3.5 Codecs</a></h2>
157
+
158
+<table>
159
+<tr><td width="40%">3IV1</td><td width="40%">non-compliant MPEG-4 generated by old 3ivx</td></tr>
160
+<tr><td width="40%">ASV1</td><td width="40%">Asus Video</td></tr>
161
+<tr><td width="40%">ASV2</td><td width="40%">Asus Video 2</td></tr>
162
+<tr><td width="40%">CVID</td><td width="40%">Cinepak</td></tr>
163
+<tr><td width="40%">CYUV</td><td width="40%">Creative YUV</td></tr>
164
+<tr><td width="40%">DIVX</td><td width="40%">non-compliant MPEG-4 generated by old DivX</td></tr>
165
+<tr><td width="40%">DUCK</td><td width="40%">Truemotion 1</td></tr>
166
+<tr><td width="40%">FFV1</td><td width="40%">FFmpeg video 1</td></tr>
167
+<tr><td width="40%">FFVH</td><td width="40%">FFmpeg Huffyuv</td></tr>
168
+<tr><td width="40%">H261</td><td width="40%">ITU H.261</td></tr>
169
+<tr><td width="40%">H262</td><td width="40%">ITU H.262</td></tr>
170
+<tr><td width="40%">H263</td><td width="40%">ITU H.263</td></tr>
171
+<tr><td width="40%">H264</td><td width="40%">ITU H.264</td></tr>
172
+<tr><td width="40%">HFYU</td><td width="40%">Huffyuv</td></tr>
173
+<tr><td width="40%">I263</td><td width="40%">Intel H.263</td></tr>
174
+<tr><td width="40%">IV31</td><td width="40%">Indeo 3.1</td></tr>
175
+<tr><td width="40%">IV32</td><td width="40%">Indeo 3.2</td></tr>
176
+<tr><td width="40%">IV50</td><td width="40%">Indeo 5.0</td></tr>
177
+<tr><td width="40%">LJPG</td><td width="40%">ITU JPEG (lossless)</td></tr>
178
+<tr><td width="40%">MJLS</td><td width="40%">ITU JPEG-LS</td></tr>
179
+<tr><td width="40%">MJPG</td><td width="40%">ITU JPEG</td></tr>
180
+<tr><td width="40%">MPG4</td><td width="40%">MS MPEG-4v1 (not ISO MPEG-4)</td></tr>
181
+<tr><td width="40%">MP42</td><td width="40%">MS MPEG-4v2</td></tr>
182
+<tr><td width="40%">MP43</td><td width="40%">MS MPEG-4v3</td></tr>
183
+<tr><td width="40%">MP4V</td><td width="40%">ISO MPEG-4 Part 2 Video (from old encoders)</td></tr>
184
+<tr><td width="40%">mpg1</td><td width="40%">ISO MPEG-1 Video</td></tr>
185
+<tr><td width="40%">mpg2</td><td width="40%">ISO MPEG-2 Video</td></tr>
186
+<tr><td width="40%">MRLE</td><td width="40%">MS RLE</td></tr>
187
+<tr><td width="40%">MSVC</td><td width="40%">MS Video 1</td></tr>
188
+<tr><td width="40%">RT21</td><td width="40%">Indeo 2.1</td></tr>
189
+<tr><td width="40%">RV10</td><td width="40%">RealVideo 1.0</td></tr>
190
+<tr><td width="40%">RV20</td><td width="40%">RealVideo 2.0</td></tr>
191
+<tr><td width="40%">RV30</td><td width="40%">RealVideo 3.0</td></tr>
192
+<tr><td width="40%">RV40</td><td width="40%">RealVideo 4.0</td></tr>
193
+<tr><td width="40%">SNOW</td><td width="40%">FFmpeg Snow</td></tr>
194
+<tr><td width="40%">SVQ1</td><td width="40%">Sorenson Video 1</td></tr>
195
+<tr><td width="40%">SVQ3</td><td width="40%">Sorenson Video 3</td></tr>
196
+<tr><td width="40%">theo</td><td width="40%">Xiph Theora</td></tr>
197
+<tr><td width="40%">TM20</td><td width="40%">Truemotion 2.0</td></tr>
198
+<tr><td width="40%">UMP4</td><td width="40%">non-compliant MPEG-4 generated by UB Video MPEG-4</td></tr>
199
+<tr><td width="40%">VCR1</td><td width="40%">ATI VCR1</td></tr>
200
+<tr><td width="40%">VP30</td><td width="40%">VP 3.0</td></tr>
201
+<tr><td width="40%">VP31</td><td width="40%">VP 3.1</td></tr>
202
+<tr><td width="40%">VP50</td><td width="40%">VP 5.0</td></tr>
203
+<tr><td width="40%">VP60</td><td width="40%">VP 6.0</td></tr>
204
+<tr><td width="40%">VP61</td><td width="40%">VP 6.1</td></tr>
205
+<tr><td width="40%">VP62</td><td width="40%">VP 6.2</td></tr>
206
+<tr><td width="40%">VP70</td><td width="40%">VP 7.0</td></tr>
207
+<tr><td width="40%">WMV1</td><td width="40%">MS WMV7</td></tr>
208
+<tr><td width="40%">WMV2</td><td width="40%">MS WMV8</td></tr>
209
+<tr><td width="40%">WMV3</td><td width="40%">MS WMV9</td></tr>
210
+<tr><td width="40%">WV1F</td><td width="40%">non-compliant MPEG-4 generated by ?</td></tr>
211
+<tr><td width="40%">WVC1</td><td width="40%">VC-1</td></tr>
212
+<tr><td width="40%">XVID</td><td width="40%">non-compliant MPEG-4 generated by old Xvid</td></tr>
213
+<tr><td width="40%">XVIX</td><td width="40%">non-compliant MPEG-4 generated by old Xvid with interlacing bug</td></tr>
214
+</table>
215
+
216
+    </div>
217
+  </body>
218
+</html>
219
+

+ 406
- 0
Common/ffmpeg/doc/platform.html ファイルの表示

@@ -0,0 +1,406 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <title>FFmpeg documentation</title>
7
+    <link rel="stylesheet" href="bootstrap.min.css" />
8
+    <link rel="stylesheet" href="style.min.css" />
9
+
10
+<meta name="description" content="Platform Specific Information: ">
11
+<meta name="keywords" content="FFmpeg documentation : Platform Specific Information: ">
12
+<meta name="Generator" content="texi2html 5.0">
13
+<!-- Created on March 9, 2020 by texi2html 5.0 -->
14
+<!--
15
+texi2html was written by: 
16
+            Lionel Cons <Lionel.Cons@cern.ch> (original author)
17
+            Karl Berry  <karl@freefriends.org>
18
+            Olaf Bachmann <obachman@mathematik.uni-kl.de>
19
+            and many others.
20
+Maintained by: Many creative people.
21
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
22
+
23
+-->
24
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25
+  </head>
26
+  <body>
27
+    <div class="container">
28
+
29
+<h1 class="titlefont">Platform Specific Information</h1>
30
+<hr>
31
+<a name="SEC_Top"></a>
32
+
33
+<a name="SEC_Contents"></a>
34
+<h1>Table of Contents</h1>
35
+
36
+<div class="contents">
37
+
38
+<ul class="no-bullet">
39
+  <li><a name="toc-Unix_002dlike" href="#Unix_002dlike">1 Unix-like</a>
40
+  <ul class="no-bullet">
41
+    <li><a name="toc-Advanced-linking-configuration" href="#Advanced-linking-configuration">1.1 Advanced linking configuration</a></li>
42
+    <li><a name="toc-BSD" href="#BSD">1.2 BSD</a></li>
43
+    <li><a name="toc-_0028Open_0029Solaris" href="#g_t_0028Open_0029Solaris">1.3 (Open)Solaris</a></li>
44
+    <li><a name="toc-Darwin-_0028Mac-OS-X_002c-iPhone_0029" href="#Darwin-_0028Mac-OS-X_002c-iPhone_0029">1.4 Darwin (Mac OS X, iPhone)</a></li>
45
+  </ul></li>
46
+  <li><a name="toc-DOS" href="#DOS">2 DOS</a></li>
47
+  <li><a name="toc-OS_002f2" href="#OS_002f2">3 OS/2</a></li>
48
+  <li><a name="toc-Windows" href="#Windows">4 Windows</a>
49
+  <ul class="no-bullet">
50
+    <li><a name="toc-Native-Windows-compilation-using-MinGW-or-MinGW_002dw64" href="#Native-Windows-compilation-using-MinGW-or-MinGW_002dw64">4.1 Native Windows compilation using MinGW or MinGW-w64</a>
51
+    <ul class="no-bullet">
52
+      <li><a name="toc-Native-Windows-compilation-using-MSYS2" href="#Native-Windows-compilation-using-MSYS2">4.1.1 Native Windows compilation using MSYS2</a></li>
53
+    </ul></li>
54
+    <li><a name="toc-Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows" href="#Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows">4.2 Microsoft Visual C++ or Intel C++ Compiler for Windows</a>
55
+    <ul class="no-bullet">
56
+      <li><a name="toc-Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b" href="#Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b">4.2.1 Linking to FFmpeg with Microsoft Visual C++</a></li>
57
+    </ul></li>
58
+    <li><a name="toc-Cross-compilation-for-Windows-with-Linux-1" href="#Cross-compilation-for-Windows-with-Linux-1">4.3 Cross compilation for Windows with Linux</a></li>
59
+    <li><a name="toc-Compilation-under-Cygwin" href="#Compilation-under-Cygwin">4.4 Compilation under Cygwin</a></li>
60
+    <li><a name="toc-Crosscompilation-for-Windows-under-Cygwin" href="#Crosscompilation-for-Windows-under-Cygwin">4.5 Crosscompilation for Windows under Cygwin</a></li>
61
+  </ul>
62
+</li>
63
+</ul>
64
+</div>
65
+
66
+
67
+<hr size="6">
68
+<a name="Unix_002dlike"></a>
69
+<h1 class="chapter"><a href="platform.html#toc-Unix_002dlike">1 Unix-like</a></h1>
70
+
71
+<p>Some parts of FFmpeg cannot be built with version 2.15 of the GNU
72
+assembler which is still provided by a few AMD64 distributions. To
73
+make sure your compiler really uses the required version of gas
74
+after a binutils upgrade, run:
75
+</p>
76
+<div class="example">
77
+<pre class="example">$(gcc -print-prog-name=as) --version
78
+</pre></div>
79
+
80
+<p>If not, then you should install a different compiler that has no
81
+hard-coded path to gas. In the worst case pass <code>--disable-asm</code>
82
+to configure.
83
+</p>
84
+<a name="Advanced-linking-configuration"></a>
85
+<h2 class="section"><a href="platform.html#toc-Advanced-linking-configuration">1.1 Advanced linking configuration</a></h2>
86
+
87
+<p>If you compiled FFmpeg libraries statically and you want to use them to
88
+build your own shared library, you may need to force PIC support (with
89
+<code>--enable-pic</code> during FFmpeg configure) and add the following option
90
+to your project LDFLAGS:
91
+</p>
92
+<div class="example">
93
+<pre class="example">-Wl,-Bsymbolic
94
+</pre></div>
95
+
96
+<p>If your target platform requires position independent binaries, you should
97
+pass the correct linking flag (e.g. <code>-pie</code>) to <code>--extra-ldexeflags</code>.
98
+</p>
99
+<a name="BSD"></a>
100
+<h2 class="section"><a href="platform.html#toc-BSD">1.2 BSD</a></h2>
101
+
102
+<p>BSD make will not build FFmpeg, you need to install and use GNU Make
103
+(<code>gmake</code>).
104
+</p>
105
+<a name="g_t_0028Open_0029Solaris"></a>
106
+<h2 class="section"><a href="platform.html#toc-_0028Open_0029Solaris">1.3 (Open)Solaris</a></h2>
107
+
108
+<p>GNU Make is required to build FFmpeg, so you have to invoke (<code>gmake</code>),
109
+standard Solaris Make will not work. When building with a non-c99 front-end
110
+(gcc, generic suncc) add either <code>--extra-libs=/usr/lib/values-xpg6.o</code>
111
+or <code>--extra-libs=/usr/lib/64/values-xpg6.o</code> to the configure options
112
+since the libc is not c99-compliant by default. The probes performed by
113
+configure may raise an exception leading to the death of configure itself
114
+due to a bug in the system shell. Simply invoke a different shell such as
115
+bash directly to work around this:
116
+</p>
117
+<div class="example">
118
+<pre class="example">bash ./configure
119
+</pre></div>
120
+
121
+<p><a name="Darwin"></a>
122
+</p><a name="Darwin-_0028Mac-OS-X_002c-iPhone_0029"></a>
123
+<h2 class="section"><a href="platform.html#toc-Darwin-_0028Mac-OS-X_002c-iPhone_0029">1.4 Darwin (Mac OS X, iPhone)</a></h2>
124
+
125
+<p>The toolchain provided with Xcode is sufficient to build the basic
126
+unaccelerated code.
127
+</p>
128
+<p>Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from
129
+<a href="https://github.com/FFmpeg/gas-preprocessor">https://github.com/FFmpeg/gas-preprocessor</a> or
130
+<a href="https://github.com/yuvi/gas-preprocessor">https://github.com/yuvi/gas-preprocessor</a>(currently outdated) to build the optimized
131
+assembly functions. Put the Perl script somewhere
132
+in your PATH, FFmpeg&rsquo;s configure will pick it up automatically.
133
+</p>
134
+<p>Mac OS X on amd64 and x86 requires <code>nasm</code> to build most of the
135
+optimized assembly functions. <a href="http://www.finkproject.org/">Fink</a>,
136
+<a href="https://wiki.gentoo.org/wiki/Project:Prefix">Gentoo Prefix</a>,
137
+<a href="https://mxcl.github.com/homebrew/">Homebrew</a>
138
+or <a href="http://www.macports.org">MacPorts</a> can easily provide it.
139
+</p>
140
+
141
+<a name="DOS"></a>
142
+<h1 class="chapter"><a href="platform.html#toc-DOS">2 DOS</a></h1>
143
+
144
+<p>Using a cross-compiler is preferred for various reasons.
145
+<a href="http://www.delorie.com/howto/djgpp/linux-x-djgpp.html">http://www.delorie.com/howto/djgpp/linux-x-djgpp.html</a>
146
+</p>
147
+
148
+<a name="OS_002f2"></a>
149
+<h1 class="chapter"><a href="platform.html#toc-OS_002f2">3 OS/2</a></h1>
150
+
151
+<p>For information about compiling FFmpeg on OS/2 see
152
+<a href="http://www.edm2.com/index.php/FFmpeg">http://www.edm2.com/index.php/FFmpeg</a>.
153
+</p>
154
+
155
+<a name="Windows"></a>
156
+<h1 class="chapter"><a href="platform.html#toc-Windows">4 Windows</a></h1>
157
+
158
+<p>To get help and instructions for building FFmpeg under Windows, check out
159
+the FFmpeg Windows Help Forum at <a href="http://ffmpeg.zeranoe.com/forum/">http://ffmpeg.zeranoe.com/forum/</a>.
160
+</p>
161
+<a name="Native-Windows-compilation-using-MinGW-or-MinGW_002dw64"></a>
162
+<h2 class="section"><a href="platform.html#toc-Native-Windows-compilation-using-MinGW-or-MinGW_002dw64">4.1 Native Windows compilation using MinGW or MinGW-w64</a></h2>
163
+
164
+<p>FFmpeg can be built to run natively on Windows using the MinGW-w64
165
+toolchain. Install the latest versions of MSYS2 and MinGW-w64 from
166
+<a href="http://msys2.github.io/">http://msys2.github.io/</a> and/or <a href="http://mingw-w64.sourceforge.net/">http://mingw-w64.sourceforge.net/</a>.
167
+You can find detailed installation instructions in the download section and
168
+the FAQ.
169
+</p>
170
+<p>Notes:
171
+</p>
172
+<ul>
173
+<li> Building for the MSYS environment is discouraged, MSYS2 provides a full
174
+MinGW-w64 environment through &lsquo;<tt>mingw64_shell.bat</tt>&rsquo; or
175
+&lsquo;<tt>mingw32_shell.bat</tt>&rsquo; that should be used instead of the environment
176
+provided by &lsquo;<tt>msys2_shell.bat</tt>&rsquo;.
177
+
178
+</li><li> Building using MSYS2 can be sped up by disabling implicit rules in the
179
+Makefile by calling <code>make -r</code> instead of plain <code>make</code>. This
180
+speed up is close to non-existent for normal one-off builds and is only
181
+noticeable when running make for a second time (for example during
182
+<code>make install</code>).
183
+
184
+</li><li> In order to compile FFplay, you must have the MinGW development library
185
+of <a href="http://www.libsdl.org/">SDL</a> and <code>pkg-config</code> installed.
186
+
187
+</li><li> By using <code>./configure --enable-shared</code> when configuring FFmpeg,
188
+you can build the FFmpeg libraries (e.g. libavutil, libavcodec,
189
+libavformat) as DLLs.
190
+
191
+</li></ul>
192
+
193
+<a name="Native-Windows-compilation-using-MSYS2"></a>
194
+<h3 class="subsection"><a href="platform.html#toc-Native-Windows-compilation-using-MSYS2">4.1.1 Native Windows compilation using MSYS2</a></h3>
195
+
196
+<p>The MSYS2 MinGW-w64 environment provides ready to use toolchains and dependencies
197
+through <code>pacman</code>.
198
+</p>
199
+<p>Make sure to use &lsquo;<tt>mingw64_shell.bat</tt>&rsquo; or &lsquo;<tt>mingw32_shell.bat</tt>&rsquo; to have
200
+the correct MinGW-w64 environment. The default install provides shortcuts to
201
+them under <code>MinGW-w64 Win64 Shell</code> and <code>MinGW-w64 Win32 Shell</code>.
202
+</p>
203
+<div class="example">
204
+<pre class="example"># normal msys2 packages
205
+pacman -S make pkgconf diffutils
206
+
207
+# mingw-w64 packages and toolchains
208
+pacman -S mingw-w64-x86_64-nasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2
209
+</pre></div>
210
+
211
+<p>To target 32 bits replace <code>x86_64</code> with <code>i686</code> in the command above.
212
+</p>
213
+<a name="Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows"></a>
214
+<h2 class="section"><a href="platform.html#toc-Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows">4.2 Microsoft Visual C++ or Intel C++ Compiler for Windows</a></h2>
215
+
216
+<p>FFmpeg can be built with MSVC 2013 or later.
217
+</p>
218
+<p>You will need the following prerequisites:
219
+</p>
220
+<ul>
221
+<li> <a href="http://msys2.github.io/">MSYS2</a>
222
+</li><li> <a href="http://www.nasm.us/">NASM</a>
223
+(Also available via MSYS2&rsquo;s package manager.)
224
+</li></ul>
225
+
226
+<p>To set up a proper environment in MSYS2, you need to run <code>msys_shell.bat</code> from
227
+the Visual Studio or Intel Compiler command prompt.
228
+</p>
229
+<p>Place <code>yasm.exe</code> somewhere in your <code>PATH</code>.
230
+</p>
231
+<p>Next, make sure any other headers and libs you want to use, such as zlib, are
232
+located in a spot that the compiler can see. Do so by modifying the <code>LIB</code>
233
+and <code>INCLUDE</code> environment variables to include the <strong>Windows-style</strong>
234
+paths to these directories. Alternatively, you can try to use the
235
+<code>--extra-cflags</code>/<code>--extra-ldflags</code> configure options.
236
+</p>
237
+<p>Finally, run:
238
+</p>
239
+<div class="example">
240
+<pre class="example">For MSVC:
241
+./configure --toolchain=msvc
242
+
243
+For ICL:
244
+./configure --toolchain=icl
245
+
246
+make
247
+make install
248
+</pre></div>
249
+
250
+<p>If you wish to compile shared libraries, add <code>--enable-shared</code> to your
251
+configure options. Note that due to the way MSVC and ICL handle DLL imports and
252
+exports, you cannot compile static and shared libraries at the same time, and
253
+enabling shared libraries will automatically disable the static ones.
254
+</p>
255
+<p>Notes:
256
+</p>
257
+<ul>
258
+<li> If you wish to build with zlib support, you will have to grab a compatible
259
+zlib binary from somewhere, with an MSVC import lib, or if you wish to link
260
+statically, you can follow the instructions below to build a compatible
261
+<code>zlib.lib</code> with MSVC. Regardless of which method you use, you must still
262
+follow step 3, or compilation will fail.
263
+<ol>
264
+<li> Grab the <a href="http://zlib.net/">zlib sources</a>.
265
+</li><li> Edit <code>win32/Makefile.msc</code> so that it uses -MT instead of -MD, since
266
+this is how FFmpeg is built as well.
267
+</li><li> Edit <code>zconf.h</code> and remove its inclusion of <code>unistd.h</code>. This gets
268
+erroneously included when building FFmpeg.
269
+</li><li> Run <code>nmake -f win32/Makefile.msc</code>.
270
+</li><li> Move <code>zlib.lib</code>, <code>zconf.h</code>, and <code>zlib.h</code> to somewhere MSVC
271
+can see.
272
+</li></ol>
273
+
274
+</li><li> FFmpeg has been tested with the following on i686 and x86_64:
275
+<ul>
276
+<li> Visual Studio 2013 Pro and Express
277
+</li><li> Intel Composer XE 2013
278
+</li><li> Intel Composer XE 2013 SP1
279
+</li></ul>
280
+<p>Anything else is not officially supported.
281
+</p>
282
+</li></ul>
283
+
284
+<a name="Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b"></a>
285
+<h3 class="subsection"><a href="platform.html#toc-Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b">4.2.1 Linking to FFmpeg with Microsoft Visual C++</a></h3>
286
+
287
+<p>If you plan to link with MSVC-built static libraries, you will need
288
+to make sure you have <code>Runtime Library</code> set to
289
+<code>Multi-threaded (/MT)</code> in your project&rsquo;s settings.
290
+</p>
291
+<p>You will need to define <code>inline</code> to something MSVC understands:
292
+</p><div class="example">
293
+<pre class="example">#define inline __inline
294
+</pre></div>
295
+
296
+<p>Also note, that as stated in <strong>Microsoft Visual C++</strong>, you will need
297
+an MSVC-compatible <a href="http://code.google.com/p/msinttypes/">inttypes.h</a>.
298
+</p>
299
+<p>If you plan on using import libraries created by dlltool, you must
300
+set <code>References</code> to <code>No (/OPT:NOREF)</code> under the linker optimization
301
+settings, otherwise the resulting binaries will fail during runtime.
302
+This is not required when using import libraries generated by <code>lib.exe</code>.
303
+This issue is reported upstream at
304
+<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12633">http://sourceware.org/bugzilla/show_bug.cgi?id=12633</a>.
305
+</p>
306
+<p>To create import libraries that work with the <code>/OPT:REF</code> option
307
+(which is enabled by default in Release mode), follow these steps:
308
+</p>
309
+<ol>
310
+<li> Open the <em>Visual Studio Command Prompt</em>.
311
+
312
+<p>Alternatively, in a normal command line prompt, call &lsquo;<tt>vcvars32.bat</tt>&rsquo;
313
+which sets up the environment variables for the Visual C++ tools
314
+(the standard location for this file is something like
315
+&lsquo;<tt>C:\Program Files (x86_\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat</tt>&rsquo;).
316
+</p>
317
+</li><li> Enter the &lsquo;<tt>bin</tt>&rsquo; directory where the created LIB and DLL files
318
+are stored.
319
+
320
+</li><li> Generate new import libraries with <code>lib.exe</code>:
321
+
322
+<div class="example">
323
+<pre class="example">lib /machine:i386 /def:..\lib\foo-version.def  /out:foo.lib
324
+</pre></div>
325
+
326
+<p>Replace <code>foo-version</code> and <code>foo</code> with the respective library names.
327
+</p>
328
+</li></ol>
329
+
330
+<p><a name="Cross-compilation-for-Windows-with-Linux"></a>
331
+</p><a name="Cross-compilation-for-Windows-with-Linux-1"></a>
332
+<h2 class="section"><a href="platform.html#toc-Cross-compilation-for-Windows-with-Linux-1">4.3 Cross compilation for Windows with Linux</a></h2>
333
+
334
+<p>You must use the MinGW cross compilation tools available at
335
+<a href="http://www.mingw.org/">http://www.mingw.org/</a>.
336
+</p>
337
+<p>Then configure FFmpeg with the following options:
338
+</p><div class="example">
339
+<pre class="example">./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
340
+</pre></div>
341
+<p>(you can change the cross-prefix according to the prefix chosen for the
342
+MinGW tools).
343
+</p>
344
+<p>Then you can easily test FFmpeg with <a href="http://www.winehq.com/">Wine</a>.
345
+</p>
346
+<a name="Compilation-under-Cygwin"></a>
347
+<h2 class="section"><a href="platform.html#toc-Compilation-under-Cygwin">4.4 Compilation under Cygwin</a></h2>
348
+
349
+<p>Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
350
+llrint() in its C library.
351
+</p>
352
+<p>Install your Cygwin with all the &quot;Base&quot; packages, plus the
353
+following &quot;Devel&quot; ones:
354
+</p><div class="example">
355
+<pre class="example">binutils, gcc4-core, make, git, mingw-runtime, texinfo
356
+</pre></div>
357
+
358
+<p>In order to run FATE you will also need the following &quot;Utils&quot; packages:
359
+</p><div class="example">
360
+<pre class="example">diffutils
361
+</pre></div>
362
+
363
+<p>If you want to build FFmpeg with additional libraries, download Cygwin
364
+&quot;Devel&quot; packages for Ogg and Vorbis from any Cygwin packages repository:
365
+</p><div class="example">
366
+<pre class="example">libogg-devel, libvorbis-devel
367
+</pre></div>
368
+
369
+<p>These library packages are only available from
370
+<a href="http://sourceware.org/cygwinports/">Cygwin Ports</a>:
371
+</p>
372
+<div class="example">
373
+<pre class="example">yasm, libSDL-devel, libgsm-devel, libmp3lame-devel,
374
+speex-devel, libtheora-devel, libxvidcore-devel
375
+</pre></div>
376
+
377
+<p>The recommendation for x264 is to build it from source, as it evolves too
378
+quickly for Cygwin Ports to be up to date.
379
+</p>
380
+<a name="Crosscompilation-for-Windows-under-Cygwin"></a>
381
+<h2 class="section"><a href="platform.html#toc-Crosscompilation-for-Windows-under-Cygwin">4.5 Crosscompilation for Windows under Cygwin</a></h2>
382
+
383
+<p>With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
384
+</p>
385
+<p>Just install your Cygwin as explained before, plus these additional
386
+&quot;Devel&quot; packages:
387
+</p><div class="example">
388
+<pre class="example">gcc-mingw-core, mingw-runtime, mingw-zlib
389
+</pre></div>
390
+
391
+<p>and add some special flags to your configure invocation.
392
+</p>
393
+<p>For a static build run
394
+</p><div class="example">
395
+<pre class="example">./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
396
+</pre></div>
397
+
398
+<p>and for a build with shared libraries
399
+</p><div class="example">
400
+<pre class="example">./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
401
+</pre></div>
402
+
403
+    </div>
404
+  </body>
405
+</html>
406
+

+ 23
- 0
Common/ffmpeg/doc/style.min.css
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 393
- 0
Common/ffmpeg/presets/ffprobe.xsd ファイルの表示

@@ -0,0 +1,393 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
4
+    targetNamespace="http://www.ffmpeg.org/schema/ffprobe"
5
+    xmlns:ffprobe="http://www.ffmpeg.org/schema/ffprobe">
6
+
7
+    <xsd:element name="ffprobe" type="ffprobe:ffprobeType"/>
8
+
9
+    <xsd:complexType name="ffprobeType">
10
+        <xsd:sequence>
11
+            <xsd:element name="program_version"  type="ffprobe:programVersionType"  minOccurs="0" maxOccurs="1" />
12
+            <xsd:element name="library_versions" type="ffprobe:libraryVersionsType" minOccurs="0" maxOccurs="1" />
13
+            <xsd:element name="pixel_formats"    type="ffprobe:pixelFormatsType"    minOccurs="0" maxOccurs="1" />
14
+            <xsd:element name="packets"  type="ffprobe:packetsType" minOccurs="0" maxOccurs="1" />
15
+            <xsd:element name="frames"   type="ffprobe:framesType"  minOccurs="0" maxOccurs="1" />
16
+            <xsd:element name="packets_and_frames" type="ffprobe:packetsAndFramesType" minOccurs="0" maxOccurs="1" />
17
+            <xsd:element name="programs" type="ffprobe:programsType" minOccurs="0" maxOccurs="1" />
18
+            <xsd:element name="streams"  type="ffprobe:streamsType" minOccurs="0" maxOccurs="1" />
19
+            <xsd:element name="chapters" type="ffprobe:chaptersType" minOccurs="0" maxOccurs="1" />
20
+            <xsd:element name="format"   type="ffprobe:formatType"  minOccurs="0" maxOccurs="1" />
21
+            <xsd:element name="error"    type="ffprobe:errorType"   minOccurs="0" maxOccurs="1" />
22
+        </xsd:sequence>
23
+    </xsd:complexType>
24
+
25
+    <xsd:complexType name="packetsType">
26
+        <xsd:sequence>
27
+            <xsd:element name="packet" type="ffprobe:packetType" minOccurs="0" maxOccurs="unbounded"/>
28
+        </xsd:sequence>
29
+    </xsd:complexType>
30
+
31
+    <xsd:complexType name="framesType">
32
+        <xsd:sequence>
33
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
34
+                <xsd:element name="frame" type="ffprobe:frameType" minOccurs="0" maxOccurs="unbounded"/>
35
+                <xsd:element name="subtitle" type="ffprobe:subtitleType" minOccurs="0" maxOccurs="unbounded"/>
36
+            </xsd:choice>
37
+        </xsd:sequence>
38
+    </xsd:complexType>
39
+
40
+    <xsd:complexType name="packetsAndFramesType">
41
+        <xsd:sequence>
42
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
43
+                <xsd:element name="packet" type="ffprobe:packetType" minOccurs="0" maxOccurs="unbounded"/>
44
+                <xsd:element name="frame" type="ffprobe:frameType" minOccurs="0" maxOccurs="unbounded"/>
45
+                <xsd:element name="subtitle" type="ffprobe:subtitleType" minOccurs="0" maxOccurs="unbounded"/>
46
+            </xsd:choice>
47
+        </xsd:sequence>
48
+    </xsd:complexType>
49
+
50
+    <xsd:complexType name="packetType">
51
+      <xsd:sequence>
52
+        <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
53
+        <xsd:element name="side_data_list" type="ffprobe:packetSideDataListType"   minOccurs="0" maxOccurs="1" />
54
+      </xsd:sequence>
55
+
56
+      <xsd:attribute name="codec_type"    type="xsd:string" use="required" />
57
+      <xsd:attribute name="stream_index"  type="xsd:int" use="required" />
58
+      <xsd:attribute name="pts"           type="xsd:long"  />
59
+      <xsd:attribute name="pts_time"      type="xsd:float" />
60
+      <xsd:attribute name="dts"           type="xsd:long"  />
61
+      <xsd:attribute name="dts_time"      type="xsd:float" />
62
+      <xsd:attribute name="duration"      type="xsd:long"  />
63
+      <xsd:attribute name="duration_time" type="xsd:float" />
64
+      <xsd:attribute name="convergence_duration"      type="xsd:long"  />
65
+      <xsd:attribute name="convergence_duration_time" type="xsd:float" />
66
+      <xsd:attribute name="size"          type="xsd:long" use="required" />
67
+      <xsd:attribute name="pos"           type="xsd:long"  />
68
+      <xsd:attribute name="flags"         type="xsd:string" use="required" />
69
+      <xsd:attribute name="data"          type="xsd:string" />
70
+      <xsd:attribute name="data_hash"     type="xsd:string" />
71
+    </xsd:complexType>
72
+
73
+    <xsd:complexType name="packetSideDataListType">
74
+        <xsd:sequence>
75
+            <xsd:element name="side_data" type="ffprobe:packetSideDataType" minOccurs="1" maxOccurs="unbounded"/>
76
+        </xsd:sequence>
77
+    </xsd:complexType>
78
+    <xsd:complexType name="packetSideDataType">
79
+        <xsd:attribute name="side_data_type"              type="xsd:string"/>
80
+        <xsd:attribute name="side_data_size"              type="xsd:int"   />
81
+    </xsd:complexType>
82
+
83
+    <xsd:complexType name="frameType">
84
+      <xsd:sequence>
85
+            <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
86
+            <xsd:element name="logs" type="ffprobe:logsType" minOccurs="0" maxOccurs="1"/>
87
+            <xsd:element name="side_data_list" type="ffprobe:frameSideDataListType"   minOccurs="0" maxOccurs="1" />
88
+      </xsd:sequence>
89
+
90
+      <xsd:attribute name="media_type"    type="xsd:string" use="required"/>
91
+      <xsd:attribute name="stream_index"  type="xsd:int"  />
92
+      <xsd:attribute name="key_frame"     type="xsd:int"    use="required"/>
93
+      <xsd:attribute name="pts"           type="xsd:long" />
94
+      <xsd:attribute name="pts_time"      type="xsd:float"/>
95
+      <xsd:attribute name="pkt_pts"       type="xsd:long" />
96
+      <xsd:attribute name="pkt_pts_time"  type="xsd:float"/>
97
+      <xsd:attribute name="pkt_dts"       type="xsd:long" />
98
+      <xsd:attribute name="pkt_dts_time"  type="xsd:float"/>
99
+      <xsd:attribute name="best_effort_timestamp"      type="xsd:long" />
100
+      <xsd:attribute name="best_effort_timestamp_time" type="xsd:float" />
101
+      <xsd:attribute name="pkt_duration"  type="xsd:long" />
102
+      <xsd:attribute name="pkt_duration_time" type="xsd:float"/>
103
+      <xsd:attribute name="pkt_pos"       type="xsd:long" />
104
+      <xsd:attribute name="pkt_size"      type="xsd:int" />
105
+
106
+      <!-- audio attributes -->
107
+      <xsd:attribute name="sample_fmt"             type="xsd:string"/>
108
+      <xsd:attribute name="nb_samples"             type="xsd:long"  />
109
+      <xsd:attribute name="channels"               type="xsd:int"   />
110
+      <xsd:attribute name="channel_layout"         type="xsd:string"/>
111
+
112
+      <!-- video attributes -->
113
+      <xsd:attribute name="width"                  type="xsd:long"  />
114
+      <xsd:attribute name="height"                 type="xsd:long"  />
115
+      <xsd:attribute name="pix_fmt"                type="xsd:string"/>
116
+      <xsd:attribute name="sample_aspect_ratio"    type="xsd:string"/>
117
+      <xsd:attribute name="pict_type"              type="xsd:string"/>
118
+      <xsd:attribute name="coded_picture_number"   type="xsd:long"  />
119
+      <xsd:attribute name="display_picture_number" type="xsd:long"  />
120
+      <xsd:attribute name="interlaced_frame"       type="xsd:int"   />
121
+      <xsd:attribute name="top_field_first"        type="xsd:int"   />
122
+      <xsd:attribute name="repeat_pict"            type="xsd:int"   />
123
+      <xsd:attribute name="color_range"            type="xsd:string"/>
124
+      <xsd:attribute name="color_space"            type="xsd:string"/>
125
+      <xsd:attribute name="color_primaries"        type="xsd:string"/>
126
+      <xsd:attribute name="color_transfer"         type="xsd:string"/>
127
+      <xsd:attribute name="chroma_location"        type="xsd:string"/>
128
+    </xsd:complexType>
129
+
130
+    <xsd:complexType name="logsType">
131
+        <xsd:sequence>
132
+            <xsd:element name="log" type="ffprobe:logType" minOccurs="1" maxOccurs="unbounded"/>
133
+        </xsd:sequence>
134
+    </xsd:complexType>
135
+    <xsd:complexType name="logType">
136
+        <xsd:attribute name="context"                     type="xsd:string"/>
137
+        <xsd:attribute name="level"                       type="xsd:int"   />
138
+        <xsd:attribute name="category"                    type="xsd:int"   />
139
+        <xsd:attribute name="parent_context"              type="xsd:string"/>
140
+        <xsd:attribute name="parent_category"             type="xsd:int"   />
141
+        <xsd:attribute name="message"                     type="xsd:string"/>
142
+    </xsd:complexType>
143
+
144
+    <xsd:complexType name="frameSideDataListType">
145
+        <xsd:sequence>
146
+            <xsd:element name="side_data" type="ffprobe:frameSideDataType" minOccurs="1" maxOccurs="unbounded"/>
147
+        </xsd:sequence>
148
+    </xsd:complexType>
149
+    <xsd:complexType name="frameSideDataType">
150
+        <xsd:sequence>
151
+            <xsd:element name="timecodes" type="ffprobe:frameSideDataTimecodeList" minOccurs="0" maxOccurs="1"/>
152
+        </xsd:sequence>
153
+
154
+        <xsd:attribute name="side_data_type"              type="xsd:string"/>
155
+        <xsd:attribute name="side_data_size"              type="xsd:int"   />
156
+        <xsd:attribute name="timecode"                    type="xsd:string"/>
157
+    </xsd:complexType>
158
+
159
+    <xsd:complexType name="frameSideDataTimecodeList">
160
+        <xsd:sequence>
161
+            <xsd:element name="timecode" type="ffprobe:frameSideDataTimecodeType" minOccurs="0" maxOccurs="unbounded"/>
162
+        </xsd:sequence>
163
+    </xsd:complexType>
164
+
165
+    <xsd:complexType name="frameSideDataTimecodeType">
166
+        <xsd:attribute name="value"              type="xsd:string"/>
167
+    </xsd:complexType>
168
+
169
+    <xsd:complexType name="subtitleType">
170
+      <xsd:attribute name="media_type"         type="xsd:string" fixed="subtitle" use="required"/>
171
+      <xsd:attribute name="pts"                type="xsd:long" />
172
+      <xsd:attribute name="pts_time"           type="xsd:float"/>
173
+      <xsd:attribute name="format"             type="xsd:int"  />
174
+      <xsd:attribute name="start_display_time" type="xsd:int"  />
175
+      <xsd:attribute name="end_display_time"   type="xsd:int"  />
176
+      <xsd:attribute name="num_rects"          type="xsd:int"  />
177
+    </xsd:complexType>
178
+
179
+    <xsd:complexType name="streamsType">
180
+        <xsd:sequence>
181
+            <xsd:element name="stream" type="ffprobe:streamType" minOccurs="0" maxOccurs="unbounded"/>
182
+        </xsd:sequence>
183
+    </xsd:complexType>
184
+
185
+    <xsd:complexType name="programsType">
186
+        <xsd:sequence>
187
+            <xsd:element name="program" type="ffprobe:programType" minOccurs="0" maxOccurs="unbounded"/>
188
+        </xsd:sequence>
189
+    </xsd:complexType>
190
+
191
+    <xsd:complexType name="streamDispositionType">
192
+      <xsd:attribute name="default"          type="xsd:int" use="required" />
193
+      <xsd:attribute name="dub"              type="xsd:int" use="required" />
194
+      <xsd:attribute name="original"         type="xsd:int" use="required" />
195
+      <xsd:attribute name="comment"          type="xsd:int" use="required" />
196
+      <xsd:attribute name="lyrics"           type="xsd:int" use="required" />
197
+      <xsd:attribute name="karaoke"          type="xsd:int" use="required" />
198
+      <xsd:attribute name="forced"           type="xsd:int" use="required" />
199
+      <xsd:attribute name="hearing_impaired" type="xsd:int" use="required" />
200
+      <xsd:attribute name="visual_impaired"  type="xsd:int" use="required" />
201
+      <xsd:attribute name="clean_effects"    type="xsd:int" use="required" />
202
+      <xsd:attribute name="attached_pic"     type="xsd:int" use="required" />
203
+      <xsd:attribute name="timed_thumbnails" type="xsd:int" use="required" />
204
+    </xsd:complexType>
205
+
206
+    <xsd:complexType name="streamType">
207
+      <xsd:sequence>
208
+        <xsd:element name="disposition" type="ffprobe:streamDispositionType" minOccurs="0" maxOccurs="1"/>
209
+        <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
210
+        <xsd:element name="side_data_list" type="ffprobe:packetSideDataListType"   minOccurs="0" maxOccurs="1" />
211
+      </xsd:sequence>
212
+
213
+      <xsd:attribute name="index"            type="xsd:int" use="required"/>
214
+      <xsd:attribute name="codec_name"       type="xsd:string" />
215
+      <xsd:attribute name="codec_long_name"  type="xsd:string" />
216
+      <xsd:attribute name="profile"          type="xsd:string" />
217
+      <xsd:attribute name="codec_type"       type="xsd:string" />
218
+      <xsd:attribute name="codec_time_base"  type="xsd:string" use="required"/>
219
+      <xsd:attribute name="codec_tag"        type="xsd:string" use="required"/>
220
+      <xsd:attribute name="codec_tag_string" type="xsd:string" use="required"/>
221
+      <xsd:attribute name="extradata"        type="xsd:string" />
222
+      <xsd:attribute name="extradata_hash"   type="xsd:string" />
223
+
224
+      <!-- video attributes -->
225
+      <xsd:attribute name="width"                type="xsd:int"/>
226
+      <xsd:attribute name="height"               type="xsd:int"/>
227
+      <xsd:attribute name="coded_width"          type="xsd:int"/>
228
+      <xsd:attribute name="coded_height"         type="xsd:int"/>
229
+      <xsd:attribute name="has_b_frames"         type="xsd:int"/>
230
+      <xsd:attribute name="sample_aspect_ratio"  type="xsd:string"/>
231
+      <xsd:attribute name="display_aspect_ratio" type="xsd:string"/>
232
+      <xsd:attribute name="pix_fmt"              type="xsd:string"/>
233
+      <xsd:attribute name="level"                type="xsd:int"/>
234
+      <xsd:attribute name="color_range"          type="xsd:string"/>
235
+      <xsd:attribute name="color_space"          type="xsd:string"/>
236
+      <xsd:attribute name="color_transfer"       type="xsd:string"/>
237
+      <xsd:attribute name="color_primaries"      type="xsd:string"/>
238
+      <xsd:attribute name="chroma_location"      type="xsd:string"/>
239
+      <xsd:attribute name="field_order"          type="xsd:string"/>
240
+      <xsd:attribute name="timecode"             type="xsd:string"/>
241
+      <xsd:attribute name="refs"                 type="xsd:int"/>
242
+
243
+      <!-- audio attributes -->
244
+      <xsd:attribute name="sample_fmt"       type="xsd:string"/>
245
+      <xsd:attribute name="sample_rate"      type="xsd:int"/>
246
+      <xsd:attribute name="channels"         type="xsd:int"/>
247
+      <xsd:attribute name="channel_layout"   type="xsd:string"/>
248
+      <xsd:attribute name="bits_per_sample"  type="xsd:int"/>
249
+
250
+      <xsd:attribute name="id"               type="xsd:string"/>
251
+      <xsd:attribute name="r_frame_rate"     type="xsd:string" use="required"/>
252
+      <xsd:attribute name="avg_frame_rate"   type="xsd:string" use="required"/>
253
+      <xsd:attribute name="time_base"        type="xsd:string" use="required"/>
254
+      <xsd:attribute name="start_pts"        type="xsd:long"/>
255
+      <xsd:attribute name="start_time"       type="xsd:float"/>
256
+      <xsd:attribute name="duration_ts"      type="xsd:long"/>
257
+      <xsd:attribute name="duration"         type="xsd:float"/>
258
+      <xsd:attribute name="bit_rate"         type="xsd:int"/>
259
+      <xsd:attribute name="max_bit_rate"     type="xsd:int"/>
260
+      <xsd:attribute name="bits_per_raw_sample" type="xsd:int"/>
261
+      <xsd:attribute name="nb_frames"        type="xsd:int"/>
262
+      <xsd:attribute name="nb_read_frames"   type="xsd:int"/>
263
+      <xsd:attribute name="nb_read_packets"  type="xsd:int"/>
264
+    </xsd:complexType>
265
+
266
+    <xsd:complexType name="programType">
267
+      <xsd:sequence>
268
+        <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
269
+        <xsd:element name="streams" type="ffprobe:streamsType" minOccurs="0" maxOccurs="1"/>
270
+      </xsd:sequence>
271
+
272
+      <xsd:attribute name="program_id"           type="xsd:int"    use="required"/>
273
+      <xsd:attribute name="program_num"          type="xsd:int"    use="required"/>
274
+      <xsd:attribute name="nb_streams"           type="xsd:int"    use="required"/>
275
+      <xsd:attribute name="start_time"           type="xsd:float"/>
276
+      <xsd:attribute name="start_pts"            type="xsd:long"/>
277
+      <xsd:attribute name="end_time"             type="xsd:float"/>
278
+      <xsd:attribute name="end_pts"              type="xsd:long"/>
279
+      <xsd:attribute name="pmt_pid"              type="xsd:int"    use="required"/>
280
+      <xsd:attribute name="pcr_pid"              type="xsd:int"    use="required"/>
281
+    </xsd:complexType>
282
+
283
+    <xsd:complexType name="formatType">
284
+      <xsd:sequence>
285
+        <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
286
+      </xsd:sequence>
287
+
288
+      <xsd:attribute name="filename"         type="xsd:string" use="required"/>
289
+      <xsd:attribute name="nb_streams"       type="xsd:int"    use="required"/>
290
+      <xsd:attribute name="nb_programs"      type="xsd:int"    use="required"/>
291
+      <xsd:attribute name="format_name"      type="xsd:string" use="required"/>
292
+      <xsd:attribute name="format_long_name" type="xsd:string"/>
293
+      <xsd:attribute name="start_time"       type="xsd:float"/>
294
+      <xsd:attribute name="duration"         type="xsd:float"/>
295
+      <xsd:attribute name="size"             type="xsd:long"/>
296
+      <xsd:attribute name="bit_rate"         type="xsd:long"/>
297
+      <xsd:attribute name="probe_score"      type="xsd:int"/>
298
+    </xsd:complexType>
299
+
300
+    <xsd:complexType name="tagType">
301
+      <xsd:attribute name="key"   type="xsd:string" use="required"/>
302
+      <xsd:attribute name="value" type="xsd:string" use="required"/>
303
+    </xsd:complexType>
304
+
305
+    <xsd:complexType name="errorType">
306
+      <xsd:attribute name="code"   type="xsd:int"    use="required"/>
307
+      <xsd:attribute name="string" type="xsd:string" use="required"/>
308
+    </xsd:complexType>
309
+
310
+    <xsd:complexType name="programVersionType">
311
+      <xsd:attribute name="version"          type="xsd:string" use="required"/>
312
+      <xsd:attribute name="copyright"        type="xsd:string" use="required"/>
313
+      <xsd:attribute name="build_date"       type="xsd:string"/>
314
+      <xsd:attribute name="build_time"       type="xsd:string"/>
315
+      <xsd:attribute name="compiler_ident"   type="xsd:string" use="required"/>
316
+      <xsd:attribute name="configuration"    type="xsd:string" use="required"/>
317
+    </xsd:complexType>
318
+
319
+    <xsd:complexType name="chaptersType">
320
+      <xsd:sequence>
321
+        <xsd:element name="chapter" type="ffprobe:chapterType" minOccurs="0" maxOccurs="unbounded"/>
322
+      </xsd:sequence>
323
+    </xsd:complexType>
324
+
325
+    <xsd:complexType name="chapterType">
326
+      <xsd:sequence>
327
+        <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
328
+      </xsd:sequence>
329
+
330
+      <xsd:attribute name="id"         type="xsd:int" use="required"/>
331
+      <xsd:attribute name="time_base"  type="xsd:string" use="required"/>
332
+      <xsd:attribute name="start"      type="xsd:int" use="required"/>
333
+      <xsd:attribute name="start_time" type="xsd:float"/>
334
+      <xsd:attribute name="end"        type="xsd:int" use="required"/>
335
+      <xsd:attribute name="end_time"   type="xsd:float" use="required"/>
336
+    </xsd:complexType>
337
+
338
+    <xsd:complexType name="libraryVersionType">
339
+      <xsd:attribute name="name"        type="xsd:string" use="required"/>
340
+      <xsd:attribute name="major"       type="xsd:int"    use="required"/>
341
+      <xsd:attribute name="minor"       type="xsd:int"    use="required"/>
342
+      <xsd:attribute name="micro"       type="xsd:int"    use="required"/>
343
+      <xsd:attribute name="version"     type="xsd:int"    use="required"/>
344
+      <xsd:attribute name="ident"       type="xsd:string" use="required"/>
345
+    </xsd:complexType>
346
+
347
+    <xsd:complexType name="libraryVersionsType">
348
+        <xsd:sequence>
349
+          <xsd:element name="library_version" type="ffprobe:libraryVersionType" minOccurs="0" maxOccurs="unbounded"/>
350
+        </xsd:sequence>
351
+    </xsd:complexType>
352
+
353
+    <xsd:complexType name="pixelFormatFlagsType">
354
+      <xsd:attribute name="big_endian" type="xsd:int" use="required"/>
355
+      <xsd:attribute name="palette"    type="xsd:int" use="required"/>
356
+      <xsd:attribute name="bitstream"  type="xsd:int" use="required"/>
357
+      <xsd:attribute name="hwaccel"    type="xsd:int" use="required"/>
358
+      <xsd:attribute name="planar"     type="xsd:int" use="required"/>
359
+      <xsd:attribute name="rgb"        type="xsd:int" use="required"/>
360
+      <xsd:attribute name="pseudopal"  type="xsd:int" use="required"/>
361
+      <xsd:attribute name="alpha"      type="xsd:int" use="required"/>
362
+    </xsd:complexType>
363
+
364
+    <xsd:complexType name="pixelFormatComponentType">
365
+      <xsd:attribute name="index"      type="xsd:int" use="required"/>
366
+      <xsd:attribute name="bit_depth"  type="xsd:int" use="required"/>
367
+    </xsd:complexType>
368
+
369
+    <xsd:complexType name="pixelFormatComponentsType">
370
+      <xsd:sequence>
371
+        <xsd:element name="component" type="ffprobe:pixelFormatComponentType" minOccurs="0" maxOccurs="unbounded"/>
372
+      </xsd:sequence>
373
+    </xsd:complexType>
374
+
375
+    <xsd:complexType name="pixelFormatType">
376
+      <xsd:sequence>
377
+        <xsd:element name="flags" type="ffprobe:pixelFormatFlagsType" minOccurs="0" maxOccurs="1"/>
378
+        <xsd:element name="components" type="ffprobe:pixelFormatComponentsType" minOccurs="0" maxOccurs="1"/>
379
+      </xsd:sequence>
380
+
381
+      <xsd:attribute name="name"                type="xsd:string" use="required"/>
382
+      <xsd:attribute name="nb_components"       type="xsd:int"    use="required"/>
383
+      <xsd:attribute name="log2_chroma_w"       type="xsd:int"/>
384
+      <xsd:attribute name="log2_chroma_h"       type="xsd:int"/>
385
+      <xsd:attribute name="bits_per_pixel"      type="xsd:int"/>
386
+    </xsd:complexType>
387
+
388
+    <xsd:complexType name="pixelFormatsType">
389
+      <xsd:sequence>
390
+        <xsd:element name="pixel_format" type="ffprobe:pixelFormatType" minOccurs="0" maxOccurs="unbounded"/>
391
+      </xsd:sequence>
392
+    </xsd:complexType>
393
+</xsd:schema>

+ 19
- 0
Common/ffmpeg/presets/libvpx-1080p.ffpreset ファイルの表示

@@ -0,0 +1,19 @@
1
+vcodec=libvpx
2
+
3
+g=120
4
+lag-in-frames=16
5
+deadline=good
6
+cpu-used=0
7
+vprofile=1
8
+qmax=51
9
+qmin=11
10
+slices=4
11
+b=2M
12
+
13
+#ignored unless using -pass 2
14
+maxrate=24M
15
+minrate=100k
16
+auto-alt-ref=1
17
+arnr-maxframes=7
18
+arnr-strength=5
19
+arnr-type=centered

+ 19
- 0
Common/ffmpeg/presets/libvpx-1080p50_60.ffpreset ファイルの表示

@@ -0,0 +1,19 @@
1
+vcodec=libvpx
2
+
3
+g=120
4
+lag-in-frames=25
5
+deadline=good
6
+cpu-used=0
7
+vprofile=1
8
+qmax=51
9
+qmin=11
10
+slices=4
11
+b=2M
12
+
13
+#ignored unless using -pass 2
14
+maxrate=24M
15
+minrate=100k
16
+auto-alt-ref=1
17
+arnr-maxframes=7
18
+arnr-strength=5
19
+arnr-type=centered

+ 18
- 0
Common/ffmpeg/presets/libvpx-360p.ffpreset ファイルの表示

@@ -0,0 +1,18 @@
1
+vcodec=libvpx
2
+
3
+g=120
4
+lag-in-frames=16
5
+deadline=good
6
+cpu-used=0
7
+vprofile=0
8
+qmax=63
9
+qmin=0
10
+b=768k
11
+
12
+#ignored unless using -pass 2
13
+maxrate=1.5M
14
+minrate=40k
15
+auto-alt-ref=1
16
+arnr-maxframes=7
17
+arnr-strength=5
18
+arnr-type=centered

+ 19
- 0
Common/ffmpeg/presets/libvpx-720p.ffpreset ファイルの表示

@@ -0,0 +1,19 @@
1
+vcodec=libvpx
2
+
3
+g=120
4
+lag-in-frames=16
5
+deadline=good
6
+cpu-used=0
7
+vprofile=0
8
+qmax=51
9
+qmin=11
10
+slices=4
11
+b=2M
12
+
13
+#ignored unless using -pass 2
14
+maxrate=24M
15
+minrate=100k
16
+auto-alt-ref=1
17
+arnr-maxframes=7
18
+arnr-strength=5
19
+arnr-type=centered

+ 19
- 0
Common/ffmpeg/presets/libvpx-720p50_60.ffpreset ファイルの表示

@@ -0,0 +1,19 @@
1
+vcodec=libvpx
2
+
3
+g=120
4
+lag-in-frames=25
5
+deadline=good
6
+cpu-used=0
7
+vprofile=0
8
+qmax=51
9
+qmin=11
10
+slices=4
11
+b=2M
12
+
13
+#ignored unless using -pass 2
14
+maxrate=24M
15
+minrate=100k
16
+auto-alt-ref=1
17
+arnr-maxframes=7
18
+arnr-strength=5
19
+arnr-type=centered

+ 52
- 0
Common/log4net.config ファイルの表示

@@ -0,0 +1,52 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+  <log4net>
3
+    <!--错误日志类-->
4
+    <logger name="logerror">
5
+      <!--日志类的名字-->
6
+      <level value="ALL" />
7
+      <!--定义记录的日志级别-->
8
+      <appender-ref ref="ErrorAppender" />
9
+      <!--记录到哪个介质中去-->
10
+    </logger>
11
+    <!--信息日志类-->
12
+    <logger name="loginfo">
13
+      <level value="ALL" />
14
+      <appender-ref ref="InfoAppender" />
15
+    </logger>
16
+    <!--错误日志附加介质-->
17
+    <appender name="ErrorAppender" type="log4net.Appender.RollingFileAppender">
18
+      <!-- name属性指定其名称,type则是log4net.Appender命名空间的一个类的名称,意思是,指定使用哪种介质-->
19
+      <param name="File" value="Log\\LogError\\" />
20
+      <!--日志输出到exe程序这个相对目录下-->
21
+      <param name="AppendToFile" value="true" />
22
+      <!--输出的日志不会覆盖以前的信息-->
23
+      <param name="MaxSizeRollBackups" value="100" />
24
+      <!--备份文件的个数-->
25
+      <param name="MaxFileSize" value="10240" />
26
+      <!--当个日志文件的最大大小-->
27
+      <param name="StaticLogFileName" value="false" />
28
+      <!--是否使用静态文件名-->
29
+      <param name="DatePattern" value="yyyyMMdd&quot;.htm&quot;" />
30
+      <!--日志文件名-->
31
+      <param name="RollingStyle" value="Date" />
32
+      <!--文件创建的方式,这里是以Date方式创建-->
33
+      <!--错误日志布局-->
34
+      <layout type="log4net.Layout.PatternLayout">
35
+        <param name="ConversionPattern" value="&lt;HR COLOR=red&gt;%n异常时间:%d [%t] &lt;BR&gt;%n异常级别:%-5p &lt;BR&gt;%n异 常 类:%c [%x] &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;"  />
36
+      </layout>
37
+    </appender>
38
+    <!--信息日志附加介质-->
39
+    <appender name="InfoAppender" type="log4net.Appender.RollingFileAppender">
40
+      <param name="File" value="Log\\LogInfo\\" />
41
+      <param name="AppendToFile" value="true" />
42
+      <param name="MaxFileSize" value="10240" />
43
+      <param name="MaxSizeRollBackups" value="100" />
44
+      <param name="StaticLogFileName" value="false" />
45
+      <param name="DatePattern" value="yyyyMMdd&quot;.htm&quot;" />
46
+      <param name="RollingStyle" value="Date" />
47
+      <!--信息日志布局-->
48
+      <layout type="log4net.Layout.PatternLayout">
49
+        <param name="ConversionPattern" value="&lt;HR COLOR=blue&gt;%n日志时间:%d [%t] &lt;BR&gt;%n日志级别:%-5p &lt;BR&gt;%n日 志 类:%c [%x] &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;"  />
50
+      </layout>
51
+    </appender>
52
+  </log4net>

+ 10
- 0
Common/packages.config ファイルの表示

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<packages>
3
+  <package id="AForge" version="2.2.5" targetFramework="net452" />
4
+  <package id="AForge.Controls" version="2.2.5" targetFramework="net452" />
5
+  <package id="AForge.Imaging" version="2.2.5" targetFramework="net452" />
6
+  <package id="AForge.Math" version="2.2.5" targetFramework="net452" />
7
+  <package id="AForge.Video" version="2.2.5" targetFramework="net452" />
8
+  <package id="AForge.Video.DirectShow" version="2.2.5" targetFramework="net452" />
9
+  <package id="VisioForge.DotNet.Core.TRIAL" version="12.0.56" targetFramework="net452" />
10
+</packages>

+ 508
- 0
Common/system/BlackboardNew.cs ファイルの表示

@@ -0,0 +1,508 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Windows;
5
+using System.Windows.Controls;
6
+using System.Windows.Ink;
7
+using System.Windows.Input;
8
+using System.Windows.Media;
9
+
10
+namespace Common.system
11
+{
12
+    internal enum ZPenType : byte
13
+    {
14
+        Pen = 1,
15
+        Erase = 2
16
+    };
17
+    /// <summary>
18
+    /// 画板线模型
19
+    /// </summary>
20
+    internal class ZBBPage
21
+    {
22
+        /// <summary>
23
+        /// 线
24
+        /// </summary>
25
+        public List<ZBBPageStep> lines { get; set; }
26
+        /// <summary>
27
+        /// 历史记录
28
+        /// </summary>
29
+        public List<ZBBPageStep> lines_histoty { get; set; }
30
+        /// <summary>
31
+        /// 画板模型
32
+        /// </summary>
33
+        public ZBBPage()
34
+        {
35
+            lines = new List<ZBBPageStep>();
36
+            lines_histoty = new List<ZBBPageStep>();
37
+        }
38
+    }
39
+
40
+    internal class ZBBPageStep
41
+    {
42
+        public StrokeCollection lines_curr { get; set; }
43
+        public StrokeCollection lines_add { get; set; }
44
+        public StrokeCollection lines_remove { get; set; }
45
+
46
+        public ZBBPageStep()
47
+        {
48
+            lines_curr = new StrokeCollection();
49
+            lines_add = new StrokeCollection();
50
+            lines_remove = new StrokeCollection();
51
+        }
52
+    }
53
+    public class BlackboardNew
54
+    {
55
+        private InkCanvas m_canvas;
56
+
57
+        //private ZPenType type = ZPenType.Pen;
58
+        /// <summary>
59
+        /// 当前页索引
60
+        /// </summary>
61
+        private int pagenum = 0;
62
+        /// <summary>
63
+        /// 橡皮大小
64
+        /// </summary>
65
+        private readonly int erasesize = 64;
66
+        /// <summary>
67
+        /// 笔粗细
68
+        /// </summary>
69
+        private readonly int pensize = 3;
70
+        /// <summary>
71
+        /// 是否在进行撤销恢复操作
72
+        /// </summary>
73
+        private int undoOrRedo = 0;
74
+        /// <summary>
75
+        /// 笔颜色
76
+        /// </summary>
77
+        private Color pencolor;
78
+        /// <summary>
79
+        /// 所有画板线
80
+        /// </summary>
81
+        private readonly List<ZBBPage> strokes_page_all = new List<ZBBPage>();
82
+
83
+        // 添加这个变量是因为在用橡皮擦时 一次操作会触发多次StrokesChanged回掉 这里是把多次回掉合并在一起
84
+        private ZBBPageStep step = null;
85
+
86
+        public BlackboardNew(InkCanvas canvas)
87
+        {
88
+            init(canvas, Colors.White);
89
+        }
90
+
91
+        public BlackboardNew(InkCanvas canvas, Color _pencolor)
92
+        {
93
+            init(canvas, _pencolor);
94
+        }
95
+
96
+        private DrawingAttributes drawingAttributes;
97
+        private void init(InkCanvas canvas, Color _pencolor)
98
+        {
99
+            m_canvas = canvas;
100
+            pencolor = _pencolor;
101
+            ZBBPage page = new ZBBPage();
102
+            page.lines.Add(new ZBBPageStep());
103
+            strokes_page_all.Add(page);
104
+            if (canvas != null)
105
+            {
106
+                canvas.EditingMode = InkCanvasEditingMode.Ink;
107
+                drawingAttributes = new DrawingAttributes();
108
+                canvas.DefaultDrawingAttributes = drawingAttributes;
109
+                drawingAttributes.Width = pensize;
110
+                drawingAttributes.Height = pensize;
111
+                drawingAttributes.Color = pencolor;
112
+                drawingAttributes.FitToCurve = true;
113
+                drawingAttributes.IgnorePressure = false;
114
+                canvas.Strokes.StrokesChanged += Strokes_StrokesChanged;
115
+                canvas.StrokeCollected += Canvas_StrokeCollected;
116
+                canvas.StrokeErasing += Canvas_StrokeErasing;
117
+                canvas.StrokeErased += Canvas_StrokeErased;
118
+                canvas.MouseUp += Canvas_MouseUp;
119
+            }
120
+        }
121
+
122
+        private void Canvas_StrokeErasing(object sender, InkCanvasStrokeErasingEventArgs e)
123
+        {
124
+            undoOrRedo = 0;
125
+        }
126
+
127
+        private void Canvas_StrokeErased(object sender, RoutedEventArgs e)
128
+        {
129
+        }
130
+
131
+        private void Canvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e)
132
+        {
133
+        }
134
+
135
+        private void Canvas_MouseUp(object sender, MouseButtonEventArgs e)
136
+        {
137
+            if (step != null)
138
+            {
139
+                if (pagenum + 1 > strokes_page_all.Count)
140
+                {
141
+                    ZBBPage pagetemp = new ZBBPage();
142
+                    pagetemp.lines.Add(new ZBBPageStep());
143
+                    strokes_page_all.Add(pagetemp);
144
+                }
145
+
146
+                try
147
+                {
148
+                    ZBBPage page = strokes_page_all[pagenum];
149
+                    if (page != null)
150
+                    {
151
+                        step.lines_curr.Add(m_canvas.Strokes);
152
+                        page.lines.Add(step);
153
+                        step = null;
154
+                    }
155
+                }
156
+                catch (Exception ex)
157
+                {
158
+                    if (strokes_page_all != null)
159
+                    {
160
+                        if (strokes_page_all.Count == 0)
161
+                        {
162
+                            ZBBPage pagetemp = new ZBBPage();
163
+                            pagetemp.lines.Add(new ZBBPageStep());
164
+                            strokes_page_all.Add(pagetemp);
165
+                        }
166
+                    }
167
+                    LogHelper.WriteErrLog("【画板】(Canvas_MouseUp)添加失败,strokes_page_all为0," + ex.Message, ex);
168
+                }
169
+            }
170
+        }
171
+
172
+        private void Strokes_StrokesChanged(object sender, StrokeCollectionChangedEventArgs e)
173
+        {
174
+            if (undoOrRedo > 0)
175
+            {
176
+                undoOrRedo -= 1;
177
+                return;
178
+            }
179
+
180
+            if (step == null)
181
+            {
182
+                step = new ZBBPageStep();
183
+            }
184
+
185
+            // 笔模式
186
+            if (e.Added.Count > 0 && e.Removed.Count == 0)
187
+            {
188
+                step.lines_add.Add(e.Added);
189
+            }
190
+            // 橡皮模式 会多次进入回掉
191
+            else if (e.Removed.Count > 0)
192
+            {
193
+                step.lines_add.Add(e.Added);
194
+                for (int i = 0; i < e.Removed.Count; i++)
195
+                {
196
+                    Stroke removeItem = e.Removed[i];
197
+                    if (step.lines_add.Contains(removeItem))
198
+                    {
199
+                        step.lines_add.Remove(removeItem);
200
+                    }
201
+                    else
202
+                    {
203
+                        step.lines_remove.Add(removeItem);
204
+                    }
205
+                }
206
+            }
207
+        }
208
+
209
+        // public方法 笔
210
+        public void change_pen(Color _color)
211
+        {
212
+            //this.type = ZPenType.Pen;
213
+            DrawingAttributes drawingAttributes = new DrawingAttributes();
214
+            m_canvas.DefaultDrawingAttributes = drawingAttributes;
215
+            drawingAttributes.Color = _color;
216
+            drawingAttributes.Width = pensize;
217
+            drawingAttributes.Height = pensize;
218
+            drawingAttributes.FitToCurve = true;
219
+            drawingAttributes.IgnorePressure = false;
220
+            m_canvas.EditingMode = InkCanvasEditingMode.Ink;
221
+        }
222
+
223
+        // 橡皮
224
+        public void change_erase()
225
+        {
226
+            //this.type = ZPenType.Erase;
227
+            m_canvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
228
+            m_canvas.EraserShape = new EllipseStylusShape(erasesize, erasesize, 0);
229
+        }
230
+
231
+        // 撤销
232
+        public void undo()
233
+        {
234
+            ZBBPage page = strokes_page_all[pagenum];
235
+
236
+            if (page != null && m_canvas.Strokes.Count > 0 && page.lines.Count > 1)
237
+            {
238
+                ZBBPageStep last = page.lines.Last();
239
+                page.lines.Remove(last);
240
+                page.lines_histoty.Add(last);
241
+                if (page.lines.Last().lines_curr.Count > 0)
242
+                {
243
+                    undoOrRedo = 2;
244
+                }
245
+                else
246
+                {
247
+                    undoOrRedo = 1;
248
+                }
249
+
250
+                m_canvas.Strokes.Clear();
251
+                m_canvas.Strokes.Add(page.lines.Last().lines_curr);
252
+            }
253
+        }
254
+
255
+        // 恢复
256
+        public void redo()
257
+        {
258
+            ZBBPage page = strokes_page_all[pagenum];
259
+            if (page != null && page.lines_histoty.Count > 0)
260
+            {
261
+                ZBBPageStep line = page.lines_histoty[page.lines_histoty.Count - 1];
262
+
263
+                page.lines.Add(line);
264
+                page.lines_histoty.Remove(line);
265
+                if (page.lines.Last().lines_curr.Count > 0)
266
+                {
267
+                    undoOrRedo = 2;
268
+                }
269
+                else
270
+                {
271
+                    undoOrRedo = 1;
272
+                }
273
+                m_canvas.Strokes.Clear();
274
+                m_canvas.Strokes.Add(page.lines.Last().lines_curr);
275
+            }
276
+        }
277
+
278
+        // 清空
279
+        public void clear()
280
+        {
281
+
282
+            //ZBBPage page = new ZBBPage();
283
+            //page.lines.Add(new ZBBPageStep());
284
+            //page.lines = new List<ZBBPageStep>();
285
+            //page.lines_histoty = new List<ZBBPageStep>();
286
+            //strokes_page_all.Add(page);
287
+
288
+            strokes_page_all.Clear();
289
+            m_canvas.Strokes.Clear();
290
+            //for (int i=0;i< strokes_page_all.Count;i++)
291
+            //{
292
+            //    ZBBPage page = strokes_page_all[pagenum];
293
+            //    if (page != null)
294
+            //    {
295
+            //        m_canvas.Strokes.Clear();
296
+            //        page.lines_histoty.Clear();
297
+            //        page.lines.Clear();
298
+            //        page.lines.Add(new ZBBPageStep());
299
+            //    }
300
+            //}
301
+
302
+
303
+        }
304
+        /// <summary>
305
+        /// 翻页
306
+        /// </summary>
307
+        /// <param name="mpagenum"></param>
308
+        public void changepage(int mpagenum)
309
+        {
310
+            if (pagenum != mpagenum)
311
+            {
312
+                pagenum = mpagenum;
313
+                //新增页
314
+                if (pagenum >= strokes_page_all.Count)
315
+                {
316
+                    int numadd = pagenum - strokes_page_all.Count + 1;
317
+                    for (int i = 0; i < numadd; i++)
318
+                    {
319
+                        ZBBPage pagetemp = new ZBBPage();
320
+                        pagetemp.lines.Add(new ZBBPageStep());
321
+                        strokes_page_all.Add(pagetemp);
322
+                    }
323
+                }
324
+
325
+                ZBBPage page = strokes_page_all[pagenum];
326
+                if (page != null && page.lines.Count > 0)
327
+                {
328
+                    if (page.lines.Last().lines_curr.Count > 0)
329
+                    {
330
+                        undoOrRedo += 1;
331
+                    }
332
+                    if (m_canvas.Strokes.Count > 0)
333
+                    {
334
+                        undoOrRedo += 1;
335
+                        m_canvas.Strokes.Clear();
336
+                    }
337
+                    //StrokeCollection strokes = new StrokeCollection();
338
+                    StylusPointCollection stylusPoints = new StylusPointCollection();
339
+                    //System.Windows.Input.StylusPointDescription stylusPointDescription = new StylusPointDescription();
340
+                    StylusPoint stylusPoint = new StylusPoint
341
+                    {
342
+                        X = 580,
343
+                        Y = 212
344
+                    };
345
+                    stylusPoints.Add(stylusPoint);
346
+                    Stroke stroke = new Stroke(stylusPoints);
347
+
348
+                    stylusPoint.X = 581;
349
+                    stylusPoint.Y = 213;
350
+                    stylusPoints.Add(stylusPoint);
351
+                    stroke = new Stroke(stylusPoints);
352
+                    page.lines.Last().lines_curr.Add(stroke);
353
+                    m_canvas.Strokes.Add(page.lines.Last().lines_curr);
354
+                }
355
+            }
356
+        }
357
+
358
+        private StylusPointCollection stylusPoints = new StylusPointCollection();
359
+        private StylusPoint stylusPoint = new StylusPoint();
360
+        private Stroke stroke;
361
+        private bool isFirst = true;
362
+        public void changepages(double _x, double _y, bool _new, Color _color, int _size, int i)
363
+        {
364
+            if (_new)
365
+            {
366
+                if (stroke != null && stroke.StylusPoints.Count > 1)
367
+                {
368
+                    isFirst = true;
369
+                    try
370
+                    {
371
+                        if(strokes_page_all.Count<=i)
372
+                        {
373
+                            ZBBPage pagetemp = new ZBBPage();
374
+                            pagetemp.lines.Add(new ZBBPageStep());
375
+                            strokes_page_all.Add(pagetemp);
376
+                        }
377
+                        strokes_page_all[i].lines.Last().lines_curr.Add(stroke);
378
+                    }
379
+                    catch (Exception ex)
380
+                    {
381
+                        if (strokes_page_all != null)
382
+                        {
383
+                            if (strokes_page_all.Count == 0)
384
+                            {
385
+                                ZBBPage pagetemp = new ZBBPage();
386
+                                pagetemp.lines.Add(new ZBBPageStep());
387
+                                strokes_page_all.Add(pagetemp);
388
+                            }
389
+                        }
390
+                        LogHelper.WriteErrLog("【画板】(changepages)添加失败,strokes_page_all为0," + ex.Message, ex);
391
+                    }
392
+                }
393
+                stylusPoints = new StylusPointCollection();
394
+                stylusPoint = new StylusPoint();
395
+                stroke = null;
396
+            }
397
+            else
398
+            {
399
+                if (isFirst)
400
+                {
401
+                    stylusPoint.X = _x;
402
+                    stylusPoint.Y = _y;
403
+                    stylusPoints.Add(stylusPoint);
404
+                    if (stylusPoints.Count > 1)
405
+                    {
406
+                        stroke = new Stroke(stylusPoints);
407
+                        drawingAttributes = new DrawingAttributes
408
+                        {
409
+                            Color = _color,
410
+                            Width = _size * 4.5,
411
+                            Height = _size * 4.5,
412
+                            FitToCurve = true,
413
+                            IgnorePressure = false
414
+                        };
415
+                        stroke.DrawingAttributes = drawingAttributes;
416
+                        m_canvas.Strokes.Add(stroke);
417
+                        isFirst = false;
418
+                    }
419
+                }
420
+                else
421
+                {
422
+                    if (m_canvas.Strokes.Count > 0)
423
+                    {
424
+                        stylusPoint.X = _x;
425
+                        stylusPoint.Y = _y;
426
+                        stylusPoints.Add(stylusPoint);
427
+                        stroke = new Stroke(stylusPoints);
428
+                        drawingAttributes = new DrawingAttributes
429
+                        {
430
+                            Color = _color,
431
+                            Width = _size * 4.5,
432
+                            Height = _size * 4.5,
433
+                            FitToCurve = true,
434
+                            IgnorePressure = false
435
+                        };
436
+                        stroke.DrawingAttributes = drawingAttributes;
437
+                        m_canvas.Strokes[m_canvas.Strokes.Count - 1] = stroke;
438
+                    }
439
+                }
440
+            }
441
+        }
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+
458
+        //public void changepages(double _x, double _y, bool _new, Color _color, int _size, int i)
459
+        //{
460
+        //    try
461
+        //    {
462
+        //        if (_new)
463
+        //        {
464
+        //            if (stroke != null && stroke.StylusPoints.Count > 1)
465
+        //            {
466
+        //                drawingAttributes = new DrawingAttributes();
467
+        //                //m_canvas.DefaultDrawingAttributes = drawingAttributes;
468
+        //                drawingAttributes.Color = _color;
469
+        //                drawingAttributes.Width = _size * 5;
470
+        //                drawingAttributes.Height = _size * 5;
471
+        //                drawingAttributes.FitToCurve = true;
472
+        //                drawingAttributes.IgnorePressure = false;
473
+
474
+        //                stroke.DrawingAttributes = drawingAttributes;
475
+        //                //m_canvas.DefaultDrawingAttributes= drawingAttributes;
476
+
477
+        //                m_canvas.Strokes.Add(stroke);
478
+        //                strokes_page_all[i].lines.Last().lines_curr.Add(stroke);
479
+
480
+        //                //int currCount= strokes_page_all[i].lines.Last().lines_curr.Count;
481
+        //                //if (currCount > 0)
482
+        //                //{
483
+        //                //    strokes_page_all[i].lines.Last().lines_curr[currCount - 1] = stroke;
484
+        //                //}
485
+        //                stroke = null;
486
+        //            }
487
+        //            stylusPoints = new StylusPointCollection();
488
+        //            stylusPoint = new StylusPoint();
489
+        //            //stroke = new Stroke(stylusPoints);
490
+        //            //stroke = null;
491
+        //        }
492
+        //        else
493
+        //        {
494
+        //            //stylusPoints = new StylusPointCollection();
495
+        //            //stylusPoint = new StylusPoint();
496
+        //            stylusPoint.X = _x;
497
+        //            stylusPoint.Y = _y;
498
+        //            stylusPoints.Add(stylusPoint);
499
+        //            stroke = new Stroke(stylusPoints);
500
+        //        }
501
+        //    }
502
+        //    catch (Exception ex)
503
+        //    {
504
+        //        LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(changepages)点阵比书写报错:" + ex.Message, ex);
505
+        //    }
506
+        //}
507
+    }
508
+}

+ 701
- 0
Common/system/CLeopardZip.cs ファイルの表示

@@ -0,0 +1,701 @@
1
+using ICSharpCode.SharpZipLib.Checksums;
2
+using ICSharpCode.SharpZipLib.Zip;
3
+
4
+using System;
5
+using System.Collections.Generic;
6
+using System.IO;
7
+
8
+namespace Common.system
9
+{
10
+    /// <summary>   
11
+    /// 适用与ZIP压缩   
12
+    /// </summary>   
13
+    public class ZipHelper
14
+    {
15
+        #region 压缩
16
+
17
+        /// <summary>   
18
+        /// 递归压缩文件夹的内部方法   
19
+        /// </summary>   
20
+        /// <param name="folderToZip">要压缩的文件夹路径</param>   
21
+        /// <param name="zipStream">压缩输出流</param>   
22
+        /// <param name="parentFolderName">此文件夹的上级文件夹</param>   
23
+        /// <returns></returns>   
24
+        private static bool ZipDirectory(string folderToZip, ZipOutputStream zipStream, string parentFolderName)
25
+        {
26
+            bool result = true;
27
+            string[] folders, files;
28
+            ZipEntry ent = null;
29
+            FileStream fs = null;
30
+            Crc32 crc = new Crc32();
31
+
32
+            try
33
+            {
34
+                ent = new ZipEntry(Path.Combine(parentFolderName, Path.GetFileName(folderToZip) + "/"));
35
+                zipStream.PutNextEntry(ent);
36
+                zipStream.Flush();
37
+
38
+                files = Directory.GetFiles(folderToZip);
39
+                foreach (string file in files)
40
+                {
41
+                    fs = File.OpenRead(file);
42
+
43
+                    byte[] buffer = new byte[fs.Length];
44
+                    fs.Read(buffer, 0, buffer.Length);
45
+                    ent = new ZipEntry(Path.Combine(parentFolderName, Path.GetFileName(folderToZip) + "/" + Path.GetFileName(file)))
46
+                    {
47
+                        DateTime = DateTime.Now,
48
+                        Size = fs.Length
49
+                    };
50
+
51
+                    fs.Close();
52
+
53
+                    crc.Reset();
54
+                    crc.Update(buffer);
55
+
56
+                    ent.Crc = crc.Value;
57
+                    zipStream.PutNextEntry(ent);
58
+                    zipStream.Write(buffer, 0, buffer.Length);
59
+                }
60
+
61
+            }
62
+            catch
63
+            {
64
+                result = false;
65
+            }
66
+            finally
67
+            {
68
+                if (fs != null)
69
+                {
70
+                    fs.Close();
71
+                    fs.Dispose();
72
+                }
73
+                if (ent != null)
74
+                {
75
+                    ent = null;
76
+                }
77
+                GC.Collect();
78
+                GC.Collect(1);
79
+            }
80
+
81
+            folders = Directory.GetDirectories(folderToZip);
82
+            foreach (string folder in folders)
83
+            {
84
+                if (!ZipDirectory(folder, zipStream, folderToZip))
85
+                {
86
+                    return false;
87
+                }
88
+            }
89
+
90
+            return result;
91
+        }
92
+
93
+        /// <summary>   
94
+        /// 压缩文件夹    
95
+        /// </summary>   
96
+        /// <param name="folderToZip">要压缩的文件夹路径</param>   
97
+        /// <param name="zipedFile">压缩文件完整路径</param>   
98
+        /// <param name="password">密码</param>   
99
+        /// <returns>是否压缩成功</returns>   
100
+        public static bool ZipDirectory(string folderToZip, string zipedFile, string password)
101
+        {
102
+            bool result = false;
103
+            if (!Directory.Exists(folderToZip))
104
+            {
105
+                return result;
106
+            }
107
+
108
+            ZipOutputStream zipStream = new ZipOutputStream(File.Create(zipedFile));
109
+            zipStream.SetLevel(6);
110
+            if (!string.IsNullOrEmpty(password))
111
+            {
112
+                zipStream.Password = password;
113
+            }
114
+
115
+            result = ZipDirectory(folderToZip, zipStream, "");
116
+
117
+            zipStream.Finish();
118
+            zipStream.Close();
119
+
120
+            return result;
121
+        }
122
+
123
+        /// <summary>   
124
+        /// 压缩文件夹   
125
+        /// </summary>   
126
+        /// <param name="folderToZip">要压缩的文件夹路径</param>   
127
+        /// <param name="zipedFile">压缩文件完整路径</param>   
128
+        /// <returns>是否压缩成功</returns>   
129
+        public static bool ZipDirectory(string folderToZip, string zipedFile)
130
+        {
131
+            bool result = ZipDirectory(folderToZip, zipedFile, null);
132
+            return result;
133
+        }
134
+
135
+        /// <summary>   
136
+        /// 压缩文件   
137
+        /// </summary>   
138
+        /// <param name="fileToZip">要压缩的文件全名</param>   
139
+        /// <param name="zipedFile">压缩后的文件名</param>   
140
+        /// <param name="password">密码</param>   
141
+        /// <returns>压缩结果</returns>   
142
+        public static bool ZipFile(string fileToZip, string zipedFile, string password)
143
+        {
144
+            bool result = true;
145
+            ZipOutputStream zipStream = null;
146
+            FileStream fs = null;
147
+            ZipEntry ent = null;
148
+
149
+            if (!File.Exists(fileToZip))
150
+            {
151
+                return false;
152
+            }
153
+
154
+            try
155
+            {
156
+                fs = File.OpenRead(fileToZip);
157
+                byte[] buffer = new byte[fs.Length];
158
+                fs.Read(buffer, 0, buffer.Length);
159
+                fs.Close();
160
+
161
+                fs = File.Create(zipedFile);
162
+                zipStream = new ZipOutputStream(fs);
163
+                if (!string.IsNullOrEmpty(password))
164
+                {
165
+                    zipStream.Password = password;
166
+                }
167
+
168
+                ent = new ZipEntry(Path.GetFileName(fileToZip));
169
+                zipStream.PutNextEntry(ent);
170
+                zipStream.SetLevel(6);
171
+
172
+                zipStream.Write(buffer, 0, buffer.Length);
173
+
174
+            }
175
+            catch
176
+            {
177
+                result = false;
178
+            }
179
+            finally
180
+            {
181
+                if (zipStream != null)
182
+                {
183
+                    zipStream.Finish();
184
+                    zipStream.Close();
185
+                }
186
+                if (ent != null)
187
+                {
188
+                    ent = null;
189
+                }
190
+                if (fs != null)
191
+                {
192
+                    fs.Close();
193
+                    fs.Dispose();
194
+                }
195
+            }
196
+            GC.Collect();
197
+            GC.Collect(1);
198
+
199
+            return result;
200
+        }
201
+
202
+        /// <summary>   
203
+        /// 压缩文件   
204
+        /// </summary>   
205
+        /// <param name="fileToZip">要压缩的文件全名</param>   
206
+        /// <param name="zipedFile">压缩后的文件名</param>   
207
+        /// <returns>压缩结果</returns>   
208
+        public static bool ZipFile(string fileToZip, string zipedFile)
209
+        {
210
+            bool result = ZipFile(fileToZip, zipedFile, null);
211
+            return result;
212
+        }
213
+
214
+        /// <summary>   
215
+        /// 压缩文件或文件夹   
216
+        /// </summary>   
217
+        /// <param name="fileToZip">要压缩的路径</param>   
218
+        /// <param name="zipedFile">压缩后的文件名</param>   
219
+        /// <param name="password">密码</param>   
220
+        /// <returns>压缩结果</returns>   
221
+        public static bool Zip(string fileToZip, string zipedFile, string password)
222
+        {
223
+            bool result = false;
224
+            if (Directory.Exists(fileToZip))
225
+            {
226
+                result = ZipDirectory(fileToZip, zipedFile, password);
227
+            }
228
+            else if (File.Exists(fileToZip))
229
+            {
230
+                result = ZipFile(fileToZip, zipedFile, password);
231
+            }
232
+
233
+            return result;
234
+        }
235
+
236
+        /// <summary>   
237
+        /// 压缩文件或文件夹   
238
+        /// </summary>   
239
+        /// <param name="fileToZip">要压缩的路径</param>   
240
+        /// <param name="zipedFile">压缩后的文件名</param>   
241
+        /// <returns>压缩结果</returns>   
242
+        public static bool Zip(string fileToZip, string zipedFile)
243
+        {
244
+            bool result = Zip(fileToZip, zipedFile, null);
245
+            return result;
246
+
247
+        }
248
+
249
+        #endregion
250
+
251
+        #region 解压
252
+
253
+        /// <summary>   
254
+        /// 解压功能(解压压缩文件到指定目录)   
255
+        /// </summary>   
256
+        /// <param name="fileToUnZip">待解压的文件</param>   
257
+        /// <param name="zipedFolder">指定解压目标目录</param>   
258
+        /// <param name="password">密码</param>   
259
+        /// <returns>解压结果</returns>   
260
+        public static bool UnZip(string fileToUnZip, string zipedFolder, string password)
261
+        {
262
+            bool result = true;
263
+            FileStream fs = null;
264
+            ZipInputStream zipStream = null;
265
+            ZipEntry ent = null;
266
+            string fileName;
267
+
268
+            if (!File.Exists(fileToUnZip))
269
+            {
270
+                return false;
271
+            }
272
+
273
+            if (!Directory.Exists(zipedFolder))
274
+            {
275
+                Directory.CreateDirectory(zipedFolder);
276
+            }
277
+
278
+            try
279
+            {
280
+                zipStream = new ZipInputStream(File.OpenRead(fileToUnZip));
281
+                if (!string.IsNullOrEmpty(password))
282
+                {
283
+                    zipStream.Password = password;
284
+                }
285
+
286
+                while ((ent = zipStream.GetNextEntry()) != null)
287
+                {
288
+                    if (!string.IsNullOrEmpty(ent.Name))
289
+                    {
290
+                        fileName = Path.Combine(zipedFolder, ent.Name);
291
+                        fileName = fileName.Replace('/', '\\');//change by Mr.HopeGi   
292
+
293
+                        if (fileName.EndsWith("\\"))
294
+                        {
295
+                            Directory.CreateDirectory(fileName);
296
+                            continue;
297
+                        }
298
+
299
+                        fs = File.Create(fileName);
300
+                        int size = 2048;
301
+                        byte[] data = new byte[size];
302
+                        while (true)
303
+                        {
304
+                            size = zipStream.Read(data, 0, data.Length);
305
+                            if (size > 0)
306
+                            {
307
+                                fs.Write(data, 0, data.Length);
308
+                            }
309
+                            else
310
+                            {
311
+                                break;
312
+                            }
313
+                        }
314
+                    }
315
+                }
316
+            }
317
+            catch
318
+            {
319
+                result = false;
320
+            }
321
+            finally
322
+            {
323
+                if (fs != null)
324
+                {
325
+                    fs.Close();
326
+                    fs.Dispose();
327
+                }
328
+                if (zipStream != null)
329
+                {
330
+                    zipStream.Close();
331
+                    zipStream.Dispose();
332
+                }
333
+                if (ent != null)
334
+                {
335
+                    ent = null;
336
+                }
337
+                GC.Collect();
338
+                GC.Collect(1);
339
+            }
340
+            return result;
341
+        }
342
+
343
+        /// <summary>   
344
+        /// 解压功能(解压压缩文件到指定目录)   
345
+        /// </summary>   
346
+        /// <param name="fileToUnZip">待解压的文件</param>   
347
+        /// <param name="zipedFolder">指定解压目标目录</param>   
348
+        /// <returns>解压结果</returns>   
349
+        public static bool UnZip(string fileToUnZip, string zipedFolder)
350
+        {
351
+            bool result = NewUnZip(fileToUnZip, zipedFolder, null, true);
352
+            return result;
353
+        }
354
+
355
+        /// <summary>
356
+        /// ZIP:解压一个zip文件
357
+        /// </summary>
358
+        /// <param name="ZipFile">需要解压的Zip文件(绝对路径)</param>
359
+        /// <param name="TargetDirectory">解压到的目录</param>
360
+        /// <param name="Password">解压密码</param>
361
+        /// <param name="OverWrite">是否覆盖已存在的文件</param>
362
+        public static bool NewUnZip(string ZipFile, string TargetDirectory, string Password, bool OverWrite = true)
363
+        {
364
+            try
365
+            {
366
+
367
+                //如果解压到的目录不存在,则报错
368
+                if (!System.IO.Directory.Exists(TargetDirectory))
369
+                {
370
+                    throw new System.IO.FileNotFoundException("指定的目录: " + TargetDirectory + " 不存在!");
371
+                }
372
+                //目录结尾
373
+                if (!TargetDirectory.EndsWith("\\")) { TargetDirectory = TargetDirectory + "\\"; }
374
+
375
+                using (ZipInputStream zipfiles = new ZipInputStream(File.OpenRead(ZipFile)))
376
+                {
377
+                    zipfiles.Password = Password;
378
+                    ZipEntry theEntry;
379
+
380
+                    while ((theEntry = zipfiles.GetNextEntry()) != null)
381
+                    {
382
+                        string directoryName = "";
383
+                        string pathToZip = "";
384
+                        pathToZip = theEntry.Name;
385
+
386
+                        if (pathToZip != "")
387
+                        {
388
+                            directoryName = Path.GetDirectoryName(pathToZip) + "\\";
389
+                        }
390
+
391
+                        string fileName = Path.GetFileName(pathToZip);
392
+
393
+                        Directory.CreateDirectory(TargetDirectory + directoryName);
394
+
395
+                        if (fileName != "")
396
+                        {
397
+                            if ((File.Exists(TargetDirectory + directoryName + fileName) && OverWrite) || (!File.Exists(TargetDirectory + directoryName + fileName)))
398
+                            {
399
+                                try
400
+                                {
401
+                                    using (FileStream streamWriter = File.Create(TargetDirectory + directoryName + fileName))
402
+                                    {
403
+                                        int size = 2048;
404
+                                        byte[] data = new byte[2048];
405
+                                        while (true)
406
+                                        {
407
+                                            size = zipfiles.Read(data, 0, data.Length);
408
+
409
+                                            if (size > 0)
410
+                                            {
411
+                                                streamWriter.Write(data, 0, size);
412
+                                            }
413
+                                            else
414
+                                            {
415
+                                                break;
416
+                                            }
417
+                                        }
418
+                                        streamWriter.Close();
419
+                                    }
420
+                                }
421
+                                catch (Exception ex)
422
+                                {
423
+                                    string message = ex.Message;
424
+                                    //解压出错//若文件无损坏则可能为无法覆盖文件
425
+                                }
426
+                            }
427
+                        }
428
+                    }
429
+
430
+                    zipfiles.Close();
431
+                }
432
+                return true;
433
+            }
434
+            catch (Exception)
435
+            {
436
+                return false;
437
+            }
438
+        }
439
+        #endregion
440
+
441
+
442
+        #region 压缩文件
443
+        /// <summary>    
444
+        /// 压缩文件    
445
+        /// </summary>    
446
+        /// <param name="fileNames">要打包的文件列表</param>    
447
+        /// <param name="GzipFileName">目标文件名</param>    
448
+        /// <param name="CompressionLevel">压缩品质级别(0~9)</param>    
449
+        /// <param name="deleteFile">是否删除原文件</param>  
450
+        public static void CompressFile(List<FileInfo> fileNames, string GzipFileName, int CompressionLevel, bool deleteFile)
451
+        {
452
+            ZipOutputStream s = new ZipOutputStream(File.Create(GzipFileName));
453
+            try
454
+            {
455
+                s.SetLevel(CompressionLevel);   //0 - store only to 9 - means best compression    
456
+                foreach (FileInfo file in fileNames)
457
+                {
458
+                    FileStream fs = null;
459
+                    try
460
+                    {
461
+                        fs = file.Open(FileMode.Open, FileAccess.ReadWrite);
462
+                    }
463
+                    catch
464
+                    { continue; }
465
+                    //  方法二,将文件分批读入缓冲区    
466
+                    byte[] data = new byte[2048];
467
+                    int size = 2048;
468
+                    ZipEntry entry = new ZipEntry(Path.GetFileName(file.Name))
469
+                    {
470
+                        DateTime = (file.CreationTime > file.LastWriteTime ? file.LastWriteTime : file.CreationTime)
471
+                    };
472
+                    s.PutNextEntry(entry);
473
+                    while (true)
474
+                    {
475
+                        size = fs.Read(data, 0, size);
476
+                        if (size <= 0)
477
+                        {
478
+                            break;
479
+                        }
480
+
481
+                        s.Write(data, 0, size);
482
+                    }
483
+                    fs.Close();
484
+                    if (deleteFile)
485
+                    {
486
+                        file.Delete();
487
+                    }
488
+                }
489
+            }
490
+            finally
491
+            {
492
+                s.Finish();
493
+                s.Close();
494
+            }
495
+        }
496
+        public static void CompressFile(string fileName, string GzipFileName, int CompressionLevel, bool deleteFile)
497
+        {
498
+            ZipOutputStream s = new ZipOutputStream(File.Create(GzipFileName));
499
+            try
500
+            {
501
+                s.SetLevel(CompressionLevel);   //0 - store only to 9 - means best compression    
502
+                FileInfo file = new FileInfo(fileName);
503
+                FileStream fs = null;
504
+                try
505
+                {
506
+                    fs = file.Open(FileMode.Open, FileAccess.ReadWrite);
507
+                }
508
+                catch
509
+                { return; }
510
+                //  方法二,将文件分批读入缓冲区    
511
+                byte[] data = new byte[2048];
512
+                int size = 2048;
513
+                ZipEntry entry = new ZipEntry(Path.GetFileName(file.Name))
514
+                {
515
+                    DateTime = (file.CreationTime > file.LastWriteTime ? file.LastWriteTime : file.CreationTime)
516
+                };
517
+                s.PutNextEntry(entry);
518
+                while (true)
519
+                {
520
+                    size = fs.Read(data, 0, size);
521
+                    if (size <= 0)
522
+                    {
523
+                        break;
524
+                    }
525
+
526
+                    s.Write(data, 0, size);
527
+                }
528
+                fs.Close();
529
+                if (deleteFile)
530
+                {
531
+                    file.Delete();
532
+                }
533
+            }
534
+            finally
535
+            {
536
+                s.Finish();
537
+                s.Close();
538
+            }
539
+        }
540
+        /// <summary>    
541
+        /// 压缩文件夹    
542
+        /// </summary>    
543
+        /// <param name="dirPath">要打包的文件夹</param>    
544
+        /// <param name="GzipFileName">目标文件名</param>    
545
+        /// <param name="CompressionLevel">压缩品质级别(0~9)</param>    
546
+        /// <param name="deleteDir">是否删除原文件夹</param>  
547
+        public static void CompressDirectory(string dirPath, string GzipFileName, int CompressionLevel, bool deleteDir)
548
+        {
549
+            //压缩文件为空时默认与压缩文件夹同一级目录    
550
+            if (GzipFileName == string.Empty)
551
+            {
552
+                GzipFileName = dirPath.Substring(dirPath.LastIndexOf("//") + 1);
553
+                GzipFileName = dirPath.Substring(0, dirPath.LastIndexOf("//")) + "//" + GzipFileName + ".zip";
554
+            }
555
+            //if (Path.GetExtension(GzipFileName) != ".zip")  
556
+            //{  
557
+            //    GzipFileName = GzipFileName + ".zip";  
558
+            //}  
559
+            using (ZipOutputStream zipoutputstream = new ZipOutputStream(File.Create(GzipFileName)))
560
+            {
561
+                zipoutputstream.SetLevel(CompressionLevel);
562
+                Crc32 crc = new Crc32();
563
+                Dictionary<string, DateTime> fileList = GetAllFies(dirPath);
564
+                foreach (KeyValuePair<string, DateTime> item in fileList)
565
+                {
566
+                    FileStream fs = File.OpenRead(item.Key.ToString());
567
+                    byte[] buffer = new byte[fs.Length];
568
+                    fs.Read(buffer, 0, buffer.Length);
569
+                    ZipEntry entry = new ZipEntry(item.Key.Substring(dirPath.Length))
570
+                    {
571
+                        DateTime = item.Value,
572
+                        Size = fs.Length
573
+                    };
574
+                    fs.Close();
575
+                    crc.Reset();
576
+                    crc.Update(buffer);
577
+                    entry.Crc = crc.Value;
578
+                    zipoutputstream.PutNextEntry(entry);
579
+                    zipoutputstream.Write(buffer, 0, buffer.Length);
580
+                }
581
+            }
582
+            if (deleteDir)
583
+            {
584
+                Directory.Delete(dirPath, true);
585
+            }
586
+        }
587
+        /// <summary>    
588
+        /// 获取所有文件    
589
+        /// </summary>    
590
+        /// <returns></returns>    
591
+        private static Dictionary<string, DateTime> GetAllFies(string dir)
592
+        {
593
+            Dictionary<string, DateTime> FilesList = new Dictionary<string, DateTime>();
594
+            DirectoryInfo fileDire = new DirectoryInfo(dir);
595
+            if (!fileDire.Exists)
596
+            {
597
+                throw new System.IO.FileNotFoundException("目录:" + fileDire.FullName + "没有找到!");
598
+            }
599
+            GetAllDirFiles(fileDire, FilesList);
600
+            GetAllDirsFiles(fileDire.GetDirectories(), FilesList);
601
+            return FilesList;
602
+        }
603
+        /// <summary>    
604
+        /// 获取一个文件夹下的所有文件夹里的文件    
605
+        /// </summary>    
606
+        /// <param name="dirs"></param>    
607
+        /// <param name="filesList"></param>    
608
+        private static void GetAllDirsFiles(DirectoryInfo[] dirs, Dictionary<string, DateTime> filesList)
609
+        {
610
+            foreach (DirectoryInfo dir in dirs)
611
+            {
612
+                foreach (FileInfo file in dir.GetFiles("*.*"))
613
+                {
614
+                    filesList.Add(file.FullName, file.LastWriteTime);
615
+                }
616
+                GetAllDirsFiles(dir.GetDirectories(), filesList);
617
+            }
618
+        }
619
+        /// <summary>    
620
+        /// 获取一个文件夹下的文件    
621
+        /// </summary>    
622
+        /// <param name="dir">目录名称</param>    
623
+        /// <param name="filesList">文件列表HastTable</param>    
624
+        private static void GetAllDirFiles(DirectoryInfo dir, Dictionary<string, DateTime> filesList)
625
+        {
626
+            foreach (FileInfo file in dir.GetFiles("*.*"))
627
+            {
628
+                filesList.Add(file.FullName, file.LastWriteTime);
629
+            }
630
+        }
631
+        #endregion
632
+
633
+        #region 解压缩文件
634
+        /// <summary>    
635
+        /// 解压缩文件    
636
+        /// </summary>    
637
+        /// <param name="GzipFile">压缩包文件名</param>    
638
+        /// <param name="targetPath">解压缩目标路径</param>           
639
+        public static void Decompress(string GzipFile, string targetPath)
640
+        {
641
+            //string directoryName = Path.GetDirectoryName(targetPath + "//") + "//";    
642
+            string directoryName = targetPath;
643
+            if (!Directory.Exists(directoryName))
644
+            {
645
+                Directory.CreateDirectory(directoryName);//生成解压目录    
646
+            }
647
+
648
+            string CurrentDirectory = directoryName;
649
+            byte[] data = new byte[2048];
650
+            int size = 2048;
651
+            ZipEntry theEntry = null;
652
+            using (ZipInputStream s = new ZipInputStream(File.OpenRead(GzipFile)))
653
+            {
654
+                while ((theEntry = s.GetNextEntry()) != null)
655
+                {
656
+                    if (theEntry.IsDirectory)
657
+                    {// 该结点是目录    
658
+                        if (!Directory.Exists(CurrentDirectory + theEntry.Name))
659
+                        {
660
+                            Directory.CreateDirectory(CurrentDirectory + theEntry.Name);
661
+                        }
662
+                    }
663
+                    else
664
+                    {
665
+                        if (theEntry.Name != string.Empty)
666
+                        {
667
+                            //  检查多级目录是否存在  
668
+                            if (theEntry.Name.Contains("\\"))
669
+                            {
670
+                                string parentDirPath = theEntry.Name.Remove(theEntry.Name.LastIndexOf("\\") + 1);
671
+                                if (!Directory.Exists(parentDirPath))
672
+                                {
673
+                                    Directory.CreateDirectory(CurrentDirectory + parentDirPath);
674
+                                }
675
+                            }
676
+
677
+                            //解压文件到指定的目录    
678
+                            using (FileStream streamWriter = File.Create(CurrentDirectory + theEntry.Name))
679
+                            {
680
+                                while (true)
681
+                                {
682
+                                    size = s.Read(data, 0, data.Length);
683
+                                    if (size <= 0)
684
+                                    {
685
+                                        break;
686
+                                    }
687
+
688
+                                    streamWriter.Write(data, 0, size);
689
+                                }
690
+                                streamWriter.Close();
691
+                            }
692
+                        }
693
+                    }
694
+                }
695
+                s.Close();
696
+            }
697
+        }
698
+        #endregion
699
+
700
+    }
701
+}

+ 148
- 0
Common/system/CameraHelper.cs ファイルの表示

@@ -0,0 +1,148 @@
1
+using AForge.Controls;
2
+using AForge.Video.DirectShow;
3
+
4
+using System;
5
+using System.Drawing;
6
+using System.Drawing.Imaging;
7
+using System.IO;
8
+
9
+
10
+namespace Common.system
11
+{
12
+    public static class CameraHelper
13
+    {
14
+        private static FilterInfoCollection _cameraDevices;
15
+        private static VideoCaptureDevice div = null;
16
+        private static VideoSourcePlayer sourcePlayer = new VideoSourcePlayer();
17
+        private static bool _isDisplay = false;
18
+        //指示_isDisplay设置为true后,是否设置了其他的sourcePlayer,若未设置则_isDisplay重设为false
19
+        private static bool isSet = false;
20
+
21
+        /// <summary>
22
+        /// 获取或设置摄像头设备,无设备为null
23
+        /// </summary>
24
+        public static FilterInfoCollection CameraDevices
25
+        {
26
+            get => _cameraDevices;
27
+            set => _cameraDevices = value;
28
+        }
29
+        /// <summary>
30
+        /// 指示是否显示摄像头视频画面
31
+        /// 默认false
32
+        /// </summary>
33
+        public static bool IsDisplay
34
+        {
35
+            get => _isDisplay;
36
+            set => _isDisplay = value;
37
+        }
38
+        /// <summary>
39
+        /// 获取或设置VideoSourcePlayer控件,
40
+        /// 只有当IsDisplay设置为true时,该属性才可以设置成功
41
+        /// </summary>
42
+        public static VideoSourcePlayer SourcePlayer
43
+        {
44
+            get => sourcePlayer;
45
+            set
46
+            {
47
+                if (_isDisplay)
48
+                {
49
+                    sourcePlayer = value;
50
+                    isSet = true;
51
+                }
52
+
53
+            }
54
+        }
55
+        /// <summary>
56
+        /// 更新摄像头设备信息
57
+        /// </summary>
58
+        public static void UpdateCameraDevices()
59
+        {
60
+            _cameraDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
61
+        }
62
+        /// <summary>
63
+        /// 设置使用的摄像头设备
64
+        /// </summary>
65
+        /// <param name="index">设备在CameraDevices中的索引</param>
66
+        /// <returns><see cref="bool"/></returns>
67
+        public static bool SetCameraDevice(int index)
68
+        {
69
+            if (!isSet)
70
+            {
71
+                _isDisplay = false;
72
+            }
73
+            //无设备,返回false
74
+            if (_cameraDevices.Count <= 0 || index < 0)
75
+            {
76
+                return false;
77
+            }
78
+
79
+            if (index > _cameraDevices.Count - 1)
80
+            {
81
+                return false;
82
+            }
83
+            // 设定初始视频设备
84
+            div = new VideoCaptureDevice(_cameraDevices[index].MonikerString);
85
+            sourcePlayer.VideoSource = div;
86
+            div.Start();
87
+            sourcePlayer.Start();
88
+            return true;
89
+        }
90
+        /// <summary>
91
+        /// 截取一帧图像并保存
92
+        /// </summary>
93
+        /// <param name="filePath">图像保存路径</param>
94
+        /// <param name="fileName">保存的图像文件名</param>
95
+        /// <returns>如果保存成功,则返回完整路径,否则为 null</returns>
96
+        public static string CaptureImage(string filePath, string fileName = null)
97
+        {
98
+            if (sourcePlayer.VideoSource == null)
99
+            {
100
+                return null;
101
+            }
102
+
103
+            if (!Directory.Exists(filePath))
104
+            {
105
+                Directory.CreateDirectory(filePath);
106
+            }
107
+            try
108
+            {
109
+                Image bitmap = sourcePlayer.GetCurrentVideoFrame();
110
+                if (bitmap != null)
111
+                {
112
+                    if (fileName == null)
113
+                    {
114
+                        fileName = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
115
+                    }
116
+
117
+                    string fullPath = Path.Combine(filePath, fileName + "-cap.jpg");
118
+
119
+                    System.Drawing.Bitmap objNewPic = new System.Drawing.Bitmap(bitmap, 172, 124);//图片保存的大小尺寸  
120
+                    objNewPic.Save(fullPath, ImageFormat.Jpeg);
121
+                    //bitmap.Save(fullPath, ImageFormat.Jpeg);
122
+                    bitmap.Dispose();
123
+                    objNewPic.Dispose();
124
+                    return fullPath;
125
+                }
126
+                return null;
127
+            }
128
+            catch (Exception)
129
+            {
130
+
131
+                return null;
132
+            }
133
+        }
134
+        /// <summary>
135
+        /// 关闭摄像头设备
136
+        /// </summary>
137
+        public static void CloseDevice()
138
+        {
139
+            if (div != null && div.IsRunning)
140
+            {
141
+                sourcePlayer.Stop();
142
+                div.SignalToStop();
143
+                div = null;
144
+                _cameraDevices = null;
145
+            }
146
+        }
147
+    }
148
+}

+ 36
- 0
Common/system/DataConvertCommon.cs ファイルの表示

@@ -0,0 +1,36 @@
1
+namespace Common.system
2
+{
3
+    /// <summary>
4
+    /// 数据转换帮助类
5
+    /// 创建人:赵耀
6
+    /// 创建时间:2018年10月24日
7
+    /// </summary>
8
+    public class DataConvertCommon
9
+    {
10
+        /// <summary>
11
+        /// 父类向子类赋值
12
+        /// 创建人:赵耀
13
+        /// 创建时间:2018年10月24日
14
+        /// </summary>
15
+        /// <typeparam name="TParent">父类</typeparam>
16
+        /// <typeparam name="TChild">子类</typeparam>
17
+        /// <param name="parent">子数据</param>
18
+        /// <returns></returns>
19
+        public static TChild ParentClassCopy<TParent, TChild>(TParent parent) where TChild : TParent, new()
20
+        {
21
+            TChild child = new TChild();
22
+            System.Type ParentType = typeof(TParent);
23
+            System.Reflection.PropertyInfo[] Properties = ParentType.GetProperties();
24
+            foreach (System.Reflection.PropertyInfo Propertie in Properties)
25
+            {
26
+                //循环遍历属性
27
+                if (Propertie.CanRead && Propertie.CanWrite)
28
+                {
29
+                    //进行属性拷贝
30
+                    Propertie.SetValue(child, Propertie.GetValue(parent, null), null);
31
+                }
32
+            }
33
+            return child;
34
+        }
35
+    }
36
+}

+ 48
- 0
Common/system/DataProvider.cs ファイルの表示

@@ -0,0 +1,48 @@
1
+using System;
2
+using System.IO;
3
+using System.Security.Cryptography;
4
+using System.Text;
5
+
6
+namespace Common.system
7
+{
8
+    public class DataProvider
9
+    {
10
+        ///3DES解密   
11
+        public static string TripleDESDecrypt(string pToDecrypt, string sKey)
12
+        {
13
+            sKey = sKey.Substring(0, 24);
14
+            TripleDESCryptoServiceProvider des = new TripleDESCryptoServiceProvider
15
+            {
16
+                Mode = CipherMode.ECB,
17
+                Padding = PaddingMode.Zeros
18
+            };
19
+            byte[] inputByteArray = new byte[pToDecrypt.Length / 2];
20
+            for (int x = 0; x < pToDecrypt.Length / 2; x++)
21
+            {
22
+                int i = (Convert.ToInt32(pToDecrypt.Substring(x * 2, 2), 16));
23
+                inputByteArray[x] = (byte)i;
24
+            }
25
+
26
+            des.Key = ASCIIEncoding.ASCII.GetBytes(sKey);
27
+            des.IV = new byte[] { 0, 00, 00, 00, 00, 00, 00, 00, };
28
+            MemoryStream ms = new MemoryStream();
29
+            CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write);
30
+            cs.Write(inputByteArray, 0, inputByteArray.Length);
31
+            cs.FlushFinalBlock();
32
+
33
+            StringBuilder ret = new StringBuilder();
34
+
35
+            return System.Text.Encoding.Default.GetString(ms.ToArray()).Replace("\0", "");
36
+        }
37
+        /// <summary>
38
+        /// 返回一个时间戳到秒
39
+        /// </summary>
40
+        /// <returns></returns>
41
+        public static long TimestampTotalSeconds()
42
+        {
43
+            TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
44
+            long timestr = Convert.ToInt64(ts.TotalSeconds);
45
+            return timestr;
46
+        }
47
+    }
48
+}

+ 411
- 0
Common/system/DownloadManager.cs ファイルの表示

@@ -0,0 +1,411 @@
1
+using Common.Model;
2
+
3
+using System;
4
+using System.Collections.Generic;
5
+using System.IO;
6
+using System.Linq;
7
+using System.Threading;
8
+
9
+namespace Common.system
10
+{
11
+    /// <summary>
12
+    /// 下载方法
13
+    /// 创建人:赵耀
14
+    /// 创建时间:2018年10月30日
15
+    /// </summary>
16
+    public class DownloadManager
17
+    {
18
+        private long fromIndex = 0;//开始下载的位置
19
+        private bool isRun = false;//是否正在进行
20
+        private DownloadInfoModel dlInfo;
21
+
22
+        private List<DownloadService> dls = new List<DownloadService>();
23
+        /// <summary>
24
+        /// 开始下载
25
+        /// </summary>
26
+        public event Action OnStart;
27
+        /// <summary>
28
+        /// 停止下载
29
+        /// </summary>
30
+        public event Action OnStop;
31
+        /// <summary>
32
+        /// 下载进度
33
+        /// </summary>
34
+        public event Action<long, long, string> OnDownload;
35
+        /// <summary>
36
+        /// 下载完成
37
+        /// </summary>
38
+        public event Action<string> OnFinsh;
39
+        /// <summary>
40
+        /// 断开网络连接
41
+        /// </summary>
42
+        public event Action<string> OnDisconnect;
43
+
44
+        public DownloadManager(DownloadInfoModel dlInfo)
45
+        {
46
+            this.dlInfo = dlInfo;
47
+        }
48
+        /// <summary>
49
+        /// 暂停
50
+        /// </summary>
51
+        public void Stop()
52
+        {
53
+            isRun = false;
54
+            dls.ForEach(dl => dl.Stop());
55
+            OnStopHandler();
56
+        }
57
+        /// <summary>
58
+        /// 开始下载
59
+        /// </summary>
60
+        public void Start()
61
+        {
62
+            dlInfo.isReStart = false;
63
+            WorkStart();
64
+        }
65
+        /// <summary>
66
+        /// 重新下载
67
+        /// </summary>
68
+        public void ReStart()
69
+        {
70
+            dlInfo.isReStart = true;
71
+            WorkStart();
72
+        }
73
+        /// <summary>
74
+        /// 下载
75
+        /// </summary>
76
+        private void WorkStart()
77
+        {
78
+            new Action(() =>
79
+            {
80
+                if (dlInfo.isReStart)
81
+                {
82
+                    Stop();
83
+                }
84
+
85
+                while (dls.Where(dl => !dl.isStopped).Count() > 0)
86
+                {
87
+                    if (dlInfo.isReStart)
88
+                    {
89
+                        Thread.Sleep(100);
90
+                    }
91
+                    else
92
+                    {
93
+                        return;
94
+                    }
95
+                }
96
+
97
+                isRun = true;
98
+                OnStartHandler();
99
+                //首次任务或者不支持断点续传的进入
100
+                if (dlInfo.isNewTask || (!dlInfo.isNewTask && !dlInfo.IsSupportMultiThreading))
101
+                {
102
+                    try
103
+                    {
104
+                        //第一次请求获取一小块数据,根据返回的情况判断是否支持断点续传
105
+                        using (System.Net.WebResponse rsp = HttpHelper.Download(dlInfo.downloadUrlList[0], 0, 0, dlInfo.method))
106
+                        {
107
+
108
+                            //获取文件名,如果包含附件名称则取下附件,否则从url获取名称
109
+                            string Disposition = rsp.Headers["Content-Disposition"];
110
+                            try
111
+                            {
112
+                                if (Disposition != null)
113
+                                {
114
+                                    dlInfo.fileName = Disposition.Split('=')[1];
115
+                                }
116
+                                else
117
+                                {
118
+                                    dlInfo.fileName = Path.GetFileName(rsp.ResponseUri.AbsolutePath);
119
+                                }
120
+                            }
121
+                            catch (Exception)//无法获取文件名时  使用传入保存名称
122
+                            {
123
+                                dlInfo.fileName = dlInfo.saveFileName;
124
+                            }
125
+
126
+                            //默认给流总数
127
+                            dlInfo.count = rsp.ContentLength;
128
+                            //尝试获取 Content-Range 头部,不为空说明支持断点续传
129
+                            string contentRange = rsp.Headers["Content-Range"];
130
+                            if (contentRange != null)
131
+                            {
132
+                                //支持断点续传的话,就取range 这里的总数
133
+                                dlInfo.count = long.Parse(rsp.Headers["Content-Range"].Split('/')[1]);
134
+                                dlInfo.IsSupportMultiThreading = true;
135
+
136
+                                //生成一个临时文件名
137
+                                //var tempFileName = Convert.ToBase64String(Encoding.UTF8.GetBytes(dlInfo.fileName)).ToUpper();
138
+                                //tempFileName = tempFileName.Length > 32 ? tempFileName.Substring(0, 32) : tempFileName;
139
+                                //dlInfo.tempFileName = "test"; //tempFileName + DateTime.Now.ToString("yyyyMMddHHmmssfff");
140
+                                ///创建线程信息
141
+                                ///
142
+                                GetTaskInfo(dlInfo);
143
+
144
+                            }
145
+                            else
146
+                            {
147
+                                //不支持断点续传则一开始就直接读完整流
148
+                                Save(GetRealFileName(dlInfo), rsp.GetResponseStream());
149
+                                OnFineshHandler();
150
+                            }
151
+                        }
152
+                    }
153
+                    catch (Exception ex)
154
+                    {
155
+                        string ErrMessage = "【下载】(DownloadManager):" + ex.Message;
156
+                        LogHelper.WriteErrLog(ErrMessage, ex);
157
+                        OnDisconnectHandler();
158
+                        return;
159
+                    }
160
+                    dlInfo.isNewTask = false;
161
+                }
162
+                //如果支持断点续传采用这个
163
+                if (dlInfo.IsSupportMultiThreading)
164
+                {
165
+                    StartTask(dlInfo);
166
+
167
+                    //等待合并
168
+                    while (dls.Where(td => !td.isFinish).Count() > 0 && isRun)
169
+                    {
170
+                        Thread.Sleep(100);
171
+                    }
172
+                    if ((dls.Where(td => !td.isFinish).Count() == 0))
173
+                    {
174
+
175
+                        CombineFiles(dlInfo);
176
+                        OnFineshHandler();
177
+                    }
178
+                }
179
+
180
+            }).BeginInvoke(null, null);
181
+        }
182
+        /// <summary>
183
+        /// 合成文件
184
+        /// </summary>
185
+        /// <param name="dlInfo"></param>
186
+        private void CombineFiles(DownloadInfoModel dlInfo)
187
+        {
188
+            string realFilePath = GetRealFileName(dlInfo);
189
+
190
+            //合并数据
191
+            byte[] buffer = new byte[2048];
192
+            int length = 0;
193
+            using (FileStream fileStream = File.Open(realFilePath, FileMode.CreateNew))
194
+            {
195
+                for (int i = 0; i < dlInfo.TaskInfoList.Count; i++)
196
+                {
197
+                    string tempFile = dlInfo.TaskInfoList[i].filePath;
198
+                    using (FileStream tempStream = File.Open(tempFile, FileMode.Open))
199
+                    {
200
+                        while ((length = tempStream.Read(buffer, 0, buffer.Length)) > 0)
201
+                        {
202
+                            fileStream.Write(buffer, 0, length);
203
+                        }
204
+                        tempStream.Flush();
205
+                    }
206
+                    //File.Delete(tempFile);
207
+                }
208
+            }
209
+        }
210
+        /// <summary>
211
+        /// 创建文件
212
+        /// </summary>
213
+        /// <param name="dlInfo"></param>
214
+        /// <returns></returns>
215
+        private static string GetRealFileName(DownloadInfoModel dlInfo)
216
+        {
217
+            //创建正式文件名,如果已存在则加数字序号创建,避免覆盖
218
+            int fileIndex = 0;
219
+            string realFilePath = Path.Combine(dlInfo.saveDir, dlInfo.saveFileName);
220
+            while (File.Exists(realFilePath))
221
+            {
222
+                realFilePath = Path.Combine(dlInfo.saveDir, string.Format("{0}_{1}", fileIndex++, dlInfo.fileName));
223
+            }
224
+
225
+            return realFilePath;
226
+        }
227
+
228
+        private void StartTask(DownloadInfoModel dlInfo)
229
+        {
230
+            dls = new List<DownloadService>();
231
+            if (dlInfo.TaskInfoList != null)
232
+            {
233
+                foreach (TaskInfoModel item in dlInfo.TaskInfoList)
234
+                {
235
+                    DownloadService dl = new DownloadService();
236
+                    dl.OnDownload += OnDownloadHandler;
237
+                    dl.OnDisconnect += OnDisconnectHandler;
238
+                    dls.Add(dl);
239
+                    try
240
+                    {
241
+                        dl.Start(item, dlInfo.isReStart);
242
+                    }
243
+                    catch (Exception ex)
244
+                    {
245
+                        string ErrMessage = "【下载】(DownloadManager):" + ex.Message;
246
+                        LogHelper.WriteErrLog(ErrMessage, ex);
247
+                    }
248
+                }
249
+            }
250
+        }
251
+
252
+        /// <summary>
253
+        /// 创建下载任务
254
+        /// </summary>
255
+        /// <param name="dlInfo"></param>
256
+        private void GetTaskInfo(DownloadInfoModel dlInfo)
257
+        {
258
+            long pieceSize = (dlInfo.count) / dlInfo.taskCount;
259
+            dlInfo.TaskInfoList = new List<TaskInfoModel>();
260
+            Random rand = new Random();
261
+            int urlIndex = 0;
262
+            for (int i = 0; i <= dlInfo.taskCount + 1; i++)
263
+            {
264
+                long from = (i * pieceSize);
265
+
266
+                if (from >= dlInfo.count)
267
+                {
268
+                    break;
269
+                }
270
+
271
+                long to = from + pieceSize;
272
+                if (to >= dlInfo.count)
273
+                {
274
+                    to = dlInfo.count;
275
+                }
276
+
277
+                dlInfo.TaskInfoList.Add(
278
+                    new TaskInfoModel
279
+                    {
280
+                        method = dlInfo.method,
281
+                        downloadUrl = dlInfo.downloadUrlList[urlIndex++],
282
+
283
+                        filePath = Path.Combine(dlInfo.saveDir, dlInfo.tempFileName + ".temp" + i),
284
+                        fromIndex = from,
285
+                        toIndex = to
286
+                    });
287
+                if (urlIndex >= dlInfo.downloadUrlList.Count)
288
+                {
289
+                    urlIndex = 0;
290
+                }
291
+            }
292
+        }
293
+
294
+        /// <summary>
295
+        /// 保存内容
296
+        /// </summary>
297
+        /// <param name="filePath"></param>
298
+        /// <param name="stream"></param>
299
+        private void Save(string filePath, Stream stream)
300
+        {
301
+            try
302
+            {
303
+                using (FileStream writer = File.Open(filePath, FileMode.Append))
304
+                {
305
+                    using (stream)
306
+                    {
307
+                        int repeatTimes = 0;
308
+                        byte[] buffer = new byte[1024];
309
+                        int length = 0;
310
+                        while ((length = stream.Read(buffer, 0, buffer.Length)) > 0 && isRun)
311
+                        {
312
+                            writer.Write(buffer, 0, length);
313
+                            fromIndex += length;
314
+                            if (repeatTimes % 5 == 0)
315
+                            {
316
+                                writer.Flush();//一定大小就刷一次缓冲区
317
+                                OnDownloadHandler();
318
+                            }
319
+                            repeatTimes++;
320
+                        }
321
+                        writer.Flush();
322
+                        OnDownloadHandler();
323
+                    }
324
+                }
325
+            }
326
+            catch (Exception)
327
+            {
328
+                //异常也不影响
329
+            }
330
+        }
331
+
332
+        /// <summary>
333
+        /// 开始下载
334
+        /// </summary>
335
+        private void OnStartHandler()
336
+        {
337
+            new Action(() =>
338
+            {
339
+                OnStart.Invoke();
340
+            }).BeginInvoke(null, null);
341
+        }
342
+        /// <summary>
343
+        /// 暂停下载
344
+        /// </summary>
345
+        private void OnStopHandler()
346
+        {
347
+            new Action(() =>
348
+            {
349
+                OnStop.Invoke();
350
+            }).BeginInvoke(null, null);
351
+        }
352
+        /// <summary>
353
+        /// 下载完成
354
+        /// </summary>
355
+        private void OnFineshHandler()
356
+        {
357
+            new Action(() =>
358
+            {
359
+                for (int i = 0; i < dlInfo.TaskInfoList.Count; i++)
360
+                {
361
+                    string tempFile = dlInfo.TaskInfoList[i].filePath;
362
+                    File.Delete(tempFile);
363
+                }
364
+                OnFinsh.Invoke(dlInfo.saveFileName);
365
+            }).BeginInvoke(null, null);
366
+        }
367
+        /// <summary>
368
+        /// 下载进度
369
+        /// </summary>
370
+        private void OnDownloadHandler()
371
+        {
372
+            new Action(() =>
373
+            {
374
+                long current = GetDownloadLength();
375
+                OnDownload.Invoke(current, dlInfo.count, dlInfo.saveFileName);
376
+            }).BeginInvoke(null, null);
377
+        }
378
+        /// <summary>
379
+        /// 断开网络连接
380
+        /// </summary>
381
+        private void OnDisconnectHandler()
382
+        {
383
+            new Action(() =>
384
+            {
385
+                OnDisconnect.Invoke(dlInfo.saveFileName);
386
+            }).BeginInvoke(null, null);
387
+        }
388
+        /// <summary>
389
+        /// 当前下载进度
390
+        /// </summary>
391
+        /// <returns></returns>
392
+        public long GetDownloadLength()
393
+        {
394
+            if (dlInfo.IsSupportMultiThreading)
395
+            {
396
+                return dls.Sum(dl => dl.GetDownloadedCount());
397
+            }
398
+            else
399
+            {
400
+                return fromIndex;
401
+            }
402
+        }
403
+
404
+        /// <summary>
405
+        /// 获取保存文件名
406
+        /// </summary>
407
+        /// <returns></returns>
408
+        public DownloadInfoModel GetFileInfo => dlInfo;
409
+
410
+    }
411
+}

+ 237
- 0
Common/system/DownloadService.cs ファイルの表示

@@ -0,0 +1,237 @@
1
+using Common.Model;
2
+
3
+using System;
4
+using System.IO;
5
+using System.Net;
6
+
7
+namespace Common.system
8
+{
9
+    /// <summary>
10
+    /// 下载方法
11
+    /// 创建人:赵耀
12
+    /// 创建时间:2018年10月30日
13
+    /// </summary>
14
+    public class DownloadService
15
+    {
16
+        private string downloadUrl = "";//文件下载地址
17
+        private string filePath = "";//文件保存路径
18
+        private string method = "";//方法
19
+        private long fromIndex = 0;//开始下载的位置
20
+        private long toIndex = 0;//结束下载的位置
21
+        private long count = 0;//总大小
22
+        private long size = 524288;//每次下载大小 512kb
23
+        private bool isRun = false;//是否正在进行
24
+
25
+
26
+        public bool isFinish = false;//是否已下载完成{ get; private set; }
27
+
28
+        public bool isStopped = true;//是否已停止{ get; private set; }
29
+
30
+        /// <summary>
31
+        /// 开始下载
32
+        /// </summary>
33
+        public event Action OnStart;
34
+        /// <summary>
35
+        /// 下载进度
36
+        /// </summary>
37
+        public event Action OnDownload;
38
+        /// <summary>
39
+        /// 完成下载
40
+        /// </summary>
41
+        public event Action OnFinsh;
42
+        /// <summary>
43
+        /// 断开网络连接
44
+        /// </summary>
45
+        public event Action OnDisconnect;
46
+
47
+
48
+        public long GetDownloadedCount()
49
+        {
50
+            return count - toIndex + fromIndex - 1;
51
+        }
52
+
53
+        public void Stop()
54
+        {
55
+            isRun = false;
56
+        }
57
+
58
+        /// <summary>
59
+        /// 开始下载
60
+        /// </summary>
61
+        /// <param name="info"></param>
62
+        /// <param name="isReStart"></param>
63
+        /// <returns></returns>
64
+        public bool Start(TaskInfoModel info, bool isReStart)
65
+        {
66
+            downloadUrl = info.downloadUrl;
67
+            fromIndex = info.fromIndex;
68
+            toIndex = info.toIndex;
69
+            method = info.method;
70
+            filePath = info.filePath;
71
+            count = info.count;
72
+            isStopped = false;
73
+            if (File.Exists(filePath))
74
+            {
75
+                if (isReStart)
76
+                {
77
+                    File.Delete(filePath);
78
+                    File.Create(filePath).Close();
79
+                }
80
+            }
81
+            else
82
+            {
83
+                File.Create(filePath).Close();
84
+            }
85
+            using (FileStream file = File.Open(filePath, FileMode.Open))
86
+            {
87
+                fromIndex = info.fromIndex + file.Length;
88
+            }
89
+            if (fromIndex >= toIndex)
90
+            {
91
+                OnFineshHandler();
92
+                isFinish = true;
93
+                isStopped = true;
94
+                return false;
95
+            }
96
+            OnStartHandler();
97
+            isRun = true;
98
+            new Action(() =>
99
+            {
100
+                WebResponse rsp;
101
+                while (fromIndex < toIndex && isRun)
102
+                {
103
+                    long to;
104
+                    if (fromIndex + size >= toIndex - 1)
105
+                    {
106
+                        to = toIndex - 1;
107
+                    }
108
+                    else
109
+                    {
110
+                        to = fromIndex + size;
111
+                    }
112
+
113
+                    try
114
+                    {
115
+                        using (rsp = HttpHelper.Download(downloadUrl, fromIndex, to, method))
116
+                        {
117
+                            Save(filePath, rsp.GetResponseStream());
118
+                        }
119
+                    }
120
+                    catch (Exception ex)
121
+                    {
122
+                        string ErrMessage = "【下载】(DownloadService):" + ex.Message;
123
+                        LogHelper.WriteErrLog(ErrMessage, ex);
124
+                        OnDisconnectHandler();
125
+                        return;
126
+                    }
127
+                }
128
+                if (!isRun)
129
+                {
130
+                    isStopped = true;
131
+                }
132
+
133
+                if (fromIndex >= toIndex)
134
+                {
135
+                    isFinish = true;
136
+                    isStopped = true;
137
+                    OnFineshHandler();
138
+                }
139
+
140
+            }).BeginInvoke(null, null);
141
+            return true;
142
+        }
143
+        /// <summary>
144
+        /// 保存文件
145
+        /// </summary>
146
+        /// <param name="filePath"></param>
147
+        /// <param name="stream"></param>
148
+        private void Save(string filePath, Stream stream)
149
+        {
150
+            try
151
+            {
152
+                using (FileStream writer = File.Open(filePath, FileMode.Append))
153
+                {
154
+                    using (stream)
155
+                    {
156
+                        int repeatTimes = 0;
157
+                        byte[] buffer = new byte[1024];
158
+                        int length = 0;
159
+                        while ((length = stream.Read(buffer, 0, buffer.Length)) > 0 && isRun)
160
+                        {
161
+                            writer.Write(buffer, 0, length);
162
+                            fromIndex += length;
163
+                            if (repeatTimes % 5 == 0)
164
+                            {
165
+                                OnDownloadHandler();
166
+                            }
167
+                            repeatTimes++;
168
+                        }
169
+                    }
170
+                }
171
+                OnDownloadHandler();
172
+            }
173
+            catch (Exception)
174
+            {
175
+                //异常也不影响
176
+            }
177
+        }
178
+        /// <summary>
179
+        /// 开始下载
180
+        /// </summary>
181
+        private void OnStartHandler()
182
+        {
183
+            new Action(() =>
184
+            {
185
+                if (OnStart != null)
186
+                {
187
+                    OnStart.Invoke();
188
+                }
189
+            }).BeginInvoke(null, null);
190
+        }
191
+        /// <summary>
192
+        /// 完成下载
193
+        /// </summary>
194
+        private void OnFineshHandler()
195
+        {
196
+            new Action(() =>
197
+            {
198
+                if (OnFinsh != null)
199
+                {
200
+                    OnFinsh.Invoke();
201
+                }
202
+
203
+                if (OnDownload != null)
204
+                {
205
+                    OnDownload.Invoke();
206
+                }
207
+            }).BeginInvoke(null, null);
208
+        }
209
+        /// <summary>
210
+        /// 下载进度
211
+        /// </summary>
212
+        private void OnDownloadHandler()
213
+        {
214
+            new Action(() =>
215
+            {
216
+                if (OnDownload != null)
217
+                {
218
+                    OnDownload.Invoke();
219
+                }
220
+            }).BeginInvoke(null, null);
221
+        }
222
+        /// <summary>
223
+        /// 断开网络连接
224
+        /// </summary>
225
+        private void OnDisconnectHandler()
226
+        {
227
+            new Action(() =>
228
+            {
229
+                if (OnDisconnect != null)
230
+                {
231
+                    OnDisconnect.Invoke();
232
+                }
233
+            }).BeginInvoke(null, null);
234
+
235
+        }
236
+    }
237
+}

+ 1316
- 0
Common/system/FFMpeg.cs
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 982
- 0
Common/system/FileToolsCommon.cs ファイルの表示

@@ -0,0 +1,982 @@
1
+using System;
2
+using System.Configuration;
3
+using System.IO;
4
+using System.Text;
5
+using System.Text.RegularExpressions;
6
+using System.Windows.Forms;
7
+
8
+namespace Common.system
9
+{
10
+    /// <summary>
11
+    /// 文件工具公共方法
12
+    /// 创建人:赵耀
13
+    /// 创建时间:2018年11月6日
14
+    /// </summary>
15
+    public static class FileToolsCommon
16
+    {
17
+        #region 获取文件的绝对路径
18
+
19
+        /// <summary>
20
+        /// 获取文件的绝对路径
21
+        /// </summary>
22
+        /// <param name="Path">相对路径</param>
23
+        /// <returns></returns>
24
+        public static string GetFileAbsolutePath(string Path = "")
25
+        {
26
+            try
27
+            {
28
+                if (!string.IsNullOrWhiteSpace(Path))
29
+                {
30
+                    Path = Path.Replace("\\", "/");
31
+                    if (Path != "/")
32
+                    {
33
+                        if (Path.Substring(1, 1) == ":")
34
+                        {
35
+                            return Path;
36
+                        }
37
+
38
+                        if (Path.Substring(0, 1) != "/")
39
+                        {
40
+                            Path = "/" + Path;
41
+                        }
42
+                    }
43
+                }
44
+                string AbsolutePath = Application.StartupPath.ToString().Replace("\\", "/") + Path;
45
+                return AbsolutePath;
46
+            }
47
+            catch (Exception)
48
+            {
49
+                return Path;
50
+            }
51
+        }
52
+        /// <summary>
53
+        /// 获取合法路径 结尾带/
54
+        /// </summary>
55
+        /// <returns></returns>
56
+        public static string GetLegalPath(string FilePath)
57
+        {
58
+            FilePath = System.IO.Path.Combine(FilePath.Replace("\\", "/"));
59
+            FilePath += (FilePath.Substring(FilePath.Length - 1, 1) == "/" ? "" : "/");
60
+            return FilePath;
61
+        }
62
+        #endregion
63
+
64
+        #region 检测路径是否合法
65
+        /// <summary>
66
+        /// 检测路径是否合法
67
+        /// </summary>
68
+        /// <param name="FilePathName">绝对路径</param>
69
+        /// <param name="ErrMessage">返回错误</param>
70
+        /// <returns></returns>
71
+        public static bool IsLegalPath(string FilePathName, out string ErrMessage)
72
+        {
73
+            string FilePath;
74
+            string FileName;
75
+            ErrMessage = "";
76
+            try
77
+            {
78
+                FilePathName = GetLegalPath(FilePathName);
79
+                FilePath = GetDirectoryName(FilePathName);
80
+                FileName = GetIOFileName(FilePathName);
81
+            }
82
+            catch (Exception)
83
+            {
84
+                ErrMessage = "路径或文件名不合法!";
85
+                return false;
86
+            }
87
+            Regex regex = new Regex(@"^([a-zA-Z]:\\)?[^\/\:\*\?\""\<\>\|\,]*$");
88
+            Match m = regex.Match(FilePath);
89
+            if (!m.Success)
90
+            {
91
+                ErrMessage = "非法的文件保存路径!";
92
+                return false;
93
+            }
94
+            if (!string.IsNullOrWhiteSpace(FileName))
95
+            {
96
+                regex = new Regex(@"^[^\/\:\*\?\""\<\>\|\,]+$");
97
+                m = regex.Match(FileName);
98
+                if (!m.Success)
99
+                {
100
+                    ErrMessage = "非法的文件名!文件名中包含\\ / : * ? \" < > |等字符!";
101
+                    return false;
102
+                }
103
+            }
104
+            return true;
105
+
106
+        }
107
+        #endregion
108
+
109
+        #region 检测指定目录是否存在
110
+        /// <summary>  
111
+        /// 检测指定目录是否存在  
112
+        /// </summary>  
113
+        /// <param name="directoryPath">目录的绝对路径</param>          
114
+        public static bool IsExistDirectory(string directoryPath)
115
+        {
116
+            return Directory.Exists(directoryPath);
117
+        }
118
+        #endregion
119
+
120
+        #region 检测指定文件是否存在
121
+        /// <summary>  
122
+        /// 检测指定文件是否存在,如果存在则返回true。  
123
+        /// </summary>  
124
+        /// <param name="filePath">文件的绝对路径</param>          
125
+        public static bool IsExistFile(string filePath)
126
+        {
127
+            return File.Exists(filePath);
128
+        }
129
+        #endregion
130
+
131
+        #region 检测指定目录是否为空
132
+        /// <summary>  
133
+        /// 检测指定目录是否为空  
134
+        /// </summary>  
135
+        /// <param name="directoryPath">指定目录的绝对路径</param>          
136
+        public static bool IsEmptyDirectory(string directoryPath)
137
+        {
138
+            try
139
+            {
140
+                //判断是否存在文件  
141
+                string[] fileNames = GetFileNames(directoryPath);
142
+                if (fileNames.Length > 0)
143
+                {
144
+                    return false;
145
+                }
146
+
147
+                //判断是否存在文件夹  
148
+                string[] directoryNames = GetDirectories(directoryPath);
149
+                return directoryNames.Length <= 0;
150
+            }
151
+            catch
152
+            {
153
+                return false;
154
+            }
155
+        }
156
+        #endregion
157
+
158
+        #region 检测指定目录中是否存在指定的文件
159
+        /// <summary>  
160
+        /// 检测指定目录中是否存在指定的文件,若要搜索子目录请使用重载方法.  
161
+        /// </summary>  
162
+        /// <param name="directoryPath">指定目录的绝对路径</param>  
163
+        /// <param name="searchPattern">模式字符串,"*"代表0或N个字符,"?"代表1个字符。  
164
+        /// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。</param>          
165
+        public static bool Contains(string directoryPath, string searchPattern)
166
+        {
167
+            try
168
+            {
169
+                //获取指定的文件列表  
170
+                string[] fileNames = GetFileNames(directoryPath, searchPattern, false);
171
+
172
+                //判断指定文件是否存在  
173
+                return fileNames.Length != 0;
174
+            }
175
+            catch
176
+            {
177
+                return false;
178
+            }
179
+        }
180
+
181
+        /// <summary>  
182
+        /// 检测指定目录中是否存在指定的文件  
183
+        /// </summary>  
184
+        /// <param name="directoryPath">指定目录的绝对路径</param>  
185
+        /// <param name="searchPattern">模式字符串,"*"代表0或N个字符,"?"代表1个字符。  
186
+        /// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。</param>   
187
+        /// <param name="isSearchChild">是否搜索子目录</param>  
188
+        public static bool Contains(string directoryPath, string searchPattern, bool isSearchChild)
189
+        {
190
+            try
191
+            {
192
+                //获取指定的文件列表  
193
+                string[] fileNames = GetFileNames(directoryPath, searchPattern, isSearchChild);
194
+
195
+                //判断指定文件是否存在  
196
+                return fileNames.Length != 0;
197
+            }
198
+            catch
199
+            {
200
+                return false;
201
+            }
202
+        }
203
+        #endregion
204
+
205
+        #region 创建一个目录
206
+        /// <summary>  
207
+        /// 创建一个目录  
208
+        /// </summary>  
209
+        /// <param name="directoryPath">目录的绝对路径</param>  
210
+        public static void CreateDirectory(string directoryPath)
211
+        {
212
+            try
213
+            {
214
+                //如果目录不存在则创建该目录  
215
+                if (!IsExistDirectory(directoryPath))
216
+                {
217
+                    Directory.CreateDirectory(directoryPath);
218
+                }
219
+            }
220
+            catch (Exception ex)
221
+            {
222
+                throw new ApplicationException(ex.Message); //"请使用管理员权限运行!"
223
+            }
224
+        }
225
+        #endregion
226
+
227
+        #region 创建一个文件
228
+        /// <summary>  
229
+        /// 创建一个文件。  
230
+        /// </summary>  
231
+        /// <param name="filePath">文件的绝对路径</param>  
232
+        public static bool CreateFile(string filePath)
233
+        {
234
+            try
235
+            {
236
+                //如果文件不存在则创建该文件  
237
+                if (!IsExistFile(filePath))
238
+                {
239
+                    //创建一个FileInfo对象  
240
+                    FileInfo file = new FileInfo(filePath);
241
+                    //创建文件  
242
+                    FileStream fs = file.Create();
243
+                    //关闭文件流  
244
+                    fs.Close();
245
+                }
246
+            }
247
+            catch
248
+            {
249
+                return false;
250
+            }
251
+
252
+            return true;
253
+        }
254
+
255
+        /// <summary>  
256
+        /// 创建一个文件,并将字节流写入文件。  
257
+        /// </summary>  
258
+        /// <param name="filePath">文件的绝对路径</param>  
259
+        /// <param name="buffer">二进制流数据</param>  
260
+        public static bool CreateFile(string filePath, byte[] buffer)
261
+        {
262
+            try
263
+            {
264
+                //如果文件不存在则创建该文件  
265
+                if (!IsExistFile(filePath))
266
+                {
267
+                    //创建一个FileInfo对象  
268
+                    FileInfo file = new FileInfo(filePath);
269
+
270
+                    //创建文件  
271
+                    FileStream fs = file.Create();
272
+
273
+                    //写入二进制流  
274
+                    fs.Write(buffer, 0, buffer.Length);
275
+
276
+                    //关闭文件流  
277
+                    fs.Close();
278
+                }
279
+            }
280
+            catch
281
+            {
282
+                return false;
283
+            }
284
+            return true;
285
+        }
286
+        #endregion
287
+
288
+        #region 获取文本文件的行数
289
+        /// <summary>  
290
+        /// 获取文本文件的行数  
291
+        /// </summary>  
292
+        /// <param name="filePath">文件的绝对路径</param>          
293
+        public static int GetLineCount(string filePath)
294
+        {
295
+            //将文本文件的各行读到一个字符串数组中  
296
+            string[] rows = File.ReadAllLines(filePath);
297
+
298
+            //返回行数  
299
+            return rows.Length;
300
+        }
301
+        #endregion
302
+
303
+        #region 获取一个文件的长度
304
+        /// <summary>  
305
+        /// 获取一个文件的长度,单位为Byte  
306
+        /// </summary>  
307
+        /// <param name="filePath">文件的绝对路径</param>          
308
+        public static long GetFileSize(string filePath)
309
+        {
310
+            //创建一个文件对象  
311
+            FileInfo fi = new FileInfo(filePath);
312
+
313
+            //获取文件的大小  
314
+            return fi.Length;
315
+        }
316
+
317
+        /// <summary>  
318
+        /// 获取一个文件的长度,单位为KB  
319
+        /// </summary>  
320
+        /// <param name="filePath">文件的路径</param>          
321
+        public static double GetFileSizeByKB(string filePath)
322
+        {
323
+            //创建一个文件对象  
324
+            FileInfo fi = new FileInfo(filePath);
325
+            //double size = fi.Length / 1024;
326
+            double size = Math.Round((fi.Length / 1024.0), 2, MidpointRounding.AwayFromZero);
327
+            //获取文件的大小  
328
+            return size;
329
+        }
330
+
331
+        /// <summary>  
332
+        /// 获取一个文件的长度,单位为MB  
333
+        /// </summary>  
334
+        /// <param name="filePath">文件的路径</param>          
335
+        public static double GetFileSizeByMB(string filePath)
336
+        {
337
+            //创建一个文件对象  
338
+            FileInfo fi = new FileInfo(filePath);
339
+            //double size = fi.Length / 1024 / 1024;
340
+            double size = Math.Round((fi.Length / 1024.0 / 1024.0), 2, MidpointRounding.AwayFromZero);
341
+            //获取文件的大小  
342
+            return size;
343
+        }
344
+        #endregion
345
+
346
+        #region 获取指定目录中的文件列表
347
+        /// <summary>  
348
+        /// 获取指定目录中所有文件列表  
349
+        /// </summary>  
350
+        /// <param name="directoryPath">指定目录的绝对路径</param>          
351
+        public static FileInfo[] GetFileInfos(string directoryPath, string files = null)
352
+        {
353
+            //如果目录不存在,则抛出异常  
354
+            if (!IsExistDirectory(directoryPath))
355
+            {
356
+                return null;//throw new FileNotFoundException();
357
+            }
358
+            DirectoryInfo folder = new DirectoryInfo(directoryPath);
359
+            FileInfo[] fileList;
360
+            if (files == null)
361
+            {
362
+                fileList = folder.GetFiles();
363
+            }
364
+            else
365
+            {
366
+                fileList = folder.GetFiles(files);
367
+            }
368
+            //获取文件列表  
369
+            return fileList;
370
+        }
371
+
372
+        /// <summary>  
373
+        /// 获取指定目录中所有文件列表  
374
+        /// </summary>  
375
+        /// <param name="directoryPath">指定目录的绝对路径</param>          
376
+        public static string[] GetFileNames(string directoryPath)
377
+        {
378
+            //如果目录不存在,则抛出异常  
379
+            if (!IsExistDirectory(directoryPath))
380
+            {
381
+                return null;//throw new FileNotFoundException();
382
+            }
383
+
384
+            //获取文件列表  
385
+            return Directory.GetFiles(directoryPath);
386
+        }
387
+
388
+        /// <summary>  
389
+        /// 获取指定目录及子目录中所有文件列表  
390
+        /// </summary>  
391
+        /// <param name="directoryPath">指定目录的绝对路径</param>  
392
+        /// <param name="searchPattern">模式字符串,"*"代表0或N个字符,"?"代表1个字符。  
393
+        /// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。</param>  
394
+        /// <param name="isSearchChild">是否搜索子目录</param>  
395
+        public static string[] GetFileNames(string directoryPath, string searchPattern, bool isSearchChild)
396
+        {
397
+            //如果目录不存在,则抛出异常  
398
+            if (!IsExistDirectory(directoryPath))
399
+            {
400
+                return null;//throw new FileNotFoundException();
401
+            }
402
+
403
+            try
404
+            {
405
+                return Directory.GetFiles(directoryPath, searchPattern, isSearchChild ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
406
+            }
407
+            catch
408
+            {
409
+                return null;
410
+            }
411
+        }
412
+        #endregion
413
+
414
+        #region 获取指定目录中的子目录列表
415
+        /// <summary>  
416
+        /// 获取指定目录中所有子目录列表,若要搜索嵌套的子目录列表,请使用重载方法.  
417
+        /// </summary>  
418
+        /// <param name="directoryPath">指定目录的绝对路径</param>          
419
+        public static string[] GetDirectories(string directoryPath)
420
+        {
421
+            try
422
+            {
423
+                return Directory.GetDirectories(directoryPath);
424
+            }
425
+            catch
426
+            {
427
+                return null;
428
+            }
429
+        }
430
+
431
+        /// <summary>  
432
+        /// 获取指定目录及子目录中所有子目录列表  
433
+        /// </summary>  
434
+        /// <param name="directoryPath">指定目录的绝对路径</param>  
435
+        /// <param name="searchPattern">模式字符串,"*"代表0或N个字符,"?"代表1个字符。  
436
+        /// 范例:"Log*.xml"表示搜索所有以Log开头的Xml文件。</param>  
437
+        /// <param name="isSearchChild">是否搜索子目录</param>  
438
+        public static string[] GetDirectories(string directoryPath, string searchPattern, bool isSearchChild)
439
+        {
440
+            try
441
+            {
442
+                return Directory.GetDirectories(directoryPath, searchPattern, isSearchChild ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
443
+            }
444
+            catch
445
+            {
446
+                return null;//throw
447
+            }
448
+        }
449
+        #endregion
450
+
451
+        #region 向文本文件写入内容
452
+        /// <summary>  
453
+        /// 向文本文件中写入内容  
454
+        /// </summary>  
455
+        /// <param name="filePath">文件的绝对路径</param>  
456
+        /// <param name="content">写入的内容</param>          
457
+        public static void WriteText(string filePath, string content)
458
+        {
459
+            //向文件写入内容  
460
+            File.WriteAllText(filePath, content);
461
+        }
462
+        #endregion
463
+
464
+        #region 向文本文件的尾部追加内容
465
+        /// <summary>  
466
+        /// 向文本文件的尾部追加内容  
467
+        /// </summary>  
468
+        /// <param name="filePath">文件的绝对路径</param>  
469
+        /// <param name="content">写入的内容</param>  
470
+        public static void AppendText(string filePath, string content)
471
+        {
472
+            File.AppendAllText(filePath, content);
473
+        }
474
+        #endregion
475
+
476
+        #region 将现有文件的内容复制到新文件中
477
+        /// <summary>  
478
+        /// 将源文件的内容复制到目标文件中  
479
+        /// </summary>  
480
+        /// <param name="sourceFilePath">源文件的绝对路径</param>  
481
+        /// <param name="destFilePath">目标文件的绝对路径</param>  
482
+        public static void Copy(string sourceFilePath, string destFilePath)
483
+        {
484
+            File.Copy(sourceFilePath, destFilePath, true);
485
+        }
486
+        #endregion
487
+
488
+        #region 将文件移动到指定目录
489
+        /// <summary>  
490
+        /// 将文件移动到指定目录  
491
+        /// </summary>  
492
+        /// <param name="sourceFilePath">需要移动的源文件的绝对路径</param>  
493
+        /// <param name="descDirectoryPath">移动到的目录的绝对路径</param>  
494
+        public static void Move(string sourceFilePath, string descDirectoryPath)
495
+        {
496
+            //获取源文件的名称  
497
+            string sourceFileName = GetFileName(sourceFilePath);
498
+
499
+            if (IsExistDirectory(descDirectoryPath))
500
+            {
501
+                //如果目标中存在同名文件,则删除  
502
+                if (IsExistFile(descDirectoryPath + "\\" + sourceFileName))
503
+                {
504
+                    DeleteFile(descDirectoryPath + "\\" + sourceFileName);
505
+                }
506
+                //将文件移动到指定目录  
507
+                File.Move(sourceFilePath, descDirectoryPath + "\\" + sourceFileName);
508
+            }
509
+        }
510
+        #endregion
511
+
512
+        #region 将流读取到缓冲区中
513
+        /// <summary>  
514
+        /// 将流读取到缓冲区中  
515
+        /// </summary>  
516
+        /// <param name="stream">原始流</param>  
517
+        public static byte[] StreamToBytes(Stream stream)
518
+        {
519
+            try
520
+            {
521
+                //创建缓冲区  
522
+                byte[] buffer = new byte[stream.Length];
523
+
524
+                //读取流  
525
+                stream.Read(buffer, 0, int.Parse(stream.Length.ToString()));
526
+
527
+                //返回流  
528
+                return buffer;
529
+            }
530
+            catch
531
+            {
532
+                return null;
533
+            }
534
+            finally
535
+            {
536
+                //关闭流  
537
+                stream.Close();
538
+            }
539
+        }
540
+        #endregion
541
+
542
+        #region 将文件读取到缓冲区中
543
+        /// <summary>  
544
+        /// 将文件读取到缓冲区中  
545
+        /// </summary>  
546
+        /// <param name="filePath">文件的绝对路径</param>  
547
+        public static byte[] FileToBytes(string filePath)
548
+        {
549
+            //获取文件的大小   
550
+            long fileSize = GetFileSize(filePath);
551
+
552
+            //创建一个临时缓冲区  
553
+            byte[] buffer = new byte[fileSize];
554
+
555
+            //创建一个文件流  
556
+            FileInfo fi = new FileInfo(filePath);
557
+            FileStream fs = fi.Open(FileMode.Open);
558
+
559
+            try
560
+            {
561
+                //将文件流读入缓冲区  
562
+                fs.Read(buffer, 0, (int)fileSize);
563
+
564
+                return buffer;
565
+            }
566
+            catch
567
+            {
568
+                return null;
569
+            }
570
+            finally
571
+            {
572
+                //关闭文件流  
573
+                fs.Close();
574
+            }
575
+        }
576
+        /// <summary>
577
+        /// 读取大文件用,读取文件前面指定长度字节数
578
+        /// </summary>
579
+        /// <param name="filePath">文件路径</param>
580
+        /// <param name="Length">读取长度,单位字节</param>
581
+        /// <returns></returns>
582
+        public static byte[] ReadBigFile(string filePath, int Length)
583
+        {
584
+            FileStream stream = new FileStream(filePath, FileMode.Open);
585
+            byte[] buffer = new byte[Length];
586
+            //stream.Position = startIndex;
587
+            stream.Read(buffer, 0, Length);
588
+            stream.Close();
589
+            stream.Dispose();
590
+            return buffer;
591
+        }
592
+        /// <summary>
593
+        /// 读取指定长度的流
594
+        /// </summary>
595
+        /// <param name="filePath">文件位置</param>
596
+        /// <param name="startIndex">开始位置</param>
597
+        /// <param name="Length">长度</param>
598
+        /// <returns></returns>
599
+        public static byte[] ReadBigFileSpecifyLength(string filePath, long startIndex, int Length)
600
+        {
601
+            FileStream stream = new FileStream(filePath, FileMode.Open);
602
+            if (startIndex + Length + 1 > stream.Length)
603
+            {
604
+                Length = (int)(stream.Length - startIndex);
605
+            }
606
+            byte[] buffer = new byte[Length];
607
+            stream.Position = startIndex;
608
+            stream.Read(buffer, 0, Length);
609
+            stream.Close();
610
+            stream.Dispose();
611
+            return buffer;
612
+        }
613
+        #endregion
614
+
615
+        #region 将文件读取到字符串中
616
+        /// <summary>  
617
+        /// 将文件读取到字符串中  
618
+        /// </summary>  
619
+        /// <param name="filePath">文件的绝对路径</param>  
620
+        public static string FileToString(string filePath)
621
+        {
622
+            //return FileToString(filePath, Encoding.Default); 
623
+            return FileToString(filePath, Encoding.UTF8);
624
+        }
625
+        /// <summary>  
626
+        /// 将文件读取到字符串中  
627
+        /// </summary>  
628
+        /// <param name="filePath">文件的绝对路径</param>  
629
+        /// <param name="encoding">字符编码</param>  
630
+        public static string FileToString(string filePath, Encoding encoding)
631
+        {
632
+            //创建流读取器  
633
+            StreamReader reader = new StreamReader(filePath, encoding);
634
+            try
635
+            {
636
+                //读取流  
637
+                return reader.ReadToEnd();
638
+            }
639
+            catch
640
+            {
641
+                return string.Empty;
642
+            }
643
+            finally
644
+            {
645
+                //关闭流读取器  
646
+                reader.Close();
647
+            }
648
+        }
649
+        /// <summary>
650
+        /// 读取大文件用,读取文件前面指定长度字节的字符串
651
+        /// </summary>
652
+        /// <param name="filePath">文件路径</param>
653
+        /// <param name="Length">读取长度,单位字节</param>
654
+        /// <returns></returns>
655
+        public static string ReadBigFileStr(string filePath, int Length)
656
+        {
657
+            byte[] buffer = ReadBigFile(filePath, Length);
658
+            return Encoding.Default.GetString(buffer);
659
+        }
660
+
661
+        #endregion
662
+
663
+        #region 从文件的绝对路径中获取文件名( 包含扩展名 )
664
+        /// <summary>  
665
+        /// 从文件的绝对路径中获取文件名( 包含扩展名 )  
666
+        /// </summary>  
667
+        /// <param name="filePath">文件的绝对路径</param>          
668
+        public static string GetFileName(string filePath)
669
+        {
670
+            //获取文件的名称  
671
+            FileInfo fi = new FileInfo(filePath);
672
+            return fi.Name;
673
+        }
674
+        /// <summary>  
675
+        /// 使用IO从文件的绝对路径中获取文件名( 包含扩展名 )  
676
+        /// </summary>  
677
+        /// <param name="filePath">文件的绝对路径</param>          
678
+        public static string GetIOFileName(string filePath)
679
+        {
680
+            return Path.GetFileName(filePath);
681
+        }
682
+        #endregion
683
+
684
+        #region 从文件的绝对路径中获取文件名( 不包含扩展名 )
685
+        /// <summary>  
686
+        /// 从文件的绝对路径中获取文件名( 不包含扩展名 )  
687
+        /// </summary>  
688
+        /// <param name="filePath">文件的绝对路径</param>          
689
+        public static string GetFileNameNoExtension(string filePath)
690
+        {
691
+            //获取文件的名称  
692
+            FileInfo fi = new FileInfo(filePath);
693
+            return fi.Name.Split('.')[0];
694
+        }
695
+        /// <summary>  
696
+        /// 使用IO从文件的绝对路径中获取文件名( 不包含扩展名 )  
697
+        /// </summary>  
698
+        /// <param name="filePath">文件的绝对路径</param>          
699
+        public static string GetIOFileNameNoExtension(string filePath)
700
+        {
701
+            return System.IO.Path.GetFileNameWithoutExtension(filePath);
702
+        }
703
+        #endregion
704
+
705
+        #region 从文件的绝对路径中获取扩展名
706
+        /// <summary>  
707
+        /// 从文件的绝对路径中获取扩展名  
708
+        /// </summary>  
709
+        /// <param name="filePath">文件的绝对路径</param>          
710
+        public static string GetExtension(string filePath)
711
+        {
712
+            //获取文件的名称  
713
+            FileInfo fi = new FileInfo(filePath);
714
+            return fi.Extension;
715
+        }
716
+        /// <summary>  
717
+        /// 使用IO从文件的绝对路径中获取扩展名 
718
+        /// </summary>  
719
+        /// <param name="filePath">文件的绝对路径</param>          
720
+        public static string GetIOExtension(string filePath)
721
+        {
722
+            string Extension = System.IO.Path.GetExtension(filePath);
723
+            return Extension;
724
+        }
725
+
726
+        #endregion
727
+
728
+        #region 从文件的绝对路径中获取路径名
729
+        /// <summary>  
730
+        /// 使用IO从文件的绝对路径中获取路径名  
731
+        /// </summary>  
732
+        /// <param name="filePath">文件的绝对路径</param>          
733
+        public static string GetDirectoryName(string filePath)
734
+        {
735
+            string DirectoryName = (System.IO.Path.GetDirectoryName(filePath) + @"/").Replace("\\", "/");
736
+            return DirectoryName;
737
+        }
738
+        #endregion
739
+
740
+        #region 清空指定目录
741
+        /// <summary>  
742
+        /// 清空指定目录下所有文件及子目录,但该目录依然保存.  
743
+        /// </summary>  
744
+        /// <param name="directoryPath">指定目录的绝对路径</param>  
745
+        public static void ClearDirectory(string directoryPath)
746
+        {
747
+            if (IsExistDirectory(directoryPath))
748
+            {
749
+                //删除目录中所有的文件  
750
+                string[] fileNames = GetFileNames(directoryPath);
751
+                foreach (string t in fileNames)
752
+                {
753
+                    DeleteFile(t);
754
+                }
755
+
756
+                //删除目录中所有的子目录  
757
+                string[] directoryNames = GetDirectories(directoryPath);
758
+                foreach (string t in directoryNames)
759
+                {
760
+                    DeleteDirectory(t);
761
+                }
762
+            }
763
+        }
764
+        #endregion
765
+
766
+        #region 清空文件内容
767
+        /// <summary>  
768
+        /// 清空文件内容  
769
+        /// </summary>  
770
+        /// <param name="filePath">文件的绝对路径</param>  
771
+        public static void ClearFile(string filePath)
772
+        {
773
+            //删除文件  
774
+            File.Delete(filePath);
775
+
776
+            //重新创建该文件  
777
+            CreateFile(filePath);
778
+        }
779
+        #endregion
780
+
781
+        #region 删除指定文件
782
+        /// <summary>  
783
+        /// 删除指定文件  
784
+        /// </summary>  
785
+        /// <param name="filePath">文件的绝对路径</param>  
786
+        public static void DeleteFile(string filePath)
787
+        {
788
+            try
789
+            {
790
+                if (IsExistFile(filePath))
791
+                {
792
+                    File.Delete(filePath);
793
+                }
794
+            }
795
+            catch (Exception)
796
+            {
797
+
798
+            }
799
+        }
800
+        #endregion
801
+
802
+        #region 删除指定目录
803
+        /// <summary>  
804
+        /// 删除指定目录及其所有子目录  
805
+        /// </summary>  
806
+        /// <param name="directoryPath">指定目录的绝对路径</param>  
807
+        public static bool DeleteDirectory(string directoryPath)
808
+        {
809
+            try
810
+            {
811
+                if (IsExistDirectory(directoryPath))
812
+                {
813
+                    Directory.Delete(directoryPath, true);
814
+                }
815
+                return true;
816
+            }
817
+            catch (Exception)
818
+            {
819
+                //目录中有文件占用
820
+                return false;
821
+            }
822
+        }
823
+        #endregion
824
+
825
+        #region 获取指定目录大小
826
+        /// <summary>
827
+        /// 获取目录大小
828
+        /// </summary>
829
+        /// <param name="directoryPath">目录地址</param>
830
+        /// <returns> 单位:MB</returns>
831
+        public static double PathSize(string directoryPath)
832
+        {
833
+            DirectoryInfo folder = new DirectoryInfo(directoryPath);
834
+            double DirectorySize = DirSize(folder);
835
+            for (int i = 0; i < 2; i++)
836
+            {
837
+                DirectorySize /= 1024;
838
+            }
839
+            return DirectorySize;
840
+        }
841
+
842
+        /// <summary>
843
+        /// 获取目录大小
844
+        /// </summary>
845
+        /// <param name="d">目录</param>
846
+        /// <returns>字节</returns>
847
+        public static long DirSize(DirectoryInfo d)
848
+        {
849
+            long Size = 0;
850
+            // 所有文件大小.
851
+            FileInfo[] fis = d.GetFiles();
852
+            foreach (FileInfo fi in fis)
853
+            {
854
+                Size += fi.Length;
855
+            }
856
+            // 遍历出当前目录的所有文件夹.
857
+            DirectoryInfo[] dis = d.GetDirectories();
858
+            foreach (DirectoryInfo di in dis)
859
+            {
860
+                Size += DirSize(di);   //这就用到递归了,调用父方法,注意,这里并不是直接返回值,而是调用父返回来的
861
+            }
862
+            return (Size);
863
+        }
864
+        #endregion
865
+
866
+        #region 移动目录
867
+        /// <summary>
868
+        /// 移动目录并重命名
869
+        /// </summary>
870
+        /// <param name="directoryPath">操作目录绝对路径</param>
871
+        /// <param name="newDirectoryPath">目标目录绝对路径</param>
872
+        /// <param name="Message">返回错误消息,成功则为空</param>
873
+        /// <returns></returns>
874
+        public static bool MoveDirectory(string directoryPath, string newDirectoryPath, out string Message)
875
+        {
876
+            Message = "";
877
+            try
878
+            {
879
+                if (!IsExistDirectory(directoryPath))//判断目录是否存在
880
+                {
881
+                    Message = "操作目录不存在!";
882
+                    return false;
883
+                }
884
+                if (IsExistDirectory(newDirectoryPath))
885
+                {
886
+                    Message = "目标目录已存在!";
887
+                    return false;
888
+                }
889
+                Directory.Move(directoryPath, newDirectoryPath);
890
+                return true;
891
+            }
892
+            catch (Exception ex)
893
+            {
894
+                Message = ex.Message;
895
+                return false;
896
+            }
897
+        }
898
+        #endregion
899
+
900
+        #region 操作配置文件
901
+        #region 从配置文件获取Value
902
+        /// <summary>
903
+        /// 从配置文件获取Value
904
+        /// </summary>
905
+        /// <param name="key">配置文件中key字符串</param>
906
+        /// <returns></returns>
907
+        public static string GetConfigValue(string key)
908
+        {
909
+            try
910
+            {
911
+                Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
912
+                //获取AppSettings的节点 
913
+                AppSettingsSection appsection = (AppSettingsSection)config.GetSection("appSettings");
914
+                return appsection.Settings[key].Value;
915
+            }
916
+            catch
917
+            {
918
+                return "";
919
+            }
920
+        }
921
+        #endregion
922
+
923
+        #region 设置配置文件
924
+        /// <summary>
925
+        /// 设置配置文件
926
+        /// </summary>
927
+        /// <param name="key">配置文件中key字符串</param>
928
+        /// <param name="value">配置文件中value字符串</param>
929
+        /// <returns></returns>
930
+        public static bool SetConfigValue(string key, string value)
931
+        {
932
+            try
933
+            {
934
+                //打开配置文件 
935
+                Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
936
+                //获取AppSettings的节点 
937
+                AppSettingsSection appsection = (AppSettingsSection)config.GetSection("appSettings");
938
+                appsection.Settings[key].Value = value;
939
+                config.Save();
940
+
941
+                return true;
942
+            }
943
+            catch
944
+            {
945
+                return false;
946
+            }
947
+        }
948
+        #endregion
949
+        #endregion
950
+
951
+        #region 获取媒体文件的播放时长
952
+
953
+        #endregion
954
+
955
+        #region 检测是否安装了某个程序
956
+        /// <summary>  
957
+        /// 确认电脑上是否安装有某个程序 
958
+        /// </summary>  
959
+        /// <param name="softWareName">程序安装后的名称</param>
960
+        /// <returns>true: 有安裝, false:沒有安裝</returns>  
961
+        public static bool CheckSoftWartInstallState(string softWareName)
962
+        {
963
+            Microsoft.Win32.RegistryKey uninstallNode =
964
+                Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.ReadKey);
965
+            foreach (string subKeyName in uninstallNode.GetSubKeyNames())
966
+            {
967
+                Microsoft.Win32.RegistryKey subKey = uninstallNode.OpenSubKey(subKeyName);
968
+                object displayName = subKey.GetValue("DisplayName");
969
+                if (displayName != null)
970
+                {
971
+                    if (displayName.ToString().Contains(softWareName))
972
+                    {
973
+                        return true;
974
+                        // MessageWindow.Show(displayName.ToString());  
975
+                    }
976
+                }
977
+            }
978
+            return false;
979
+        }
980
+        #endregion
981
+    }
982
+}

+ 60
- 0
Common/system/FreeMemoryHelper.cs ファイルの表示

@@ -0,0 +1,60 @@
1
+using Microsoft.Win32;
2
+
3
+using System;
4
+using System.Runtime.InteropServices;
5
+
6
+namespace Common.system
7
+{
8
+    /// <summary>
9
+    /// 释放内存帮助类 创建人:赵耀 创建时间:2020年8月12日
10
+    /// </summary>
11
+    public class FreeMemoryHelper
12
+    {
13
+        [DllImport("kernel32.dll")]
14
+        private static extern bool SetProcessWorkingSetSize(IntPtr proc, int min, int max);
15
+
16
+        /// <summary>
17
+        /// Close、Hide、最小化页面时调用此方法,释放占用内存并重新分配 将暂时不需要的内容放进虚拟内存,当应用程序重新激活时,会将虚拟内存的内容重新加载到内存。
18
+        /// 不宜过度频繁的调用该方法,频繁调用会降低使使用性能。 创建人:赵耀 创建时间:2020年8月12日
19
+        /// </summary>
20
+        public static void ReallocateMemory()
21
+        {
22
+            GC.Collect();
23
+            GC.WaitForPendingFinalizers();
24
+
25
+            if (Environment.OSVersion.Platform == PlatformID.Win32NT)
26
+            {
27
+                SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
28
+            }
29
+        }
30
+
31
+        /// <summary>
32
+        /// ---屏蔽DevExpress试用信息 与内存释放无关
33
+        /// </summary>
34
+        public static void SetDate()
35
+        {
36
+            CreateKey();
37
+            RegistryKey currentUser = Registry.CurrentUser;
38
+            RegistryKey registryKey = currentUser.OpenSubKey("SOFTWARE\\DevExpress\\Components", writable: true);
39
+            registryKey.GetValue("LastAboutShowedTime");
40
+            string value = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss");
41
+            registryKey.SetValue("LastAboutShowedTime", value);
42
+            currentUser.Dispose();
43
+        }
44
+
45
+        // 摘要: 创建键值
46
+        private static void CreateKey()
47
+        {
48
+            RegistryKey currentUser = Registry.CurrentUser;
49
+            if (currentUser.OpenSubKey("SOFTWARE\\DevExpress\\Components", writable: true) == null)
50
+            {
51
+                RegistryKey registryKey = currentUser.CreateSubKey("SOFTWARE\\DevExpress\\Components");
52
+                registryKey.CreateSubKey("LastAboutShowedTime").SetValue("LastAboutShowedTime", DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"));
53
+                registryKey.CreateSubKey("DisableSmartTag").SetValue("LastAboutShowedTime", false);
54
+                registryKey.CreateSubKey("SmartTagWidth").SetValue("LastAboutShowedTime", 350);
55
+            }
56
+
57
+            currentUser.Dispose();
58
+        }
59
+    }
60
+}

+ 631
- 0
Common/system/HttpHelper.cs ファイルの表示

@@ -0,0 +1,631 @@
1
+using Newtonsoft.Json.Linq;
2
+
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Collections.Specialized;
6
+using System.IO;
7
+using System.Net;
8
+using System.Net.Security;
9
+using System.Security.Cryptography.X509Certificates;
10
+using System.Text;
11
+using System.Threading;
12
+
13
+namespace Common.system
14
+{
15
+    /// <summary>
16
+    /// HttpHelper
17
+    /// 创建人:赵耀
18
+    /// </summary>
19
+    public class HttpHelper
20
+    {
21
+        public static void init_Request(ref System.Net.HttpWebRequest request)
22
+        {
23
+            request.Accept = "text/json,*/*;q=0.5";
24
+            request.Headers.Add("Accept-Charset", "utf-8;q=0.7,*;q=0.7");
25
+            request.Headers.Add("Accept-Encoding", "gzip, deflate, x-gzip, identity; q=0.9");
26
+            request.AutomaticDecompression = System.Net.DecompressionMethods.GZip;
27
+            request.Timeout = 8000;
28
+        }
29
+
30
+        private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
31
+        {
32
+            return true; //总是接受  
33
+        }
34
+
35
+        public static System.Net.HttpWebRequest GetHttpWebRequest(string url)
36
+        {
37
+            HttpWebRequest request = null;
38
+            if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
39
+            {
40
+                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
41
+                request = WebRequest.Create(url) as HttpWebRequest;
42
+                request.ProtocolVersion = HttpVersion.Version10;
43
+            }
44
+            else
45
+            {
46
+                request = WebRequest.Create(url) as HttpWebRequest;
47
+            }
48
+            return request;
49
+        }
50
+        public static WebResponse Download(string downloadUrl, long from, long to, string method)
51
+        {
52
+            for (int i = 0; i < 10; i++)
53
+            {
54
+                try
55
+                {
56
+                    HttpWebRequest request = HttpHelper.GetHttpWebRequest(downloadUrl);
57
+                    HttpHelper.init_Request(ref request);
58
+                    request.Accept = "text/json,*/*;q=0.5";
59
+                    request.AddRange(from, to);
60
+                    request.Headers.Add("Accept-Charset", "utf-8;q=0.7,*;q=0.7");
61
+                    request.Headers.Add("Accept-Encoding", "gzip, deflate, x-gzip, identity; q=0.9");
62
+                    request.AutomaticDecompression = System.Net.DecompressionMethods.GZip;
63
+                    request.Timeout = 120000;
64
+                    request.Method = method;
65
+                    request.KeepAlive = false;
66
+                    request.ContentType = "application/json; charset=utf-8";
67
+                    return request.GetResponse();
68
+                }
69
+                catch (Exception)
70
+                {
71
+                    Thread.Sleep(100);
72
+                }
73
+            }
74
+            throw new Exception("已断开网络!请检查网络连接后重试下载!");
75
+        }
76
+        public static string Get(string url, IDictionary<string, string> param)
77
+        {
78
+            List<string> paramBuilder = new List<string>();
79
+            foreach (KeyValuePair<string, string> item in param)
80
+            {
81
+                paramBuilder.Add(string.Format("{0}={1}", item.Key, item.Value));
82
+            }
83
+            url = string.Format("{0}?{1}", url.TrimEnd('?'), string.Join(",", paramBuilder.ToArray()));
84
+            return Get(url);
85
+        }
86
+        public static string Get(string url)
87
+        {
88
+            try
89
+            {
90
+                HttpWebRequest request = GetHttpWebRequest(url);
91
+                if (request != null)
92
+                {
93
+                    string retval = null;
94
+                    init_Request(ref request);
95
+                    using (WebResponse Response = request.GetResponse())
96
+                    {
97
+                        using (StreamReader reader = new System.IO.StreamReader(Response.GetResponseStream(), System.Text.Encoding.UTF8))
98
+                        {
99
+                            retval = reader.ReadToEnd();
100
+                        }
101
+                    }
102
+                    return retval;
103
+                }
104
+            }
105
+            catch
106
+            {
107
+
108
+            }
109
+            return null;
110
+        }
111
+        public static string Post(string url, string data)
112
+        {
113
+            try
114
+            {
115
+                HttpWebRequest request = GetHttpWebRequest(url);
116
+                if (request != null)
117
+                {
118
+                    string retval = null;
119
+                    init_Request(ref request);
120
+                    request.Method = "POST";
121
+                    request.ServicePoint.Expect100Continue = false;
122
+                    request.ContentType = "application/json; charset=utf-8";
123
+                    request.Timeout = 5000;
124
+                    byte[] bytes = System.Text.UTF8Encoding.UTF8.GetBytes(data);
125
+                    request.ContentLength = bytes.Length;
126
+                    using (Stream stream = request.GetRequestStream())
127
+                    {
128
+                        stream.Write(bytes, 0, bytes.Length);
129
+                    }
130
+                    using (WebResponse response = request.GetResponse())
131
+                    {
132
+                        using (StreamReader reader = new System.IO.StreamReader(response.GetResponseStream()))
133
+                        {
134
+                            retval = reader.ReadToEnd();
135
+                        }
136
+                    }
137
+                    return retval;
138
+                }
139
+            }
140
+            catch
141
+            {
142
+
143
+            }
144
+            return null;
145
+        }
146
+
147
+        /// <summary>
148
+        ///调用Post接口
149
+        /// </summary>
150
+        /// <param name="request"></param>
151
+        /// <returns></returns>
152
+        public static string HttpPost(string body, string Url)
153
+        {
154
+            try
155
+            {
156
+                Encoding encoding = Encoding.UTF8;
157
+
158
+                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
159
+                request.Method = "POST";
160
+                request.Accept = "text/html,application/xhtml+xml,*/*";
161
+                request.ContentType = "application/json";
162
+
163
+                byte[] buffer = encoding.GetBytes(body);
164
+                request.ContentLength = buffer.Length;
165
+                request.GetRequestStream().Write(buffer, 0, buffer.Length);
166
+
167
+                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
168
+                using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
169
+                {
170
+                    return reader.ReadToEnd();
171
+                }
172
+            }
173
+            catch (Exception ex)
174
+            {
175
+                // LogHelper.Instance.Debug($"POST接口连接失败,请求参数:{ex.Message}");
176
+                return "POST报错:" + ex.Message;
177
+            }
178
+        }
179
+        /// <summary>
180
+        /// Post Http请求
181
+        /// </summary>
182
+        /// <param name="url">请求地址</param>
183
+        /// <param name="postData">传输数据</param>
184
+        /// <param name="timeout">超时时间</param>
185
+        /// <param name="contentType">媒体格式</param>
186
+        /// <param name="encode">编码</param>
187
+        /// <returns>泛型集合</returns>
188
+        public static T PostAndRespSignle<T>(string url, int timeout = 5000, string postData = "", string contentType = "application/json;", string encode = "UTF-8") where T : class
189
+        {
190
+            if (!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(encode) && !string.IsNullOrEmpty(contentType) && postData != null)
191
+            {
192
+                // webRequest.Headers.Add("Authorization", "Bearer " + "SportApiAuthData");
193
+                HttpWebResponse webResponse = null;
194
+                Stream responseStream = null;
195
+                Stream requestStream = null;
196
+                StreamReader streamReader = null;
197
+                try
198
+                {
199
+                    string respstr = GetStreamReader(url, responseStream, requestStream, streamReader, webResponse, timeout, encode, postData, contentType);
200
+                    return JsonHelper.JsonToObj<T>(respstr);
201
+                }
202
+                catch (Exception)
203
+                {
204
+                }
205
+                finally
206
+                {
207
+                    if (responseStream != null)
208
+                    {
209
+                        responseStream.Dispose();
210
+                    }
211
+
212
+                    if (webResponse != null)
213
+                    {
214
+                        webResponse.Close();
215
+                    }
216
+
217
+                    if (requestStream != null)
218
+                    {
219
+                        requestStream.Dispose();
220
+                    }
221
+
222
+                    if (streamReader != null)
223
+                    {
224
+                        streamReader.Dispose();
225
+                    }
226
+                }
227
+            }
228
+            return default(T);
229
+        }
230
+        private static string GetStreamReader(string url, Stream responseStream, Stream requestStream, StreamReader streamReader, WebResponse webResponse, int timeout, string encode, string postData, string contentType)
231
+        {
232
+            try
233
+            {
234
+                byte[] data = Encoding.GetEncoding(encode).GetBytes(postData);
235
+                HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
236
+                webRequest.Method = "POST";
237
+                webRequest.ContentType = contentType + ";" + encode;
238
+                webRequest.ContentLength = data.Length;
239
+                webRequest.Timeout = timeout;
240
+                requestStream = webRequest.GetRequestStream();
241
+                requestStream.Write(data, 0, data.Length);
242
+                webResponse = (HttpWebResponse)webRequest.GetResponse();
243
+                responseStream = webResponse.GetResponseStream();
244
+                if (responseStream == null) { return ""; }
245
+                streamReader = new StreamReader(responseStream, Encoding.GetEncoding(encode));
246
+                return streamReader.ReadToEnd();
247
+            }
248
+            catch (Exception)
249
+            {
250
+                return null;
251
+            }
252
+        }
253
+        /// <summary>
254
+        /// Cookie
255
+        /// </summary>
256
+        public static CookieContainer cc = new CookieContainer();
257
+        /// <summary>
258
+        /// Get请求
259
+        /// </summary>
260
+        /// <param name="serviceaddress">请求地址</param>
261
+        /// <param name="strcontent">头</param>
262
+        /// <param name="contenttype">参数</param>
263
+        /// <param name="header">token</param>
264
+        /// <returns></returns>
265
+        public static JObject GetFunction(string serviceaddress, string strcontent, string contenttype, string header, int Timeout = 5000)
266
+        {
267
+            try
268
+            {
269
+                string serviceAddress = serviceaddress + strcontent;
270
+                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceAddress);
271
+                WebHeaderCollection myWebHeaderCollection = request.Headers;
272
+                request.CookieContainer = cc;
273
+                if (header != "")
274
+                {
275
+                    myWebHeaderCollection.Add("access_token:" + header);
276
+                }
277
+
278
+                request.Method = "GET";
279
+                request.ContentType = contenttype;
280
+                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
281
+
282
+                string encoding = response.ContentEncoding;
283
+                if (encoding == null || encoding.Length < 1)
284
+                {
285
+                    encoding = "UTF-8"; //默认编码  
286
+                }
287
+                StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding));
288
+                string retString = reader.ReadToEnd();
289
+
290
+                //解析josn
291
+                JObject jo = JObject.Parse(retString);
292
+                return jo;
293
+            }
294
+            catch (Exception)
295
+            {
296
+                return null;
297
+            }
298
+        }
299
+
300
+        /// <summary>
301
+        /// Post请求
302
+        /// </summary>
303
+        /// <param name="serviceaddress">请求地址</param>
304
+        /// <param name="contenttype">头 application/x-www-form-urlencoded</param>
305
+        /// <param name="strcontent">参数</param>
306
+        /// <param name="header">token</param>
307
+        /// <returns></returns>
308
+        public static JObject PostFunction(string serviceaddress, string contenttype, string strcontent, string header, int Timeout = 5000)
309
+        {
310
+            try
311
+            {
312
+                string serviceAddress = serviceaddress;
313
+                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceAddress);
314
+                WebHeaderCollection myWebHeaderCollection = request.Headers;
315
+
316
+                request.CookieContainer = cc;
317
+                //myWebHeaderCollection.Add("Accept", "*/*");
318
+                if (header != "")
319
+                {
320
+                    myWebHeaderCollection.Add("access_token:" + header);
321
+                }
322
+                request.Timeout = Timeout;
323
+                request.Method = "POST";
324
+                request.ContentType = contenttype;
325
+
326
+                string strContent = strcontent;
327
+                using (StreamWriter dataStream = new StreamWriter(request.GetRequestStream()))
328
+                {
329
+                    dataStream.Write(strContent);
330
+                    dataStream.Close();
331
+                }
332
+                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
333
+                string encoding = response.ContentEncoding;
334
+                if (encoding == null || encoding.Length < 1)
335
+                {
336
+                    encoding = "UTF-8"; //默认编码  
337
+                }
338
+                StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding));
339
+                string retString = reader.ReadToEnd();
340
+                retString = retString.Replace("\\r\\n", "");
341
+
342
+                //解析josn
343
+                JObject jo = JObject.Parse(retString);
344
+                return jo;
345
+            }
346
+            catch (Exception ex)
347
+            {
348
+                LogHelper.WriteErrLog("请求失败(若网络无问题,请重置winsock,解决方法:以管理员方式打开cmd执行 netsh winsock reset 后重启)", ex);
349
+                return null;
350
+            }
351
+
352
+        }
353
+
354
+        /// <summary>
355
+        ///  上传方法
356
+        /// </summary>
357
+        /// <param name="url">webapi地址</param>
358
+        /// <param name="files">本地文件路径,单文件默认为string[0]</param>
359
+        /// <param name="token"></param>
360
+        /// <param name="formFields">参数可不传</param>
361
+        /// <returns></returns>
362
+        public static JObject UploadFilesToRemoteUrl(string url, string[] files, string token, NameValueCollection formFields = null)
363
+        {
364
+            string boundary = "----------------------------" + DateTime.Now.Ticks.ToString("x");
365
+            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
366
+            request.ContentType = "multipart/form-data; boundary=" +
367
+                                    boundary;
368
+            request.Method = "POST";
369
+            request.KeepAlive = true;
370
+
371
+            Stream memStream = new System.IO.MemoryStream();
372
+
373
+            byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" +
374
+                                                                    boundary + "\r\n");
375
+            byte[] endBoundaryBytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" +
376
+                                                                        boundary + "--");
377
+            WebHeaderCollection myWebHeaderCollection = request.Headers;
378
+            request.CookieContainer = cc;
379
+            if (token != "")
380
+            {
381
+                myWebHeaderCollection.Add("access_token:" + token);
382
+            }
383
+
384
+            string formdataTemplate = "\r\n--" + boundary +
385
+                                        "\r\nContent-Disposition: form-data; name=\"{0}\";\r\n\r\n{1}";
386
+            if (formFields != null)
387
+            {
388
+                foreach (string key in formFields.Keys)
389
+                {
390
+                    string formitem = string.Format(formdataTemplate, key, formFields[key]);
391
+                    byte[] formitembytes = System.Text.Encoding.UTF8.GetBytes(formitem);
392
+                    memStream.Write(formitembytes, 0, formitembytes.Length);
393
+                }
394
+            }
395
+
396
+            string headerTemplate =
397
+                "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\n" +
398
+                "Content-Type: application/octet-stream\r\n\r\n";
399
+
400
+            for (int i = 0; i < files.Length; i++)
401
+            {
402
+                memStream.Write(boundarybytes, 0, boundarybytes.Length);
403
+                string header = string.Format(headerTemplate, "file", files[i]);
404
+                byte[] headerbytes = System.Text.Encoding.UTF8.GetBytes(header);
405
+
406
+                memStream.Write(headerbytes, 0, headerbytes.Length);
407
+
408
+                using (FileStream fileStream = new FileStream(files[i], FileMode.Open, FileAccess.Read))
409
+                {
410
+                    byte[] buffer = new byte[1024];
411
+                    int bytesRead = 0;
412
+                    while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0)
413
+                    {
414
+                        memStream.Write(buffer, 0, bytesRead);
415
+                    }
416
+                }
417
+            }
418
+
419
+            //memStream.Write(endBoundaryBytes, 0, endBoundaryBytes.Length);
420
+            request.ContentLength = memStream.Length;
421
+
422
+            using (Stream requestStream = request.GetRequestStream())
423
+            {
424
+                memStream.Position = 0;
425
+                byte[] tempBuffer = new byte[memStream.Length];
426
+                memStream.Read(tempBuffer, 0, tempBuffer.Length);
427
+                memStream.Close();
428
+                requestStream.Write(tempBuffer, 0, tempBuffer.Length);
429
+            }
430
+
431
+            using (WebResponse response = request.GetResponse())
432
+            {
433
+                Stream stream2 = response.GetResponseStream();
434
+                StreamReader reader2 = new StreamReader(stream2);
435
+                JObject a = JObject.Parse(reader2.ReadToEnd());
436
+                return a;
437
+            }
438
+        }
439
+
440
+        /// <summary>
441
+        /// HttpWebRequest 下载
442
+        /// </summary>
443
+        /// <param name="url">URI</param>
444
+        /// <returns></returns>
445
+        public static bool GetDataGetHtml(string url, string filePath, string header)
446
+        {
447
+            try
448
+            {
449
+                HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
450
+
451
+                //httpWebRequest.ContentType = "application/x-www-form-urlencoded";
452
+                httpWebRequest.Method = "GET";
453
+                //httpWebRequest.ContentType = "image/jpeg";
454
+                //对发送的数据不使用缓存
455
+                httpWebRequest.AllowWriteStreamBuffering = false;
456
+                //httpWebRequest.Timeout = 300000;
457
+                httpWebRequest.ServicePoint.Expect100Continue = false;
458
+
459
+                WebHeaderCollection myWebHeaderCollection = httpWebRequest.Headers;
460
+                //myWebHeaderCollection.Add("Accept", "*/*");
461
+                if (header != "")
462
+                {
463
+                    myWebHeaderCollection.Add("access_token:" + header);
464
+                }
465
+
466
+                HttpWebResponse webRespon = (HttpWebResponse)httpWebRequest.GetResponse();
467
+                Stream webStream = webRespon.GetResponseStream();
468
+                long length = webRespon.ContentLength;
469
+                if (webStream == null)
470
+                {
471
+                    return false;
472
+                }
473
+                int lengthint = Convert.ToInt32(length);
474
+                //int num = lengthint / 1024;
475
+                //int count = 0;
476
+                //M_DownloadInfo.totalCount = lengthint / 1024;
477
+                //M_DownloadInfo.downloadCount = 0;
478
+
479
+                Stream stream = new FileStream(filePath, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
480
+                byte[] bArr = new byte[1024];
481
+                int size = webStream.Read(bArr, 0, bArr.Length);
482
+                while (size > 0)
483
+                {
484
+                    stream.Write(bArr, 0, size);
485
+                    size = webStream.Read(bArr, 0, bArr.Length);
486
+                    //M_DownloadInfo.downloadCount = M_DownloadInfo.downloadCount + 1;
487
+                }
488
+                webRespon.Close();
489
+                stream.Close();
490
+                webStream.Close();
491
+                return true;
492
+            }
493
+            catch (Exception)
494
+            {
495
+                //LogHelper.WriteErrLog("请求失败:" + ex.Message, ex);
496
+                return false;
497
+            }
498
+        }
499
+
500
+        /// <summary>
501
+        /// 上传文件流
502
+        /// 创建人:赵耀
503
+        /// 创建时间:2020年9月5日
504
+        /// </summary>
505
+        /// <param name="url">URL</param>
506
+        /// <param name="databyte">文件数据流</param>
507
+        /// <param name="filename">文件名</param>
508
+        /// <param name="formFields">参数 可不传</param>
509
+        public static JObject UploadRequestflow(string url, byte[] databyte, string filename, NameValueCollection formFields = null)
510
+        {
511
+            JObject jobResult = null;
512
+            // 时间戳,用做boundary
513
+            string boundary = "-----" + DateTime.Now.Ticks.ToString("x");
514
+            byte[] boundarybytes = Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
515
+
516
+            //根据uri创建HttpWebRequest对象
517
+            HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(url));
518
+            httpReq.ContentType = "multipart/form-data; boundary=" + boundary;
519
+            httpReq.Method = "POST";
520
+            httpReq.KeepAlive = true;
521
+            //httpReq.Timeout = 300000;
522
+            //httpReq.AllowWriteStreamBuffering = false; //对发送的数据不使用缓存
523
+            httpReq.Credentials = CredentialCache.DefaultCredentials;
524
+
525
+            try
526
+            {
527
+                Stream postStream = httpReq.GetRequestStream();
528
+                //参数
529
+                const string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}";
530
+                if (formFields != null)
531
+                {
532
+                    foreach (string key in formFields.Keys)
533
+                    {
534
+                        postStream.Write(boundarybytes, 0, boundarybytes.Length);
535
+                        string formitem = string.Format(formdataTemplate, key, formFields[key]);
536
+                        byte[] formitembytes = Encoding.UTF8.GetBytes(formitem);
537
+                        postStream.Write(formitembytes, 0, formitembytes.Length);
538
+                    }
539
+                }
540
+                postStream.Write(boundarybytes, 0, boundarybytes.Length);
541
+
542
+                const string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: application/octet-stream\r\n\r\n";
543
+
544
+                //文件头
545
+                string header = string.Format(headerTemplate, "file", filename);
546
+                byte[] headerbytes = Encoding.UTF8.GetBytes(header);
547
+                postStream.Write(headerbytes, 0, headerbytes.Length);
548
+
549
+                //文件流
550
+                postStream.Write(databyte, 0, databyte.Length);
551
+
552
+                //结束边界
553
+                byte[] boundaryBytes = Encoding.ASCII.GetBytes("\r\n--" + boundary + "--\r\n");
554
+                postStream.Write(boundaryBytes, 0, boundaryBytes.Length);
555
+                postStream.Close();
556
+
557
+                //获取服务器端的响应
558
+                using (HttpWebResponse response = (HttpWebResponse)httpReq.GetResponse())
559
+                {
560
+                    Stream receiveStream = response.GetResponseStream();
561
+                    StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
562
+                    string returnValue = readStream.ReadToEnd();
563
+                    jobResult = JObject.Parse(returnValue);
564
+                    response.Close();
565
+                    readStream.Close();
566
+                    //MessageWindow.Show(returnValue);
567
+                    //LogHelper.WriteInfoLog("【文件上传】" + returnValue);
568
+                }
569
+                return jobResult;
570
+            }
571
+            catch (Exception ex)
572
+            {
573
+                LogHelper.WriteErrLog("【文件上传】" + ex.Message, ex);
574
+                return null;
575
+            }
576
+            finally
577
+            {
578
+                httpReq = null;
579
+            }
580
+        }
581
+        /// <summary>
582
+        /// Post Http请求
583
+        /// </summary>
584
+        /// <param name="url"></param>
585
+        /// <param name="postData"></param>
586
+        /// <param name="timeout"></param>
587
+        /// <param name="contentType"></param>
588
+        /// <param name="encode"></param>
589
+        /// <returns>响应流字符串</returns>
590
+        public static string PostAndRespStr(string url, string postData = "", int timeout = 5000, string contentType = "application/json;", string encode = "UTF-8")
591
+        {
592
+            if (!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(encode) && !string.IsNullOrEmpty(contentType) && postData != null)
593
+            {
594
+                HttpWebResponse webResponse = null;
595
+                Stream responseStream = null;
596
+                Stream requestStream = null;
597
+                StreamReader streamReader = null;
598
+                try
599
+                {
600
+                    return GetStreamReader(url, responseStream, requestStream, streamReader, webResponse, timeout, encode, postData, contentType);
601
+                }
602
+                catch (Exception)
603
+                {
604
+                }
605
+                finally
606
+                {
607
+                    if (responseStream != null)
608
+                    {
609
+                        responseStream.Dispose();
610
+                    }
611
+
612
+                    if (webResponse != null)
613
+                    {
614
+                        webResponse.Close();
615
+                    }
616
+
617
+                    if (requestStream != null)
618
+                    {
619
+                        requestStream.Dispose();
620
+                    }
621
+
622
+                    if (streamReader != null)
623
+                    {
624
+                        streamReader.Dispose();
625
+                    }
626
+                }
627
+            }
628
+            return null;
629
+        }
630
+    }
631
+}

+ 938
- 0
Common/system/ImageHelper.cs ファイルの表示

@@ -0,0 +1,938 @@
1
+using System;
2
+using System.Drawing;
3
+using System.Drawing.Imaging;
4
+using System.IO;
5
+using System.Text;
6
+using System.Threading;
7
+using System.Windows;
8
+using System.Windows.Media;
9
+using System.Windows.Media.Imaging;
10
+
11
+namespace Common.system
12
+{
13
+    /// <summary>
14
+    /// 图片帮助类
15
+    /// 创建人:赵耀
16
+    /// 创建时间:2018年11月1日
17
+    /// </summary>
18
+    public class ImageHelper
19
+    {
20
+        /// <summary>
21
+        /// 通过FileStream 来打开文件,这样就可以实现不锁定Image文件,到时可以让多用户同时访问Image文件
22
+        /// </summary>
23
+        /// <param name="path">图片位置</param>
24
+        /// <returns></returns>
25
+        public static Bitmap ReadBitmapFile(string path)
26
+        {
27
+            try
28
+            {
29
+                if (File.Exists(path))
30
+                {
31
+                    FileStream fs = File.OpenRead(path); //OpenRead
32
+                    int filelength = 0;
33
+                    filelength = (int)fs.Length; //获得文件长度 
34
+                    byte[] image = new byte[filelength]; //建立一个字节数组 
35
+                    fs.Read(image, 0, filelength); //按字节流读取 
36
+                    System.Drawing.Image result = System.Drawing.Image.FromStream(fs);
37
+                    fs.Close();
38
+                    Bitmap bit = new Bitmap(result);
39
+                    return bit;
40
+                }
41
+                else
42
+                {
43
+                    return null;
44
+                }
45
+            }
46
+            catch (Exception)
47
+            {
48
+                return null;
49
+            }
50
+        }
51
+        /// <summary>
52
+        /// 通过FileStream 来打开文件,这样就可以实现不锁定Image文件,到时可以让多用户同时访问Image文件
53
+        /// </summary>
54
+        /// <param name="path">图片位置</param>
55
+        /// <returns></returns>
56
+        public static Image ReadImageFile(string path)
57
+        {
58
+            try
59
+            {
60
+                if (File.Exists(path))
61
+                {
62
+                    FileStream fs = File.OpenRead(path); //OpenRead
63
+                    int filelength = 0;
64
+                    filelength = (int)fs.Length; //获得文件长度 
65
+                    byte[] image = new byte[filelength]; //建立一个字节数组 
66
+                    fs.Read(image, 0, filelength); //按字节流读取 
67
+                    System.Drawing.Image result = System.Drawing.Image.FromStream(fs);
68
+                    fs.Close();
69
+                    return result;
70
+                }
71
+                else
72
+                {
73
+                    return null;
74
+                }
75
+            }
76
+            catch (Exception)
77
+            {
78
+                return null;
79
+            }
80
+        }
81
+        /// <summary>
82
+        /// 通过FileStream 来打开文件,这样就可以实现不锁定Image文件,到时可以让多用户同时访问Image文件
83
+        /// </summary>
84
+        /// <param name="path">图片位置</param>
85
+        /// <returns></returns>
86
+        public static BitmapImage ReadBitmapImageFile(string path)
87
+        {
88
+            BitmapImage bitmap = new BitmapImage();
89
+            try
90
+            {
91
+                using (MemoryStream ms = new MemoryStream(File.ReadAllBytes(path)))
92
+                {
93
+                    bitmap = new BitmapImage
94
+                    {
95
+                        DecodePixelHeight = 100
96
+                    };
97
+                    bitmap.BeginInit();
98
+                    bitmap.CacheOption = BitmapCacheOption.OnLoad;//设置缓存模式
99
+                    bitmap.StreamSource = ms;//通过StreamSource加载图片
100
+                    bitmap.EndInit();
101
+                    bitmap.Freeze();
102
+                }
103
+                return bitmap;
104
+            }
105
+            catch (Exception)
106
+            {
107
+                return null;
108
+            }
109
+        }
110
+        #region 获取RGB
111
+
112
+        private static Bitmap _Bitmap = null;
113
+        private static StringBuilder sb = new StringBuilder();
114
+
115
+        public static string GetRGB(int x, int y)
116
+        {
117
+            sb = new StringBuilder();
118
+            try
119
+            {
120
+                System.Drawing.Color color = _Bitmap.GetPixel(x, y);
121
+
122
+                sb.Append("RGB:(");
123
+                sb.Append(color.R.ToString());
124
+                sb.Append(",");
125
+                sb.Append(color.G.ToString());
126
+                sb.Append(",");
127
+                sb.Append(color.B.ToString());
128
+                sb.Append(")");
129
+            }
130
+            catch (Exception ex)
131
+            {
132
+                LogHelper.WriteErrLog("ImageHelper(GetRGB)" + ex.Message, ex);
133
+            }
134
+
135
+            return sb.ToString();
136
+        }
137
+
138
+        #endregion 获取RGB
139
+
140
+        #region 截图统一方法
141
+        /// <summary>
142
+        /// 截图通用方法 创建人:赵耀 创建时间:2020年8月11日
143
+        /// </summary>
144
+        /// <param name="ScreenSize">截图的区域,设置new Rectangle(0, 0, 0, 0)为截全屏</param>
145
+        /// <param name="ImageSavePath">图片存储路径,为空或null则保存到临时文件夹</param>
146
+        /// <param name="IsRetImg">是否返回图片</param>
147
+        /// <param name="bitmapimg">图片</param>
148
+        /// <param name="level">压缩等级,0到100,0 最差质量,100 最佳</param>
149
+        /// <returns></returns>
150
+        public static bool GetScreenshot(Rectangle ScreenSize, string ImageSavePath, bool IsRetImg, out BitmapImage bitmapimg, long level = -1)
151
+        {
152
+            bitmapimg = null;
153
+            try
154
+            {
155
+                System.Drawing.Size bounds = PrimaryScreen.DESKTOP;
156
+                if (string.IsNullOrEmpty(ImageSavePath))
157
+                {
158
+                    ImageSavePath = GetTempImagePath();//如果为空则指定临时存储路径
159
+                }
160
+                double scaleWidth = (bounds.Width * 1.0) / SystemParameters.PrimaryScreenWidth;
161
+                double scaleHeight = (bounds.Height * 1.0) / SystemParameters.PrimaryScreenHeight;
162
+                int width = bounds.Width;
163
+                int height = bounds.Height;
164
+                if (ScreenSize.Size != new System.Drawing.Size(0, 0))
165
+                {
166
+                    width = (int)(ScreenSize.Size.Width * scaleWidth);
167
+                    height = (int)(ScreenSize.Size.Height * scaleHeight);
168
+                }
169
+                int l = (int)(ScreenSize.X * scaleWidth);
170
+                int t = (int)(ScreenSize.Y * scaleHeight);
171
+                if (_Bitmap != null)
172
+                {
173
+                    _Bitmap.Dispose();
174
+                }
175
+                _Bitmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
176
+                using (Graphics g = Graphics.FromImage(_Bitmap))
177
+                {
178
+                    g.CopyFromScreen(l, t, 0, 0, _Bitmap.Size, CopyPixelOperation.SourceCopy);
179
+                    Compress(_Bitmap, ImageSavePath, level);
180
+                }
181
+                if (IsRetImg)
182
+                {
183
+
184
+                    Uri uri = new Uri(ImageSavePath, UriKind.Absolute);
185
+                    bitmapimg = new BitmapImage(uri);
186
+                }
187
+                GC.Collect();
188
+                return true;
189
+            }
190
+            catch (Exception ex)
191
+            {
192
+                LogHelper.WriteErrLog("【截图】(GetBitmapSource)截图失败," + ex.Message, ex);
193
+                return false;
194
+            }
195
+        }
196
+        /// <summary>
197
+        /// 获取临时图片保存位置
198
+        /// </summary>
199
+        /// <returns></returns>
200
+        public static string GetTempImagePath()
201
+        {
202
+            TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
203
+
204
+            string TempPath = FileToolsCommon.GetFileAbsolutePath("/temp/Screenshot/");
205
+            FileToolsCommon.CreateDirectory(TempPath);
206
+            TempPath += Convert.ToInt64(ts.TotalMilliseconds).ToString() + ".jpg";
207
+            return TempPath;
208
+        }
209
+        #endregion 截图统一方法
210
+
211
+        #region 图片压缩
212
+
213
+        /// <summary>
214
+        /// 图片压缩(降低质量以减小文件的大小) 创建人:赵耀 创建时间:2020年8月11日
215
+        /// </summary>
216
+        /// <param name="srcBitMap">传入的Bitmap对象</param>
217
+        /// <param name="destFile">压缩后的图片保存路径</param>
218
+        /// <param name="level">压缩等级,-1为config配置的值,0到100,0 最差质量,100 最佳</param>
219
+        public static void Compress(Bitmap srcBitMap, string destFile, long level)
220
+        {
221
+            if (level <= -1)
222
+            {
223
+                int ImageCompressionLevel = int.Parse(FileToolsCommon.GetConfigValue("ImageCompressionLevel"));
224
+                level = ImageCompressionLevel;
225
+            }
226
+            Stream s = new FileStream(destFile, FileMode.Create);
227
+            Compress(srcBitMap, s, level);
228
+            s.Close();
229
+        }
230
+
231
+        /// <summary>
232
+        /// 图片压缩(降低质量以减小文件的大小) 创建人:赵耀 创建时间:2020年8月11日
233
+        /// </summary>
234
+        /// <param name="srcBitmap">传入的Bitmap对象</param>
235
+        /// <param name="destStream">压缩后的Stream对象</param>
236
+        /// <param name="level">压缩等级,0到100,0 最差质量,100 最佳</param>
237
+        public static void Compress(Bitmap srcBitmap, Stream destStream, long level)
238
+        {
239
+            ImageCodecInfo myImageCodecInfo;
240
+            System.Drawing.Imaging.Encoder myEncoder;
241
+            EncoderParameter myEncoderParameter;
242
+            EncoderParameters myEncoderParameters;
243
+
244
+            //获取表示jpeg编解码器的imagecodecinfo对象
245
+            myImageCodecInfo = GetEncoderInfo("image/jpeg");
246
+
247
+            myEncoder = System.Drawing.Imaging.Encoder.Quality;
248
+
249
+            myEncoderParameters = new EncoderParameters(1);
250
+
251
+            myEncoderParameter = new EncoderParameter(myEncoder, level);
252
+            myEncoderParameters.Param[0] = myEncoderParameter;
253
+            srcBitmap.Save(destStream, myImageCodecInfo, myEncoderParameters);
254
+        }
255
+
256
+        /// <summary>
257
+        /// 获取解码器 创建人:赵耀 创建时间2020年8月11日
258
+        /// </summary>
259
+        /// <param name="mimeType"></param>
260
+        /// <returns></returns>
261
+        private static ImageCodecInfo GetEncoderInfo(string mimeType)
262
+        {
263
+            int j;
264
+            ImageCodecInfo[] encoders;
265
+            encoders = ImageCodecInfo.GetImageEncoders();
266
+            for (j = 0; j < encoders.Length; ++j)
267
+            {
268
+                if (encoders[j].MimeType == mimeType)
269
+                {
270
+                    return encoders[j];
271
+                }
272
+            }
273
+            return null;
274
+        }
275
+
276
+        /// <summary>
277
+        /// 压缩图片 -测试方法 待完善 暂无用
278
+        /// </summary>
279
+        /// <param name="_bitmap">原图片</param>
280
+        /// <param name="dFile">压缩后保存图片地址</param>
281
+        /// <param name="flag">压缩质量(数字越小压缩率越高)1-100</param>
282
+        /// <param name="size">压缩后图片的最大大小</param>
283
+        /// <param name="sfsc">是否是第一次调用</param>
284
+        /// <returns></returns>
285
+        public static bool CompressImage(Bitmap _bitmap, string dFile, int flag = 90, int size = 300)
286
+        {
287
+            ////如果是第一次调用,原始图像的大小小于要压缩的大小,则直接复制文件,并且返回true
288
+            //FileInfo firstFileInfo = new FileInfo(sFile);
289
+            //if (sfsc == true && firstFileInfo.Length < size * 1024)
290
+            //{
291
+            //    firstFileInfo.CopyTo(dFile);
292
+            //    return true;
293
+            //}
294
+            //Image iSource = Image.FromFile(sFile);
295
+            Image iSource = _bitmap;
296
+            ImageFormat tFormat = iSource.RawFormat;
297
+            int dHeight = iSource.Height / 2;
298
+            int dWidth = iSource.Width / 2;
299
+            int sW, sH;
300
+            //按比例缩放
301
+            System.Drawing.Size tem_size = new System.Drawing.Size(iSource.Width, iSource.Height);
302
+            if (tem_size.Width > dHeight || tem_size.Width > dWidth)
303
+            {
304
+                if ((tem_size.Width * dHeight) > (tem_size.Width * dWidth))
305
+                {
306
+                    sW = dWidth;
307
+                    sH = (dWidth * tem_size.Height) / tem_size.Width;
308
+                }
309
+                else
310
+                {
311
+                    sH = dHeight;
312
+                    sW = (tem_size.Width * dHeight) / tem_size.Height;
313
+                }
314
+            }
315
+            else
316
+            {
317
+                sW = tem_size.Width;
318
+                sH = tem_size.Height;
319
+            }
320
+
321
+            Bitmap ob = new Bitmap(dWidth, dHeight);
322
+            Graphics g = Graphics.FromImage(ob);
323
+
324
+            g.Clear(System.Drawing.Color.WhiteSmoke);
325
+            g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
326
+            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
327
+            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
328
+
329
+            g.DrawImage(iSource, new Rectangle((dWidth - sW) / 2, (dHeight - sH) / 2, sW, sH), 0, 0, iSource.Width, iSource.Height, GraphicsUnit.Pixel);
330
+
331
+            g.Dispose();
332
+
333
+            //以下代码为保存图片时,设置压缩质量
334
+            EncoderParameters ep = new EncoderParameters();
335
+            long[] qy = new long[1];
336
+            qy[0] = flag;//设置压缩的比例1-100
337
+            EncoderParameter eParam = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, qy);
338
+            ep.Param[0] = eParam;
339
+
340
+            try
341
+            {
342
+                ImageCodecInfo[] arrayICI = ImageCodecInfo.GetImageEncoders();
343
+                ImageCodecInfo jpegICIinfo = null;
344
+                for (int x = 0; x < arrayICI.Length; x++)
345
+                {
346
+                    if (arrayICI[x].FormatDescription.Equals("JPEG"))
347
+                    {
348
+                        jpegICIinfo = arrayICI[x];
349
+                        break;
350
+                    }
351
+                }
352
+                if (jpegICIinfo != null)
353
+                {
354
+                    if (flag > 0)
355
+                    {
356
+                        ob.Save(dFile, jpegICIinfo, ep);//dFile是压缩后的新路径
357
+                        FileInfo fi = new FileInfo(dFile);
358
+                        if (fi.Length > 1024 * size)
359
+                        {
360
+                            flag -= 10;
361
+                            CompressImage(_bitmap, dFile, flag, size);
362
+                        }
363
+                    }
364
+                    //ob.Save(dFile, jpegICIinfo, ep);
365
+                    //FileInfo fi = new FileInfo(dFile);
366
+                    //bool IsAgain = false;
367
+                    //if (fi.Length > 1024 * size)
368
+                    //{
369
+                    //    fi.CopyTo(dFile + fi.Length);
370
+                    //    fi.Delete();
371
+                    //    Bitmap newbitmap = ReadImageFile(dFile + fi.Length);
372
+                    //    CompressImage(newbitmap, dFile, flag, size);
373
+                    //    FileToolsCommon.DeleteFile(dFile + fi.Length);
374
+                    //}
375
+                }
376
+                else
377
+                {
378
+                    ob.Save(dFile, tFormat);
379
+                }
380
+                return true;
381
+            }
382
+            catch
383
+            {
384
+                return false;
385
+            }
386
+            finally
387
+            {
388
+                iSource.Dispose();
389
+                ob.Dispose();
390
+            }
391
+        }
392
+        #endregion 图片压缩
393
+
394
+        #region 截屏指定UI控件
395
+        /// <summary>
396
+        /// 保存图片
397
+        /// </summary>
398
+        /// <param name="ui">需要截图的UI控件</param>
399
+        /// <param name="filePathName">图片保存地址 命名 1.png</param>
400
+        /// <param name="width">图片宽</param>
401
+        /// <param name="height">图片高</param>
402
+        /// <param name="ImgWidth">转换后高</param>
403
+        /// <param name="ImgHeight">转换后高</param>
404
+        public static void SaveUI(FrameworkElement ui, string filePathName, int width, int height, int ImgWidth, int ImgHeight)
405
+        {
406
+            try
407
+            {
408
+                //在位图中呈现UI元素
409
+                RenderTargetBitmap bmp = new RenderTargetBitmap(width, height, PrimaryScreen.DpiX, PrimaryScreen.DpiY, PixelFormats.Pbgra32);
410
+                bmp.Render(ui);
411
+
412
+                //定义切割矩形
413
+                var cut = new Int32Rect(0, 0, width, height);
414
+                //计算Stride
415
+                var stride = bmp.Format.BitsPerPixel * cut.Width / 8;
416
+                //声明字节数组
417
+                byte[] data = new byte[cut.Height * stride];
418
+
419
+                //调用CopyPixels
420
+                bmp.CopyPixels(cut, data, stride, 0);
421
+                new Thread(new ThreadStart(new Action(() =>
422
+                {
423
+                    BitmapSource bitmapSource = BitmapSource.Create(width, height, PrimaryScreen.DpiX, PrimaryScreen.DpiY, PixelFormats.Bgr32, null, data, stride);
424
+
425
+                    BitmapEncoder encoder = new PngBitmapEncoder();
426
+                    encoder.Frames.Add(BitmapFrame.Create(bitmapSource));
427
+                    if (ImgWidth > 0)
428
+                    {
429
+                        Bitmap Img = new Bitmap(ImgWidth, ImgHeight);
430
+                        try
431
+                        {
432
+                            //MemoryStream memoryStream = new MemoryStream(data);
433
+                            //Bitmap bit = (Bitmap)Image.FromStream(memoryStream);
434
+
435
+                            MemoryStream memoryStream = new MemoryStream();
436
+                            encoder.Save(memoryStream);
437
+                            Bitmap bit = new Bitmap(memoryStream, true);
438
+                            if (ImgWidth - 2 < bit.Width)
439
+                            {
440
+                                try
441
+                                {
442
+                                    Graphics g = Graphics.FromImage(Img);
443
+                                    g.DrawImage(bit, new Rectangle(0, 0, ImgWidth, ImgHeight), new Rectangle(0, 0, bit.Width, bit.Height), GraphicsUnit.Pixel);
444
+                                    g.Dispose();
445
+                                }
446
+                                catch
447
+                                {
448
+                                    Img = bit;
449
+                                }
450
+                            }
451
+                            else
452
+                            {
453
+                                Img = bit;
454
+                            }
455
+                            Img.Save(filePathName);
456
+                            memoryStream.Dispose();
457
+                            Img.Dispose();
458
+                            bit.Dispose();
459
+                        }
460
+                        catch (Exception)
461
+                        {
462
+                            using (var stream = new FileStream(filePathName, FileMode.Create))
463
+                            {
464
+                                encoder.Save(stream);
465
+                            }
466
+                        }
467
+                    }
468
+                    else
469
+                    {
470
+                        using (var stream = new FileStream(filePathName, FileMode.Create))
471
+                        {
472
+                            encoder.Save(stream);
473
+                        }
474
+                    }
475
+                }))).Start();
476
+            }
477
+            catch (Exception)
478
+            {
479
+
480
+            }
481
+        }
482
+
483
+        /// <summary>
484
+        /// 保存图片
485
+        /// </summary>
486
+        /// <param name="ui">需要截图的UI控件</param>
487
+        /// <param name="filePathName">图片保存地址 命名 1.png</param>
488
+        /// <param name="width">窗口宽</param>
489
+        /// <param name="height">窗口高</param>
490
+        /// <param name="ImgWidth">图片高</param>
491
+        /// <param name="ImgHeight">图片高</param>
492
+        public static void SaveUIToImage(FrameworkElement ui, string filePathName, int width, int height, int ImgWidth, int ImgHeight)
493
+        {
494
+            try
495
+            {
496
+                //在位图中呈现UI元素
497
+                RenderTargetBitmap bmp = new RenderTargetBitmap(width, height, PrimaryScreen.DpiX, PrimaryScreen.DpiY, PixelFormats.Pbgra32);
498
+                bmp.Render(ui);
499
+                BitmapEncoder encoder = new PngBitmapEncoder();
500
+                encoder.Frames.Add(BitmapFrame.Create(bmp));
501
+                if (ImgWidth > 0)
502
+                {
503
+                    Bitmap Img = new Bitmap(ImgWidth, ImgHeight);
504
+                    try
505
+                    {
506
+                        MemoryStream memoryStream = new MemoryStream();
507
+                        encoder.Save(memoryStream);
508
+                        new Thread(new ThreadStart(new Action(() =>
509
+                        {
510
+                            //System.Drawing.Image img = System.Drawing.Image.FromStream(memoryStream);
511
+                            Bitmap bit = new Bitmap(memoryStream);
512
+                            if (ImgWidth - 2 < bit.Width)
513
+                            {
514
+                                try
515
+                                {
516
+                                    Graphics g = Graphics.FromImage(Img);
517
+                                    //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
518
+                                    g.DrawImage(bit, new Rectangle(0, 0, ImgWidth, ImgHeight), new Rectangle(0, 0, bit.Width, bit.Height), GraphicsUnit.Pixel);
519
+                                    g.Dispose();
520
+                                }
521
+                                catch
522
+                                {
523
+                                    Img = bit;
524
+                                }
525
+                            }
526
+                            else
527
+                            {
528
+                                Img = bit;
529
+                            }
530
+                            Img.Save(filePathName);
531
+                            //Bitmap bitmap = CutImageWhitePart(Img);
532
+                            //FileToolsCommon.DeleteFile(filePathName);
533
+                            //bitmap.Save(filePathName);
534
+                            //bitmap.Dispose();
535
+                            memoryStream.Dispose();
536
+                            Img.Dispose();
537
+                            bit.Dispose();
538
+                        }))).Start();
539
+                    }
540
+                    catch (Exception)
541
+                    {
542
+
543
+                    }
544
+                }
545
+                else
546
+                {
547
+                    //SaveImageModel sim = new SaveImageModel();
548
+                    //sim.encoder = new PngBitmapEncoder();
549
+                    //sim.encoder = new PngBitmapEncoder();
550
+                    //BitmapFrame test= encoder.Frames[0];
551
+                    //sim.encoder.Frames.Add(BitmapFrame.Create(test));
552
+                    ////sim.encoder.Frames[0].CopyTo(encoder.Frames[0]);
553
+                    ////sim.encoder.CopyTo(encoder);
554
+                    ////encoder.CopyTo(sim.encoder);
555
+                    //sim.FilePath = filePathName;
556
+                    ////sim.bmp = new RenderTargetBitmap(width, height, PrimaryScreen.DpiX, PrimaryScreen.DpiY, PixelFormats.Pbgra32);
557
+                    ////bmp.CopyTo(sim.bmp);
558
+                    //Thread t1 = new Thread(SaveImage);
559
+                    //t1.Start(sim);
560
+
561
+                    System.IO.FileStream fs = new System.IO.FileStream(filePathName, System.IO.FileMode.Create);
562
+                    encoder.Save(fs);
563
+                    fs.Close();
564
+                }
565
+            }
566
+            catch (Exception ex)
567
+            {
568
+                LogHelper.WriteErrLog("【UI生成图片】(SaveUIToImage)" + ex.Message, ex);
569
+                //Console.WriteLine(ex.Message);
570
+            }
571
+        }
572
+        public static void SaveUI1(FrameworkElement ui, string filePathName, int width, int height, int ImgWidth, int ImgHeight)
573
+        {
574
+            try
575
+            {
576
+                //在位图中呈现UI元素
577
+                RenderTargetBitmap bmp = new RenderTargetBitmap(width, height, PrimaryScreen.DpiX, PrimaryScreen.DpiY, PixelFormats.Pbgra32);
578
+                bmp.Render(ui);
579
+
580
+                //BitmapEncoder encoder = new PngBitmapEncoder();
581
+                //encoder.Frames.Add(BitmapFrame.Create(bmp));
582
+
583
+                //BitmapSource bitmapSource= bmp.Clone();
584
+
585
+
586
+
587
+                //定义切割矩形
588
+                var cut = new Int32Rect(0, 0, width, height);
589
+                //计算Stride
590
+                var stride = bmp.Format.BitsPerPixel * cut.Width / 8;
591
+                //声明字节数组
592
+                byte[] data = new byte[cut.Height * stride];
593
+
594
+                //调用CopyPixels
595
+                bmp.CopyPixels(cut, data, stride, 0);
596
+                new Thread(new ThreadStart(new Action(() =>
597
+                {
598
+                    BitmapSource bitmapSource = BitmapSource.Create(width, height, PrimaryScreen.DpiX, PrimaryScreen.DpiY, PixelFormats.Bgr32, null, data, stride);
599
+
600
+                    BitmapEncoder encoder = new PngBitmapEncoder();
601
+                    encoder.Frames.Add(BitmapFrame.Create(bitmapSource));
602
+
603
+                    using (var stream = new FileStream(filePathName, FileMode.Create))
604
+                    {
605
+                        encoder.Save(stream);
606
+                    }
607
+                }))).Start();
608
+                //SaveModel saveModel = new SaveModel();
609
+                //saveModel.ImgWidth = ImgWidth;
610
+                //saveModel.ImgHeight = ImgHeight;
611
+                //saveModel.filePathName = filePathName;
612
+                //saveModel.bmp = bmp;
613
+                //saveModel.encoder =new PngBitmapEncoder();
614
+                //foreach (BitmapFrame eitem in encoder.Frames)
615
+                //{
616
+                //    saveModel.encoder = new PngBitmapEncoder();
617
+                //    saveModel.encoder.Frames.Add( eitem );
618
+                //}
619
+
620
+                //Thread myThread = new Thread(SaveImage);
621
+                //myThread.Start(saveModel);
622
+            }
623
+            catch (Exception)
624
+            {
625
+
626
+            }
627
+
628
+        }
629
+        public static void SaveImage(object model)
630
+        {
631
+            try
632
+            {
633
+                SaveModel saveModel = (SaveModel)model;
634
+                int ImgWidth = saveModel.ImgWidth;
635
+                int ImgHeight = saveModel.ImgHeight;
636
+                //BitmapEncoder encoder = saveModel.encoder;
637
+                RenderTargetBitmap bmp = saveModel.bmp;
638
+                BitmapEncoder encoder = new PngBitmapEncoder();
639
+                encoder.Frames.Add(BitmapFrame.Create(bmp));
640
+                string filePathName = saveModel.filePathName;
641
+                if (ImgWidth > 0)
642
+                {
643
+                    Bitmap Img = new Bitmap(ImgWidth, ImgHeight);
644
+                    try
645
+                    {
646
+                        MemoryStream memoryStream = new MemoryStream();
647
+                        encoder.Save(memoryStream);
648
+                        new Thread(new ThreadStart(new Action(() =>
649
+                        {
650
+                        //System.Drawing.Image img = System.Drawing.Image.FromStream(memoryStream);
651
+                        Bitmap bit = new Bitmap(memoryStream);
652
+                            if (ImgWidth - 2 < bit.Width)
653
+                            {
654
+                                try
655
+                                {
656
+                                    Graphics g = Graphics.FromImage(Img);
657
+                                //g.InterpolationMode = InterpolationMode.HighQualityBicubic;
658
+                                g.DrawImage(bit, new Rectangle(0, 0, ImgWidth, ImgHeight), new Rectangle(0, 0, bit.Width, bit.Height), GraphicsUnit.Pixel);
659
+                                    g.Dispose();
660
+                                }
661
+                                catch
662
+                                {
663
+                                    Img = bit;
664
+                                }
665
+                            }
666
+                            else
667
+                            {
668
+                                Img = bit;
669
+                            }
670
+                            Img.Save(filePathName);
671
+                        //Bitmap bitmap = CutImageWhitePart(Img);
672
+                        //FileToolsCommon.DeleteFile(filePathName);
673
+                        //bitmap.Save(filePathName);
674
+                        //bitmap.Dispose();
675
+                        memoryStream.Dispose();
676
+                            Img.Dispose();
677
+                            bit.Dispose();
678
+                        }))).Start();
679
+                    }
680
+                    catch (Exception)
681
+                    {
682
+
683
+                    }
684
+                }
685
+                else
686
+                {
687
+                    //SaveImageModel sim = new SaveImageModel();
688
+                    //sim.encoder = new PngBitmapEncoder();
689
+                    //sim.encoder = new PngBitmapEncoder();
690
+                    //BitmapFrame test= encoder.Frames[0];
691
+                    //sim.encoder.Frames.Add(BitmapFrame.Create(test));
692
+                    ////sim.encoder.Frames[0].CopyTo(encoder.Frames[0]);
693
+                    ////sim.encoder.CopyTo(encoder);
694
+                    ////encoder.CopyTo(sim.encoder);
695
+                    //sim.FilePath = filePathName;
696
+                    ////sim.bmp = new RenderTargetBitmap(width, height, PrimaryScreen.DpiX, PrimaryScreen.DpiY, PixelFormats.Pbgra32);
697
+                    ////bmp.CopyTo(sim.bmp);
698
+                    //Thread t1 = new Thread(SaveImage);
699
+                    //t1.Start(sim);
700
+
701
+                    System.IO.FileStream fs = new System.IO.FileStream(filePathName, System.IO.FileMode.Create);
702
+                    encoder.Save(fs);
703
+                    fs.Close();
704
+                }
705
+            }
706
+            catch (Exception)
707
+            {
708
+
709
+            }
710
+        }
711
+        /// <summary>
712
+        /// 截图转换成bitmap
713
+        /// </summary>
714
+        /// <param name="element"></param>
715
+        /// <param name="width">默认控件宽度</param>
716
+        /// <param name="height">默认控件高度</param>
717
+        /// <param name="x">默认0</param>
718
+        /// <param name="y">默认0</param>
719
+        /// <returns></returns>
720
+        public static Bitmap ToBitmap(FrameworkElement element, string filePathName, int width = 0, int height = 0, int x = 0, int y = 0)
721
+        {
722
+            if (width == 0) width = (int)element.ActualWidth;
723
+            if (height == 0) height = (int)element.ActualHeight;
724
+
725
+            var rtb = new RenderTargetBitmap(width, height, x, y, System.Windows.Media.PixelFormats.Default);
726
+            rtb.Render(element);
727
+            var bit = BitmapSourceToBitmap(rtb);
728
+
729
+            //测试代码
730
+            DirectoryInfo d = new DirectoryInfo(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "Cache"));
731
+            if (!d.Exists) d.Create();
732
+            bit.Save(System.IO.Path.Combine(d.FullName, "控件截图.png"));
733
+
734
+            return bit;
735
+        }
736
+
737
+        /// <summary>
738
+        /// BitmapSource转Bitmap
739
+        /// </summary>
740
+        /// <param name="source"></param>
741
+        /// <returns></returns>
742
+        public static Bitmap BitmapSourceToBitmap(BitmapSource source)
743
+        {
744
+            return BitmapSourceToBitmap(source, source.PixelWidth, source.PixelHeight);
745
+        }
746
+
747
+        /// <summary>
748
+        /// Convert BitmapSource to Bitmap
749
+        /// </summary>
750
+        /// <param name="source"></param>
751
+        /// <returns></returns>
752
+        public static Bitmap BitmapSourceToBitmap(BitmapSource source, int width, int height)
753
+        {
754
+            Bitmap bmp = null;
755
+            try
756
+            {
757
+                System.Drawing.Imaging.PixelFormat format = System.Drawing.Imaging.PixelFormat.Format24bppRgb;
758
+                /*set the translate type according to the in param(source)*/
759
+                switch (source.Format.ToString())
760
+                {
761
+                    case "Rgb24":
762
+                    case "Bgr24": format = System.Drawing.Imaging.PixelFormat.Format24bppRgb; break;
763
+                    case "Bgra32": format = System.Drawing.Imaging.PixelFormat.Format32bppPArgb; break;
764
+                    case "Bgr32": format = System.Drawing.Imaging.PixelFormat.Format32bppRgb; break;
765
+                    case "Pbgra32": format = System.Drawing.Imaging.PixelFormat.Format32bppArgb; break;
766
+                }
767
+                bmp = new Bitmap(width, height, format);
768
+                BitmapData data = bmp.LockBits(new System.Drawing.Rectangle(System.Drawing.Point.Empty, bmp.Size),
769
+                    ImageLockMode.WriteOnly,
770
+                    format);
771
+                source.CopyPixels(Int32Rect.Empty, data.Scan0, data.Height * data.Stride, data.Stride);
772
+                bmp.UnlockBits(data);
773
+            }
774
+            catch
775
+            {
776
+                if (bmp != null)
777
+                {
778
+                    bmp.Dispose();
779
+                    bmp = null;
780
+                }
781
+            }
782
+
783
+            return bmp;
784
+        }
785
+        private static void SaveImage1(object obj)
786
+        {
787
+            SaveImageModel sim = (SaveImageModel)obj;
788
+            //RenderTargetBitmap bmp = sim.bmp;
789
+            //BitmapEncoder encoder = new PngBitmapEncoder();
790
+            //encoder.Frames.Add(BitmapFrame.Create(bmp));
791
+            BitmapEncoder encoder = sim.encoder;
792
+            string filePathName = sim.FilePath;
793
+            System.IO.FileStream fs = new System.IO.FileStream(filePathName, System.IO.FileMode.Create);
794
+            encoder.Save(fs);
795
+            fs.Close();
796
+        }
797
+
798
+        #endregion
799
+
800
+        #region 去掉白边
801
+        /// <summary>
802
+        /// 裁剪图片(去掉白边)
803
+        /// </summary>
804
+        /// <param name="FilePath"></param>
805
+        public static Bitmap CutImageWhitePart(Bitmap bmp)
806
+        {
807
+            //Bitmap bmp = new Bitmap(FilePath);
808
+            //上左右下
809
+            int top = 0, left = 0, right = bmp.Width, bottom = bmp.Height;
810
+
811
+            //寻找最上面的标线,从左(0)到右,从上(0)到下
812
+            for (int i = 0; i < bmp.Height; i++)//行
813
+            {
814
+                bool find = false;
815
+                for (int j = 0; j < bmp.Width; j++)//列
816
+                {
817
+                    System.Drawing.Color c = bmp.GetPixel(j, i);
818
+                    if (!IsWhite(c))
819
+                    {
820
+                        top = i;
821
+                        find = true;
822
+                        break;
823
+                    }
824
+                }
825
+                if (find)
826
+                {
827
+                    break;
828
+                }
829
+            }
830
+            //寻找最左边的标线,从上(top位)到下,从左到右
831
+            for (int i = 0; i < bmp.Width; i++)//列
832
+            {
833
+                bool find = false;
834
+                for (int j = top; j < bmp.Height; j++)//行
835
+                {
836
+                    System.Drawing.Color c = bmp.GetPixel(i, j);
837
+                    if (!IsWhite(c))
838
+                    {
839
+                        left = i;
840
+                        find = true;
841
+                        break;
842
+                    }
843
+                }
844
+                if (find)
845
+                {
846
+                    break;
847
+                }
848
+            }
849
+            //寻找最下边标线,从下到上,从左到右
850
+            for (int i = bmp.Height - 1; i >= 0; i--)//行
851
+            {
852
+                bool find = false;
853
+                for (int j = left; j < bmp.Width; j++)//列
854
+                {
855
+                    System.Drawing.Color c = bmp.GetPixel(j, i);
856
+                    if (!IsWhite(c))
857
+                    {
858
+                        bottom = i;
859
+                        find = true;
860
+                        break;
861
+                    }
862
+                }
863
+                if (find)
864
+                {
865
+                    break;
866
+                }
867
+            }
868
+            //寻找最右边的标线,从上到下,从右往左
869
+            for (int i = bmp.Width - 1; i >= 0; i--)//列
870
+            {
871
+                bool find = false;
872
+                for (int j = 0; j <= bottom; j++)//行
873
+                {
874
+                    System.Drawing.Color c = bmp.GetPixel(i, j);
875
+                    if (!IsWhite(c))
876
+                    {
877
+                        right = i;
878
+                        find = true;
879
+                        break;
880
+                    }
881
+                }
882
+                if (find)
883
+                {
884
+                    break;
885
+                }
886
+            }
887
+
888
+            if (right - left <= 0)//zxyceshi
889
+            {
890
+                //克隆位图对象的一部分。
891
+                System.Drawing.Rectangle cloneRect = new System.Drawing.Rectangle(left, top, 1, bottom - top);
892
+                Bitmap cloneBitmap = bmp.Clone(cloneRect, bmp.PixelFormat);
893
+                bmp.Dispose();
894
+                //cloneBitmap.Save(@"d:\123.png", ImageFormat.Png);
895
+                return cloneBitmap;
896
+            }
897
+            else
898
+            {
899
+                //克隆位图对象的一部分。
900
+                System.Drawing.Rectangle cloneRect = new System.Drawing.Rectangle(left, top, right - left, bottom - top);
901
+                Bitmap cloneBitmap = bmp.Clone(cloneRect, bmp.PixelFormat);
902
+                bmp.Dispose();
903
+                //cloneBitmap.Save(@"d:\123.png", ImageFormat.Png);
904
+                return cloneBitmap;
905
+            }
906
+
907
+        }
908
+
909
+        /// <summary>
910
+        /// 判断是否白色和纯透明色(10点的容差)
911
+        /// </summary>
912
+        public static bool IsWhite(System.Drawing.Color c)
913
+        {
914
+            //纯透明也是白色,RGB都为255为纯白
915
+            if (c.A < 10 || (c.R > 245 && c.G > 245 && c.B > 245))
916
+            {
917
+                return true;
918
+            }
919
+
920
+            return false;
921
+        }
922
+        #endregion
923
+    }
924
+    public class SaveImageModel
925
+    {
926
+        public string FilePath { get; set; }
927
+        public BitmapEncoder encoder { get; set; }
928
+        //public RenderTargetBitmap bmp { get; set; }
929
+    }
930
+    public class SaveModel
931
+    {
932
+        public int ImgWidth { get; set; }
933
+        public int ImgHeight { get; set; }
934
+        public BitmapEncoder encoder { get; set; }
935
+        public string filePathName { get; set; }
936
+        public RenderTargetBitmap bmp { get; set; }
937
+    }
938
+}

+ 65
- 0
Common/system/JsonHelper.cs ファイルの表示

@@ -0,0 +1,65 @@
1
+using Newtonsoft.Json;
2
+
3
+using System.Collections.Generic;
4
+using System.IO;
5
+
6
+namespace Common.system
7
+{
8
+    public class JsonHelper
9
+    {
10
+        #region Method
11
+
12
+        /// <summary>
13
+        /// 类对像转换成json格式
14
+        /// </summary>
15
+        /// <returns></returns>
16
+        public static string ToJson(object t)
17
+        {
18
+            return JsonConvert.SerializeObject(
19
+                t, Newtonsoft.Json.Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Include }
20
+                );
21
+        }
22
+
23
+        /// <summary>
24
+        /// 类对像转换成json格式
25
+        /// </summary>
26
+        /// <param name="t"></param>
27
+        /// <param name="HasNullIgnore">是否忽略NULL值</param>
28
+        /// <returns></returns>
29
+        public static string ToJson(object t, bool HasNullIgnore)
30
+        {
31
+            if (HasNullIgnore)
32
+            {
33
+                return JsonConvert.SerializeObject(t, Newtonsoft.Json.Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
34
+            }
35
+            else
36
+            {
37
+                return ToJson(t);
38
+            }
39
+        }
40
+
41
+        /// <summary>
42
+        /// json格式转换
43
+        /// </summary>
44
+        /// <typeparam name="T"></typeparam>
45
+        /// <param name="strJson"></param>
46
+        /// <returns></returns>
47
+        public static T JsonToObj<T>(string strJson) where T : class
48
+        {
49
+            if (strJson != null && strJson != "") { return JsonConvert.DeserializeObject<T>(strJson); }
50
+
51
+            return null;
52
+        }
53
+
54
+        internal static List<T> JsonToList<T>(string respstr)
55
+        {
56
+            JsonSerializer serializer = new JsonSerializer();
57
+            StringReader sr = new StringReader(respstr);
58
+            object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
59
+            List<T> list = o as List<T>;
60
+            return list;
61
+        }
62
+
63
+        #endregion Method
64
+    }
65
+}

+ 208
- 0
Common/system/KeyboardHookCommon.cs ファイルの表示

@@ -0,0 +1,208 @@
1
+using System;
2
+using System.Runtime.InteropServices;
3
+using System.Windows.Forms;
4
+
5
+namespace Common.system
6
+{
7
+    /// <summary>
8
+    /// 键盘钩子
9
+    /// 创建人:赵耀
10
+    /// 创建时间:2020年9月11日
11
+    /// </summary>
12
+    public class KeyboardHookCommon
13
+    {
14
+        /// <summary>
15
+        /// 全局按键按下
16
+        /// </summary>
17
+        public event KeyEventHandler KeyDownEvent;
18
+        /// <summary>
19
+        /// 窗口按键按下
20
+        /// </summary>
21
+        public event KeyPressEventHandler KeyPressEvent;
22
+        /// <summary>
23
+        /// 全局按键抬起
24
+        /// </summary>
25
+        public event KeyEventHandler KeyUpEvent;
26
+
27
+        public delegate int HookProc(int nCode, int wParam, IntPtr lParam);
28
+
29
+        private static int hKeyboardHook = 0; //声明键盘钩子处理的初始值
30
+                                              //值在Microsoft SDK的Winuser.h里查询
31
+        /// <summary>
32
+        /// 线程键盘钩子监听鼠标消息设为2,全局键盘监听鼠标消息设为13
33
+        /// </summary>
34
+        public const int WH_KEYBOARD_LL = 13;
35
+
36
+        /// <summary>
37
+        /// 声明KeyboardHookProcedure作为HookProc类型
38
+        /// </summary>
39
+        private HookProc KeyboardHookProcedure;
40
+
41
+        /// <summary>
42
+        /// 自己创建窗口按键 
43
+        /// </summary>
44
+        private const int WM_KEYDOWN = 0x100;//KEYDOWN
45
+        /// <summary>
46
+        /// 窗口按键抬起
47
+        /// </summary>
48
+        private const int WM_KEYUP = 0x101;//KEYUP
49
+        /// <summary>
50
+        /// 全局系统按键
51
+        /// </summary>
52
+        private const int WM_SYSKEYDOWN = 0x104;//SYSKEYDOWN
53
+        /// <summary>
54
+        /// 全局按键抬起
55
+        /// </summary>
56
+        private const int WM_SYSKEYUP = 0x105;//SYSKEYUP
57
+
58
+        //键盘结构
59
+        [StructLayout(LayoutKind.Sequential)]
60
+        public class KeyboardHookStruct
61
+        {
62
+            public int vkCode;  //定一个虚拟键码。该代码必须有一个价值的范围1至254
63
+            public int scanCode; // 指定的硬件扫描码的关键
64
+            public int flags;  // 键标志
65
+            public int time; // 指定的时间戳记的这个讯息
66
+            public int dwExtraInfo; // 指定额外信息相关的信息
67
+        }
68
+        //使用此功能,安装了一个钩子
69
+        [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
70
+        public static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);
71
+
72
+
73
+        //调用此函数卸载钩子
74
+        [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
75
+        public static extern bool UnhookWindowsHookEx(int idHook);
76
+
77
+
78
+        //使用此功能,通过信息钩子继续下一个钩子
79
+        [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
80
+        public static extern int CallNextHookEx(int idHook, int nCode, int wParam, IntPtr lParam);
81
+
82
+        // 取得当前线程编号(线程钩子需要用到)
83
+        [DllImport("kernel32.dll")]
84
+        private static extern int GetCurrentThreadId();
85
+
86
+        //使用WINDOWS API函数代替获取当前实例的函数,防止钩子失效
87
+        [DllImport("kernel32.dll")]
88
+        public static extern IntPtr GetModuleHandle(string name);
89
+
90
+        //ToAscii职能的转换指定的虚拟键码和键盘状态的相应字符或字符
91
+        [DllImport("user32")]
92
+        public static extern int ToAscii(int uVirtKey, //[in] 指定虚拟关键代码进行翻译。
93
+                                         int uScanCode, // [in] 指定的硬件扫描码的关键须翻译成英文。高阶位的这个值设定的关键,如果是(不压)
94
+                                         byte[] lpbKeyState, // [in] 指针,以256字节数组,包含当前键盘的状态。每个元素(字节)的数组包含状态的一个关键。如果高阶位的字节是一套,关键是下跌(按下)。在低比特,如果设置表明,关键是对切换。在此功能,只有肘位的CAPS LOCK键是相关的。在切换状态的NUM个锁和滚动锁定键被忽略。
95
+                                         byte[] lpwTransKey, // [out] 指针的缓冲区收到翻译字符或字符。
96
+                                         int fuState); // [in] Specifies whether a menu is active. This parameter must be 1 if a menu is active, or 0 otherwise.
97
+
98
+        //获取按键的状态
99
+        [DllImport("user32")]
100
+        public static extern int GetKeyboardState(byte[] pbKeyState);
101
+
102
+
103
+        [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
104
+        private static extern short GetKeyState(int vKey);
105
+
106
+        public void Start()
107
+        {
108
+            // 安装键盘钩子
109
+            if (hKeyboardHook == 0)
110
+            {
111
+                KeyboardHookProcedure = new HookProc(KeyboardHookProc);
112
+                hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProcedure, GetModuleHandle(System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName), 0);
113
+                //hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProcedure, Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]), 0);
114
+                //************************************
115
+                //键盘线程钩子
116
+                //SetWindowsHookEx( 2,KeyboardHookProcedure, IntPtr.Zero, GetCurrentThreadId());//指定要监听的线程idGetCurrentThreadId(),
117
+                //键盘全局钩子,需要引用空间(using System.Reflection;)
118
+                //SetWindowsHookEx( 13,MouseHookProcedure,Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]),0);
119
+                //
120
+                //关于SetWindowsHookEx (int idHook, HookProc lpfn, IntPtr hInstance, int threadId)函数将钩子加入到钩子链表中,说明一下四个参数:
121
+                //idHook 钩子类型,即确定钩子监听何种消息,上面的代码中设为2,即监听键盘消息并且是线程钩子,如果是全局钩子监听键盘消息应设为13,
122
+                //线程钩子监听鼠标消息设为7,全局钩子监听鼠标消息设为14。lpfn 钩子子程的地址指针。如果dwThreadId参数为0 或是一个由别的进程创建的
123
+                //线程的标识,lpfn必须指向DLL中的钩子子程。 除此以外,lpfn可以指向当前进程的一段钩子子程代码。钩子函数的入口地址,当钩子钩到任何
124
+                //消息后便调用这个函数。hInstance应用程序实例的句柄。标识包含lpfn所指的子程的DLL。如果threadId 标识当前进程创建的一个线程,而且子
125
+                //程代码位于当前进程,hInstance必须为NULL。可以很简单的设定其为本应用程序的实例句柄。threaded 与安装的钩子子程相关联的线程的标识符
126
+                //如果为0,钩子子程与所有的线程关联,即为全局钩子
127
+                //************************************
128
+                //如果SetWindowsHookEx失败
129
+                if (hKeyboardHook == 0)
130
+                {
131
+                    Stop();
132
+                    throw new Exception("安装键盘钩子失败");
133
+                }
134
+            }
135
+        }
136
+        public void Stop()
137
+        {
138
+            bool retKeyboard = true;
139
+
140
+
141
+            if (hKeyboardHook != 0)
142
+            {
143
+                retKeyboard = UnhookWindowsHookEx(hKeyboardHook);
144
+                hKeyboardHook = 0;
145
+            }
146
+            try
147
+            {
148
+
149
+                if (!(retKeyboard))
150
+                {
151
+                    throw new Exception("卸载钩子失败!");
152
+                }
153
+            }
154
+            catch (Exception)
155
+            {
156
+
157
+            }
158
+        }
159
+        ////接收SetWindowsHookEx返回值  
160
+        //private static int _hHookValue = 0;
161
+        private int KeyboardHookProc(int nCode, int wParam, IntPtr lParam)
162
+        {
163
+            // 侦听键盘事件
164
+            if ((nCode >= 0) && (KeyDownEvent != null || KeyUpEvent != null || KeyPressEvent != null))
165
+            {
166
+                KeyboardHookStruct MyKeyboardHookStruct = (KeyboardHookStruct)Marshal.PtrToStructure(lParam, typeof(KeyboardHookStruct));
167
+                // raise KeyDown
168
+                if (KeyDownEvent != null && (wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN))
169
+                {
170
+                    Keys keyData = (Keys)MyKeyboardHookStruct.vkCode;
171
+                    KeyEventArgs e = new KeyEventArgs(keyData);
172
+                    KeyDownEvent(this, e);
173
+                }
174
+
175
+                //键盘按下
176
+                if (KeyPressEvent != null && wParam == WM_KEYDOWN)
177
+                {
178
+                    byte[] keyState = new byte[256];
179
+                    GetKeyboardState(keyState);
180
+
181
+                    byte[] inBuffer = new byte[2];
182
+                    if (ToAscii(MyKeyboardHookStruct.vkCode, MyKeyboardHookStruct.scanCode, keyState, inBuffer, MyKeyboardHookStruct.flags) == 1)
183
+                    {
184
+                        KeyPressEventArgs e = new KeyPressEventArgs((char)inBuffer[0]);
185
+                        KeyPressEvent(this, e);
186
+                    }
187
+                }
188
+
189
+                // 键盘抬起
190
+                if (KeyUpEvent != null && (wParam == WM_KEYUP || wParam == WM_SYSKEYUP))
191
+                {
192
+                    Keys keyData = (Keys)MyKeyboardHookStruct.vkCode;
193
+                    KeyEventArgs e = new KeyEventArgs(keyData);
194
+                    KeyUpEvent(this, e);
195
+                }
196
+
197
+            }
198
+            //如果返回1,则结束消息,这个消息到此为止,不再传递。
199
+            //如果返回0或调用CallNextHookEx函数则消息出了这个钩子继续往下传递,也就是传给消息真正的接受者
200
+            return CallNextHookEx(hKeyboardHook, nCode, wParam, lParam);
201
+        }
202
+        ~KeyboardHookCommon()
203
+        {
204
+            Stop();
205
+        }
206
+
207
+    }
208
+}

+ 25
- 0
Common/system/LogHelper.cs ファイルの表示

@@ -0,0 +1,25 @@
1
+using System;
2
+
3
+namespace Common.system
4
+{
5
+    public class LogHelper
6
+    {
7
+        public static readonly log4net.ILog loginfo = log4net.LogManager.GetLogger("loginfo");
8
+        public static readonly log4net.ILog logerror = log4net.LogManager.GetLogger("logerror");
9
+        public static void WriteInfoLog(string info)
10
+        {
11
+            if (loginfo.IsInfoEnabled)
12
+            {
13
+                loginfo.Info(info);
14
+            }
15
+        }
16
+
17
+        public static void WriteErrLog(string info, Exception ex)
18
+        {
19
+            if (logerror.IsErrorEnabled)
20
+            {
21
+                logerror.Error("[V " + FileToolsCommon.GetConfigValue("VersionName") + "]"+info, ex);
22
+            }
23
+        }
24
+    }
25
+}

+ 95
- 0
Common/system/MouseEventCommon.cs ファイルの表示

@@ -0,0 +1,95 @@
1
+using System.Runtime.InteropServices;
2
+
3
+namespace Common.system
4
+{
5
+    public class MouseEventCommon
6
+    {
7
+        //[DllImport("user32.dll")]
8
+        //static extern void mouse_event(MouseEventFlag flags, int dx, int dy, uint data, UIntPtr extraInfo);
9
+
10
+        [DllImport("user32")]
11
+        private static extern int mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
12
+        /// <summary>
13
+        /// 设置鼠标的坐标 
14
+        /// </summary>
15
+        /// <param name="x">横坐标</param>
16
+        /// <param name="y">纵坐标</param>
17
+        /// <returns></returns>
18
+        [DllImport("user32.dll")]
19
+        public static extern int SetCursorPos(int x, int y);
20
+
21
+        /// <summary>   
22
+        /// 获取鼠标的坐标   
23
+        /// </summary>   
24
+        /// <param name="lpPoint">传址参数,坐标point类型</param>   
25
+        /// <returns>获取成功返回真</returns>   
26
+
27
+
28
+        [DllImport("user32.dll", CharSet = CharSet.Auto)]
29
+        public static extern bool GetCursorPos(out POINT pt);
30
+
31
+        /// <summary>
32
+        /// 鼠标点击左键
33
+        /// </summary>
34
+        /// <param name="dx">坐标x</param>
35
+        /// <param name="dy">坐标Y</param>
36
+        /// <param name="data"></param>
37
+        public static void MouseLefClickEvent(int dx, int dy, int data)
38
+        {
39
+            GetCursorPos(out POINT pointRecord);
40
+            mouse_event((int)MouseEventFlag.MiddleDown, pointRecord.X, pointRecord.Y, data, 0);
41
+            mouse_event((int)MouseEventFlag.MiddleUp, pointRecord.X, pointRecord.Y, data, 0);
42
+        }
43
+        public static void MouseText(int dx, int dy)
44
+        {
45
+            mouse_event((int)MouseEventFlag.LeftDown, dx, dy, 0, 0);
46
+            mouse_event((int)MouseEventFlag.LeftUp, dx, dy, 0, 0);
47
+        }
48
+        /// <summary>
49
+        /// 鼠标点击中中键
50
+        /// </summary>
51
+        /// <param name="data"></param>
52
+        public static void MouseMiddleClickEvent(int data)
53
+        {
54
+            GetCursorPos(out POINT pointRecord);
55
+            mouse_event((int)MouseEventFlag.MiddleDown, pointRecord.X, pointRecord.Y, data, 0);
56
+            mouse_event((int)MouseEventFlag.MiddleUp, pointRecord.X, pointRecord.Y, data, 0);
57
+        }
58
+
59
+        public struct POINT
60
+        {
61
+            public int X;
62
+            public int Y;
63
+            public POINT(int x, int y)
64
+            {
65
+                this.X = x;
66
+                this.Y = y;
67
+            }
68
+
69
+        }
70
+
71
+        enum MouseEventFlag : uint
72
+        {
73
+            //移动鼠标 
74
+            Move = 0x0001,
75
+            //模拟鼠标左键按下 
76
+            LeftDown = 0x0002,
77
+            //模拟鼠标左键抬起 
78
+            LeftUp = 0x0004,
79
+            //模拟鼠标右键按下 
80
+            RightDown = 0x0008,
81
+            //模拟鼠标右键抬起 
82
+            RightUp = 0x0010,
83
+            //模拟鼠标中键按下 
84
+            MiddleDown = 0x0020,
85
+            //模拟鼠标中键抬起 
86
+            MiddleUp = 0x0040,
87
+            XDown = 0x0080,
88
+            XUp = 0x0100,
89
+            Wheel = 0x0800,
90
+            VirtualDesk = 0x4000,
91
+            //标示是否采用绝对坐标 
92
+            Absolute = 0x8000
93
+        }
94
+    }
95
+}

+ 88
- 0
Common/system/PdfTrunImage.cs ファイルの表示

@@ -0,0 +1,88 @@
1
+using O2S.Components.PDFRender4NET;
2
+
3
+using System.Collections.Generic;
4
+using System.Drawing;
5
+using System.Drawing.Imaging;
6
+using System.IO;
7
+
8
+namespace Common.system
9
+{
10
+    /// <summary>
11
+    /// 
12
+    /// Class to convert a pdf to an image using GhostScript DLL
13
+    /// Credit for this code go to:Rangel Avulso
14
+    /// i only fix a little bug and refactor a little
15
+    /// http://www.hrangel.com.br/index.php/2006/12/04/converter-pdf-para-imagem-jpeg-em-c/
16
+    /// </summary>
17
+    /// <seealso cref="http://www.hrangel.com.br/index.php/2006/12/04/converter-pdf-para-imagem-jpeg-em-c/"/>
18
+    public class PdfTrunImage
19
+    {
20
+        public enum Definition
21
+        {
22
+            One = 1, Two = 2, Three = 3, Four = 4, Five = 5, Six = 6, Seven = 7, Eight = 8, Nine = 9, Ten = 10
23
+        }
24
+
25
+        /// <summary>
26
+        /// 将PDF文档转换为图片的方法
27
+        /// </summary>
28
+        /// <param name="pdfInputPath">PDF文件路径</param>
29
+        /// <param name="imageOutputPath">图片输出路径</param>
30
+        /// <param name="imageName">生成图片的名字</param>
31
+        /// <param name="startPageNum">从PDF文档的第几页开始转换</param>
32
+        /// <param name="endPageNum">从PDF文档的第几页开始停止转换</param>
33
+        /// <param name="imageFormat">设置所需图片格式</param>
34
+        /// <param name="definition">设置图片的清晰度,数字越大越清晰</param>
35
+        public static List<string> ConvertPDF2Image(string pdfInputPath, string imageOutputPath,
36
+            string imageName, int startPageNum, int endPageNum, ImageFormat imageFormat, Definition definition)
37
+        {
38
+            List<string> images = new List<string>();
39
+            try
40
+            {
41
+                PDFFile pdfFile = PDFFile.Open(pdfInputPath);
42
+
43
+                if (!Directory.Exists(imageOutputPath))
44
+                {
45
+                    Directory.CreateDirectory(imageOutputPath);
46
+                }
47
+
48
+                // validate pageNum
49
+                if (startPageNum <= 0)
50
+                {
51
+                    startPageNum = 1;
52
+                }
53
+
54
+                if (endPageNum == 0 || endPageNum > pdfFile.PageCount)
55
+                {
56
+                    endPageNum = pdfFile.PageCount;
57
+                }
58
+                if (startPageNum > endPageNum)
59
+                {
60
+                    int tempPageNum = startPageNum;
61
+                    startPageNum = endPageNum;
62
+                    endPageNum = startPageNum;
63
+                }
64
+
65
+                // start to convert each page
66
+                for (int i = startPageNum; i <= endPageNum; i++)
67
+                {
68
+                    Bitmap pageImage = pdfFile.GetPageImage(i - 1, 56 * (int)definition);
69
+                    string imgPath = imageOutputPath + imageName + i.ToString() + "." + imageFormat.ToString();
70
+                    pageImage.Save(imgPath, imageFormat);
71
+                    images.Add(imgPath);
72
+                    // 返回的图片绝对路径集合
73
+                    pageImage.Dispose();
74
+                }
75
+
76
+                pdfFile.Dispose();
77
+                return images;
78
+            }
79
+            catch (System.Exception ex)
80
+            {
81
+                LogHelper.WriteErrLog("PDF转图片" +
82
+                    "【PdfTrunImage】" + ex.Message, ex);
83
+                images = new List<string>();
84
+                return images;
85
+            }
86
+        }
87
+    }
88
+}

+ 166
- 0
Common/system/PrimaryScreen.cs ファイルの表示

@@ -0,0 +1,166 @@
1
+using System;
2
+using System.Drawing;
3
+using System.Runtime.InteropServices;
4
+
5
+namespace Common.system
6
+{
7
+    /// <summary>
8
+    /// 获取系统DPI缩放倍数和真实大小
9
+    /// </summary>
10
+    public class PrimaryScreen
11
+    {
12
+        #region Win32 API
13
+        [DllImport("user32.dll")]
14
+        private static extern IntPtr GetDC(IntPtr ptr);
15
+        [DllImport("gdi32.dll")]
16
+        private static extern int GetDeviceCaps(
17
+       IntPtr hdc, // handle to DC
18
+       int nIndex // index of capability
19
+       );
20
+        [DllImport("user32.dll", EntryPoint = "ReleaseDC")]
21
+        private static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDc);
22
+        #endregion
23
+        #region DeviceCaps常量
24
+        /// <summary>
25
+        /// 屏幕的宽度(像素);
26
+        /// </summary>
27
+        private const int HORZRES = 8;
28
+
29
+        /// <summary>
30
+        /// 屏幕的高度
31
+        /// </summary>
32
+        private const int VERTRES = 10;
33
+
34
+        /// <summary>
35
+        /// 沿屏幕宽度每逻辑英寸的像素数,在多显示器系统中,该值对所显示器相同
36
+        /// </summary>
37
+        private const int LOGPIXELSX = 88;
38
+
39
+        /// <summary>
40
+        /// 沿屏幕高度每逻辑英寸的像素数,在多显示器系统中,该值对所显示器相同;
41
+        /// </summary>
42
+        private const int LOGPIXELSY = 90;
43
+
44
+        /// <summary>
45
+        /// Windows NT:可视桌面的以像素为单位的高度。
46
+        /// </summary>
47
+        private const int DESKTOPVERTRES = 117;
48
+
49
+        /// <summary>
50
+        /// DESKTOPHORZRES:Windows NT:可视桌面的以像素为单位的宽度。如果设备支持一个可视桌面或双重显示则此值可能大于VERTRES;
51
+        /// </summary>
52
+        private const int DESKTOPHORZRES = 118;
53
+        #endregion
54
+
55
+        #region 属性
56
+        /// <summary>
57
+        /// 获取屏幕分辨率当前物理大小 设置缩放后
58
+        /// </summary>
59
+        public static Size WorkingArea
60
+        {
61
+            get
62
+            {
63
+                IntPtr hdc = GetDC(IntPtr.Zero);
64
+                Size size = new Size
65
+                {
66
+                    Width = GetDeviceCaps(hdc, HORZRES),
67
+                    Height = GetDeviceCaps(hdc, VERTRES)
68
+                };
69
+                ReleaseDC(IntPtr.Zero, hdc);
70
+                return size;
71
+            }
72
+        }
73
+        /// <summary>
74
+        /// 当前系统DPI_X 大小 一般为96
75
+        /// </summary>
76
+        public static int DpiX
77
+        {
78
+            get
79
+            {
80
+                IntPtr hdc = GetDC(IntPtr.Zero);
81
+                int DpiX = GetDeviceCaps(hdc, LOGPIXELSX);
82
+                ReleaseDC(IntPtr.Zero, hdc);
83
+                return DpiX;
84
+            }
85
+        }
86
+        /// <summary>
87
+        /// 当前系统DPI_Y 大小 一般为96
88
+        /// </summary>
89
+        public static int DpiY
90
+        {
91
+            get
92
+            {
93
+                IntPtr hdc = GetDC(IntPtr.Zero);
94
+                int DpiX = GetDeviceCaps(hdc, LOGPIXELSY);
95
+                ReleaseDC(IntPtr.Zero, hdc);
96
+                return DpiX;
97
+            }
98
+        }
99
+        /// <summary>
100
+        /// 获取真实设置的桌面分辨率大小
101
+        /// </summary>
102
+        public static Size DESKTOP
103
+        {
104
+            get
105
+            {
106
+                IntPtr hdc = GetDC(IntPtr.Zero);
107
+                Size size = new Size
108
+                {
109
+                    Width = GetDeviceCaps(hdc, DESKTOPHORZRES),
110
+                    Height = GetDeviceCaps(hdc, DESKTOPVERTRES)
111
+                };
112
+                ReleaseDC(IntPtr.Zero, hdc);
113
+                return size;
114
+            }
115
+        }
116
+
117
+        /// <summary>
118
+        /// 获取宽度缩放百分比
119
+        /// </summary>
120
+        public static float ScaleX
121
+        {
122
+            get
123
+            {
124
+                IntPtr hdc = GetDC(IntPtr.Zero);
125
+                /*int t = */
126
+                GetDeviceCaps(hdc, DESKTOPHORZRES);
127
+                /* int d = */
128
+                GetDeviceCaps(hdc, HORZRES);
129
+                float ScaleX = GetDeviceCaps(hdc, DESKTOPHORZRES) / (float)GetDeviceCaps(hdc, HORZRES);
130
+                ReleaseDC(IntPtr.Zero, hdc);
131
+                return ScaleX;
132
+            }
133
+        }
134
+        /// <summary>
135
+        /// 获取高度缩放百分比
136
+        /// </summary>
137
+        public static float ScaleY
138
+        {
139
+            get
140
+            {
141
+                IntPtr hdc = GetDC(IntPtr.Zero);
142
+                float ScaleY = (float)GetDeviceCaps(hdc, DESKTOPVERTRES) / GetDeviceCaps(hdc, VERTRES);
143
+                ReleaseDC(IntPtr.Zero, hdc);
144
+                return ScaleY;
145
+            }
146
+        }
147
+
148
+        /// <summary>
149
+        /// 缩放后的大小
150
+        /// </summary>
151
+        /// <returns></returns>
152
+        public static SizeF ScaleScreenSize => new SizeF(DESKTOP.Width / (DpiX / 96f), DESKTOP.Height / (DpiY / 96f));
153
+        /// <summary>
154
+        /// 获取缩放后的工作区域大小
155
+        /// </summary>
156
+        public static RectangleF ScaleWorkingAreaSize
157
+        {
158
+            get
159
+            {
160
+                RectangleF rect = System.Windows.Forms.Screen.GetWorkingArea(new System.Drawing.Point((int)ScaleScreenSize.Width, (int)ScaleScreenSize.Height));
161
+                return new RectangleF(((float)rect.X) / (DpiX / 96f), ((float)rect.Y) / (DpiX / 96f), ((float)rect.Width) / (DpiX / 96f), ((float)rect.Height) / (DpiY / 96f));
162
+            }
163
+        }
164
+        #endregion
165
+    }
166
+}

+ 92
- 0
Common/system/QueueSync.cs ファイルの表示

@@ -0,0 +1,92 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace Common.system
8
+{
9
+    /// <summary>
10
+    /// 队列操作类 默认队列数1000
11
+    /// 创建人:赵耀
12
+    /// 创建时间:2019年8月22日
13
+    /// </summary>
14
+    /// <typeparam name="T"></typeparam>
15
+    public class QueueSync<T>
16
+    {
17
+        int _maxcount = 10000;
18
+        Queue<T> _queue = new Queue<T>();
19
+        /// <summary>
20
+        /// 获取该队列包含的元素数
21
+        /// </summary>
22
+        public int Count
23
+        {
24
+            get
25
+            {
26
+                if (_queue == null)
27
+                {
28
+                    return 0;
29
+                }
30
+                else
31
+                {
32
+                    return _queue.Count;
33
+                }
34
+            }
35
+        }
36
+
37
+        /// <summary>
38
+        /// 默认1000
39
+        /// </summary>
40
+        public QueueSync() : this(1000) { }
41
+
42
+        /// <summary>
43
+        /// 定义一个指定容量的队列
44
+        /// </summary>
45
+        /// <param name="maxcount"></param>
46
+        public QueueSync(int maxcount)
47
+        {
48
+            //_maxcount = Math.Max(maxcount, _maxcount);
49
+            _maxcount = maxcount;
50
+        }
51
+
52
+        /// <summary>
53
+        /// 入队列
54
+        /// </summary>
55
+        /// <param name="obj"></param>
56
+        /// <returns></returns>
57
+        public bool Enqueue(T obj)
58
+        {
59
+            bool result = false;
60
+            lock (this)
61
+            {
62
+                if (_queue.Count > _maxcount)
63
+                {
64
+                    _queue.Dequeue();
65
+                }
66
+                _queue.Enqueue(obj);
67
+                result = true;
68
+            }
69
+            return result;
70
+        }
71
+        /// <summary>
72
+        /// 出队列
73
+        /// </summary>
74
+        /// <returns></returns>
75
+        public T Dequeue()
76
+        {
77
+            T obj = default(T);
78
+            lock (this)
79
+            {
80
+                try
81
+                {
82
+                    obj = _queue.Dequeue();
83
+                }
84
+                catch
85
+                {
86
+
87
+                }
88
+            }
89
+            return obj;
90
+        }
91
+    }
92
+}

+ 104
- 0
Common/system/SplashScreen.cs ファイルの表示

@@ -0,0 +1,104 @@
1
+using System;
2
+using System.Reflection;
3
+using System.Threading;
4
+using System.Windows.Forms;
5
+
6
+namespace Common.system
7
+{
8
+    /// <summary>
9
+    /// 解决闪屏  加载等待 
10
+    /// 创建人:赵耀
11
+    /// 创建时间:2018年11月27日
12
+    /// </summary>
13
+    public class SplashScreen
14
+    {
15
+        private static object _obj = new object();
16
+
17
+        private static Form _SplashForm = null;
18
+
19
+        private static Thread _SplashThread = null;
20
+
21
+        private delegate void ChangeFormTextdelegate(string s);
22
+
23
+        public static void Show(Type splashFormType)
24
+        {
25
+            if (_SplashThread != null)
26
+            {
27
+                return;
28
+            }
29
+
30
+            if (splashFormType == null)
31
+            {
32
+                throw (new Exception());
33
+            }
34
+
35
+            _SplashThread = new Thread(new ThreadStart(delegate ()
36
+            {
37
+                CreateInstance(splashFormType);
38
+                Application.Run(_SplashForm);
39
+            }))
40
+            {
41
+                IsBackground = true
42
+            };
43
+            _SplashThread.SetApartmentState(ApartmentState.STA);
44
+            _SplashThread.Start();
45
+        }
46
+
47
+        public static void ChangeTitle(string status)
48
+        {
49
+            ChangeFormTextdelegate de = new ChangeFormTextdelegate(ChangeText);
50
+            _SplashForm.Invoke(de, status);
51
+        }
52
+
53
+
54
+
55
+        public static void Close()
56
+        {
57
+            if (_SplashThread == null || _SplashForm == null)
58
+            {
59
+                return;
60
+            }
61
+
62
+            try
63
+            {
64
+                _SplashForm.Invoke(new MethodInvoker(_SplashForm.Close));
65
+            }
66
+            catch (Exception)
67
+            {
68
+            }
69
+            _SplashThread = null;
70
+            _SplashForm = null;
71
+        }
72
+
73
+        private static void ChangeText(string title)
74
+        {
75
+            _SplashForm.Text = title.ToString();
76
+        }
77
+
78
+
79
+
80
+        private static void CreateInstance(Type FormType)
81
+        {
82
+            if (_SplashForm == null)
83
+            {
84
+                lock (_obj)
85
+                {
86
+                    object obj = FormType.InvokeMember(null,
87
+                                        BindingFlags.DeclaredOnly |
88
+                                        BindingFlags.Public | BindingFlags.NonPublic |
89
+                                        BindingFlags.Instance | BindingFlags.CreateInstance, null, null, null);
90
+                    _SplashForm = obj as Form;
91
+                    _SplashForm.TopMost = true;
92
+                    _SplashForm.ShowInTaskbar = false;
93
+                    _SplashForm.BringToFront();
94
+                    _SplashForm.StartPosition = FormStartPosition.CenterScreen;
95
+                    if (_SplashForm == null)
96
+                    {
97
+                        throw (new Exception());
98
+                    }
99
+                }
100
+            }
101
+        }
102
+
103
+    }
104
+}

+ 192
- 0
Common/system/XmlUtilHelper.cs ファイルの表示

@@ -0,0 +1,192 @@
1
+using System;
2
+using System.Data;
3
+using System.IO;
4
+using System.Xml;
5
+using System.Xml.Serialization;
6
+
7
+namespace Common.system
8
+{
9
+
10
+    /// <summary>
11
+    /// 通用XML序列化和反序列化工具类
12
+    /// 创建人:赵耀
13
+    /// 创建时间:2018年11月16日
14
+    /// </summary>
15
+    public static class XmlUtilHelper
16
+    {
17
+        #region 反序列化
18
+        /// <summary>
19
+        /// 反序列化
20
+        /// </summary>
21
+        /// <param name="type">类型</param>
22
+        /// <param name="xml">XML字符串</param>
23
+        /// <returns></returns>
24
+        public static object Deserialize(Type type, string xml)
25
+        {
26
+            try
27
+            {
28
+                using (StringReader sr = new StringReader(xml))
29
+                {
30
+                    XmlSerializer xmldes = new XmlSerializer(type);
31
+                    return xmldes.Deserialize(sr);
32
+                }
33
+            }
34
+            catch (Exception)
35
+            {
36
+                return null;
37
+            }
38
+        }
39
+        /// <summary>
40
+        /// 反序列化
41
+        /// </summary>
42
+        /// <param name="type"></param>
43
+        /// <param name="xml"></param>
44
+        /// <returns></returns>
45
+        public static object Deserialize(Type type, Stream stream)
46
+        {
47
+            XmlSerializer xmldes = new XmlSerializer(type);
48
+
49
+            return xmldes.Deserialize(stream);
50
+        }
51
+        /// <summary>
52
+        /// 反序列化实体
53
+        /// </summary>
54
+        /// <typeparam name="T"></typeparam>
55
+        /// <param name="strXML"></param>
56
+        /// <returns></returns>
57
+        public static T DESerializer<T>(string strXML) where T : class
58
+        {
59
+            try
60
+            {
61
+                using (StringReader sr = new StringReader(strXML))
62
+                {
63
+                    XmlSerializer serializer = new XmlSerializer(typeof(T));
64
+                    return serializer.Deserialize(sr) as T;
65
+                }
66
+            }
67
+            catch (Exception)
68
+            {
69
+                return null;
70
+            }
71
+        }
72
+
73
+        /// <summary>  
74
+        /// 从xml序列中反序列化  
75
+        /// </summary>  
76
+        /// <param name="objname"></param>  
77
+        /// <returns></returns>  
78
+        public static object Deserailize(Type type, string filename)
79
+        {
80
+            try
81
+            {
82
+                object obj;
83
+                if (!System.IO.File.Exists(filename))
84
+                {
85
+                    throw new Exception("指定文件不存在");
86
+                }
87
+                //Xml格式反序列化  
88
+                using (Stream stream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read))
89
+                {
90
+                    XmlSerializer formatter = new XmlSerializer(type);
91
+                    obj = formatter.Deserialize(stream);
92
+                    stream.Close();
93
+                }
94
+                return obj;
95
+            }
96
+            catch (Exception)
97
+            {
98
+                //Logger.Log4NetHelp.Error("反序列化失败:", e);
99
+                return null;
100
+            }
101
+        }
102
+
103
+        /// <summary>
104
+        /// 将xml转为Datable
105
+        /// </summary>
106
+        public static DataTable XmlToDataTable(string xmlStr)
107
+        {
108
+            if (!string.IsNullOrEmpty(xmlStr))
109
+            {
110
+                StringReader StrStream = null;
111
+                XmlTextReader Xmlrdr = null;
112
+                try
113
+                {
114
+                    DataSet ds = new DataSet();
115
+                    //读取字符串中的信息  
116
+                    StrStream = new StringReader(xmlStr);
117
+                    //获取StrStream中的数据  
118
+                    Xmlrdr = new XmlTextReader(StrStream);
119
+                    //ds获取Xmlrdr中的数据                 
120
+                    ds.ReadXml(Xmlrdr);
121
+                    return ds.Tables[0];
122
+                }
123
+                catch (Exception)
124
+                {
125
+                    return null;
126
+                }
127
+                finally
128
+                {
129
+                    //释放资源  
130
+                    if (Xmlrdr != null)
131
+                    {
132
+                        Xmlrdr.Close();
133
+                        StrStream.Close();
134
+                        StrStream.Dispose();
135
+                    }
136
+                }
137
+            }
138
+            return null;
139
+        }
140
+
141
+        #endregion
142
+
143
+        #region 序列化
144
+        /// <summary>
145
+        /// 实体类转XML
146
+        /// </summary>
147
+        /// <typeparam name="T"></typeparam>
148
+        /// <param name="obj"></param>
149
+        /// <returns></returns>
150
+        public static string XmlSerialize<T>(T obj)
151
+        {
152
+            using (StringWriter sw = new StringWriter())
153
+            {
154
+                Type t = obj.GetType();
155
+                XmlSerializer serializer = new XmlSerializer(obj.GetType());
156
+                serializer.Serialize(sw, obj);
157
+                sw.Close();
158
+                return sw.ToString();
159
+            }
160
+        }
161
+        /// <summary>
162
+        /// 序列化
163
+        /// </summary>
164
+        /// <param name="type">类型</param>
165
+        /// <param name="obj">对象</param>
166
+        /// <returns></returns>
167
+        public static string Serializer(Type type, object obj)
168
+        {
169
+            MemoryStream Stream = new MemoryStream();
170
+            XmlSerializer xml = new XmlSerializer(type);
171
+            try
172
+            {
173
+                //序列化对象
174
+                xml.Serialize(Stream, obj);
175
+            }
176
+            catch (InvalidOperationException)
177
+            {
178
+                //Logger.Log4NetHelp.Error("序列化失败:", ex);
179
+            }
180
+            Stream.Position = 0;
181
+            StreamReader sr = new StreamReader(Stream);
182
+            string str = sr.ReadToEnd();
183
+
184
+            sr.Dispose();
185
+            Stream.Dispose();
186
+
187
+            return str;
188
+        }
189
+
190
+        #endregion
191
+    }
192
+}

+ 94
- 0
Common/system/ZJClippingBorder.cs ファイルの表示

@@ -0,0 +1,94 @@
1
+using System;
2
+using System.Windows;
3
+using System.Windows.Controls;
4
+using System.Windows.Media;
5
+
6
+namespace Common.system
7
+{
8
+    public class ZJClippingBorder : Border
9
+    {
10
+        private object _oldClip;
11
+
12
+        protected override void OnRender(DrawingContext dc)
13
+        {
14
+            OnApplyChildClip();
15
+            base.OnRender(dc);
16
+        }
17
+
18
+        public override UIElement Child
19
+        {
20
+            get => base.Child;
21
+            set
22
+            {
23
+                if (Child != value)
24
+                {
25
+                    if (Child != null)
26
+                    {
27
+                        Child.SetValue(ClipProperty, _oldClip);
28
+                    }
29
+
30
+                    if (value != null)
31
+                    {
32
+                        _oldClip = value.ReadLocalValue(ClipProperty);
33
+                    }
34
+                    else
35
+                    {
36
+                        // If we dont set it to null we could leak a Geometry object
37
+                        _oldClip = null;
38
+                    }
39
+
40
+                    base.Child = value;
41
+                }
42
+            }
43
+        }
44
+
45
+        protected virtual void OnApplyChildClip()
46
+        {
47
+            UIElement child = Child;
48
+            if (child != null)
49
+            {
50
+                double top = Math.Max(CornerRadius.TopLeft, CornerRadius.TopRight);
51
+                double bottom = Math.Max(CornerRadius.BottomLeft, CornerRadius.BottomRight);
52
+                double max = Math.Max(top, bottom);
53
+                Size size = RenderSize;
54
+                double width = size.Width - (BorderThickness.Left + BorderThickness.Right);
55
+                double height = size.Height - (BorderThickness.Top + BorderThickness.Bottom);
56
+                Geometry result = new RectangleGeometry(new Rect(0, 0, width, height), max, max);
57
+                double halfWidth = width / 2;
58
+                double halfHeight = height / 2;
59
+
60
+                if (CornerRadius.TopLeft == 0)
61
+                {
62
+                    result = new CombinedGeometry(
63
+                        GeometryCombineMode.Union,
64
+                        result,
65
+                        new RectangleGeometry(new Rect(0, 0, halfWidth, halfHeight))
66
+                    );
67
+                }
68
+
69
+                if (CornerRadius.TopRight == 0)
70
+                {
71
+                    result = new CombinedGeometry(GeometryCombineMode.Union, result, new RectangleGeometry
72
+                (new Rect(halfWidth, 0, halfWidth, halfHeight)));
73
+                }
74
+
75
+                if (CornerRadius.BottomLeft == 0)
76
+                {
77
+                    result = new CombinedGeometry
78
+                  (GeometryCombineMode.Union, result, new RectangleGeometry
79
+                  (new Rect(0, halfHeight, halfWidth, halfHeight)));
80
+                }
81
+                if (CornerRadius.BottomRight == 0)
82
+                {
83
+                    result = new CombinedGeometry
84
+                  (
85
+                GeometryCombineMode.Union,
86
+                result,
87
+                new RectangleGeometry(new Rect(halfWidth, halfHeight, halfWidth, halfHeight))
88
+                );
89
+                }
90
+                child.Clip = result;
91
+            }
92
+        }
93
+    }
94
+}

+ 15
- 0
XHZB.Desktop/App.config ファイルの表示

@@ -0,0 +1,15 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+<configuration>
3
+    <startup> 
4
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5
+    </startup>
6
+  <appSettings>
7
+    <!--0正式 1测试-->
8
+    <add key="IsDebug" value="1" />
9
+    <!--是否输出信息日志0否-->
10
+    <add key="OutputVideoLog" value="0"/>
11
+    <!--版本号-->
12
+    <add key="VersionCode" value="1" />
13
+    <add key="VersionName" value="1.0.1" />
14
+  </appSettings>
15
+</configuration>

+ 393
- 0
XHZB.Desktop/App.cs ファイルの表示

@@ -0,0 +1,393 @@
1
+using Common.system;
2
+
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Diagnostics;
6
+using System.IO;
7
+using System.Reflection;
8
+using System.Security.Principal;
9
+using System.Threading;
10
+using System.Windows;
11
+using System.Windows.Threading;
12
+
13
+namespace XHZB.Desktop
14
+{
15
+    public partial class APP : Application
16
+    {
17
+        #region 全局变量
18
+        /// <summary>
19
+        /// 是否为测试版
20
+        /// </summary>
21
+        public static bool isDebug = FileToolsCommon.GetConfigValue("IsDebug") != "0";
22
+        /// <summary>
23
+        /// 接口地址
24
+        /// </summary>
25
+        public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("APIRequestAddress");
26
+        /// <summary>
27
+        /// 图片地址
28
+        /// </summary>
29
+        public static string uploadUrl = isDebug ? "http://schoolfiletest.xhkjedu.com/" : FileToolsCommon.GetConfigValue("FileRequestAddress");
30
+        /// <summary>
31
+        /// 展示文件
32
+        /// </summary>
33
+        public static string showImageUrl = isDebug ? "http://schoolfiletest.xhkjedu.com/static/" : FileToolsCommon.GetConfigValue("SchoolfileRequestAddress") + "/static/";
34
+        /// <summary>
35
+        /// 认证接口地址
36
+        /// </summary>
37
+        public static string certapiUrl = isDebug ? "http://certapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("CertapiRequestAddress");
38
+        /// <summary>
39
+        /// 数据存放目录
40
+        /// </summary>
41
+        public static string dataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\XHZB\\";
42
+        /// <summary>
43
+        /// 签名
44
+        /// </summary>
45
+        public static string Signature = "";
46
+        public static string secretKey = "nanhuakaizhangjianwangni";
47
+        /// <summary>
48
+        /// 录屏工具
49
+        /// </summary>
50
+        public static FFMpeg FFmpeg = new FFMpeg();
51
+        /// <summary>
52
+        /// 登陆状态 false 未登录 true已登陆
53
+        /// </summary>
54
+        public static bool IsLoginType = false;
55
+        /// <summary>
56
+        /// 防止图片地址重复
57
+        /// </summary>
58
+        public static long num = 9999;
59
+        /// <summary>
60
+        /// 导入图片路径
61
+        /// </summary>
62
+        public static string[] Paths = new string[] { };
63
+        /// <summary>
64
+        /// 截图图片路径
65
+        /// </summary>
66
+        public static string[] JPaths = new string[999];
67
+        public static string ImgPath = string.Empty;
68
+        /// <summary>
69
+        /// 页码IP
70
+        /// </summary>
71
+        public static string[] OutPut = new string[] { };
72
+        public static string CameraPosition = string.Empty;
73
+        /// <summary>
74
+        /// 数据存放目录
75
+        /// </summary>
76
+        public static string DataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\XHZB\\";
77
+        /// <summary>
78
+        /// 是否正在
79
+        /// </summary>
80
+        public static bool IsUpLoad = false;
81
+        #region 页面
82
+        /// <summary>
83
+        /// 主页面
84
+        /// </summary>
85
+        public static MainWindow W_MainWindow = null;
86
+        #endregion
87
+        #endregion
88
+
89
+        [STAThread]
90
+        private static void Main()
91
+        {
92
+            //myloading = new LoadDialog();
93
+            StopSameProcess();
94
+            Killffmpeg();
95
+            try
96
+            {
97
+                WindowsIdentity identity = WindowsIdentity.GetCurrent();
98
+                WindowsPrincipal principal = new WindowsPrincipal(identity);
99
+                try
100
+                {
101
+                    if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "temp"))//清除临时文件
102
+                    {
103
+                        Directory.Delete(AppDomain.CurrentDomain.BaseDirectory + "temp", true);
104
+                    }
105
+                }
106
+                catch (Exception)
107
+                {
108
+                }
109
+
110
+                //如果本地文件为空,弹出弹窗 输密匙
111
+                //本地文件不为空, 解析
112
+                if (!File.Exists(APP.dataPath + "signature.txt"))//上次登陆时间为空 或者签名为空 或者上次登陆时间不是今天   都需要输入密匙验证 ,否则只验证本地的签名
113
+                {
114
+                    if (principal.IsInRole(WindowsBuiltInRole.Administrator))
115
+                    {
116
+                        ////如果是管理员,则直接运行
117
+                        //KeyVerification wins = new KeyVerification();
118
+                        // 定义Application对象作为整个应用程序入口
119
+                        //Application app = new Application();
120
+                        //app.Run(wins);
121
+                        W_MainWindow = new MainWindow();
122
+                        Application app = new Application();
123
+                        app.Run(W_MainWindow);
124
+                    }
125
+                    else
126
+                    {
127
+                        //创建启动对象
128
+                        System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo
129
+                        {
130
+                            UseShellExecute = true,
131
+                            WorkingDirectory = Environment.CurrentDirectory,
132
+                            FileName = Assembly.GetExecutingAssembly().Location,
133
+                            //设置启动动作,确保以管理员身份运行
134
+                            Verb = "runas"
135
+                        };
136
+                        try
137
+                        {
138
+                            System.Diagnostics.Process.Start(startInfo);
139
+                        }
140
+                        catch
141
+                        {
142
+                            return;
143
+                        }
144
+                        //退出
145
+                        //Current.Shutdown();
146
+                        Environment.Exit(0);
147
+
148
+                    }
149
+                }
150
+                else
151
+                {
152
+                    if (principal.IsInRole(WindowsBuiltInRole.Administrator))
153
+                    {
154
+                        //ProductVerification wins = new ProductVerification();
155
+                        //Application app = new Application();
156
+                        //app.Run(wins);
157
+
158
+                        W_MainWindow = new MainWindow();
159
+                        Application app = new Application();
160
+                        app.Run(W_MainWindow);
161
+                    }
162
+                    else
163
+                    {
164
+                        //创建启动对象
165
+                        System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo
166
+                        {
167
+                            UseShellExecute = true,
168
+                            WorkingDirectory = Environment.CurrentDirectory,
169
+                            FileName = Assembly.GetExecutingAssembly().Location,
170
+                            //设置启动动作,确保以管理员身份运行
171
+                            Verb = "runas"
172
+                        };
173
+                        try
174
+                        {
175
+                            System.Diagnostics.Process.Start(startInfo);
176
+                        }
177
+                        catch
178
+                        {
179
+                            return;
180
+                        }
181
+                        //退出
182
+                        //Current.Shutdown();
183
+                        Environment.Exit(0);
184
+
185
+                    }
186
+                }
187
+            }
188
+            catch (Exception ex)
189
+            {
190
+
191
+                string ErrMessage = "【进程】(Main):进程意外关闭。 " + ex.Message;
192
+                LogHelper.WriteErrLog(ErrMessage, ex);
193
+            }
194
+        }
195
+
196
+        #region 杀死已存在的进程
197
+        /// <summary>
198
+        /// 结束已运行的程序
199
+        /// </summary>
200
+        private static void StopSameProcess()
201
+        {
202
+            Process current = Process.GetCurrentProcess();
203
+            Process[] processList = Process.GetProcesses();
204
+            foreach (Process process in processList)
205
+            {
206
+                if (process.ProcessName.ToUpper() == "星火直播")
207
+                {
208
+                    if (process.Id != current.Id) //忽略当前进程
209
+                    {
210
+                        try
211
+                        {
212
+                            process.Kill(); //结束进程
213
+                        }
214
+                        catch (Exception)
215
+                        {
216
+                        }
217
+                    }
218
+                }
219
+            }
220
+        }
221
+        /// <summary>
222
+        /// 杀死正在运行的ffmpeg
223
+        /// </summary>
224
+        public static void Killffmpeg()
225
+        {
226
+            Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
227
+            foreach (Process KillProcess in KillProcessArray)
228
+            {
229
+                KillProcess.Kill();
230
+            }
231
+        }
232
+        #endregion
233
+
234
+        /// <summary>
235
+        /// 错误处理
236
+        /// </summary>
237
+        /// <param name="sender"></param>
238
+        /// <param name="e"></param>
239
+        private void MyApp_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
240
+        {
241
+            LogHelper.WriteErrLog("未标示错误:" + e.Exception.Message, e.Exception);
242
+            MessageWindow.Show("程序异常." + Environment.NewLine + e.Exception.Message);
243
+            e.Handled = true;
244
+        }
245
+
246
+        #region 检测解压ffmpeg
247
+        public void UnZipFFmpeg()
248
+        {
249
+            new Thread(o =>
250
+            {
251
+                if (!FileToolsCommon.IsExistDirectory(FileToolsCommon.GetFileAbsolutePath("/ffmpeg/")))
252
+                {
253
+                    try
254
+                    {
255
+                        //根据系统解压ffmpeg
256
+                        if (Environment.Is64BitOperatingSystem)
257
+                        {
258
+                            //64
259
+                            ZipHelper.UnZip(FileToolsCommon.GetFileAbsolutePath("/ffmpegx64.zip"), FileToolsCommon.GetFileAbsolutePath());
260
+                        }
261
+                        else
262
+                        {
263
+                            //32
264
+                            ZipHelper.UnZip(FileToolsCommon.GetFileAbsolutePath("/ffmpegx32.zip"), FileToolsCommon.GetFileAbsolutePath());
265
+                        }
266
+                    }
267
+                    catch (Exception)
268
+                    {
269
+                        ZipHelper.UnZip(FileToolsCommon.GetFileAbsolutePath("/ffmpegx64.zip"), FileToolsCommon.GetFileAbsolutePath());
270
+                    }
271
+                }
272
+            }).Start();
273
+        }
274
+        #endregion
275
+
276
+        #region 检测安装Screen Capturer Recorder
277
+        /// <summary>
278
+        /// 检测是否安装了Screen Capturer Recorder
279
+        /// </summary>
280
+        /// <returns></returns>
281
+        public static bool CheckScreenCapturerRecorder()
282
+        {
283
+            if (FileToolsCommon.CheckSoftWartInstallState("Screen Capturer Recorder"))
284
+            {
285
+                //已经安装
286
+                return true;
287
+            }
288
+            else
289
+            {
290
+                return false;
291
+            }
292
+        }
293
+        /// <summary>
294
+        /// 安装Screen Capturer Recorder
295
+        /// </summary>
296
+        /// <returns></returns>
297
+        public static bool InstallScreenCapturerRecorder()
298
+        {
299
+            Process InstallProcess = new Process();
300
+            string StandardError = "";
301
+            string StandardOutput = "";
302
+            try
303
+            {
304
+                InstallProcess.StartInfo.FileName = FileToolsCommon.GetFileAbsolutePath(@"/SSCR/Setup Screen Capturer Recorder v0.12.10.exe");   //绝对路径
305
+                InstallProcess.StartInfo.UseShellExecute = false;           //不使用操作系统外壳程序启动
306
+                InstallProcess.StartInfo.RedirectStandardError = true;      //重定向标准错误输出
307
+                InstallProcess.StartInfo.RedirectStandardOutput = true;
308
+                InstallProcess.StartInfo.CreateNoWindow = true;             //不显示程序窗口
309
+                InstallProcess.StartInfo.RedirectStandardInput = true;      //用于模拟该进程控制台的输入
310
+                                                                            //外部程序(这里是FFMPEG)输出流时候产生的事件,这里是把流的处理过程转移到下面的方法中,详细请查阅MSDN
311
+                InstallProcess.ErrorDataReceived += new DataReceivedEventHandler(InstallProcess_ErrorDataReceived);
312
+                InstallProcess.Start();                 //启动线程
313
+                InstallProcess.WaitForExit();           //阻塞等待进程结束
314
+                StandardError = InstallProcess.StandardError.ReadToEnd();
315
+                StandardOutput = InstallProcess.StandardOutput.ReadToEnd();
316
+                int ExitCode = InstallProcess.ExitCode;
317
+                InstallProcess.Close();                 //关闭进程
318
+                InstallProcess.Dispose();               //释放资源
319
+                if (ExitCode == 0) //非0则为安装失败 1为取消安装
320
+                {
321
+                    return true;
322
+                }
323
+                else
324
+                {
325
+                    MessageBoxResult br = MessageWindow.Show("不安装环境将无法使用微课录制系统,是否现在安装?", "安装", MessageBoxButton.OKCancel);
326
+                    if (br == MessageBoxResult.OK)
327
+                    {
328
+                        return InstallScreenCapturerRecorder();
329
+                    }
330
+                    else
331
+                    {
332
+                        return false;
333
+                    }
334
+                }
335
+            }
336
+            catch (Exception ex)
337
+            {
338
+                LogHelper.WriteErrLog("【ScreenCapturerRecorder安装】(installScreenCapturerRecorder)安装失败:" + ex.Message, ex);
339
+                if (string.IsNullOrWhiteSpace(StandardError))
340
+                {
341
+                    LogHelper.WriteErrLog("【ScreenCapturerRecorder安装】(installScreenCapturerRecorder)安装失败:" + StandardError, null);
342
+                }
343
+                if (string.IsNullOrWhiteSpace(StandardOutput))
344
+                {
345
+                    LogHelper.WriteErrLog("【ScreenCapturerRecorder安装】(installScreenCapturerRecorder)安装返回信息:" + StandardOutput, null);
346
+                }
347
+                return false;
348
+            }
349
+        }
350
+        /// <summary>
351
+        /// 安装失败信息
352
+        /// </summary>
353
+        /// <param name="sender"></param>
354
+        /// <param name="e"></param>
355
+        private static void InstallProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)
356
+        {
357
+            LogHelper.WriteErrLog("【ScreenCapturerRecorder安装】(installScreenCapturerRecorder)安装失败:" + e.Data, null);
358
+            //MessageWindow.Show(e.Data);
359
+        }
360
+
361
+        #endregion
362
+
363
+        #region 内存处理 -创建人:赵耀 -创建时间:2020年8月12日
364
+        /// <summary>
365
+        /// 内存释放压缩
366
+        /// </summary>
367
+        /// <param name="e"></param>
368
+        protected override void OnStartup(StartupEventArgs e)
369
+        {
370
+            //private LierdaCracker cracker = new LierdaCracker();
371
+            //cracker.Cracker(5000);//间隔时间
372
+            //base.OnStartup(e);
373
+            new Thread(o =>
374
+            {
375
+                while (true)
376
+                {
377
+                    try
378
+                    {
379
+                        //FreeMemoryHelper.SetDate();
380
+                        FreeMemoryHelper.ReallocateMemory();
381
+                        Thread.Sleep(20000);//暂定每20秒释放一次
382
+                    }
383
+                    catch (Exception ex)
384
+                    {
385
+                        LogHelper.WriteErrLog("【释放内存(MyApp)" + ex.Message, ex);
386
+                    }
387
+                }
388
+            }).Start();
389
+        }
390
+
391
+        #endregion 内存处理 -创建人:赵耀 -创建时间:2020年8月12日
392
+    }
393
+}

+ 9
- 0
XHZB.Desktop/App.xaml ファイルの表示

@@ -0,0 +1,9 @@
1
+<Application x:Class="XHZB.Desktop.App"
2
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
+             xmlns:local="clr-namespace:XHZB.Desktop"
5
+             StartupUri="MainWindow.xaml">
6
+    <Application.Resources>
7
+         
8
+    </Application.Resources>
9
+</Application>

+ 17
- 0
XHZB.Desktop/App.xaml.cs ファイルの表示

@@ -0,0 +1,17 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Configuration;
4
+using System.Data;
5
+using System.Linq;
6
+using System.Threading.Tasks;
7
+using System.Windows;
8
+
9
+namespace XHZB.Desktop
10
+{
11
+    /// <summary>
12
+    /// App.xaml 的交互逻辑
13
+    /// </summary>
14
+    public partial class App : Application
15
+    {
16
+    }
17
+}

+ 12
- 0
XHZB.Desktop/MainWindow.xaml ファイルの表示

@@ -0,0 +1,12 @@
1
+<Window x:Class="XHZB.Desktop.MainWindow"
2
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
+        xmlns:local="clr-namespace:XHZB.Desktop"
7
+        mc:Ignorable="d"
8
+        Title="MainWindow" Height="450" Width="800">
9
+    <Grid>
10
+        
11
+    </Grid>
12
+</Window>

+ 32
- 0
XHZB.Desktop/MainWindow.xaml.cs ファイルの表示

@@ -0,0 +1,32 @@
1
+using Common.system;
2
+
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Linq;
6
+using System.Text;
7
+using System.Threading.Tasks;
8
+using System.Windows;
9
+using System.Windows.Controls;
10
+using System.Windows.Data;
11
+using System.Windows.Documents;
12
+using System.Windows.Input;
13
+using System.Windows.Media;
14
+using System.Windows.Media.Imaging;
15
+using System.Windows.Navigation;
16
+using System.Windows.Shapes;
17
+
18
+namespace XHZB.Desktop
19
+{
20
+    /// <summary>
21
+    /// MainWindow.xaml 的交互逻辑
22
+    /// </summary>
23
+    public partial class MainWindow : Window
24
+    {
25
+        public MainWindow()
26
+        {
27
+            InitializeComponent();
28
+            LogHelper.WriteInfoLog("启动!");
29
+            MessageWindow.Show("启动成功!");
30
+        }
31
+    }
32
+}

+ 37
- 0
XHZB.Desktop/MessageWindow.xaml ファイルの表示

@@ -0,0 +1,37 @@
1
+<Window x:Class="XHZB.Desktop.MessageWindow"
2
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
+        xmlns:local="clr-namespace:XHZB.Desktop"
7
+        mc:Ignorable="d" 
8
+        Title="星火微课" WindowStartupLocation="CenterScreen"
9
+    WindowStyle="None" AllowsTransparency="True"    WindowState="Normal"
10
+    ShowInTaskbar="False"  Topmost="True" ResizeMode="NoResize" 
11
+        d:DesignHeight="250" Width="600" Height="220"  MouseMove="Window_MouseMove"  BorderThickness="7">
12
+    <Window.Effect>
13
+        <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
14
+    </Window.Effect>
15
+    <Grid>
16
+        <Grid.RowDefinitions>
17
+            <RowDefinition Height="50"/>
18
+            <RowDefinition Height="100*"/>
19
+            <RowDefinition Height="70"/>
20
+        </Grid.RowDefinitions>
21
+        <Grid Grid.Row="0">
22
+            <Label x:Name="lblTitle" Content="提示" HorizontalAlignment="Left" Margin="14,10,0,0" VerticalAlignment="Top" Foreground="#FF333333" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" FontSize="20" FontWeight="Bold"/>
23
+        </Grid>
24
+        <Grid Grid.Row="1">
25
+            <TextBlock x:Name="tbkContent" Margin="20,0,20,0" TextWrapping="Wrap" VerticalAlignment="Center" FontSize="20" Foreground="#FF919191" Grid.Row="1" HorizontalAlignment="Center" Text=""/>
26
+        </Grid>
27
+        <Grid Grid.Row="2" Margin="0,0,0,0">
28
+            <Border x:Name="borOk" Background="#2D8CF0" CornerRadius="6" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,30,20">
29
+                <Button x:Name="BtnOK" Width="104" Height="42" Content="确定" FontSize="20"  Background="#00000000"  BorderBrush="{x:Null}" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Foreground="White"  Cursor="Hand" Click="BtnOK_Click" IsDefault="True"/>
30
+            </Border>
31
+            <Border x:Name="borCancel" Background="#E5E5E5" CornerRadius="6"  HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,150,20">
32
+                <Button x:Name="BtnCancel" Width="104" Height="42" Content="取消" FontSize="20" Background="#00000000" BorderBrush="{x:Null}"  Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"  Cursor="Hand" Click="BtnCancel_Click"/>
33
+            </Border>
34
+        </Grid>
35
+
36
+    </Grid>
37
+</Window>

+ 147
- 0
XHZB.Desktop/MessageWindow.xaml.cs ファイルの表示

@@ -0,0 +1,147 @@
1
+using System.Windows;
2
+using System.Windows.Input;
3
+
4
+namespace XHZB.Desktop
5
+{
6
+    /// <summary>
7
+    /// MessageWindow.xaml 的交互逻辑
8
+    /// </summary>
9
+    public partial class MessageWindow : Window
10
+    {
11
+        /// <summary>
12
+        /// 提示框
13
+        /// </summary>
14
+        /// <param name="MessageType">取消按钮  1不显示2显示</param>
15
+        /// <param name="Title">标题</param>
16
+        /// <param name="content">消息内容</param>
17
+        public MessageWindow(int MessageType, string Title, string Content)
18
+        {
19
+            InitializeComponent();
20
+            switch (MessageType)
21
+            {
22
+                case 1:
23
+                    borCancel.Visibility = Visibility.Hidden;
24
+                    break;
25
+                case 2:
26
+                    borCancel.Visibility = Visibility.Visible;
27
+                    break;
28
+                default:
29
+                    break;
30
+            }
31
+            lblTitle.Content = Title;
32
+            if (!string.IsNullOrWhiteSpace(Content))
33
+            {
34
+                if (Content.Length > 143)
35
+                {
36
+                    Content = Content.Substring(0, 140) + "...";
37
+                }
38
+                tbkContent.Text = Content;
39
+            }
40
+            else
41
+            {
42
+                tbkContent.Text = "错误!";
43
+            }
44
+        }
45
+        /// <summary>
46
+        /// 取消
47
+        /// </summary>
48
+        /// <param name="sender"></param>
49
+        /// <param name="e"></param>
50
+        private void BtnCancel_Click(object sender, RoutedEventArgs e)
51
+        {
52
+            DialogResult = false;
53
+        }
54
+        /// <summary>
55
+        /// 确定
56
+        /// </summary>
57
+        /// <param name="sender"></param>
58
+        /// <param name="e"></param>
59
+        private void BtnOK_Click(object sender, RoutedEventArgs e)
60
+        {
61
+            DialogResult = true;
62
+        }
63
+        /// <summary>
64
+        /// 消息提示框
65
+        /// </summary>
66
+        /// <param name="Message">消息</param>
67
+        /// <returns></returns>
68
+        public static MessageBoxResult Show(string Message)
69
+        {
70
+            string Title = "消息提示";
71
+            return Show(Message, Title);
72
+        }
73
+        /// <summary>
74
+        /// 消息提示框
75
+        /// </summary>
76
+        /// <param name="Message">消息</param>
77
+        /// <returns></returns>
78
+        public static MessageBoxResult Show(string Message, string Title)
79
+        {
80
+            MessageWindow message = new MessageWindow(1, Title, Message);
81
+            message.ShowDialog();
82
+            return MessageBoxResult.Cancel;
83
+        }
84
+        /// <summary>
85
+        /// 消息提示框
86
+        /// </summary>
87
+        /// <param name="Title">标题</param>
88
+        /// <param name="Message">消息</param>
89
+        /// <returns></returns>
90
+        public static MessageBoxResult Show(string Message, string Title, MessageBoxButton messageBox)
91
+        {
92
+            if (string.IsNullOrWhiteSpace(Title))
93
+            {
94
+                Title = "消息提示";
95
+            }
96
+            MessageWindow message = new MessageWindow(2, Title, Message);
97
+            bool? res = message.ShowDialog();
98
+            if ((bool)res)
99
+            {
100
+                if (messageBox == MessageBoxButton.OKCancel)
101
+                {
102
+                    return MessageBoxResult.OK;
103
+                }
104
+                else
105
+                {
106
+                    return MessageBoxResult.Yes;
107
+                }
108
+            }
109
+            else
110
+            {
111
+                if (messageBox == MessageBoxButton.OKCancel)
112
+                {
113
+                    return MessageBoxResult.Cancel;
114
+                }
115
+                else
116
+                {
117
+                    return MessageBoxResult.No;
118
+                }
119
+            }
120
+        }
121
+        private static MessageBoxResult Win32ToMessageBoxResult(int value)
122
+        {
123
+            switch (value)
124
+            {
125
+                case 1:
126
+                    return MessageBoxResult.OK;
127
+                case 2:
128
+                    return MessageBoxResult.Cancel;
129
+                case 6:
130
+                    return MessageBoxResult.Yes;
131
+                case 7:
132
+                    return MessageBoxResult.No;
133
+                default:
134
+                    return MessageBoxResult.No;
135
+            }
136
+        }
137
+
138
+        private void Window_MouseMove(object sender, MouseEventArgs e)
139
+        {
140
+            if (e.LeftButton == MouseButtonState.Pressed)
141
+            {
142
+                //this.DragMove();              
143
+                DragMove();
144
+            }
145
+        }
146
+    }
147
+}

+ 55
- 0
XHZB.Desktop/Properties/AssemblyInfo.cs ファイルの表示

@@ -0,0 +1,55 @@
1
+using System.Reflection;
2
+using System.Resources;
3
+using System.Runtime.CompilerServices;
4
+using System.Runtime.InteropServices;
5
+using System.Windows;
6
+
7
+// 有关程序集的一般信息由以下
8
+// 控制。更改这些特性值可修改
9
+// 与程序集关联的信息。
10
+[assembly: AssemblyTitle("XHZB.Desktop")]
11
+[assembly: AssemblyDescription("")]
12
+[assembly: AssemblyConfiguration("")]
13
+[assembly: AssemblyCompany("")]
14
+[assembly: AssemblyProduct("XHZB.Desktop")]
15
+[assembly: AssemblyCopyright("Copyright ©  2021")]
16
+[assembly: AssemblyTrademark("")]
17
+[assembly: AssemblyCulture("")]
18
+
19
+// 将 ComVisible 设置为 false 会使此程序集中的类型
20
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
21
+//请将此类型的 ComVisible 特性设置为 true。
22
+[assembly: ComVisible(false)]
23
+
24
+//若要开始生成可本地化的应用程序,请设置
25
+//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
26
+//例如,如果您在源文件中使用的是美国英语,
27
+//使用的是美国英语,请将 <UICulture> 设置为 en-US。  然后取消
28
+//对以下 NeutralResourceLanguage 特性的注释。  更新
29
+//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
30
+
31
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32
+
33
+
34
+[assembly: ThemeInfo(
35
+    ResourceDictionaryLocation.None, //主题特定资源词典所处位置
36
+                                     //(未在页面中找到资源时使用,
37
+                                     //或应用程序资源字典中找到时使用)
38
+    ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
39
+                                              //(未在页面中找到资源时使用,
40
+                                              //、应用程序或任何主题专用资源字典中找到时使用)
41
+)]
42
+
43
+
44
+// 程序集的版本信息由下列四个值组成: 
45
+//
46
+//      主版本
47
+//      次版本
48
+//      生成号
49
+//      修订号
50
+//
51
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
52
+//通过使用 "*",如下所示:
53
+// [assembly: AssemblyVersion("1.0.*")]
54
+[assembly: AssemblyVersion("1.0.1.0")]
55
+[assembly: AssemblyFileVersion("1.0.1.0")]

+ 70
- 0
XHZB.Desktop/Properties/Resources.Designer.cs ファイルの表示

@@ -0,0 +1,70 @@
1
+//------------------------------------------------------------------------------
2
+// <auto-generated>
3
+//     此代码由工具生成。
4
+//     运行时版本: 4.0.30319.42000
5
+//
6
+//     对此文件的更改可能导致不正确的行为,如果
7
+//     重新生成代码,则所做更改将丢失。
8
+// </auto-generated>
9
+//------------------------------------------------------------------------------
10
+
11
+
12
+namespace XHZB.Desktop.Properties
13
+{
14
+    /// <summary>
15
+    ///   强类型资源类,用于查找本地化字符串等。
16
+    /// </summary>
17
+    // 此类是由 StronglyTypedResourceBuilder
18
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
19
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
20
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
21
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
22
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
23
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
24
+    internal class Resources
25
+    {
26
+
27
+        private static global::System.Resources.ResourceManager resourceMan;
28
+
29
+        private static global::System.Globalization.CultureInfo resourceCulture;
30
+
31
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32
+        internal Resources()
33
+        {
34
+        }
35
+
36
+        /// <summary>
37
+        ///   返回此类使用的缓存 ResourceManager 实例。
38
+        /// </summary>
39
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
40
+        internal static global::System.Resources.ResourceManager ResourceManager
41
+        {
42
+            get
43
+            {
44
+                if ((resourceMan == null))
45
+                {
46
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("XHZB.Desktop.Properties.Resources", typeof(Resources).Assembly);
47
+                    resourceMan = temp;
48
+                }
49
+                return resourceMan;
50
+            }
51
+        }
52
+
53
+        /// <summary>
54
+        ///   重写当前线程的 CurrentUICulture 属性,对
55
+        ///   使用此强类型资源类的所有资源查找执行重写。
56
+        /// </summary>
57
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
58
+        internal static global::System.Globalization.CultureInfo Culture
59
+        {
60
+            get
61
+            {
62
+                return resourceCulture;
63
+            }
64
+            set
65
+            {
66
+                resourceCulture = value;
67
+            }
68
+        }
69
+    }
70
+}

+ 117
- 0
XHZB.Desktop/Properties/Resources.resx ファイルの表示

@@ -0,0 +1,117 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:element name="root" msdata:IsDataSet="true">
64
+      <xsd:complexType>
65
+        <xsd:choice maxOccurs="unbounded">
66
+          <xsd:element name="metadata">
67
+            <xsd:complexType>
68
+              <xsd:sequence>
69
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
70
+              </xsd:sequence>
71
+              <xsd:attribute name="name" type="xsd:string" />
72
+              <xsd:attribute name="type" type="xsd:string" />
73
+              <xsd:attribute name="mimetype" type="xsd:string" />
74
+            </xsd:complexType>
75
+          </xsd:element>
76
+          <xsd:element name="assembly">
77
+            <xsd:complexType>
78
+              <xsd:attribute name="alias" type="xsd:string" />
79
+              <xsd:attribute name="name" type="xsd:string" />
80
+            </xsd:complexType>
81
+          </xsd:element>
82
+          <xsd:element name="data">
83
+            <xsd:complexType>
84
+              <xsd:sequence>
85
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
86
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
87
+              </xsd:sequence>
88
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
89
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
90
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
91
+            </xsd:complexType>
92
+          </xsd:element>
93
+          <xsd:element name="resheader">
94
+            <xsd:complexType>
95
+              <xsd:sequence>
96
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
97
+              </xsd:sequence>
98
+              <xsd:attribute name="name" type="xsd:string" use="required" />
99
+            </xsd:complexType>
100
+          </xsd:element>
101
+        </xsd:choice>
102
+      </xsd:complexType>
103
+    </xsd:element>
104
+  </xsd:schema>
105
+  <resheader name="resmimetype">
106
+    <value>text/microsoft-resx</value>
107
+  </resheader>
108
+  <resheader name="version">
109
+    <value>2.0</value>
110
+  </resheader>
111
+  <resheader name="reader">
112
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
113
+  </resheader>
114
+  <resheader name="writer">
115
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+</root>

+ 29
- 0
XHZB.Desktop/Properties/Settings.Designer.cs ファイルの表示

@@ -0,0 +1,29 @@
1
+//------------------------------------------------------------------------------
2
+// <auto-generated>
3
+//     This code was generated by a tool.
4
+//     Runtime Version:4.0.30319.42000
5
+//
6
+//     Changes to this file may cause incorrect behavior and will be lost if
7
+//     the code is regenerated.
8
+// </auto-generated>
9
+//------------------------------------------------------------------------------
10
+
11
+
12
+namespace XHZB.Desktop.Properties
13
+{
14
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
16
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
17
+    {
18
+
19
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
20
+
21
+        public static Settings Default
22
+        {
23
+            get
24
+            {
25
+                return defaultInstance;
26
+            }
27
+        }
28
+    }
29
+}

+ 7
- 0
XHZB.Desktop/Properties/Settings.settings ファイルの表示

@@ -0,0 +1,7 @@
1
+<?xml version='1.0' encoding='utf-8'?>
2
+<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
3
+  <Profiles>
4
+    <Profile Name="(Default)" />
5
+  </Profiles>
6
+  <Settings />
7
+</SettingsFile>

+ 69
- 0
XHZB.Desktop/Properties/app.manifest ファイルの表示

@@ -0,0 +1,69 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3
+  <assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
4
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5
+    <security>
6
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7
+        <!-- UAC 清单选项
8
+             如果想要更改 Windows 用户帐户控制级别,请使用
9
+             以下节点之一替换 requestedExecutionLevel 节点。n
10
+        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
11
+        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
12
+        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />
13
+
14
+            指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
15
+            如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
16
+            元素。
17
+        -->
18
+        <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
19
+      </requestedPrivileges>
20
+      <applicationRequestMinimum>
21
+        <defaultAssemblyRequest permissionSetReference="Custom" />
22
+        <PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
23
+      </applicationRequestMinimum>
24
+    </security>
25
+  </trustInfo>
26
+  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
27
+    <application>
28
+      <!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
29
+           Windows 版本的列表。取消评论适当的元素,
30
+           Windows 将自动选择最兼容的环境。 -->
31
+      <!-- Windows Vista -->
32
+      <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
33
+      <!-- Windows 7 -->
34
+      <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
35
+      <!-- Windows 8 -->
36
+      <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
37
+      <!-- Windows 8.1 -->
38
+      <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
39
+      <!-- Windows 10 -->
40
+      <!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
41
+    </application>
42
+  </compatibility>
43
+  <!-- 指示该应用程序可以感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
44
+       自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
45
+       选择加入。选择加入此设置的 Windows 窗体应用程序(目标设定为 .NET Framework 4.6 )还应
46
+       在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。-->
47
+  <!--
48
+  <application xmlns="urn:schemas-microsoft-com:asm.v3">
49
+    <windowsSettings>
50
+      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
51
+    </windowsSettings>
52
+  </application>
53
+  -->
54
+  <!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
55
+  <!--
56
+  <dependency>
57
+    <dependentAssembly>
58
+      <assemblyIdentity
59
+          type="win32"
60
+          name="Microsoft.Windows.Common-Controls"
61
+          version="6.0.0.0"
62
+          processorArchitecture="*"
63
+          publicKeyToken="6595b64144ccf1df"
64
+          language="*"
65
+        />
66
+    </dependentAssembly>
67
+  </dependency>
68
+  -->
69
+</assembly>

バイナリ
XHZB.Desktop/SSCR/Setup Screen Capturer Recorder v0.12.10.exe ファイルの表示


+ 0
- 0
XHZB.Desktop/XHZB.Desktop.csproj ファイルの表示


変更されたファイルが多すぎるため、一部のファイルは表示されません

読み込み中…
キャンセル
保存