Skip to content

Commit

Permalink
fix ffmpeg path
Browse files Browse the repository at this point in the history
  • Loading branch information
jlvihv committed Jun 26, 2024
1 parent 76be017 commit 2408b96
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "liveship"
version = "0.1.24"
version = "0.1.25"
description = "liveship is a compact and user-friendly live stream recording tool that captures live streams as video files."
authors = ["jlvihv"]
email = "[email protected]"
Expand Down
10 changes: 7 additions & 3 deletions src-tauri/src/ffmpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ pub use anyhow::Result;
use ffmpeg_sidecar::download::{download_ffmpeg_package, ffmpeg_download_url, unpack_ffmpeg};
use std::process::{Child, Stdio};

use crate::{config::config_dir, model::RecordingOption};
use crate::{config::config_dir, kv, model::RecordingOption};

/// 给定 ffmpeg 命令,这里只负责执行
pub fn execute_ffmpeg_command(ffmpeg_command: Vec<String>) -> Result<Child> {
println!("ffmpeg_command: {:?}", ffmpeg_command);
// 调用 ffmpeg 命令
let mut cmd = std::process::Command::new("ffmpeg");
// 获取配置文件中的 ffmpeg 路径
let ffmpeg_path = kv::config::get()?.ffmpeg_path;
let mut cmd = std::process::Command::new(ffmpeg_path);
// 特定于 windows 的实现,使用 CommandExt,避免出现黑窗口
#[cfg(target_os = "windows")]
{
Expand Down Expand Up @@ -38,7 +40,9 @@ pub fn execute_ffmpeg_command(ffmpeg_command: Vec<String>) -> Result<Child> {
pub fn execute_ffmpeg_command_return_output(ffmpeg_command: Vec<String>) -> Result<String> {
println!("ffmpeg_command: {:?}", ffmpeg_command);
// 调用 ffmpeg 命令
let output = std::process::Command::new("ffmpeg")
// 获取配置文件中的 ffmpeg 路径
let ffmpeg_path = kv::config::get()?.ffmpeg_path;
let output = std::process::Command::new(ffmpeg_path)
.args(&ffmpeg_command)
.output()?;
let stdout = String::from_utf8_lossy(&output.stdout);
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"productName": "liveship",
"version": "0.1.24",
"version": "0.1.25",
"identifier": "app.happyship.liveship",
"build": {
"beforeDevCommand": "bun run dev",
Expand Down

0 comments on commit 2408b96

Please sign in to comment.