├── README.md
├── README_CN.md
└── StarTools
├── .gitignore
├── StarTools.sln
└── StarTools
├── .gitignore
├── About.Designer.cs
├── About.cs
├── About.resx
├── App.config
├── CmdUtils.cs
├── Encode.Designer.cs
├── Encode.cs
├── Encode.resx
├── EncoderBox.Designer.cs
├── EncoderBox.cs
├── EncoderBox.resx
├── FileDo.cs
├── Mux.Designer.cs
├── Mux.cs
├── Mux.resx
├── Page.cs
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
├── StarTools.Designer.cs
├── StarTools.cs
├── StarTools.csproj
├── StarTools.ico
├── StarTools.nsi
├── StarTools.resx
├── ffmpeg_Live.Designer.cs
├── ffmpeg_Live.cs
├── ffmpeg_Live.resx
├── ffmpeg_demux.Designer.cs
├── ffmpeg_demux.cs
├── ffmpeg_demux.resx
├── needed.Designer.cs
├── needed.cs
├── needed.resx
├── rip_cmd.Designer.cs
├── rip_cmd.cs
├── rip_cmd.resx
├── run_rip.Designer.cs
├── run_rip.cs
└── run_rip.resx
/README.md:
--------------------------------------------------------------------------------
1 | # StarTools
2 |
3 | ****
4 | |Author|HoshinoKun|
5 | |---|---
6 | |E-mail|hoshinokun@346pro.club
7 | ****
8 |
9 | [中文简介](/README_CN.md)
10 | ## What's this?
11 | This is a GUI gadget based on FFmpeg, NVEnc, and other command line tools. It contains some commands that are commonly used in rip creation and daily use. If you have a feature you would like to add, please create issue or pull requests.
12 |
13 | ### How to use
14 | Please download the latest installation package at [releases](https://github.com/hoshinohikari/StarTools/releases) and select the required encoder according to the chipset you are using. Then you can start using this.
--------------------------------------------------------------------------------
/README_CN.md:
--------------------------------------------------------------------------------
1 | # StarTools
2 |
3 | ****
4 | |Author|HoshinoKun|
5 | |---|---
6 | |E-mail|hoshinokun@346pro.club
7 | ****
8 |
9 | ### 这是什么
10 | 这是一个基于FFmpeg、NVEnc等命令行工具的常用命令的GUI小工具,里面包含了一些在rip制作以及日常使用中常用的一些小命令,如果你有想添加的功能,请提issue或者pr
11 |
12 | ### 如何使用
13 | 请在[releases](https://github.com/hoshinohikari/StarTools/releases)中下载最新的安装包并按照自己所使用的平台选择需要的编码器,即可开始使用
14 |
--------------------------------------------------------------------------------
/StarTools/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | [Aa][Rr][Mm]/
24 | [Aa][Rr][Mm]64/
25 | bld/
26 | [Bb]in/
27 | [Oo]bj/
28 | [Ll]og/
29 |
30 | # Visual Studio 2015/2017 cache/options directory
31 | .vs/
32 | # Uncomment if you have tasks that create the project's static files in wwwroot
33 | #wwwroot/
34 |
35 | # Visual Studio 2017 auto generated files
36 | Generated\ Files/
37 |
38 | # MSTest test Results
39 | [Tt]est[Rr]esult*/
40 | [Bb]uild[Ll]og.*
41 |
42 | # NUNIT
43 | *.VisualState.xml
44 | TestResult.xml
45 |
46 | # Build Results of an ATL Project
47 | [Dd]ebugPS/
48 | [Rr]eleasePS/
49 | dlldata.c
50 |
51 | # Benchmark Results
52 | BenchmarkDotNet.Artifacts/
53 |
54 | # .NET Core
55 | project.lock.json
56 | project.fragment.lock.json
57 | artifacts/
58 |
59 | # StyleCop
60 | StyleCopReport.xml
61 |
62 | # Files built by Visual Studio
63 | *_i.c
64 | *_p.c
65 | *_h.h
66 | *.ilk
67 | *.meta
68 | *.obj
69 | *.iobj
70 | *.pch
71 | *.pdb
72 | *.ipdb
73 | *.pgc
74 | *.pgd
75 | *.rsp
76 | *.sbr
77 | *.tlb
78 | *.tli
79 | *.tlh
80 | *.tmp
81 | *.tmp_proj
82 | *_wpftmp.csproj
83 | *.log
84 | *.vspscc
85 | *.vssscc
86 | .builds
87 | *.pidb
88 | *.svclog
89 | *.scc
90 |
91 | # Chutzpah Test files
92 | _Chutzpah*
93 |
94 | # Visual C++ cache files
95 | ipch/
96 | *.aps
97 | *.ncb
98 | *.opendb
99 | *.opensdf
100 | *.sdf
101 | *.cachefile
102 | *.VC.db
103 | *.VC.VC.opendb
104 |
105 | # Visual Studio profiler
106 | *.psess
107 | *.vsp
108 | *.vspx
109 | *.sap
110 |
111 | # Visual Studio Trace Files
112 | *.e2e
113 |
114 | # TFS 2012 Local Workspace
115 | $tf/
116 |
117 | # Guidance Automation Toolkit
118 | *.gpState
119 |
120 | # ReSharper is a .NET coding add-in
121 | _ReSharper*/
122 | *.[Rr]e[Ss]harper
123 | *.DotSettings.user
124 |
125 | # JustCode is a .NET coding add-in
126 | .JustCode
127 |
128 | # TeamCity is a build add-in
129 | _TeamCity*
130 |
131 | # DotCover is a Code Coverage Tool
132 | *.dotCover
133 |
134 | # AxoCover is a Code Coverage Tool
135 | .axoCover/*
136 | !.axoCover/settings.json
137 |
138 | # Visual Studio code coverage results
139 | *.coverage
140 | *.coveragexml
141 |
142 | # NCrunch
143 | _NCrunch_*
144 | .*crunch*.local.xml
145 | nCrunchTemp_*
146 |
147 | # MightyMoose
148 | *.mm.*
149 | AutoTest.Net/
150 |
151 | # Web workbench (sass)
152 | .sass-cache/
153 |
154 | # Installshield output folder
155 | [Ee]xpress/
156 |
157 | # DocProject is a documentation generator add-in
158 | DocProject/buildhelp/
159 | DocProject/Help/*.HxT
160 | DocProject/Help/*.HxC
161 | DocProject/Help/*.hhc
162 | DocProject/Help/*.hhk
163 | DocProject/Help/*.hhp
164 | DocProject/Help/Html2
165 | DocProject/Help/html
166 |
167 | # Click-Once directory
168 | publish/
169 |
170 | # Publish Web Output
171 | *.[Pp]ublish.xml
172 | *.azurePubxml
173 | # Note: Comment the next line if you want to checkin your web deploy settings,
174 | # but database connection strings (with potential passwords) will be unencrypted
175 | *.pubxml
176 | *.publishproj
177 |
178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
179 | # checkin your Azure Web App publish settings, but sensitive information contained
180 | # in these scripts will be unencrypted
181 | PublishScripts/
182 |
183 | # NuGet Packages
184 | *.nupkg
185 | # The packages folder can be ignored because of Package Restore
186 | **/[Pp]ackages/*
187 | # except build/, which is used as an MSBuild target.
188 | !**/[Pp]ackages/build/
189 | # Uncomment if necessary however generally it will be regenerated when needed
190 | #!**/[Pp]ackages/repositories.config
191 | # NuGet v3's project.json files produces more ignorable files
192 | *.nuget.props
193 | *.nuget.targets
194 |
195 | # Microsoft Azure Build Output
196 | csx/
197 | *.build.csdef
198 |
199 | # Microsoft Azure Emulator
200 | ecf/
201 | rcf/
202 |
203 | # Windows Store app package directories and files
204 | AppPackages/
205 | BundleArtifacts/
206 | Package.StoreAssociation.xml
207 | _pkginfo.txt
208 | *.appx
209 |
210 | # Visual Studio cache files
211 | # files ending in .cache can be ignored
212 | *.[Cc]ache
213 | # but keep track of directories ending in .cache
214 | !?*.[Cc]ache/
215 |
216 | # Others
217 | ClientBin/
218 | ~$*
219 | *~
220 | *.dbmdl
221 | *.dbproj.schemaview
222 | *.jfm
223 | *.pfx
224 | *.publishsettings
225 | orleans.codegen.cs
226 |
227 | # Including strong name files can present a security risk
228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
229 | #*.snk
230 |
231 | # Since there are multiple workflows, uncomment next line to ignore bower_components
232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
233 | #bower_components/
234 |
235 | # RIA/Silverlight projects
236 | Generated_Code/
237 |
238 | # Backup & report files from converting an old project file
239 | # to a newer Visual Studio version. Backup files are not needed,
240 | # because we have git ;-)
241 | _UpgradeReport_Files/
242 | Backup*/
243 | UpgradeLog*.XML
244 | UpgradeLog*.htm
245 | ServiceFabricBackup/
246 | *.rptproj.bak
247 |
248 | # SQL Server files
249 | *.mdf
250 | *.ldf
251 | *.ndf
252 |
253 | # Business Intelligence projects
254 | *.rdl.data
255 | *.bim.layout
256 | *.bim_*.settings
257 | *.rptproj.rsuser
258 | *- Backup*.rdl
259 |
260 | # Microsoft Fakes
261 | FakesAssemblies/
262 |
263 | # GhostDoc plugin setting file
264 | *.GhostDoc.xml
265 |
266 | # Node.js Tools for Visual Studio
267 | .ntvs_analysis.dat
268 | node_modules/
269 |
270 | # Visual Studio 6 build log
271 | *.plg
272 |
273 | # Visual Studio 6 workspace options file
274 | *.opt
275 |
276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
277 | *.vbw
278 |
279 | # Visual Studio LightSwitch build output
280 | **/*.HTMLClient/GeneratedArtifacts
281 | **/*.DesktopClient/GeneratedArtifacts
282 | **/*.DesktopClient/ModelManifest.xml
283 | **/*.Server/GeneratedArtifacts
284 | **/*.Server/ModelManifest.xml
285 | _Pvt_Extensions
286 |
287 | # Paket dependency manager
288 | .paket/paket.exe
289 | paket-files/
290 |
291 | # FAKE - F# Make
292 | .fake/
293 |
294 | # JetBrains Rider
295 | .idea/
296 | *.sln.iml
297 |
298 | # CodeRush personal settings
299 | .cr/personal
300 |
301 | # Python Tools for Visual Studio (PTVS)
302 | __pycache__/
303 | *.pyc
304 |
305 | # Cake - Uncomment if you are using it
306 | # tools/**
307 | # !tools/packages.config
308 |
309 | # Tabs Studio
310 | *.tss
311 |
312 | # Telerik's JustMock configuration file
313 | *.jmconfig
314 |
315 | # BizTalk build output
316 | *.btp.cs
317 | *.btm.cs
318 | *.odx.cs
319 | *.xsd.cs
320 |
321 | # OpenCover UI analysis results
322 | OpenCover/
323 |
324 | # Azure Stream Analytics local run output
325 | ASALocalRun/
326 |
327 | # MSBuild Binary and Structured Log
328 | *.binlog
329 |
330 | # NVidia Nsight GPU debugger configuration file
331 | *.nvuser
332 |
333 | # MFractors (Xamarin productivity tool) working folder
334 | .mfractor/
335 |
336 | # Local History for Visual Studio
337 | .localhistory/
338 |
339 | # BeatPulse healthcheck temp database
340 | healthchecksdb
--------------------------------------------------------------------------------
/StarTools/StarTools.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30225.117
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StarTools", "StarTools\StarTools.csproj", "{53841EE9-2AEA-4111-B28C-CEAB47FADD53}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x64 = Debug|x64
12 | Release|Any CPU = Release|Any CPU
13 | Release|x64 = Release|x64
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {53841EE9-2AEA-4111-B28C-CEAB47FADD53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {53841EE9-2AEA-4111-B28C-CEAB47FADD53}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {53841EE9-2AEA-4111-B28C-CEAB47FADD53}.Debug|x64.ActiveCfg = Debug|x64
19 | {53841EE9-2AEA-4111-B28C-CEAB47FADD53}.Debug|x64.Build.0 = Debug|x64
20 | {53841EE9-2AEA-4111-B28C-CEAB47FADD53}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {53841EE9-2AEA-4111-B28C-CEAB47FADD53}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {53841EE9-2AEA-4111-B28C-CEAB47FADD53}.Release|x64.ActiveCfg = Release|x64
23 | {53841EE9-2AEA-4111-B28C-CEAB47FADD53}.Release|x64.Build.0 = Release|x64
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {5C3277B2-1420-4B1F-B4DE-C6BE31E1A05F}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/StarTools/StarTools/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User
7 | Setup.exe
8 |
9 | # User-specific files
10 | *.rsuser
11 | *.suo
12 | *.user
13 | *.userosscache
14 | *.sln.docstates
15 |
16 | # User-specific files (MonoDevelop/Xamarin Studio)
17 | *.userprefs
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 |
33 | # Visual Studio 2015/2017 cache/options directory
34 | .vs/
35 | # Uncomment if you have tasks that create the project's static files in wwwroot
36 | #wwwroot/
37 |
38 | # Visual Studio 2017 auto generated files
39 | Generated\ Files/
40 |
41 | # MSTest test Results
42 | [Tt]est[Rr]esult*/
43 | [Bb]uild[Ll]og.*
44 |
45 | # NUNIT
46 | *.VisualState.xml
47 | TestResult.xml
48 |
49 | # Build Results of an ATL Project
50 | [Dd]ebugPS/
51 | [Rr]eleasePS/
52 | dlldata.c
53 |
54 | # Benchmark Results
55 | BenchmarkDotNet.Artifacts/
56 |
57 | # .NET Core
58 | project.lock.json
59 | project.fragment.lock.json
60 | artifacts/
61 |
62 | # StyleCop
63 | StyleCopReport.xml
64 |
65 | # Files built by Visual Studio
66 | *_i.c
67 | *_p.c
68 | *_h.h
69 | *.ilk
70 | *.meta
71 | *.obj
72 | *.iobj
73 | *.pch
74 | *.pdb
75 | *.ipdb
76 | *.pgc
77 | *.pgd
78 | *.rsp
79 | *.sbr
80 | *.tlb
81 | *.tli
82 | *.tlh
83 | *.tmp
84 | *.tmp_proj
85 | *_wpftmp.csproj
86 | *.log
87 | *.vspscc
88 | *.vssscc
89 | .builds
90 | *.pidb
91 | *.svclog
92 | *.scc
93 |
94 | # Chutzpah Test files
95 | _Chutzpah*
96 |
97 | # Visual C++ cache files
98 | ipch/
99 | *.aps
100 | *.ncb
101 | *.opendb
102 | *.opensdf
103 | *.sdf
104 | *.cachefile
105 | *.VC.db
106 | *.VC.VC.opendb
107 |
108 | # Visual Studio profiler
109 | *.psess
110 | *.vsp
111 | *.vspx
112 | *.sap
113 |
114 | # Visual Studio Trace Files
115 | *.e2e
116 |
117 | # TFS 2012 Local Workspace
118 | $tf/
119 |
120 | # Guidance Automation Toolkit
121 | *.gpState
122 |
123 | # ReSharper is a .NET coding add-in
124 | _ReSharper*/
125 | *.[Rr]e[Ss]harper
126 | *.DotSettings.user
127 |
128 | # JustCode is a .NET coding add-in
129 | .JustCode
130 |
131 | # TeamCity is a build add-in
132 | _TeamCity*
133 |
134 | # DotCover is a Code Coverage Tool
135 | *.dotCover
136 |
137 | # AxoCover is a Code Coverage Tool
138 | .axoCover/*
139 | !.axoCover/settings.json
140 |
141 | # Visual Studio code coverage results
142 | *.coverage
143 | *.coveragexml
144 |
145 | # NCrunch
146 | _NCrunch_*
147 | .*crunch*.local.xml
148 | nCrunchTemp_*
149 |
150 | # MightyMoose
151 | *.mm.*
152 | AutoTest.Net/
153 |
154 | # Web workbench (sass)
155 | .sass-cache/
156 |
157 | # Installshield output folder
158 | [Ee]xpress/
159 |
160 | # DocProject is a documentation generator add-in
161 | DocProject/buildhelp/
162 | DocProject/Help/*.HxT
163 | DocProject/Help/*.HxC
164 | DocProject/Help/*.hhc
165 | DocProject/Help/*.hhk
166 | DocProject/Help/*.hhp
167 | DocProject/Help/Html2
168 | DocProject/Help/html
169 |
170 | # Click-Once directory
171 | publish/
172 |
173 | # Publish Web Output
174 | *.[Pp]ublish.xml
175 | *.azurePubxml
176 | # Note: Comment the next line if you want to checkin your web deploy settings,
177 | # but database connection strings (with potential passwords) will be unencrypted
178 | *.pubxml
179 | *.publishproj
180 |
181 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
182 | # checkin your Azure Web App publish settings, but sensitive information contained
183 | # in these scripts will be unencrypted
184 | PublishScripts/
185 |
186 | # NuGet Packages
187 | *.nupkg
188 | # The packages folder can be ignored because of Package Restore
189 | **/[Pp]ackages/*
190 | # except build/, which is used as an MSBuild target.
191 | !**/[Pp]ackages/build/
192 | # Uncomment if necessary however generally it will be regenerated when needed
193 | #!**/[Pp]ackages/repositories.config
194 | # NuGet v3's project.json files produces more ignorable files
195 | *.nuget.props
196 | *.nuget.targets
197 |
198 | # Microsoft Azure Build Output
199 | csx/
200 | *.build.csdef
201 |
202 | # Microsoft Azure Emulator
203 | ecf/
204 | rcf/
205 |
206 | # Windows Store app package directories and files
207 | AppPackages/
208 | BundleArtifacts/
209 | Package.StoreAssociation.xml
210 | _pkginfo.txt
211 | *.appx
212 |
213 | # Visual Studio cache files
214 | # files ending in .cache can be ignored
215 | *.[Cc]ache
216 | # but keep track of directories ending in .cache
217 | !?*.[Cc]ache/
218 |
219 | # Others
220 | ClientBin/
221 | ~$*
222 | *~
223 | *.dbmdl
224 | *.dbproj.schemaview
225 | *.jfm
226 | *.pfx
227 | *.publishsettings
228 | orleans.codegen.cs
229 |
230 | # Including strong name files can present a security risk
231 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
232 | #*.snk
233 |
234 | # Since there are multiple workflows, uncomment next line to ignore bower_components
235 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
236 | #bower_components/
237 |
238 | # RIA/Silverlight projects
239 | Generated_Code/
240 |
241 | # Backup & report files from converting an old project file
242 | # to a newer Visual Studio version. Backup files are not needed,
243 | # because we have git ;-)
244 | _UpgradeReport_Files/
245 | Backup*/
246 | UpgradeLog*.XML
247 | UpgradeLog*.htm
248 | ServiceFabricBackup/
249 | *.rptproj.bak
250 |
251 | # SQL Server files
252 | *.mdf
253 | *.ldf
254 | *.ndf
255 |
256 | # Business Intelligence projects
257 | *.rdl.data
258 | *.bim.layout
259 | *.bim_*.settings
260 | *.rptproj.rsuser
261 | *- Backup*.rdl
262 |
263 | # Microsoft Fakes
264 | FakesAssemblies/
265 |
266 | # GhostDoc plugin setting file
267 | *.GhostDoc.xml
268 |
269 | # Node.js Tools for Visual Studio
270 | .ntvs_analysis.dat
271 | node_modules/
272 |
273 | # Visual Studio 6 build log
274 | *.plg
275 |
276 | # Visual Studio 6 workspace options file
277 | *.opt
278 |
279 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
280 | *.vbw
281 |
282 | # Visual Studio LightSwitch build output
283 | **/*.HTMLClient/GeneratedArtifacts
284 | **/*.DesktopClient/GeneratedArtifacts
285 | **/*.DesktopClient/ModelManifest.xml
286 | **/*.Server/GeneratedArtifacts
287 | **/*.Server/ModelManifest.xml
288 | _Pvt_Extensions
289 |
290 | # Paket dependency manager
291 | .paket/paket.exe
292 | paket-files/
293 |
294 | # FAKE - F# Make
295 | .fake/
296 |
297 | # JetBrains Rider
298 | .idea/
299 | *.sln.iml
300 |
301 | # CodeRush personal settings
302 | .cr/personal
303 |
304 | # Python Tools for Visual Studio (PTVS)
305 | __pycache__/
306 | *.pyc
307 |
308 | # Cake - Uncomment if you are using it
309 | # tools/**
310 | # !tools/packages.config
311 |
312 | # Tabs Studio
313 | *.tss
314 |
315 | # Telerik's JustMock configuration file
316 | *.jmconfig
317 |
318 | # BizTalk build output
319 | *.btp.cs
320 | *.btm.cs
321 | *.odx.cs
322 | *.xsd.cs
323 |
324 | # OpenCover UI analysis results
325 | OpenCover/
326 |
327 | # Azure Stream Analytics local run output
328 | ASALocalRun/
329 |
330 | # MSBuild Binary and Structured Log
331 | *.binlog
332 |
333 | # NVidia Nsight GPU debugger configuration file
334 | *.nvuser
335 |
336 | # MFractors (Xamarin productivity tool) working folder
337 | .mfractor/
338 |
339 | # Local History for Visual Studio
340 | .localhistory/
341 |
342 | # BeatPulse healthcheck temp database
343 | healthchecksdb
--------------------------------------------------------------------------------
/StarTools/StarTools/About.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace StarTools
2 | {
3 | partial class About
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(About));
32 | this.uiRichTextBox1 = new Sunny.UI.UIRichTextBox();
33 | this.uiLine1 = new Sunny.UI.UILine();
34 | this.PagePanel.SuspendLayout();
35 | this.SuspendLayout();
36 | //
37 | // PagePanel
38 | //
39 | this.PagePanel.Controls.Add(this.uiLine1);
40 | this.PagePanel.Controls.Add(this.uiRichTextBox1);
41 | this.PagePanel.Size = new System.Drawing.Size(658, 378);
42 | //
43 | // uiRichTextBox1
44 | //
45 | this.uiRichTextBox1.AutoWordSelection = true;
46 | this.uiRichTextBox1.FillColor = System.Drawing.Color.White;
47 | this.uiRichTextBox1.Font = new System.Drawing.Font("微软雅黑", 12F);
48 | this.uiRichTextBox1.Location = new System.Drawing.Point(13, 44);
49 | this.uiRichTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
50 | this.uiRichTextBox1.Name = "uiRichTextBox1";
51 | this.uiRichTextBox1.Padding = new System.Windows.Forms.Padding(2);
52 | this.uiRichTextBox1.Size = new System.Drawing.Size(632, 320);
53 | this.uiRichTextBox1.TabIndex = 0;
54 | this.uiRichTextBox1.Text = "这是一个基于ffmpeg与显卡压制工具们的GUI操作工具\n用于压制某些不需要精细处理的片源\n依赖管理可完全由自己定义,只需独立的GUI文件即可运行\nGUI框架基于" +
55 | "SunnyGUI\n基础使用教学: https://www.346pro.club \nGithub: https://github.com/hoshinohika" +
56 | "ri/StarTools ";
57 | //
58 | // uiLine1
59 | //
60 | this.uiLine1.Font = new System.Drawing.Font("微软雅黑", 12F);
61 | this.uiLine1.Location = new System.Drawing.Point(13, 7);
62 | this.uiLine1.MinimumSize = new System.Drawing.Size(2, 2);
63 | this.uiLine1.Name = "uiLine1";
64 | this.uiLine1.Size = new System.Drawing.Size(632, 29);
65 | this.uiLine1.TabIndex = 1;
66 | this.uiLine1.Text = "简介";
67 | //
68 | // About
69 | //
70 | this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
71 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
72 | this.ClientSize = new System.Drawing.Size(658, 413);
73 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
74 | this.Name = "About";
75 | this.Text = "About";
76 | this.PagePanel.ResumeLayout(false);
77 | this.ResumeLayout(false);
78 |
79 | }
80 |
81 | #endregion
82 |
83 | private Sunny.UI.UIRichTextBox uiRichTextBox1;
84 | private Sunny.UI.UILine uiLine1;
85 | }
86 | }
--------------------------------------------------------------------------------
/StarTools/StarTools/About.cs:
--------------------------------------------------------------------------------
1 | using Sunny.UI;
2 |
3 | namespace StarTools
4 | {
5 | public partial class About : UITitlePage
6 | {
7 | public About()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/StarTools/StarTools/About.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 |
123 | AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAMMOAADDDgAAAAAAAAAA
124 | AADy9fj/SE91/2tGP/94UEb/bUY8/2VAM/9nQTX/ZkA0/2dBNP9mQDT/Z0I2/103IP9mPR//b0gr/z05
125 | Z/9FQpf/LTN2/x4saP8xNHz/LTV5/0k1Mv9jOR//ZkA3/2ZANP9mQDT/ZkA0/2ZANf9sRDT/SS8z/2d2
126 | nf/t5dz/oXRU///89f9eaY//XT0+/3tSR/9tRz3/ZT80/2ZBNf9nQTT/Z0E1/2ZANP9mQDb/ZD8y/2Q5
127 | GP9cPSX/Pz2L/4xa4v9FPZP/Iy9s/1RCoP90U9D/MjFM/2pAKf9mQTj/ZUA1/2ZANf9mQDT/ZUA1/29F
128 | NP87KTf/ipm7/+PVxv+od1P///Lh/4GPsf9LNED/flRH/21IQP9oQDH/aUEz/2ZANP9lQDT/aEI1/25E
129 | M/9pQTT/VDEi/z0nIP8bImP/KSF+/xciZf8TJF7/JiZ0/ysjhP8lIz//WDUt/2Y/Mv9uRDP/aEI1/2VA
130 | Nf9lQDX/bkQz/y4oRP+6xtz/zbai/7iBV//73L//rrvU/zsvSf99Ukb/d00//1g9Pf9ROkD/Z0E0/2tD
131 | M/9eOTD/Pi07/zQ2Wf9IU3z/YnCY/3yLrP+So7v/n67F/5ypxf+UpLv/k6O6/3iGqP9TX4f/OTpd/zws
132 | Pf9cODL/bUM0/2dBNf9jPjL/Mjde/+Xp8f+1ln3/ypBj/+e6lP/h5u//Oz5j/3xPP/9YRE//OjRP/2ZB
133 | Nf9uQzD/UTY6/0ZOcf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Ul2f/4qyB//rm0/+xvtP/TV+N/y8vVv9EMkL/YkFB/3RMQv98UUT/flNF/35URf9+U0X/flNF/31T
185 | RP96UEP/cUpB/10+QP8/MEP/LjRd/2d4ov/g6PL/9eTU/8iVb//Ym2v/26Fz/9mecP/an3H/2p9x/9qf
186 | cf/an3H/2p9x/9qgc//Xm2z/1phn/+/Cm//359j/wsvb/3mLsf9JWIT/NTtl/zMwUv86L0j/PzBE/0Ax
187 | RP88L0b/Ny9L/zMzVv84QGr/UWGN/4iavP/W3er///Pk/+S9nP/PlGb/3J9v/9qgc//ZnnD/2p9x/9qf
188 | cf/an3H/2Z9x/9qfcf/an3H/2p9x/9qgcv/aoHL/1Zho/9eZaf/quI7/+dm8//Lk2P/a2N7/u8PU/6Ku
189 | x/+SoL3/j528/5qnw/+rtsz/xMrW/+Hd3f/359n/+tu9/+e4kP/VmWr/15ho/9yhc//an3L/2p9x/9qf
190 | cf/an3H/2p9x/9Whdf/VoHb/2J90/9qfcf/annD/259x/9qfcf/aoHL/2qBy/9aZav/TlGT/2Jtr/+Or
191 | fv/uvJL/9Mii//bNqP/2zan/9cqk//HCmf/qton/4Kd5/9eaav/TlGP/15lp/9qgcv/aoHP/2p9x/9qf
192 | cf/an3H/2p9x/9qfcf/an3H/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
193 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
194 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
195 |
196 |
197 |
--------------------------------------------------------------------------------
/StarTools/StarTools/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/StarTools/StarTools/CmdUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Management;
4 |
5 | namespace StarTools
6 | {
7 | internal class CmdUtils
8 | {
9 | private Process _cmd;
10 | private string _exe;
11 |
12 | public void SendCmd(RipCmd cmdoom, string shell, string arg)
13 | {
14 | shell = shell + arg;
15 | _cmd = new Process();
16 | var startInfo = new ProcessStartInfo
17 | {
18 | FileName = "cmd.exe",
19 | Arguments = "",
20 | UseShellExecute = false,
21 | RedirectStandardInput = true,
22 | RedirectStandardOutput = true,
23 | RedirectStandardError = true,
24 | CreateNoWindow = true
25 | };
26 | _cmd.StartInfo = startInfo;
27 |
28 | if (_cmd.Start())
29 | {
30 | _exe = "";
31 | _cmd.StandardInput.WriteLine(shell);
32 | var log = _cmd.StandardError.ReadLine();
33 | updateLog(cmdoom, log);
34 | log = "";
35 | do
36 | {
37 | var logm = _cmd.StandardError.ReadLine();
38 | if (logm == null) break;
39 | updateLog(cmdoom, logm + "\n");
40 | log += logm;
41 | } while (true);
42 |
43 | _cmd.Close();
44 | _cmd = null;
45 | }
46 | }
47 |
48 | //TODO: 函数功能分离,创建其他页面使用的窗口
49 | private void updateLog(RipCmd cmd, string log)
50 | {
51 | void Set()
52 | {
53 | if (_exe == "") _exe = log.Substring(0, 5) == "ffmpe" ? "ffmpe" : "enc";
54 | cmd.uiRichTextBox1.AppendText(log);
55 | cmd.uiRichTextBox1.ScrollToCaret();
56 | try
57 | {
58 | if (log.Length <= 11) return;
59 | if (log.Substring(0, 11) == "encode time")
60 | cmd.uiProcessBar1.Value = 100;
61 | else
62 | switch (_exe)
63 | {
64 | case "enc":
65 | cmd.uiProcessBar1.Value = (int) float.Parse(log.Substring(
66 | log.IndexOf("[", StringComparison.Ordinal) + 1,
67 | log.IndexOf("%", StringComparison.Ordinal) -
68 | log.IndexOf("[", StringComparison.Ordinal) - 1));
69 | break;
70 | case "ffmpe":
71 | //TODO: ffmpeg管道模式下的进度条实现
72 | break;
73 | }
74 | }
75 | catch
76 | {
77 | // ignored
78 | }
79 | }
80 |
81 | cmd.Invoke((UpdateLog) Set);
82 | }
83 |
84 | public void CloseCmd()
85 | {
86 | _cmd.KillProcessTree();
87 | _cmd.Close();
88 | }
89 |
90 | private delegate void UpdateLog();
91 | }
92 |
93 | public static class ProcessEx
94 | {
95 | public static void KillProcessTree(this Process parent)
96 | {
97 | var searcher =
98 | new ManagementObjectSearcher("Select * From Win32_Process Where ParentProcessID=" + parent.Id);
99 | var moc = searcher.Get();
100 | foreach (var o in moc)
101 | {
102 | var mo = (ManagementObject) o;
103 | var childProcess = Process.GetProcessById(Convert.ToInt32(mo["ProcessID"]));
104 | childProcess.KillProcessTree();
105 | }
106 |
107 | try
108 | {
109 | if (parent.Id != Process.GetCurrentProcess().Id) parent.Kill();
110 | }
111 | catch
112 | {
113 | // ignored
114 | }
115 | }
116 | }
117 | }
--------------------------------------------------------------------------------
/StarTools/StarTools/Encode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Windows.Forms;
5 | using Sunny.UI;
6 |
7 | namespace StarTools
8 | {
9 | public partial class Encode : UITitlePage
10 | {
11 | public Encode()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private static void AddUpdateAppSettings(string key, string value)
17 | {
18 | try
19 | {
20 | var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
21 | var settings = configFile.AppSettings.Settings;
22 | if (settings[key] == null)
23 | settings.Add(key, value);
24 | else
25 | settings[key].Value = value;
26 | configFile.Save(ConfigurationSaveMode.Modified);
27 | ConfigurationManager.RefreshSection(configFile.AppSettings.SectionInformation.Name);
28 | }
29 | catch (ConfigurationErrorsException)
30 | {
31 | Console.WriteLine(@"Error writing app settings");
32 | }
33 | }
34 |
35 | private void Encode_Load(object sender, EventArgs e)
36 | {
37 | try
38 | {
39 | var appSettings = ConfigurationManager.AppSettings;
40 | var openWith = new Dictionary
41 | {
42 | {"0", 0},
43 | {"1", 1},
44 | {"2", 2}
45 | };
46 |
47 | if (appSettings["EncoderBox_selected"] == null)
48 | {
49 | AddUpdateAppSettings("EncoderBox_selected", "0");
50 | EncoderBox.SelectedIndex = 0;
51 | }
52 | else
53 | {
54 | EncoderBox.SelectedIndex = openWith[appSettings["EncoderBox_selected"]];
55 | }
56 | }
57 | catch (ConfigurationErrorsException)
58 | {
59 | Console.WriteLine(@"Error reading app settings");
60 | }
61 | }
62 |
63 | private void AddVideoFiles_Click(object sender, EventArgs e)
64 | {
65 | VideoFile.Text = FileDo.GetVideoFile("请输入视频文件");
66 | }
67 |
68 | private void AddAssFiles_Click(object sender, EventArgs e)
69 | {
70 | AssFile.Text = FileDo.GetAssFile("请输入字幕文件");
71 | }
72 |
73 | private void SaveFile_Click(object sender, EventArgs e)
74 | {
75 | OutputFile.Text = FileDo.GetSaveFiles("mp4");
76 | }
77 |
78 | private void VideoFile_TextChanged(object sender, EventArgs e)
79 | {
80 | try
81 | {
82 | OutputFile.Text =
83 | VideoFile.Text.Substring(0, VideoFile.Text.LastIndexOf(".", StringComparison.Ordinal)) +
84 | @"_rip.mp4";
85 | }
86 | catch (Exception exception)
87 | {
88 | Console.WriteLine(exception);
89 | throw;
90 | }
91 | }
92 |
93 | private void File_DragEnter(object sender, DragEventArgs e)
94 | {
95 | e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Link : DragDropEffects.None;
96 | }
97 |
98 | private void AssFile_DragDrop(object sender, DragEventArgs e)
99 | {
100 | AssFile.Text = ((Array) e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();
101 | }
102 |
103 | private void VideoFile_DragDrop(object sender, DragEventArgs e)
104 | {
105 | VideoFile.Text = ((Array) e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();
106 | }
107 |
108 | private void rip_Click(object sender, EventArgs e)
109 | {
110 | var appSettings = ConfigurationManager.AppSettings;
111 | var encoderWith = new Dictionary
112 | {
113 | {0, appSettings["QSVEnc_file"]},
114 | {1, appSettings["NVEnc_file"]},
115 | {2, appSettings["VCEEnc_file"]}
116 | };
117 | var audioWith = new Dictionary
118 | {
119 | {"0", " --audio-copy"},
120 | {"1", " --audio-codec aac --audio-bitrate " + appSettings["Raws_audiobit"]}
121 | };
122 |
123 | if (VideoFile.Text == @"请输入视频文件")
124 | {
125 | ShowErrorDialog(@"请放入源文件!");
126 | return;
127 | }
128 |
129 | if (OutputFile.Text == "")
130 | {
131 | ShowErrorDialog(@"请填写输出文件!");
132 | return;
133 | }
134 |
135 | AddUpdateAppSettings("EncoderBox_selected", EncoderBox.SelectedIndex.ToString());
136 | string cmdLine;
137 | string argLine;
138 | if (AssFile.Text != @"请输入字幕文件")
139 | {
140 | var temp = AssFile.Text;
141 | temp = temp.Replace("\\", "\\\\\\\\");
142 | temp = temp.Insert(temp.IndexOf(":", StringComparison.Ordinal), "\\\\");
143 | var ffmpegWith = new Dictionary
144 | {
145 | {0, appSettings["QSVEnc_file"]},
146 | {1, appSettings["NVEnc_file"]},
147 | {2, appSettings["VCEEnc_file"]}
148 | };
149 |
150 | if (EncoderBox.SelectedIndex == 1)
151 | {
152 | cmdLine = appSettings["NVEnc_file"];
153 | argLine = " --avhw -i \"" + VideoFile.Text +
154 | "\" --audio-codec aac --vpp-subburn filename=\"" +
155 | AssFile.Text + "\",charcode=utf-8,shaping=complex";
156 | }
157 | else
158 | {
159 | cmdLine = appSettings["ffmpeg_file"];
160 | argLine = " -y -i \"" + VideoFile.Text +
161 | "\" -vf \"ass=" + temp +
162 | "\" -codec:a copy -codec:v rawvideo -pix_fmt yuv420p -f nut - | " +
163 | ffmpegWith[EncoderBox.SelectedIndex] + " --avsw -i -";
164 | }
165 | }
166 | else
167 | {
168 | cmdLine = encoderWith[EncoderBox.SelectedIndex];
169 | argLine = " --avhw -i \"" + VideoFile.Text +
170 | "\"";
171 | }
172 |
173 | argLine += audioWith[appSettings["Raws_audiomode"]];
174 |
175 | try
176 | {
177 | var bitWith = new Dictionary
178 | {
179 | {
180 | "1",
181 | " --cqp " + appSettings["I"] + ":" + appSettings["P"] + ":" +
182 | appSettings["B"]
183 | },
184 | {"2", " --cbr " + appSettings["CBR"]},
185 | {"3", " --vbr " + appSettings["VBR"]}
186 | };
187 | argLine += bitWith[appSettings["Code_rate_control_mode_selection"]];
188 | }
189 | catch (Exception exception)
190 | {
191 | Console.WriteLine(exception);
192 | throw;
193 | }
194 |
195 | if (uiCheckBox1.Checked)
196 | argLine += " --interlace tff --vpp-deinterlace normal";
197 |
198 | if (uiCheckBox2.Checked)
199 | argLine = argLine + " --output-res " + WBox.Text + "x" + HBox.Text;
200 |
201 | if (appSettings["Code"] != null && appSettings["Code"] != "") argLine += appSettings["Code"];
202 |
203 | argLine = argLine + " -o \"" + OutputFile.Text + "\"";
204 |
205 | var f = new RunRip(cmdLine, argLine);
206 | f.ShowDialog();
207 | f.Dispose();
208 | }
209 | }
210 | }
--------------------------------------------------------------------------------
/StarTools/StarTools/Encode.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 |
123 | AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAMMOAADDDgAAAAAAAAAA
124 | AADy9fj/SE91/2tGP/94UEb/bUY8/2VAM/9nQTX/ZkA0/2dBNP9mQDT/Z0I2/103IP9mPR//b0gr/z05
125 | Z/9FQpf/LTN2/x4saP8xNHz/LTV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quI7/+dm8//Lk2P/a2N7/u8PU/6Ku
189 | x/+SoL3/j528/5qnw/+rtsz/xMrW/+Hd3f/359n/+tu9/+e4kP/VmWr/15ho/9yhc//an3L/2p9x/9qf
190 | cf/an3H/2p9x/9Whdf/VoHb/2J90/9qfcf/annD/259x/9qfcf/aoHL/2qBy/9aZav/TlGT/2Jtr/+Or
191 | fv/uvJL/9Mii//bNqP/2zan/9cqk//HCmf/qton/4Kd5/9eaav/TlGP/15lp/9qgcv/aoHP/2p9x/9qf
192 | cf/an3H/2p9x/9qfcf/an3H/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
193 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
194 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
195 |
196 |
197 |
--------------------------------------------------------------------------------
/StarTools/StarTools/EncoderBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Configuration;
3 | using Sunny.UI;
4 |
5 | namespace StarTools
6 | {
7 | public partial class EncoderBox : UITitlePage
8 | {
9 | public EncoderBox()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private static void AddUpdateAppSettings(string key, string value)
15 | {
16 | try
17 | {
18 | var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
19 | var settings = configFile.AppSettings.Settings;
20 | if (settings[key] == null)
21 | settings.Add(key, value);
22 | else
23 | settings[key].Value = value;
24 | configFile.Save(ConfigurationSaveMode.Modified);
25 | ConfigurationManager.RefreshSection(configFile.AppSettings.SectionInformation.Name);
26 | }
27 | catch (ConfigurationErrorsException)
28 | {
29 | Console.WriteLine(@"Error writing app settings");
30 | }
31 | }
32 |
33 | private void EncoderBox_Load(object sender, EventArgs e)
34 | {
35 | try
36 | {
37 | var appSettings = ConfigurationManager.AppSettings;
38 | var result = appSettings["Code_rate_control_mode_selection"] ?? "Not Found";
39 | switch (result)
40 | {
41 | case "1":
42 | uiRadioButton1.Checked = true;
43 | break;
44 | case "2":
45 | uiRadioButton2.Checked = true;
46 | break;
47 | case "3":
48 | uiRadioButton3.Checked = true;
49 | break;
50 | case "Not Found":
51 | AddUpdateAppSettings("Code_rate_control_mode_selection", "1");
52 | uiRadioButton1.Checked = true;
53 | break;
54 | default:
55 | ShowErrorDialog(@"正常情况看不到这个,出现该弹窗请带上复现方法到GitHub提issue");
56 | break;
57 | }
58 |
59 | if (appSettings["Raws_audiomode"] == null)
60 | {
61 | AddUpdateAppSettings("Raws_audiomode", "0");
62 | AudioMode.SelectedIndex = 0;
63 | }
64 | else
65 | {
66 | switch (appSettings["Raws_audiomode"])
67 | {
68 | case "0":
69 | AudioMode.SelectedIndex = 0;
70 | AudioBox.Hide();
71 | uiLabel8.Hide();
72 | uiLabel7.Show();
73 | break;
74 | case "1":
75 | AudioMode.SelectedIndex = 1;
76 | AudioBox.Show();
77 | uiLabel8.Show();
78 | uiLabel7.Hide();
79 | break;
80 | default:
81 | ShowErrorDialog(@"正常情况看不到这个,出现该弹窗请带上复现方法到GitHub提issue");
82 | break;
83 | }
84 | }
85 |
86 | if (appSettings["Raws_audiobit"] == null)
87 | {
88 | AddUpdateAppSettings("Raws_audiobit", "192");
89 | AudioBox.Text = @"192";
90 | }
91 | else
92 | {
93 | AudioBox.Text = appSettings["Raws_audiobit"];
94 | }
95 |
96 | if (appSettings["I"] == null)
97 | {
98 | AddUpdateAppSettings("I", "24");
99 | IBox.Text = @"24";
100 | }
101 | else
102 | {
103 | IBox.Text = appSettings["I"];
104 | }
105 |
106 | if (appSettings["P"] == null)
107 | {
108 | AddUpdateAppSettings("P", "26");
109 | PBox.Text = @"26";
110 | }
111 | else
112 | {
113 | PBox.Text = appSettings["P"];
114 | }
115 |
116 | if (appSettings["B"] == null)
117 | {
118 | AddUpdateAppSettings("B", "27");
119 | BBox.Text = @"27";
120 | }
121 | else
122 | {
123 | BBox.Text = appSettings["B"];
124 | }
125 |
126 | if (appSettings["CBR"] == null)
127 | {
128 | AddUpdateAppSettings("CBR", "3000");
129 | CBRBox.Text = @"3000";
130 | }
131 | else
132 | {
133 | CBRBox.Text = appSettings["CBR"];
134 | }
135 |
136 | if (appSettings["VBR"] == null)
137 | {
138 | AddUpdateAppSettings("VBR", "3000");
139 | VBRBox.Text = @"3000";
140 | }
141 | else
142 | {
143 | VBRBox.Text = appSettings["VBR"];
144 | }
145 | }
146 | catch (ConfigurationErrorsException)
147 | {
148 | Console.WriteLine(@"Error reading app settings");
149 | }
150 | }
151 |
152 | private void Save_Click(object sender, EventArgs e)
153 | {
154 | if (uiRadioButton1.Checked && !uiRadioButton2.Checked && !uiRadioButton3.Checked)
155 | AddUpdateAppSettings("Code_rate_control_mode_selection", "1");
156 | else if (!uiRadioButton1.Checked && uiRadioButton2.Checked && !uiRadioButton3.Checked)
157 | AddUpdateAppSettings("Code_rate_control_mode_selection", "2");
158 | else if (!uiRadioButton1.Checked && !uiRadioButton2.Checked && uiRadioButton3.Checked)
159 | AddUpdateAppSettings("Code_rate_control_mode_selection", "3");
160 | else
161 | ShowErrorDialog(@"正常情况看不到这个,出现该弹窗请带上复现方法到GitHub提issue");
162 |
163 | AddUpdateAppSettings("I", IBox.Text);
164 | AddUpdateAppSettings("P", PBox.Text);
165 | AddUpdateAppSettings("B", BBox.Text);
166 | AddUpdateAppSettings("CBR", CBRBox.Text);
167 | AddUpdateAppSettings("VBR", VBRBox.Text);
168 | AddUpdateAppSettings("Raws_audiobit", AudioBox.Text);
169 |
170 | UIMessageTip.ShowOk("保存成功");
171 | }
172 |
173 | private void AudioMode_SelectedIndexChanged(object sender, EventArgs e)
174 | {
175 | switch (AudioMode.SelectedIndex)
176 | {
177 | case 0:
178 | AddUpdateAppSettings("Raws_audiomode", "0");
179 | AudioBox.Hide();
180 | uiLabel8.Hide();
181 | uiLabel7.Show();
182 | break;
183 | case 1:
184 | AddUpdateAppSettings("Raws_audiomode", "1");
185 | AudioBox.Show();
186 | uiLabel8.Show();
187 | uiLabel7.Hide();
188 | break;
189 | default:
190 | ShowErrorDialog(@"正常情况看不到这个,出现该弹窗请带上复现方法到GitHub提issue");
191 | break;
192 | }
193 | }
194 | }
195 | }
--------------------------------------------------------------------------------
/StarTools/StarTools/EncoderBox.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 |
123 | AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAMMOAADDDgAAAAAAAAAA
124 | AADy9fj/SE91/2tGP/94UEb/bUY8/2VAM/9nQTX/ZkA0/2dBNP9mQDT/Z0I2/103IP9mPR//b0gr/z05
125 | Z/9FQpf/LTN2/x4saP8xNHz/LTV5/0k1Mv9jOR//ZkA3/2ZANP9mQDT/ZkA0/2ZANf9sRDT/SS8z/2d2
126 | nf/t5dz/oXRU///89f9eaY//XT0+/3tSR/9tRz3/ZT80/2ZBNf9nQTT/Z0E1/2ZANP9mQDb/ZD8y/2Q5
127 | GP9cPSX/Pz2L/4xa4v9FPZP/Iy9s/1RCoP90U9D/MjFM/2pAKf9mQTj/ZUA1/2ZANf9mQDT/ZUA1/29F
128 | NP87KTf/ipm7/+PVxv+od1P///Lh/4GPsf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9qf
192 | cf/an3H/2p9x/9qfcf/an3H/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
193 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
194 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
195 |
196 |
197 |
--------------------------------------------------------------------------------
/StarTools/StarTools/FileDo.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Security;
3 | using System.Windows.Forms;
4 |
5 | namespace StarTools
6 | {
7 | internal static class FileDo
8 | {
9 | public static string GetVideoFile(string initText)
10 | {
11 | var openFileDialog1 = new OpenFileDialog
12 | {
13 | FileName = "Select a video file",
14 | Filter =
15 | @"files (*.mp4;*.mkv;*.flv;*.m2ts;*.ts;*.264;*.h264;*.hevc)|*.mp4;*.mkv;*.flv;*.m2ts;*.ts;*.264;*.h264;*.hevc|All files (*.*)|*.*",
16 | Title = @"Open video file"
17 | };
18 | if (openFileDialog1.ShowDialog() != DialogResult.OK) return initText;
19 | try
20 | {
21 | return openFileDialog1.FileName;
22 | }
23 | catch (SecurityException ex)
24 | {
25 | MessageBox.Show($"Security error.\n\nError message: {ex.Message}\n\n" +
26 | $"Details:\n\n{ex.StackTrace}");
27 | return initText;
28 | }
29 | }
30 |
31 | public static IEnumerable GetAudioFiles()
32 | {
33 | var openFileDialog1 = new OpenFileDialog
34 | {
35 | FileName = "Select a audio file",
36 | Filter =
37 | @"Audio files (*.m4a)|*.m4a|All files (*.*)|*.*",
38 | Title = @"Open audio file",
39 | Multiselect = true
40 | };
41 | if (openFileDialog1.ShowDialog() != DialogResult.OK) return null;
42 | try
43 | {
44 | return openFileDialog1.FileNames;
45 | }
46 | catch (SecurityException ex)
47 | {
48 | MessageBox.Show($"Security error.\n\nError message: {ex.Message}\n\n" +
49 | $"Details:\n\n{ex.StackTrace}");
50 | return null;
51 | }
52 | }
53 |
54 | public static string GetAssFile(string initText)
55 | {
56 | var openFileDialog1 = new OpenFileDialog
57 | {
58 | FileName = "Select a ass file",
59 | Filter = @"Ass files (*.ass)|*.ass|All files (*.*)|*.*",
60 | Title = @"Open ass file"
61 | };
62 | if (openFileDialog1.ShowDialog() != DialogResult.OK) return initText;
63 | try
64 | {
65 | return openFileDialog1.FileName;
66 | }
67 | catch (SecurityException ex)
68 | {
69 | MessageBox.Show($"Security error.\n\nError message: {ex.Message}\n\n" +
70 | $"Details:\n\n{ex.StackTrace}");
71 | return initText;
72 | }
73 | }
74 |
75 | public static string GetSaveFiles(string filekinds)
76 | {
77 | var saveFileDialog1 = new SaveFileDialog
78 | {
79 | FileName = "Output",
80 | Filter = filekinds + @" files (*." + filekinds + @")|*." + filekinds + @"|All files (*.*)|*.*",
81 | Title = @"Save a " + filekinds + @" file"
82 | };
83 |
84 | if (saveFileDialog1.ShowDialog() != DialogResult.OK) return "";
85 | try
86 | {
87 | var filePath = saveFileDialog1.FileName;
88 | return filePath;
89 | }
90 | catch (SecurityException ex)
91 | {
92 | MessageBox.Show($"Security error.\n\nError message: {ex.Message}\n\n" +
93 | $"Details:\n\n{ex.StackTrace}");
94 | return "";
95 | }
96 | }
97 | }
98 | }
--------------------------------------------------------------------------------
/StarTools/StarTools/Mux.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Configuration;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Windows.Forms;
7 | using Sunny.UI;
8 |
9 | namespace StarTools
10 | {
11 | public partial class Mux : UITitlePage
12 | {
13 | public Mux()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | private void AddVideoFiles_Click(object sender, EventArgs e)
19 | {
20 | VideoFile.Text = FileDo.GetVideoFile("请输入视频文件");
21 | }
22 |
23 | private void mkvAddVideoFiles_Click(object sender, EventArgs e)
24 | {
25 | mkvVideoFile.Text = FileDo.GetVideoFile("请输入视频文件");
26 | }
27 |
28 | private void mp4AudioAdd_Click(object sender, EventArgs e)
29 | {
30 | foreach (var i in FileDo.GetAudioFiles()) AudioList.Items.Add(i);
31 | }
32 |
33 | private void mkvAudioAdd_Click(object sender, EventArgs e)
34 | {
35 | foreach (var i in FileDo.GetAudioFiles()) mkvAudioList.Items.Add(i);
36 | }
37 |
38 | private void mkvOthersAdd_Click(object sender, EventArgs e)
39 | {
40 | foreach (var i in FileDo.GetAudioFiles()) mkvOthersList.Items.Add(i);
41 | }
42 |
43 | private void SaveFile_Click(object sender, EventArgs e)
44 | {
45 | OutputFile.Text = FileDo.GetSaveFiles("mp4");
46 | }
47 |
48 | private void mkvSaveFile_Click(object sender, EventArgs e)
49 | {
50 | mkvOutputFile.Text = FileDo.GetSaveFiles("mkv");
51 | }
52 |
53 | private void VideoFile_TextChanged(object sender, EventArgs e)
54 | {
55 | try
56 | {
57 | OutputFile.Text =
58 | VideoFile.Text.Substring(0, VideoFile.Text.LastIndexOf(".", StringComparison.Ordinal)) +
59 | @"_mux.mp4";
60 | AudioList.Items.Clear();
61 | }
62 | catch (Exception exception)
63 | {
64 | Console.WriteLine(exception);
65 | throw;
66 | }
67 | }
68 |
69 | private void mkvVideoFile_TextChanged(object sender, EventArgs e)
70 | {
71 | try
72 | {
73 | mkvOutputFile.Text =
74 | mkvVideoFile.Text.Substring(0, mkvVideoFile.Text.LastIndexOf(".", StringComparison.Ordinal)) +
75 | @"_mux.mkv";
76 | mkvAudioList.Items.Clear();
77 | mkvOthersList.Items.Clear();
78 | }
79 | catch (Exception exception)
80 | {
81 | Console.WriteLine(exception);
82 | throw;
83 | }
84 | }
85 |
86 | private void File_DragEnter(object sender, DragEventArgs e)
87 | {
88 | e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None;
89 | }
90 |
91 | private void VideoFile_DragDrop(object sender, DragEventArgs e)
92 | {
93 | VideoFile.Text = ((Array) e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();
94 | }
95 |
96 | private void mkvVideoFile_DragDrop(object sender, DragEventArgs e)
97 | {
98 | mkvVideoFile.Text = ((Array) e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();
99 | }
100 |
101 | private void AudioList_DragDrop(object sender, DragEventArgs e)
102 | {
103 | var fileNames = (string[]) e.Data.GetData(DataFormats.FileDrop);
104 | foreach (var t in fileNames)
105 | AudioList.Items.Add(t);
106 | }
107 |
108 | private void mkvAudioList_DragDrop(object sender, DragEventArgs e)
109 | {
110 | var fileNames = (string[]) e.Data.GetData(DataFormats.FileDrop);
111 | foreach (var t in fileNames)
112 | mkvAudioList.Items.Add(t);
113 | }
114 |
115 | private void mkvOthersList_DragDrop(object sender, DragEventArgs e)
116 | {
117 | var fileNames = (string[]) e.Data.GetData(DataFormats.FileDrop);
118 | foreach (var t in fileNames)
119 | mkvOthersList.Items.Add(t);
120 | }
121 |
122 | private void mp4AudioDel_Click(object sender, EventArgs e)
123 | {
124 | if (AudioList.SelectedIndex != -1)
125 | AudioList.Items.RemoveAt(AudioList.SelectedIndex);
126 | }
127 |
128 | private void mkvAudioDel_Click(object sender, EventArgs e)
129 | {
130 | if (mkvAudioList.SelectedIndex != -1)
131 | mkvAudioList.Items.RemoveAt(mkvAudioList.SelectedIndex);
132 | }
133 |
134 | private void mkvOthersDel_Click(object sender, EventArgs e)
135 | {
136 | if (mkvOthersList.SelectedIndex != -1)
137 | mkvOthersList.Items.RemoveAt(mkvOthersList.SelectedIndex);
138 | }
139 |
140 | private void mp4mux_Click(object sender, EventArgs e)
141 | {
142 | if (OutputFile.Text == "")
143 | {
144 | ShowErrorDialog(@"请填写输出文件!");
145 | return;
146 | }
147 |
148 | var appSettings = ConfigurationManager.AppSettings;
149 | var cmdLine = appSettings["MP4Box_file"] + " -add \"" + VideoFile.Text + "\"";
150 | cmdLine = AudioList.Items.Cast