Skip to content

Commit 4e4ff31

Browse files
committed
fix ffmpeg cmd
1 parent 728bceb commit 4e4ff31

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/target
2+
/ffmpeg
23
/rife-ncnn-vulkan
34
example*
45
output*

README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
# Aurora
22

3-
Video **Frame Interpolation** using machine learning.
3+
Video **Frame Interpolation** using machine learning
44

5-
Free and **TRUE** open source.
5+
Free and **TRUE** open source
66

7-
## Prerequired
7+
## 🚀 How to run
88

9-
* Download [FFmpeg](https://ffmpeg.org/download.html) and add it to the `PATH` environment variable.
10-
* Download [rife-ncnn-vulkan release](https://github.com/nihui/rife-ncnn-vulkan/releases) according to your system, extract it, rename it to `rife-ncnn-vulkan`, and put it in the root directory of the project.
9+
1. Download [release](https://github.com/jerryshell/aurora/releases) according to your system
1110

12-
## Run
11+
2. Edit `.env` file with your preferred text editor
1312

14-
```bash
15-
VIDEO_GLOB=*.mp4 FRAME_MULTIPLE=2 aurora-cli
16-
```
13+
3. Run `aurora-cli` or `aurora-cli.exe`
14+
15+
## 🔧 Fix: vulkan-1.dll is missing from your computer
16+
17+
[Install Vulkan Runtime](https://vulkan.lunarg.com/sdk/home)
1718

18-
## Fix: macOS cannot verify that this app is free from malware
19+
## 🔧 Fix: macOS cannot verify that this app is free from malware
1920

2021
```bash
2122
xattr -dr com.apple.quarantine rife-ncnn-vulkan
2223
```
2324

24-
## License
25+
## 📄 License
2526

2627
[GNU Affero General Public License v3.0](https://choosealicense.com/licenses/agpl-3.0)

aurora-cli/src/lib.rs

+22-10
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ fn extract_audio(video_filename: &str) -> String {
1717
println!("video_extract_audio_filename: {video_extract_audio_filename}");
1818

1919
let extract_audio_cmd_str = if cfg!(target_os = "windows") {
20-
format!("ffmpeg.exe -y -i {video_filename} -vn -acodec copy {video_extract_audio_filename}")
20+
format!(
21+
r"ffmpeg\ffmpeg.exe -y -i {video_filename} -vn -acodec copy {video_extract_audio_filename}"
22+
)
2123
} else {
22-
format!("ffmpeg -y -i {video_filename} -vn -acodec copy {video_extract_audio_filename}")
24+
format!(
25+
r"ffmpeg/ffmpeg -y -i {video_filename} -vn -acodec copy {video_extract_audio_filename}"
26+
)
2327
};
2428
println!("extract_audio_cmd_str: {extract_audio_cmd_str}");
2529

@@ -40,9 +44,9 @@ fn video_frames_dir_mkdir(video_filename: &str) -> String {
4044

4145
fn decode_frames(video_filename: &str, video_frames_dir_name: &str) {
4246
let decode_frames_cmd_str = if cfg!(target_os = "windows") {
43-
format!("ffmpeg.exe -y -i {video_filename} {video_frames_dir_name}/frame_%08d.png")
47+
format!(r"ffmpeg\ffmpeg.exe -y -i {video_filename} {video_frames_dir_name}/frame_%08d.png")
4448
} else {
45-
format!("ffmpeg -y -i {video_filename} {video_frames_dir_name}/frame_%08d.png")
49+
format!(r"ffmpeg/ffmpeg -y -i {video_filename} {video_frames_dir_name}/frame_%08d.png")
4650
};
4751
println!("decode_frames_cmd_str: {decode_frames_cmd_str}");
4852

@@ -59,9 +63,9 @@ fn get_origin_frame_count(video_frames_dir_name: &str) -> usize {
5963

6064
fn get_origin_frame_rate(video_filename: &str) -> f32 {
6165
let ffprobe_cmd_str = if cfg!(target_os = "windows") {
62-
format!("ffprobe.exe {video_filename}")
66+
format!(r"ffmpeg\ffprobe.exe {video_filename}")
6367
} else {
64-
format!("ffprobe {video_filename}")
68+
format!(r"ffmpeg/ffprobe {video_filename}")
6569
};
6670
println!("ffprobe_cmd_str: {ffprobe_cmd_str}");
6771

@@ -104,9 +108,13 @@ fn interpolate_frame(
104108
video_interpolate_frames_dir_name: &str,
105109
) {
106110
let interpolate_frame_cmd_str = if cfg!(target_os = "windows") {
107-
format!("rife-ncnn-vulkan/rife-ncnn-vulkan.exe -m rife-v4.6 -n {target_frame_count} -i {video_frames_dir_name} -o {video_interpolate_frames_dir_name}")
111+
format!(
112+
r"rife-ncnn-vulkan\rife-ncnn-vulkan.exe -m rife-v4.6 -n {target_frame_count} -i {video_frames_dir_name} -o {video_interpolate_frames_dir_name}"
113+
)
108114
} else {
109-
format!("rife-ncnn-vulkan/rife-ncnn-vulkan -m rife-v4.6 -n {target_frame_count} -i {video_frames_dir_name} -o {video_interpolate_frames_dir_name}")
115+
format!(
116+
r"rife-ncnn-vulkan/rife-ncnn-vulkan -m rife-v4.6 -n {target_frame_count} -i {video_frames_dir_name} -o {video_interpolate_frames_dir_name}"
117+
)
110118
};
111119
println!("interpolate_frame_cmd_str: {interpolate_frame_cmd_str}");
112120

@@ -120,9 +128,13 @@ fn encode_video(
120128
video_filename: &str,
121129
) {
122130
let encode_video_cmd_str = if cfg!(target_os = "windows") {
123-
format!("ffmpeg.exe -y -framerate {target_frame_rate} -i {video_interpolate_frames_dir_name}/%08d.png -i {video_filename}_audio.m4a -c:a copy -crf 20 -c:v libx264 -pix_fmt yuv420p output_{video_filename}.mp4")
131+
format!(
132+
r"ffmpeg\ffmpeg.exe -y -framerate {target_frame_rate} -i {video_interpolate_frames_dir_name}/%08d.png -i {video_filename}_audio.m4a -c:a copy -crf 20 -c:v libx264 -pix_fmt yuv420p output_{video_filename}.mp4"
133+
)
124134
} else {
125-
format!("ffmpeg -y -framerate {target_frame_rate} -i {video_interpolate_frames_dir_name}/%08d.png -i {video_filename}_audio.m4a -c:a copy -crf 20 -c:v libx264 -pix_fmt yuv420p output_{video_filename}.mp4")
135+
format!(
136+
r"ffmpeg/ffmpeg -y -framerate {target_frame_rate} -i {video_interpolate_frames_dir_name}/%08d.png -i {video_filename}_audio.m4a -c:a copy -crf 20 -c:v libx264 -pix_fmt yuv420p output_{video_filename}.mp4"
137+
)
126138
};
127139
println!("encode_video_cmd_str: {encode_video_cmd_str}");
128140

0 commit comments

Comments
 (0)