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

Mac M1 support #16

Merged
merged 17 commits into from
Oct 9, 2023
Merged

Mac M1 support #16

merged 17 commits into from
Oct 9, 2023

Conversation

nathanbabcock
Copy link
Owner

Fixes #15

Copy link

@jt-wang jt-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nathanbabcock Thanks Nathan!

 ~/github/ffmpeg-sidecar main v0.4.1 git checkout feat/mac-m1   
branch 'feat/mac-m1' set up to track 'origin/feat/mac-m1'.
Switched to a new branch 'feat/mac-m1'
 ~/github/ffmpeg-sidecar    cargo run --example download_ffmpeg
   Compiling ffmpeg-sidecar v0.5.0 (~/projects/ffmpeg-sidecar)
    Finished dev [unoptimized + debuginfo] target(s) in 1.24s
     Running `target/debug/examples/download_ffmpeg`
FFmpeg is already installed! 🎉
For demo purposes, we'll re-download and unpack it anyway.
TIP: Use `auto_download()` to skip manual customization.
Error: Error { message: "Downloads must be manually provided for non-x86_64 architectures", source: None }

I believe the Error is from line 18,

pub fn ffmpeg_manifest_url() -> Result<&'static str> {
  if cfg!(not(target_arch = "x86_64")) {
    return Err(Error::msg(
      "Downloads must be manually provided for non-x86_64 architectures",
    ));
  }

because ffmpeg_manifest_url is called in line 147,

pub fn check_latest_version() -> Result<String> {
  let string = curl(ffmpeg_manifest_url()?)?;

  if cfg!(target_os = "windows") {
    Ok(string)
  } else if cfg!(target_os = "macos") {
    Ok(parse_macos_version(&string).ok_or("failed to parse version number (macos variant)")?)
  } else if cfg!(target_os = "linux") {
    Ok(parse_linux_version(&string).ok_or("failed to parse version number (linux variant)")?)
  } else {
    Err(Error::msg("Unsupported platform"))
  }
}

@nathanbabcock
Copy link
Owner Author

@jt-wang you are completely correct of course, and my apologies for taking a while to update the PR.

Give it another go now with the same command.

@nathanbabcock nathanbabcock merged commit c0900dd into main Oct 9, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ffmpeg won't auto-download for Apple Silicon Mac
2 participants