Skip to content

Commit

Permalink
built-in profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
time4tea committed Dec 30, 2023
1 parent c3dae7c commit f40af6e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
18 changes: 18 additions & 0 deletions docs/bin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,24 @@ container would be skipped.

## FFMPEG Profiles

FFMPEG Profiles are a way to control the parameters to `ffmpeg`. The program supports very many options,
so it's not very practical for us to support all of them.

`gopro-dashboard.py` has a number of built-in profiles, selectable with `--profile <name>` on the command line, or you can
create a configuration file as shown below, and create your own.

Each `profile` can control the input, output, and optionally, the filter arguments to ffmpeg.

### Built-in profiles (not yet released)

- `nvgpu` - Use NVIDIA GPU for decoding the GoPro MPEG file, and for encoding the output.
- `nnvgpu` - Use NVIDIA GPU for as much of the process as possible - only supported on in newer versions of ffmpeg, and for certain drivers.
- `mov` - Use PNG images inside a MOV container - allows an alpha channel in a movie, useful when using another video processing system. Note: Use an output filename extension of `.mov`
- `vp9` - Create a vp9 webm movie. Note: use an output filename extension of `.webm`
- `vp8` - Create a vp8 webm movie. Note: use an output filename extension of `.webm`

## User-defined profiles

Create a file `~/.gopro-graphics/ffmpeg-profiles.json`, and put FFMPEG parameters to control the `input` and `output`

Both `input` and `output` sections are mandatory.
Expand Down
22 changes: 21 additions & 1 deletion gopro_overlay/ffmpeg_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,27 @@
from .log import log

builtin_profiles = {

"nvgpu": {
"input": ["-hwaccel", "nvdec"],
"output": ["-vcodec", "h264_nvenc", "-rc:v", "cbr", "-b:v", "25M", "-bf:v", "3", "-profile:v", "high", "-spatial-aq", "true", "-movflags", "faststart"]
},
"nnvgpu": {
"input": ["-hwaccel", "cuda", "-hwaccel_output_format", "cuda"],
"filter": "[0:v]scale_cuda=format=yuv420p[mp4_stream];[1:v]format=yuva420p,hwupload[overlay_stream];[mp4_stream][overlay_stream]overlay_cuda",
"output": ["-vcodec", "h264_nvenc", "-rc:v", "cbr", "-b:v", "25M", "-bf:v", "3", "-profile:v", "main", "-spatial-aq", "true", "-movflags", "faststart"]
},
"mov": {
"input": [],
"output": ["-vcodec", "png"]
},
"vp9": {
"input": [],
"output": ["-vcodec", "vp9", "-pix_fmt", "yuva420p"]
},
"vp8": {
"input": [],
"output": ["-vcodec", "vp8", "-pix_fmt", "yuva420p", "-auto-alt-ref", "0"]
}
}


Expand Down

0 comments on commit f40af6e

Please sign in to comment.