Skip to content

Commit a0747b5

Browse files
committed
Updated README
1 parent c7db797 commit a0747b5

File tree

1 file changed

+29
-58
lines changed

1 file changed

+29
-58
lines changed

README.md

Lines changed: 29 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -16,78 +16,49 @@ you are interested in, please see below "Contributing & Distribution" below.
1616

1717
## Requirements
1818

19-
In order to build the examples, you'll need the library and header files
20-
for [FFmpeg 7.1](https://ffmpeg.org/download.html) installed.The `chromaprint` library is also
21-
required for fingerprinting audio files and SDL2 for the video player.
22-
23-
### MacOS
24-
25-
On Macintosh with [homebrew](http://bew.sh/), for example:
19+
If you're building for docker, then you can simply run the following command. This creates a docker
20+
image with all the dependencies installed.
2621

2722
```bash
28-
brew install ffmpeg chromaprint make
23+
DOCKER_REGISTRY=docker.io/user make docker
2924
```
3025

31-
### Debian
32-
33-
If you're using Debian you may not be able to get the ffmpeg 6 unless you first of all add the debi-multimedia repository.
34-
You can do this by adding the following line to your `/etc/apt/sources.list` file:
26+
However, it's more likely that you want to build the bindings. To do so, compile the FFmpeg libraries
27+
first:
3528

3629
```bash
37-
# Run commands as privileged user
38-
echo "deb https://www.deb-multimedia.org $(lsb_release -sc) main" >> /etc/apt/sources.list
39-
apt update -y -oAcquire::AllowInsecureRepositories=true
40-
apt install -y --force-yes deb-multimedia-keyring
30+
# Debian/Ubuntu
31+
apt install libfreetype-dev libmp3lame-dev libopus-dev libvorbis-dev libvpx-dev libx264-dev libx265-dev libnuma-dev
32+
git clone github.com/mutablelogic/go-media
33+
cd go-media
34+
make ffmpeg
4135
```
4236

43-
Then you can proceed to install the ffmpeg 6 and the other dependencies:
44-
4537
```bash
46-
# Run commands as privileged user
47-
apt install -y libavcodec-dev libavdevice-dev libavfilter-dev libavutil-dev libswscale-dev libswresample-dev
48-
apt install -y libchromaprint-dev
49-
apt install -y libsdl2-dev
38+
# Fedora
39+
dnf install freetype-devel lame-devel opus-devel libvorbis-devel libvpx-devel x264-devel x265-devel numactl-devel
40+
git clone github.com/mutablelogic/go-media
41+
cd go-media
42+
make ffmpeg
5043
```
5144

52-
### Docker Container
53-
54-
TODO
55-
56-
## Examples
57-
58-
There are some examples in the `cmd` folder of the main repository on how to use
59-
the package. The various make targets are:
60-
61-
* `make all` will perform tests, build all examples and the backend API;
62-
* `make test` will perform tests;
63-
* `make cmd` will build example command-line tools into the `build` folder;
64-
* `make clean` will remove all build artifacts.
65-
66-
There are also some targets to build a docker image:
67-
68-
* `DOCKER_REGISTRY=docker.io/user make docker` will build a docker image;
69-
* `DOCKER_REGISTRY=docker.io/user make docker-push` will push the docker image to the registry.
70-
71-
For example,
72-
7345
```bash
74-
git clone git@github.com:djthorpe/go-media.git
46+
# Homebrew
47+
brew install freetype lame opus libvorbis libvpx x264 x265
48+
git clone github.com/mutablelogic/go-media
7549
cd go-media
76-
DOCKER_REGISTRY=ghcr.io/mutablelogic make docker
50+
make ffmpeg
7751
```
7852

79-
There are a variety of types of object needed as part of media processing.
80-
All examples require a `Manager` to be created, which is used to enumerate all supported formats
81-
and open media files and byte streams.
53+
This will place the static libraries in the `build/install` folder which you can refer to when compiling your
54+
golang code. For example, here's a typical compile or run command on a Mac:
8255

83-
* `Manager` is the main entry point for the package. It is used to open media files and byte streams,
84-
and enumerate supported formats, codecs, pixel formats, etc.
85-
* `Media` is a hardware device, file or byte stream. It contains metadata, artwork, and streams.
86-
* `Decoder` is used to demultiplex media streams. Create a decoder and enumerate the streams which
87-
you'd like to demultiplex. Provide the audio and video parameters if you want to resample or
88-
reformat the streams.
89-
* `Encoder` is used to multiplex media streams. Create an encoder and send the output of the
90-
decoder to reencode the streams.
56+
```bash
57+
PKG_CONFIG_PATH="${PWD}/build/install/lib/pkgconfig" \
58+
LD_LIBRARY_PATH="/opt/homebrew/lib" \
59+
CGO_LDFLAGS_ALLOW="-(W|D).*" \
60+
go build -o build/media ./cmd/media
61+
```
9162

9263
### Demultiplexing
9364

@@ -366,5 +337,5 @@ the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html).
366337

367338
## References
368339

369-
* https://ffmpeg.org/doxygen/6.1/index.html
370-
* https://pkg.go.dev/github.com/mutablelogic/go-media
340+
* <https://ffmpeg.org/doxygen/7.0/index.html>
341+
* <https://pkg.go.dev/github.com/mutablelogic/go-media>

0 commit comments

Comments
 (0)