├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── autousc
├── App.config
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── README.md
├── UscProject.cs
├── UscRobot.cs
├── autousc.csproj
└── packages.config
├── mps2pmf
├── README.md
├── cxxopts.hpp
├── mps2pmf.cpp
└── pmf.h
├── pmftools.sln
├── psmfdump
├── Program.cs
├── README.md
├── format
│ ├── Atrac3Plus.cs
│ ├── Mpeg2Stream.cs
│ ├── MpegStream.cs
│ └── SonyPmfStream.cs
├── psmfdump.csproj
└── util
│ ├── ByteConversion.cs
│ ├── CalculatingOffsetDescription.cs
│ ├── Constants.cs
│ ├── FileUtil.cs
│ ├── MathUtil.cs
│ ├── OffsetDescription.cs
│ └── ParseFile.cs
└── scripts
├── avi_to_pmf.bat
└── pmf_to_mp4.bat
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Compiled Object files
5 | *.slo
6 | *.lo
7 | *.o
8 | *.obj
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 | *.dll
18 |
19 | # Fortran module files
20 | *.mod
21 | *.smod
22 |
23 | # Compiled Static libraries
24 | *.lai
25 | *.la
26 | *.a
27 | *.lib
28 |
29 | # Executables
30 | *.exe
31 | *.out
32 | *.app
33 | .vscode/settings.json
34 |
35 | ## Ignore Visual Studio temporary files, build results, and
36 | ## files generated by popular Visual Studio add-ons.
37 |
38 | # User-specific files
39 | *.suo
40 | *.user
41 | *.userosscache
42 | *.sln.docstates
43 |
44 | # User-specific files (MonoDevelop/Xamarin Studio)
45 | *.userprefs
46 |
47 | # Build results
48 | [Dd]ebug/
49 | [Dd]ebugPublic/
50 | [Rr]elease/
51 | [Rr]eleases/
52 | x64/
53 | x86/
54 | bld/
55 | [Bb]in/
56 | [Oo]bj/
57 | [Ll]og/
58 |
59 | # Visual Studio 2015 cache/options directory
60 | .vs/
61 | # Uncomment if you have tasks that create the project's static files in wwwroot
62 | #wwwroot/
63 |
64 | # MSTest test Results
65 | [Tt]est[Rr]esult*/
66 | [Bb]uild[Ll]og.*
67 |
68 | # NUNIT
69 | *.VisualState.xml
70 | TestResult.xml
71 |
72 | # Build Results of an ATL Project
73 | [Dd]ebugPS/
74 | [Rr]eleasePS/
75 | dlldata.c
76 |
77 | # DNX
78 | project.lock.json
79 | artifacts/
80 |
81 | *_i.c
82 | *_p.c
83 | *_i.h
84 | *.ilk
85 | *.meta
86 | *.obj
87 | *.pch
88 | *.pdb
89 | *.pgc
90 | *.pgd
91 | *.rsp
92 | *.sbr
93 | *.tlb
94 | *.tli
95 | *.tlh
96 | *.tmp
97 | *.tmp_proj
98 | *.log
99 | *.vspscc
100 | *.vssscc
101 | .builds
102 | *.pidb
103 | *.svclog
104 | *.scc
105 |
106 | # Chutzpah Test files
107 | _Chutzpah*
108 |
109 | # Visual C++ cache files
110 | ipch/
111 | *.aps
112 | *.ncb
113 | *.opendb
114 | *.opensdf
115 | *.sdf
116 | *.cachefile
117 | *.VC.db
118 | *.VC.VC.opendb
119 |
120 | # Visual Studio profiler
121 | *.psess
122 | *.vsp
123 | *.vspx
124 | *.sap
125 |
126 | # TFS 2012 Local Workspace
127 | $tf/
128 |
129 | # Guidance Automation Toolkit
130 | *.gpState
131 |
132 | # ReSharper is a .NET coding add-in
133 | _ReSharper*/
134 | *.[Rr]e[Ss]harper
135 | *.DotSettings.user
136 |
137 | # JustCode is a .NET coding add-in
138 | .JustCode
139 |
140 | # TeamCity is a build add-in
141 | _TeamCity*
142 |
143 | # DotCover is a Code Coverage Tool
144 | *.dotCover
145 |
146 | # NCrunch
147 | _NCrunch_*
148 | .*crunch*.local.xml
149 | nCrunchTemp_*
150 |
151 | # MightyMoose
152 | *.mm.*
153 | AutoTest.Net/
154 |
155 | # Web workbench (sass)
156 | .sass-cache/
157 |
158 | # Installshield output folder
159 | [Ee]xpress/
160 |
161 | # DocProject is a documentation generator add-in
162 | DocProject/buildhelp/
163 | DocProject/Help/*.HxT
164 | DocProject/Help/*.HxC
165 | DocProject/Help/*.hhc
166 | DocProject/Help/*.hhk
167 | DocProject/Help/*.hhp
168 | DocProject/Help/Html2
169 | DocProject/Help/html
170 |
171 | # Click-Once directory
172 | publish/
173 |
174 | # Publish Web Output
175 | *.[Pp]ublish.xml
176 | *.azurePubxml
177 | # TODO: Comment the next line if you want to checkin your web deploy settings
178 | # but database connection strings (with potential passwords) will be unencrypted
179 | *.pubxml
180 | *.publishproj
181 |
182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
183 | # checkin your Azure Web App publish settings, but sensitive information contained
184 | # in these scripts will be unencrypted
185 | PublishScripts/
186 |
187 | # NuGet Packages
188 | *.nupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/packages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/packages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/packages/repositories.config
195 | # NuGet v3's project.json files produces more ignoreable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
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 | *.pfx
226 | *.publishsettings
227 | node_modules/
228 | orleans.codegen.cs
229 |
230 | # Since there are multiple workflows, uncomment next line to ignore bower_components
231 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
232 | #bower_components/
233 |
234 | # RIA/Silverlight projects
235 | Generated_Code/
236 |
237 | # Backup & report files from converting an old project file
238 | # to a newer Visual Studio version. Backup files are not needed,
239 | # because we have git ;-)
240 | _UpgradeReport_Files/
241 | Backup*/
242 | UpgradeLog*.XML
243 | UpgradeLog*.htm
244 |
245 | # SQL Server files
246 | *.mdf
247 | *.ldf
248 |
249 | # Business Intelligence projects
250 | *.rdl.data
251 | *.bim.layout
252 | *.bim_*.settings
253 |
254 | # Microsoft Fakes
255 | FakesAssemblies/
256 |
257 | # GhostDoc plugin setting file
258 | *.GhostDoc.xml
259 |
260 | # Node.js Tools for Visual Studio
261 | .ntvs_analysis.dat
262 |
263 | # Visual Studio 6 build log
264 | *.plg
265 |
266 | # Visual Studio 6 workspace options file
267 | *.opt
268 |
269 | # Visual Studio LightSwitch build output
270 | **/*.HTMLClient/GeneratedArtifacts
271 | **/*.DesktopClient/GeneratedArtifacts
272 | **/*.DesktopClient/ModelManifest.xml
273 | **/*.Server/GeneratedArtifacts
274 | **/*.Server/ModelManifest.xml
275 | _Pvt_Extensions
276 |
277 | # Paket dependency manager
278 | .paket/paket.exe
279 | paket-files/
280 |
281 | # FAKE - F# Make
282 | .fake/
283 |
284 | # JetBrains Rider
285 | .idea/
286 | *.sln.iml
287 |
288 | # =========================
289 | # Operating System Files
290 | # =========================
291 |
292 | # OSX
293 | # =========================
294 |
295 | .DS_Store
296 | .AppleDouble
297 | .LSOverride
298 |
299 | # Thumbnails
300 | ._*
301 |
302 | # Files that might appear in the root of a volume
303 | .DocumentRevisions-V100
304 | .fseventsd
305 | .Spotlight-V100
306 | .TemporaryItems
307 | .Trashes
308 | .VolumeIcon.icns
309 |
310 | # Directories potentially created on remote AFP share
311 | .AppleDB
312 | .AppleDesktop
313 | Network Trash Folder
314 | Temporary Items
315 | .apdisk
316 |
317 | # Windows
318 | # =========================
319 |
320 | # Windows image file caches
321 | Thumbs.db
322 | ehthumbs.db
323 |
324 | # Folder config file
325 | Desktop.ini
326 |
327 | # Recycle Bin used on file shares
328 | $RECYCLE.BIN/
329 |
330 | # Windows Installer files
331 | *.cab
332 | *.msi
333 | *.msm
334 | *.msp
335 |
336 | # Windows shortcuts
337 | *.lnk
338 | *.3ps
339 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 LITTOMA
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # pmftools
2 | Tools for handling PSP PMF movies
3 |
4 | * [psmfdump](psmfdump/README.md): Dump .264 and .oma files from .pmf files.
5 | * [mps2pmf](mps2pmf/README.md): Convert .mps files to .pmf files.
6 | * [autousc](autousc/README.md): Automating UMD Stream Composer multiplex works.
7 |
8 | # Download
9 | You can find a prebuilt package in the [release](https://github.com/TeamPBCN/pmftools/releases/latest) section.
10 |
11 | # Usage
12 | Convert PMF files to MP4 for editing
13 | ```
14 | Step 1: put PMF files into `input/pmf`
15 | Step 2: run `pmf_to_mp4.bat`
16 | Step 3: find your converted files in `output/mp4` and enjoy ~^.^~!
17 | ```
18 |
19 | Convert AVI files to PMF
20 | ```
21 | Step 1: put AVI files into `input/avi`
22 | Step 2: run `avi_to_pmf.bat`
23 | Step 3: find your converted files in `output/pmf` and enjoy ~^.^~!
24 | ```
25 |
26 | # Verified by 吉🐣 PRODUCTION*
27 |
--------------------------------------------------------------------------------
/autousc/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/autousc/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | using CommandLine;
10 |
11 | namespace AutoUsc
12 | {
13 | class Program
14 | {
15 | static void Main(string[] args)
16 | {
17 | Parser.Default.ParseArguments(args)
18 | .WithParsed(opts =>
19 | {
20 | UscProject proj = null;
21 | var robot = new UscRobot(opts.Executable);
22 | try
23 | {
24 | robot.Launch();
25 | proj = robot.CreateNewProject(opts.ClipName, opts.ClipDescription, opts.ProjectName, opts.ProjectDescription, opts.Output);
26 | robot.AddVideoStream(Path.GetFullPath(opts.Video));
27 | robot.AddAudioStream(Path.GetFullPath(opts.Audio));
28 | robot.Compose(proj);
29 | }
30 | finally
31 | {
32 | robot.Close();
33 | proj?.Delete();
34 |
35 | }
36 | })
37 | .WithNotParsed(errors =>
38 | {
39 |
40 | });
41 | }
42 | }
43 |
44 | public class Options
45 | {
46 | public const string DefaultExecutablePath = ".\\Umd Stream Composer\\bin\\UmdStreamComposer.exe";
47 |
48 | [Option('x', "executable", HelpText = "Path to UmdStreamComposer.exe", Default = DefaultExecutablePath, Required = false)]
49 | public string Executable { get; set; }
50 |
51 | [Option("cn", HelpText = "Clip name", Required = true)]
52 | public string ClipName { get; set; }
53 |
54 | [Option("cd", HelpText = "Clip description", Default = "", Required = false)]
55 | public string ClipDescription { get; set; }
56 |
57 | [Option("pn", HelpText = "Project name", Required = true)]
58 | public string ProjectName { get; set; }
59 |
60 | [Option("pd", HelpText = "Project description", Default = "", Required = false)]
61 | public string ProjectDescription { get; set; }
62 |
63 | [Option('a', "audio", HelpText = "Input audio", Required = true)]
64 | public string Audio { get; set; }
65 |
66 | [Option('v', "video", HelpText = "Input video", Required = true)]
67 | public string Video { get; set; }
68 |
69 | [Option('o', "output", HelpText = "Output file", Required = false)]
70 | public string Output { get; set; }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/autousc/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("autoumc")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Team PB")]
12 | [assembly: AssemblyProduct("autoumc")]
13 | [assembly: AssemblyCopyright("Copyright (c) Team PB 2021")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("5cc089ae-53d1-4b1a-8a9f-3741f257de0d")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
33 | //通过使用 "*",如下所示:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/autousc/README.md:
--------------------------------------------------------------------------------
1 | # autousc
2 | This is an experimental tool for automating UMD Stream Composer multiplex works using UI Automation technology.
3 |
4 | # Setup
5 | Before using this tool, you must search and download "UMD Stream Composer" from the Internet and put the program folder to the same place as autousc.exe. Or you can use the "-x|--executable" option to specific the location of "UmdStreamComposer.exe".
6 |
7 | UMD Stream Composer version `1.5 RC4` is proved working with this tool.
8 |
9 | # Usage
10 | ``` shell
11 | autousc --cn --pn -a