Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dominic_render_video
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
videoag
dominic_render_video
Commits
27c7cb3c
Unverified
Commit
27c7cb3c
authored
1 year ago
by
Dominic Meiser
Browse files
Options
Downloads
Patches
Plain Diff
render videos with 3x bitrate
parent
f2f3f67d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main.rs
+6
-6
6 additions, 6 deletions
src/main.rs
src/render/ffmpeg.rs
+3
-3
3 additions, 3 deletions
src/render/ffmpeg.rs
src/render/mod.rs
+9
-0
9 additions, 0 deletions
src/render/mod.rs
with
18 additions
and
9 deletions
src/main.rs
+
6
−
6
View file @
27c7cb3c
...
...
@@ -79,7 +79,7 @@ macro_rules! resolutions {
}
}
fn
bitrate
(
self
)
->
&
'static
str
{
fn
bitrate
(
self
)
->
u64
{
match
self
{
$
(
Self
::
$res
=>
$bitrate
),
+
}
...
...
@@ -100,12 +100,12 @@ macro_rules! resolutions {
}
resolutions!
{
nHD
:
640
x
360
at
"
500
k"
,
HD
:
1280
x
720
at
"1M"
,
FullHD
:
1920
x
1080
at
"2M"
,
WQHD
:
2560
x
1440
at
"3M"
,
nHD
:
640
x
360
at
500
_000
,
HD
:
1280
x
720
at
1_000_000
,
FullHD
:
1920
x
1080
at
2_000_000
,
WQHD
:
2560
x
1440
at
3_000_000
,
// TODO qsx muss mal sagen wieviel bitrate für 4k
UHD
:
3840
x
2160
at
"4M"
UHD
:
3840
x
2160
at
4_000_000
}
#[derive(Deserialize,
Serialize)]
...
...
This diff is collapsed.
Click to expand it.
src/render/ffmpeg.rs
+
3
−
3
View file @
27c7cb3c
...
...
@@ -110,7 +110,7 @@ enum FfmpegFilter {
pub
(
crate
)
struct
Ffmpeg
{
inputs
:
Vec
<
FfmpegInput
>
,
filter
:
FfmpegFilter
,
video_bitrate
:
Option
<
&
'static
str
>
,
video_bitrate
:
Option
<
u64
>
,
output
:
FfmpegOutput
,
filter_idx
:
usize
...
...
@@ -182,7 +182,7 @@ impl Ffmpeg {
self
}
pub
fn
set_video_bitrate
(
&
mut
self
,
bitrate
:
&
'static
str
)
->
&
mut
Self
{
pub
fn
set_video_bitrate
(
&
mut
self
,
bitrate
:
u64
)
->
&
mut
Self
{
self
.video_bitrate
=
Some
(
bitrate
);
self
}
...
...
@@ -272,7 +272,7 @@ impl Ffmpeg {
cmd
.arg
(
"-c:v"
)
.arg
(
"copy"
);
}
if
venc
&&
self
.video_bitrate
.is_some
()
{
cmd
.arg
(
"-b:v"
)
.arg
(
self
.video_bitrate
.unwrap
());
cmd
.arg
(
"-b:v"
)
.arg
(
self
.video_bitrate
.unwrap
()
.to_string
()
);
}
if
aenc
{
cmd
.arg
(
"-c:a"
)
.arg
(
"aac"
);
...
...
This diff is collapsed.
Click to expand it.
src/render/mod.rs
+
9
−
0
View file @
27c7cb3c
...
...
@@ -443,6 +443,15 @@ impl<'a> Renderer<'a> {
// we're done :)
ffmpeg
.set_filter_output
(
overlay
);
ffmpeg
.set_video_bitrate
(
project
.source
.metadata
.as_ref
()
.unwrap
()
.source_res
.bitrate
()
*
3
);
ffmpeg
.run
()
?
;
Ok
(
output
)
...
...
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