Skip to content

Commit

Permalink
provide an entrypoint for the Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
slhck committed Jun 22, 2024
1 parent da2af7a commit 9cdf7a7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12.0a7-alpine3.17 as base
FROM python:3.12-alpine as base

FROM base as builder
RUN mkdir /ffmpeg
Expand All @@ -11,3 +11,5 @@ COPY --from=builder /ffmpeg/ffmpeg /usr/local/bin
COPY --from=builder /ffmpeg/ffprobe /usr/local/bin
RUN pip3 install ffmpeg-normalize
RUN chmod +x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe

ENTRYPOINT ["ffmpeg-normalize"]
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Read on for more info.
- [Requirements](#requirements)
- [ffmpeg](#ffmpeg)
- [Installation](#installation)
- [Docker Build](#docker-build)
- [Usage with Docker](#usage-with-docker)
- [From Docker Hub](#from-docker-hub)
- [Usage](#usage)
- [Description](#description)
- [Examples](#examples)
Expand Down Expand Up @@ -100,35 +101,36 @@ pip3 install ffmpeg-normalize

Or download this repository, then run `pip3 install .`.

## Docker Build
Download this repository and run
## Usage with Docker

### From Docker Hub

You can use the pre-built image from Docker Hub:

```bash
docker run -v "$(pwd):/tmp" -it slhck/ffmpeg-normalize
```
docker build -t ffmpeg-normalize .
```

Run using Windows Powershell or Linux:
Alternatively, download this repository and run

```
docker run -v "$(pwd):/tmp" -it ffmpeg-normalize /bin/sh
docker build -t ffmpeg-normalize .
```
This will mount your current folder to the /tmp directory inside the container

Note: The container will run in interactive mode.

Example Usage:
Then run the container with:

```bash
docker run -v "$(pwd):/tmp" -it ffmpeg-normalize
```
PS C:\yonkers> docker run -v "$(pwd):/tmp" -it ffmpeg-normalize /bin/sh
/ # cd /tmp
/tmp # ls
01. Goblin.mp3
/tmp # ffmpeg-normalize "01. Goblin.mp3" -f -c:a libmp3lame -b:a 320k --target-level -13 --output "01. Goblin normalized.mp3"
WARNING: The chosen output extension mp3 does not support video/cover art. It will be disabled.
/tmp # ls
01. Goblin normalized.mp3
01. Goblin.mp3

This will mount your current directory to the `/tmp` directory inside the container. Everything else works the same way as if you had installed the program locally. For example, to normalize a file:

```bash
docker run -v "$(pwd):/tmp" -it ffmpeg-normalize /tmp/yourfile.mp4 -o /tmp/yourfile-normalized.wav
```

You will then find the normalized file in your current directory.

## Usage

```bash
Expand Down

0 comments on commit 9cdf7a7

Please sign in to comment.