Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Parser
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anduin Xue
Parser
Commits
2a8f5c5b
There was an error fetching the commit references. Please try again later.
Commit
2a8f5c5b
authored
2 years ago
by
Anduin Xue
Browse files
Options
Downloads
Patches
Plain Diff
Use GPU support.
parent
f9e2eaff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Entry.cs
+4
-4
4 additions, 4 deletions
Entry.cs
with
4 additions
and
4 deletions
Entry.cs
+
4
−
4
View file @
2a8f5c5b
...
@@ -28,7 +28,7 @@ namespace Parser
...
@@ -28,7 +28,7 @@ namespace Parser
if
(
args
.
Length
<
1
)
if
(
args
.
Length
<
1
)
{
{
Console
.
WriteLine
(
"Usage: WorkingPath"
);
Console
.
WriteLine
(
"Usage: WorkingPath
[useGPU]
"
);
Console
.
WriteLine
(
"Current parameters:"
);
Console
.
WriteLine
(
"Current parameters:"
);
foreach
(
var
arg
in
args
)
foreach
(
var
arg
in
args
)
{
{
...
@@ -48,11 +48,11 @@ namespace Parser
...
@@ -48,11 +48,11 @@ namespace Parser
foreach
(
var
file
in
videos
)
foreach
(
var
file
in
videos
)
{
{
await
Parse
(
file
);
await
Parse
(
file
,
coder
:
args
.
Any
(
a
=>
a
.
Equals
(
"useGPU"
,
StringComparison
.
OrdinalIgnoreCase
))
?
"hevc_nvenc"
:
"libx265"
);
}
}
}
}
private
async
Task
Parse
(
string
filePath
)
private
async
Task
Parse
(
string
filePath
,
string
coder
)
{
{
var
folder
=
Path
.
GetDirectoryName
(
filePath
)
??
throw
new
Exception
(
$"
{
filePath
}
is invalid!"
);
var
folder
=
Path
.
GetDirectoryName
(
filePath
)
??
throw
new
Exception
(
$"
{
filePath
}
is invalid!"
);
var
baseFileInfo
=
await
_commandService
.
RunCommand
(
"ffmpeg.exe"
,
$@"-i ""
{
filePath
}
"""
,
folder
);
var
baseFileInfo
=
await
_commandService
.
RunCommand
(
"ffmpeg.exe"
,
$@"-i ""
{
filePath
}
"""
,
folder
);
...
@@ -69,7 +69,7 @@ namespace Parser
...
@@ -69,7 +69,7 @@ namespace Parser
Console
.
WriteLine
(
$"
{
filePath
}
WILL be parsed!"
);
Console
.
WriteLine
(
$"
{
filePath
}
WILL be parsed!"
);
File
.
Delete
(
newFileName
);
File
.
Delete
(
newFileName
);
await
_commandService
.
RunCommand
(
"ffmpeg"
,
$@"-i ""
{
filePath
}
"" -codec:a copy -codec:v
hevc_nvenc
-b:v 16M ""
{
newFileName
}
"""
,
folder
,
getOutput
:
false
);
await
_commandService
.
RunCommand
(
"ffmpeg"
,
$@"-i ""
{
filePath
}
"" -codec:a copy -codec:v
{
coder
}
-b:v 16M ""
{
newFileName
}
"""
,
folder
,
getOutput
:
false
);
// Delete old file.
// Delete old file.
File
.
Delete
(
filePath
);
File
.
Delete
(
filePath
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment