Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Way to get "raw" data from a sidecar #4673

Closed
Xoffio opened this issue Jul 14, 2022 · 0 comments
Closed

[feat] Way to get "raw" data from a sidecar #4673

Xoffio opened this issue Jul 14, 2022 · 0 comments
Labels
priority: 2 medium scope: core Core packages of Tauri status: backlog Issue is ready and we can work on it type: feature request

Comments

@Xoffio
Copy link

Xoffio commented Jul 14, 2022

Describe the problem

Hi guys,

When using Sidecar to bundle and execute an external program that returns non UFT-8 characters it's impossible to get the "raw" data. For example:

Let's say I want to bundle FFmpeg into my Tauri app. I guess the only way for me to execute it is using Sidecar. The code is looking something like this:

let cmd_output = tauri::api::process::Command::new_sidecar("./ffmpeg").unwrap()
        .args([
            "-i",
            &img_full_path,
            "-vf",
            &format!("select=eq(n\\,{})", frame_number),
            "-f",
            "rawvideo",
            "-pix_fmt",
            "rgba",
            "-vframes",
            "1",
            "-",
        ])
        .output(){
            Ok(out) => out,
            Err(err) => return Err( (StatusCode::INTERNAL_SERVER_ERROR, format!("Error executing FFmpeg. \n{:?}", err)) )
        };

The FFmpeg command should return some information through the stderr and it should return the "raw data"/pixels of the image through the stdout

The problem is that Tauri tries to transform all the output and sometimes we just need the raw data. Here is where it happens:

let line = String::from_utf8(buf.clone());

I had this working with my own code std::process::Command before using Sidecar.

Describe the solution you'd like

Maybe we can have a function where we don't transform the data. Or a way to call std::process::Command with the relative path of the bundled executables.

Alternatives considered

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: 2 medium scope: core Core packages of Tauri status: backlog Issue is ready and we can work on it type: feature request
Projects
None yet
Development

No branches or pull requests

2 participants