Skip to content

Commit

Permalink
Fix ffmpeg install on macos (#329)
Browse files Browse the repository at this point in the history
* use brew to install ffmpeg

* add ffmpeg to path

* source profile

* add ffprobe check

* test access to ffmpeg and ffprobe

* test access to ffmpeg and ffprobe

* test access to ffprobe

* test macos-latest-large

* see error for ffprobe

* move path export ot test block

* remove errant line

* test just macos

* make things run again

* clunky workaround

* put ubuntu back; fix syntax

* add brew to path

* use different frame rate and use default config

* use 32 fps

* use 30 fps

* format

* test fix for densepose

* single bracket

* add macosx deployment target to env

* uncomment out tests; put env var in own step for clarity

* unpin botocore

* remove botocore
  • Loading branch information
ejm714 authored May 17, 2024
1 parent 70e79f2 commit da686dd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,21 @@ jobs:

- uses: actions/checkout@v4

- name: Setup FFmpeg
uses: Iamshankhadeep/setup-ffmpeg@v1.1
- if: matrix.os == 'ubuntu-latest'
name: Setup FFmpeg
uses: Iamshankhadeep/setup-ffmpeg@v1.1 # does not support arm64
with:
# Not strictly necessary, but it may prevent rate limit
# errors especially on GitHub-hosted macos machines.
token: ${{ secrets.GITHUB_TOKEN }}
version: "4.4"

- if: matrix.os == 'macos-latest'
name: Setup FFmpeg
run: |
brew install ffmpeg@4
echo "/opt/homebrew/opt/ffmpeg@4/bin" >> $GITHUB_PATH
- name: Configure Windows compilers
uses: ilammy/msvc-dev-cmd@v1

Expand All @@ -80,6 +87,11 @@ jobs:
run: |
make tests
- if: matrix.os == 'macos-latest'
name: Specify MacOS version for densepose install
run: |
echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)" >> $GITHUB_ENV
- name: Run densepose tests
env:
ZAMBA_RUN_DENSEPOSE_TESTS: 1
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ dependencies = [
"appdirs",
"av",
"cloudpathlib[s3]",
"botocore>=1.34.0",
"ffmpeg-python",
"future",
"fvcore",
Expand Down
6 changes: 4 additions & 2 deletions tests/test_load_video_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def test_megadetector_lite_yolox_dog(tmp_path):
[
"ffmpeg",
"-r",
"60",
"30",
"-f",
"image2",
"-s",
Expand All @@ -458,7 +458,9 @@ def test_megadetector_lite_yolox_dog(tmp_path):
"-y",
]
)
frames = load_video_frames(tmp_path / "dog.mp4", megadetector_lite_config={"confidence": 0.25})
frames = load_video_frames(
tmp_path / "dog.mp4", megadetector_lite_config=MegadetectorLiteYoloXConfig()
)

# Check that we detected the correct number of frames
assert len(frames) == len(object_frame_indices)
Expand Down

0 comments on commit da686dd

Please sign in to comment.