docker-documentation/images/docker-ffmpeg.md

123 wiersze
6.3 KiB
Markdown
Czysty Zwykły widok Historia

2019-09-29 09:44:22 +00:00
# linuxserver/ffmpeg
2019-09-23 19:40:05 +00:00
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io)
2019-09-29 09:44:22 +00:00
[![Blog](https://img.shields.io/static/v1.svg?style=flat-square&color=E68523&label=linuxserver.io&message=Blog)](https://blog.linuxserver.io) [![Discord](https://img.shields.io/discord/354974912613449730.svg?style=flat-square&color=E68523&label=Discord&logo=discord&logoColor=FFFFFF)](https://discord.gg/YWrKVTn) [![Discourse](https://img.shields.io/discourse/https/discourse.linuxserver.io/topics.svg?style=flat-square&color=E68523&logo=discourse&logoColor=FFFFFF)](https://discourse.linuxserver.io) [![Fleet](https://img.shields.io/static/v1.svg?style=flat-square&color=E68523&label=linuxserver.io&message=Fleet)](https://fleet.linuxserver.io) [![Podcast](https://img.shields.io/static/v1.svg?style=flat-square&color=E68523&label=linuxserver.io&message=Podcast)](https://anchor.fm/linuxserverio) [![Open Collective](https://img.shields.io/opencollective/all/linuxserver.svg?style=flat-square&color=E68523&label=Open%20Collective%20Supporters)](https://opencollective.com/linuxserver)
2019-09-23 19:40:05 +00:00
The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring :-
2019-09-29 09:44:22 +00:00
* regular and timely application updates
* easy user mappings \(PGID, PUID\)
* custom base image with s6 overlay
* weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
* regular security updates
2019-09-23 19:40:05 +00:00
Find us at:
2019-09-29 09:44:22 +00:00
2019-09-23 19:40:05 +00:00
* [Blog](https://blog.linuxserver.io) - all the things you can do with our containers including How-To guides, opinions and much more!
* [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team.
* [Discourse](https://discourse.linuxserver.io) - post on our community forum.
* [Fleet](https://fleet.linuxserver.io) - an online web interface which displays all of our maintained images.
2019-09-29 09:44:22 +00:00
* [Podcast](https://anchor.fm/linuxserverio) - on hiatus. Coming back soon \(late 2018\).
2019-09-23 19:40:05 +00:00
* [Open Collective](https://opencollective.com/linuxserver) - please consider helping us by either donating or contributing to our budget
2019-09-29 09:44:22 +00:00
## [linuxserver/ffmpeg](https://github.com/linuxserver/docker-ffmpeg)
2019-09-23 19:40:05 +00:00
2019-09-29 09:44:22 +00:00
[![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-ffmpeg.svg?style=flat-square&color=E68523)](https://github.com/linuxserver/docker-ffmpeg/releases) [![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/ffmpeg.svg?style=flat-square&color=E68523)](https://microbadger.com/images/linuxserver/ffmpeg) [![MicroBadger Size](https://img.shields.io/microbadger/image-size/linuxserver/ffmpeg.svg?style=flat-square&color=E68523)](https://microbadger.com/images/linuxserver/ffmpeg) [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/ffmpeg.svg?style=flat-square&color=E68523)](https://hub.docker.com/r/linuxserver/ffmpeg) [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/ffmpeg.svg?style=flat-square&color=E68523)](https://hub.docker.com/r/linuxserver/ffmpeg) [![Build Status](https://ci.linuxserver.io/view/all/job/Docker-Pipeline-Builders/job/docker-ffmpeg/job/master/badge/icon?style=flat-square)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-ffmpeg/job/master/)
2019-09-23 19:40:05 +00:00
2019-09-29 09:44:22 +00:00
[FFmpeg](https://ffmpeg.org) - A complete, cross-platform solution to record, convert and stream audio and video.
2019-09-23 19:40:05 +00:00
[![ffmpeg](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/ffmpeg.png)](https://ffmpeg.org)
2019-09-29 09:44:22 +00:00
### Supported Architectures
2019-09-23 19:40:05 +00:00
Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/).
Simply pulling `linuxserver/ffmpeg` should retrieve the correct image for your arch, but you can also pull specific arch images via tags.
The architectures supported by this image are:
| Architecture | Tag |
2019-09-29 09:44:22 +00:00
| :---: | :--- |
2019-09-23 19:40:05 +00:00
| x86-64 | amd64-latest |
| arm64 | arm64v8-latest |
| armhf | arm32v7-latest |
2019-09-29 09:44:22 +00:00
### Usage
2019-09-23 19:40:05 +00:00
Unlike most of our container library this image is meant to be run ephemerally from the command line parsing user input for a custom FFmpeg command. You will need to understand some Docker basics to use this image and be familiar with how to construct an FFmpeg command. In the commands below we will be bind mounting our current working directory from the CLI to /config, the assumption is that input.mkv is in your current working directory.
2019-09-29 09:44:22 +00:00
If an input file is detected we will run FFmpeg as that user/group so the output file will match it's permissions. The image supports Hardware acceleration on x86 pay close attention to the variables for the examples below.
2019-09-23 19:40:05 +00:00
2019-09-29 09:44:22 +00:00
#### Basic Transcode
2019-09-23 19:40:05 +00:00
2019-09-29 09:44:22 +00:00
```text
2019-09-23 19:40:05 +00:00
docker run --rm -it \
-v $(pwd):/config \
linuxserver/ffmpeg \
-i /config/input.mkv \
-c:v libx264 \
-b:v 4M \
-vf scale=1280:720 \
-c:a copy \
/config/output.mkv
```
2019-09-29 09:44:22 +00:00
#### Hardware accelerated \(VAAPI\)
2019-09-23 19:40:05 +00:00
2019-09-29 09:44:22 +00:00
```text
2019-09-23 19:40:05 +00:00
docker run --rm -it \
--device=/dev/dri:/dev/dri \
-v $(pwd):/config \
linuxserver/ffmpeg \
-vaapi_device /dev/dri/renderD128 \
-i /config/input.mkv \
-c:v h264_vaapi \
-b:v 4M \
-vf 'format=nv12|vaapi,hwupload,scale_vaapi=w=1280:h=720' \
-c:a copy \
/config/output.mkv
```
2019-09-29 09:44:22 +00:00
#### Nvidia Hardware accelerated
2019-09-23 19:40:05 +00:00
2019-09-29 09:44:22 +00:00
```text
2019-09-23 19:40:05 +00:00
docker run --rm -it \
--runtime=nvidia \
-v $(pwd):/config \
linuxserver/ffmpeg \
-hwaccel nvdec \
-i /config/input.mkv \
-c:v h264_nvenc \
-b:v 4M \
-vf scale=1280:720 \
-c:a copy \
/config/output.mkv
```
2019-09-29 09:44:22 +00:00
### Building locally
2019-09-23 19:40:05 +00:00
If you want to make local modifications to these images for development purposes or just to customize the logic:
2019-09-29 09:44:22 +00:00
```text
2019-09-23 19:40:05 +00:00
git clone https://github.com/linuxserver/docker-ffmpeg.git
cd docker-ffmpeg
docker build \
--no-cache \
--pull \
-t linuxserver/ffmpeg:latest .
```
2019-09-29 09:44:22 +00:00
The ARM variants can be built on x86\_64 hardware using `multiarch/qemu-user-static`
```text
2019-09-23 19:40:05 +00:00
docker run --rm --privileged multiarch/qemu-user-static:register --reset
```
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
2019-09-29 09:44:22 +00:00
### Versions
2019-09-23 19:40:05 +00:00
* **01.08.19:** - Initial release.
2019-09-29 09:44:22 +00:00