Skip to content

FFmpeg (ffmpeg@v1)

Run FFmpeg or ffprobe from a Dagu workflow without baking FFmpeg into worker images.

  • Repository: dagucloud/ffmpeg
  • Runtime owned by the action: Tyrrrz/FFmpegBin@8.1 and nodejs/node@v22.21.1 through action tools

Contributions are welcome. The repository is public, so improvements, bug reports, and pull requests can go to dagucloud/ffmpeg.

Example

yaml
steps:
  - id: convert
    action: ffmpeg@v1
    with:
      overwrite: true
      args: >-
        -i input.mov -c:v libx264 -c:a aac "${DAG_RUN_ARTIFACTS_DIR}/converted/output.mp4"

args is the FFmpeg or ffprobe argument string excluding the executable name. It is parsed into argv by the action wrapper, not by a shell. For exact argument boundaries, pass a JSON array string:

yaml
args: '["-i","input.mov","-c:v","libx264","-c:a","aac","output.mp4"]'

The action runs ffmpeg by default and prepends automation-safe options:

  • -hide_banner unless hideBanner: false
  • -nostdin unless nostdin: false
  • -n by default, or -y when overwrite: true

Use command: ffprobe to inspect media and capture probe output:

yaml
steps:
  - id: inspect
    action: ffmpeg@v1
    with:
      command: ffprobe
      args: >-
        -v error -print_format json -show_format -show_streams /data/video.mp4

  - id: print_probe
    run: printf '%s\n' '${inspect.outputs.stdout}'
    depends: inspect

Inputs

FieldDescription
argsRequired shell-style arguments passed to ffmpeg or ffprobe, excluding the executable name. JSON array strings are also accepted.
commandffmpeg or ffprobe. Defaults to ffmpeg.
workdirOptional working directory for the command.
envExtra environment variables as newline-delimited KEY=value entries. JSON object strings are also accepted.
timeoutSecondsCommand timeout in seconds. Defaults to 3600.
overwriteFor ffmpeg, pass -y when true; otherwise pass -n.
hideBannerPass -hide_banner. Defaults to true.
nostdinFor ffmpeg, pass -nostdin. Defaults to true.
maxOutputBytesMaximum bytes captured from stdout and stderr. Defaults to 1048576.

Outputs

FieldDescription
oktrue when the command exits with status 0 before timeout.
exitCodeProcess exit code, or -1 when the process was terminated before producing one.
signalSignal name when the process was terminated by a signal.
commandffmpeg or ffprobe.
argsFinal argument list passed to the command, including action-managed defaults.
stdout / stderrCaptured stdout and stderr, truncated to maxOutputBytes.
durationMsWrapper-measured command duration in milliseconds.
timedOuttrue when timeoutSeconds was reached.
truncatedObject with stdout and stderr booleans.
errorError object when validation or process startup fails.

Do not use action outputs to carry large media data. Write media files under ${DAG_RUN_ARTIFACTS_DIR}, a shared mounted path, or object storage.

Released under the MIT License.