Skip to content

Commit

Permalink
[CI] Remove imageio-ffmpeg from dependencies. (#2519)
Browse files Browse the repository at this point in the history
* Remove imageio-ffmpeg from conda build run depedencies.

* remove uses of ffmpeg and CI installation

---------

Co-authored-by: Alexander Clegg <[email protected]>
  • Loading branch information
0mdc and aclegg3 authored Dec 13, 2024
1 parent f3089bc commit a48e2c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/install_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
conda activate habitat
cd habitat-sim
pip install -r requirements.txt --progress-bar off
pip install imageio imageio-ffmpeg
pip install imageio
git submodule update --init --recursive --jobs 8
python -u setup.py install --build-type "Release" --lto --headless --audio
python examples/tutorials/audio_agent.py
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
cd habitat-sim
pip install -r requirements.txt --progress-bar off
git submodule update --init --recursive --jobs 8
pip install imageio imageio-ffmpeg
pip install imageio
conda install -y -c conda-forge doxygen=1.9.5
conda install -y jinja2 pygments docutils
sudo apt install --yes --allow-change-held-packages \
Expand Down
1 change: 0 additions & 1 deletion conda-build/habitat-sim/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ requirements:
- scipy>=1.3.0
- tqdm
- imageio
- imageio-ffmpeg
- matplotlib
- libxcb # [linux]
- xorg-libx11 # [linux]
Expand Down
27 changes: 2 additions & 25 deletions src_python/habitat_sim/utils/viz_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,6 @@ def is_notebook() -> bool:
return True


def get_fast_video_writer(video_file: str, fps: int = 60):
if (
"google.colab" in sys.modules
and os.path.splitext(video_file)[-1] == ".mp4"
and os.environ.get("IMAGEIO_FFMPEG_EXE") == "/usr/bin/ffmpeg"
):
# USE GPU Accelerated Hardware Encoding
writer = imageio.get_writer(
video_file,
fps=fps,
codec="h264_nvenc",
mode="I",
bitrate="1000k",
format="FFMPEG", # type: ignore[arg-type]
ffmpeg_log_level="info",
output_params=["-minrate", "500k", "-maxrate", "5000k"],
)
else:
# Use software encoding
writer = imageio.get_writer(video_file, fps=fps)
return writer


def save_video(video_file: str, frames, fps: int = 60):
"""Saves the video using imageio. Will try to use GPU hardware encoding on
Google Colab for faster video encoding. Will also display a progressbar.
Expand All @@ -64,7 +41,7 @@ def save_video(video_file: str, frames, fps: int = 60):
:param frames: the actual frame objects to save
:param fps: the fps of the video (default 60)
"""
writer = get_fast_video_writer(video_file, fps=fps)
writer = imageio.get_writer(video_file, fps=fps)
for ob in tqdm(frames, desc="Encoding video:%s" % video_file):
writer.append_data(ob)
writer.close()
Expand Down Expand Up @@ -233,7 +210,7 @@ def make_video(
if not video_file.endswith(".mp4"):
video_file = video_file + ".mp4"
print("Encoding the video: %s " % video_file)
writer = get_fast_video_writer(video_file, fps=fps)
writer = imageio.get_writer(video_file, fps=fps)
observation_to_image = partial(observation_to_image, depth_clip=depth_clip)

for ob in observations:
Expand Down

0 comments on commit a48e2c0

Please sign in to comment.