Running FFmpeg on a Remote Server

Background

See also remote Docker server via SSH.

Basics

Reference: FFmpeg syntax and examples

Quick reference

Combining video and audio streams from different sources (assuming stream #0 for video and stream #1 for audio):

1
ffmpeg -i [input_source_0] -i [input_source_1] -c copy -map 0:v:0 -map 1:a:0 [output]

Streaming

Streaming capability

Be aware that not all the video container formats allow for streaming. Compared to the commonly used .mp4, effective streamable video container (muxer) names for use with FFmpeg are Matroska (.mkv), MPEG-TS (.m2ts preferred over .ts to be distinguished against TypeScript) and so on.

If the proper format option is missing, an error may occur from FFmpeg as:

1
Unable to choose an output format for 'pipe:'; use a standard extension for the filename or specify the format manually.

Preview an outbound stream in real-time replay

1
ffmpeg -i [input_source] -f [format] - | ffplay -f [format] -

Pipe and stream videos over SSH outbound to a remote ffmpeg process

Note: -y option is to skip any keyboard input prompt (in case of overriding an existing output file) to avoid the “broken pipe” error.

1
ffmpeg -i [input_source] -f [format] - | ssh [remote_user]@[remote_host] "ffmpeg -y -i pipe:0 [options] [output]"

Preview an inbound stream in real-time replay

1
ssh [remote_user]@[remote_host] "ffmpeg -i [input_source] -f [format] -" | ffplay -f [format] -

Pipe and stream videos over SSH inbound from a remote ffmpeg process

1
ssh [remote_user]@[remote_host] "ffmpeg -i [input_source] -f [format] pipe:1" | cat > output_file

Performance/Quality Tuning

Nvidia GPU-accelerated video processing

Reference 1
Reference 2
Using FFmpeg with NVIDIA GPU Hardware Acceleration

CUDA

1
ffmpeg -i [input] -hwaccel cuda [output]

CUVID

1
ffmpeg -i [input] -c:v h264_cuvid [output]

Full hardware transcode with NVDEC and NVENC

1
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i [input] -c:v h264_nvenc [output]

Further extension - batch operation

Batch video processing

Running FFmpeg on a Remote Server

https://devblog.citruxonve.net/posts/e05bb15e/

Author

CitruXonve

Posted on

12/17/2025

Updated on

02/15/2026

Licensed under

Comments