alpha
Login
or
Join now
gwen.works
/
shapemaker
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
💡 Comment ffmpeg invokation flags
author
Gwenn Le Bihan
date
8 months ago
(Oct 27, 2025, 11:15 PM +0100)
commit
39e2d0ab
39e2d0ab641d378757cc05258ede288b90298cf1
parent
71f3b2e0
71f3b2e0a11e2596d71499da9e5937693f992329
+29
-8
1 changed file
Expand all
Collapse all
Unified
Split
src
video
encoding.rs
+29
-8
src/video/encoding.rs
Reviewed
···
108
108
self.initial_canvas.resolution_to_size_even(self.resolution);
109
109
110
110
Ok(std::process::Command::new("ffmpeg")
111
111
-
.args(["-i", (self.audiofile.to_str().unwrap())])
112
112
-
.args(["-f", ("rawvideo")])
113
113
-
.args(["-pixel_format", ("rgba")])
114
114
-
.args(["-video_size", &(format!("{width}x{height}"))])
111
111
+
// Audio //
112
112
+
// File
113
113
+
.args(["-i", self.audiofile.to_str().unwrap()])
114
114
+
//
115
115
+
// Video //
116
116
+
// Raw video input
117
117
+
.args(["-f", "rawvideo"])
118
118
+
// RGBA Pixels
119
119
+
.args(["-pixel_format", "rgba"])
120
120
+
// Dimensions
121
121
+
.args(["-video_size", &format!("{width}x{height}")])
122
122
+
// FPS
115
123
.args(["-framerate", &self.fps.to_string()])
116
116
-
.args(["-i", ("-")])
117
117
-
.args(["-map", ("0:a")])
118
118
-
.args(["-map", ("1:v")])
124
124
+
// Input from pipe
125
125
+
.args(["-i", "-"])
126
126
+
.stdin(std::process::Stdio::piped())
127
127
+
//
128
128
+
// Mapping //
129
129
+
// Audio from first input
130
130
+
.args(["-map", "0:a"])
131
131
+
// Video from second input
132
132
+
.args(["-map", "1:v"])
133
133
+
// Use shortest stream for final duration
119
134
.arg("-shortest")
135
135
+
//
136
136
+
// Output //
137
137
+
// Write to file
120
138
.arg(output_path.to_str().unwrap())
139
139
+
// Debug ffmpeg too if shapemaker is debugging
121
140
.args([
122
141
"-loglevel",
123
142
(if log::log_enabled!(log::Level::Debug) {
···
126
145
"error"
127
146
}),
128
147
])
129
129
-
.stdin(std::process::Stdio::piped())
148
148
+
// Put stdout/stderr here so that it doesn't mess with progress bars
130
149
.stdout(File::create("ffmpeg_stdout.log")?)
131
150
.stderr(File::create("ffmpeg_stderr.log")?)
151
151
+
//
152
152
+
// Spawn it!
132
153
.spawn()?)
133
154
}
134
155