Skip to content

Commit

Permalink
✨ use ffmpeg to encode raw pcm
Browse files Browse the repository at this point in the history
  • Loading branch information
nicks96432 committed Feb 2, 2025
1 parent 440ff15 commit 98bd5c2
Show file tree
Hide file tree
Showing 18 changed files with 809 additions and 177 deletions.
6 changes: 6 additions & 0 deletions .cargo/config-windows.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[target.'cfg(target_env = "msvc")']
rustflags = ["-C", "target-feature=+crt-static"]

[env]
LIBCLANG_PATH = ""
FFMPEG_DIR = ""
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[target.'cfg(target_env = "msvc")']
rustflags = ["-C", "target-feature=+crt-static"]
[alias]
build-windows = "build --config .cargo/config-windows.toml"
27 changes: 16 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,28 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install nasm
uses: ilammy/setup-nasm@v1
- name: Install FFmpeg
id: setup-ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
with:
ffmpeg-version: "7.1"
linking-type: shared

- uses: Swatinem/rust-cache@v2

- name: Build
run: cargo build --release

- name: Get version (Windows)
- name: Build (Windows)
if: ${{ contains('Windows', runner.os) }}
id: version_windows
run: echo "version=$(git describe --tags --dirty)" >> $env:GITHUB_OUTPUT
run: |
$env:FFMPEG_DIR='${{ steps.setup-ffmpeg.outputs.ffmpeg-path }}'
cargo build-windows --release
echo "version=$(git describe --tags --dirty)" >> $env:GITHUB_OUTPUT
- name: Get version
- name: Build
if: ${{ !contains('Windows', runner.os) }}
id: version
run: echo "version=$(git describe --tags --dirty)" >> $GITHUB_OUTPUT
run: |
export FFMPEG_DIR='${{ steps.setup-ffmpeg.outputs.ffmpeg-path }}'
cargo build --release
echo "version=$(git describe --tags --dirty)" >> $GITHUB_OUTPUT
- name: Publish artifact (Windows)
if: ${{ contains('Windows', runner.os) }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ output/
build/

.vscode/

.cargo/config-windows.toml
Loading

0 comments on commit 98bd5c2

Please sign in to comment.