ffmpeg-over-ip

ffmpeg-over-ip

ffmpeg-over-ip lets a program that runs ffmpeg, such as Jellyfin, use a GPU on another machine. You put ffmpeg-over-ip-client where the program expects the ffmpeg binary. It sends the command line to ffmpeg-over-ip-server, which runs its own patched ffmpeg on the GPU machine. That ffmpeg reads and writes the client's files through the same TCP connection, so the client needs neither GPU passthrough nor a shared filesystem.

Install

Each script downloads the latest release into the current directory, asks a few questions and writes a starter config file there. If the binary is already there, the download is skipped; set FOIP_FORCE=1 to download again. An existing config file is left alone.

On the machine with the GPU

macOS or Linux
curl -fsSL https://ffmpeg-over-ip.com/install-server.sh | sh
Windows PowerShell
irm https://ffmpeg-over-ip.com/install-server.ps1 | iex

This installs ffmpeg-over-ip-server with its own ffmpeg and ffprobe, which must stay in the same directory. It asks for the listen IP (default 0.0.0.0), the port (default 5050) and an auth secret, then writes ffmpeg-over-ip.server.jsonc. Start the server with ./ffmpeg-over-ip-server and make sure the client can reach the port.

On the machine that runs your media server

macOS or Linux
curl -fsSL https://ffmpeg-over-ip.com/install-client.sh | sh
Windows PowerShell
irm https://ffmpeg-over-ip.com/install-client.ps1 | iex

This installs ffmpeg-over-ip-client and an ffprobe symlink to it (a copy on Windows). It asks for the server's host, port and auth secret, then writes ffmpeg-over-ip.client.jsonc. ./ffmpeg-over-ip-client -version should print the server's ffmpeg version. Then set your media server's ffmpeg path to the client; in Jellyfin, that setting is under Dashboard > Playback.

Client and server must run the same release. To upgrade from an earlier version, see Upgrading. To install by hand or run either side in a container, see Quick start and Docker.

How it works

The server runs on the machine with the GPU and listens on a TCP port. The client sits where your media server expects ffmpeg. Each time the media server starts ffmpeg, the client opens one connection to the server and this happens over it:

  1. Each side proves that it knows the shared secret, with an HMAC-SHA256 challenge-response over a fresh nonce from each side (the HELLO, CHALLENGE, COMMAND and ACCEPTED messages). The command line is signed as part of this, so a recorded command can't be replayed on a new connection.
  2. The server applies the rewrites from its config to the arguments and starts its bundled ffmpeg with them. Each connection gets its own ffmpeg process, so several clients can use one server at the same time.
  3. Each file operation of that ffmpeg (OPEN, READ, WRITE, SEEK, CLOSE and a few more) is sent to the client, which carries it out on its own disk. The patched ffmpeg reads ahead and caches what it has read, so it needs far fewer round trips than ffmpeg's own small reads would.
  4. ffmpeg's stdout and stderr are forwarded to the client while it runs. When ffmpeg exits, the server sends its exit code and the client exits with the same code.

A recorded session

This is a real transcode, recorded on 2026-11-15 with version 7.0.0. The client ran in a Linux container that could see the input file but not a GPU. The server ran on the macOS host and encoded with h264_videotoolbox. The left pane shows what the client printed, the right pane shows the server's log, and the list below them shows every message between the two. Replay it at one tenth of the recorded speed, or drag the slider.

2023.6 / 2023.6 ms
ClientLinux container without GPU access; /usr/bin/ffmpeg is ffmpeg-over-ip-client
$ ffmpeg -hide_banner -i "/media/movies/Test Pattern (2026)/Test Pattern (2026).mkv" -map 0:v:0 -map 0:a:0 -c:v h264_videotoolbox -b:v 6M -c:a aac -b:a 192k -f hls -hls_time 4 -hls_playlist_type vod -hls_segment_filename "/transcodes/test-pattern/seg%d.ts" /transcodes/test-pattern/main.m3u8
Input #0, matroska,webm, from '/media/movies/Test Pattern (2026)/Test Pattern (2026).mkv':
  Metadata:
    title           : Test Pattern
    ENCODER         : Lavf62.12.103
  Duration: 00:00:30.02, start: 0.000000, bitrate: 8179 kb/s
  Stream #0:0: Video: h264 (High), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn
    Metadata:
      ENCODER         : Lavc62.28.103 libx264
      DURATION        : 00:00:30.000000000
  Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp
    Metadata:
      ENCODER         : Lavc62.28.103 aac
      DURATION        : 00:00:30.021000000
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_videotoolbox))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, hls, to '/transcodes/test-pattern/main.m3u8':
  Metadata:
    title           : Test Pattern
    encoder         : Lavf62.12.103
  Stream #0:0: Video: h264, yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 6000 kb/s, 24 fps, 90k tbn
    Metadata:
      encoder         : Lavc62.28.103 h264_videotoolbox
      DURATION        : 00:00:30.000000000
  Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      encoder         : Lavc62.28.103 aac
      DURATION        : 00:00:30.021000000
[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg0.ts' for writing
[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg1.ts' for writingx elapsed=0:00:00.50    
[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg2.ts' for writing
[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg3.ts' for writingx elapsed=0:00:01.01    
[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg4.ts' for writing
[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg5.ts' for writingx elapsed=0:00:01.52    
[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg6.ts' for writing
[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg7.ts' for writing
[out#0/hls @ 0x75b4c08840] video:21985KiB audio:704KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
frame=  720 fps=363 q=-0.0 Lsize=N/A time=00:00:29.95 bitrate=N/A speed=15.1x elapsed=0:00:01.98    
[aac @ 0x75b4d94700] Qavg: 780.367
Client exited with code 0, 2023.6 ms after connecting.
ServermacOS host; ffmpeg-over-ip-server with "log": "stdout"
$ ./ffmpeg-over-ip-server
2026/11/15 22:27:18 listening on 127.0.0.1:5050 (tcp)
2026/11/15 22:27:20 running ffmpeg [-hide_banner -i /media/movies/Test Pattern (2026)/Test Pattern (2026).mkv -map 0:v:0 -map 0:a:0 -c:v h264_videotoolbox -b:v 6M -c:a aac -b:a 192k -f hls -hls_time 4 -hls_playlist_type vod -hls_segment_filename /transcodes/test-pattern/seg%d.ts /transcodes/test-pattern/main.m3u8] (from 127.0.0.1:56015)
2026/11/15 22:27:22 process exited with code 0 (from 127.0.0.1:56015)
Waiting for the next connection.
Messages on the connection184 of 184 rowsEach reply from the client is shown on the row of the request it answers.
  1. 1.1→ serverHELLOprotocol 0x07, client nonce
  2. 1.4→ clientCHALLENGEserver nonce
  3. 1.5→ serverCOMMANDffmpeg with 24 arguments, signed over both nonces
  4. 1.7→ clientACCEPTEDserver's proof that it knows the secret
  5. 1.8→ serverSTDIN_CLOSEstdin reached end of file
  6. 21.5→ clientOPEN/media/movies/Test Pattern (2026)/Test Pattern (2026).mkv (read)opened, 30,694,487 bytes, 0.2 ms
  7. 22.0→ clientSEEKfile 1 to byte 0at byte 0, 0.0 ms
  8. 22.3→ clientREADfile 1, up to 524,288 bytes524,288 bytes, 0.5 ms
  9. 33.4→ clientSTDERRInput #0, matroska,webm, from '/media/movies/Test Pattern (2026)/Test Pattern (2026).mkv':
  10. 33.4→ clientSTDERR Duration: 00:00:30.02, start: 0.000000, bitrate: 8179 kb/s
  11. 33.4→ clientSTDERR:0: Video: h264 (High), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr,
  12. 33.5→ clientSTDERR1k tbn
  13. 33.5→ clientSTDERR DURATION : 00:00:30.000000000
  14. 33.5→ clientSTDERR00:00:30.021000000
  15. 33.5→ clientREADfile 1, up to 524,288 bytes524,288 bytes, 0.5 ms
  16. 34.0→ clientSTDERRStream mapping:
  17. 34.1→ clientSTDERRPress [q] to stop, [?] for help
  18. 193.1→ clientSTDERROutput #0, hls, to '/transcodes/test-pattern/main.m3u8':
  19. 193.2→ clientSTDERR encoder : Lavc62.28.103 h264_videotoolbox
  20. 193.6→ clientREADfile 1, up to 1,048,576 bytes1,048,576 bytes, 1.0 ms
  21. 201.7→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 2.7 ms
  22. 271.8→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.0 ms
  23. 352.4→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.6 ms
  24. 432.0→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.1 ms
  25. 462.1→ clientSTDERR[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg0.ts' for writing
  26. 462.2→ clientOPEN/transcodes/test-pattern/seg0.ts (write, create, truncate)opened, 0 bytes, 0.3 ms
  27. 462.9→ clientSEEKfile 2 to byte 0at byte 0, 0.1 ms
  28. 463.9→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.2 ms
  29. 464.7→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.6 ms
  30. 465.8→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.2 ms
  31. 466.6→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.4 ms
  32. 469.0→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.2 ms
  33. 469.8→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.2 ms
  34. 470.5→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.2 ms
  35. 471.2→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.2 ms
  36. 472.0→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.2 ms
  37. 472.9→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.3 ms
  38. 473.6→ clientWRITEfile 2, 262,144 bytes262,144 written, 0.2 ms
  39. 474.3→ clientWRITEfile 2, 244,360 bytes244,360 written, 0.2 ms
  40. 474.7→ clientCLOSEfile 2closed, 0.2 ms
  41. 501.1→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.1 ms
  42. 543.7→ clientSTDERRframe= 129 fps=0.0 q=-0.0 size=N/A time=00:00:05.33 bitrate=N/A speed=10.5x elapsed=0:00:00.50
  43. 576.6→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.3 ms
  44. 650.4→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.1 ms
  45. 700.9→ clientSTDERR[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg1.ts' for writing
  46. 701.0→ clientOPEN/transcodes/test-pattern/seg1.ts (write, create, truncate)opened, 0 bytes, 0.3 ms
  47. 701.6→ clientSEEKfile 3 to byte 0at byte 0, 0.0 ms
  48. 702.2→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.2 ms
  49. 702.9→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.2 ms
  50. 703.7→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.2 ms
  51. 704.8→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.3 ms
  52. 705.5→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.2 ms
  53. 706.2→ clientWRITEfile 3, 262,144 bytes262,144 written, 2.8 ms
  54. 709.5→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.2 ms
  55. 710.2→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.2 ms
  56. 710.8→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.2 ms
  57. 711.7→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.2 ms
  58. 712.3→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.2 ms
  59. 713.0→ clientWRITEfile 3, 262,144 bytes262,144 written, 0.2 ms
  60. 713.5→ clientWRITEfile 3, 73,584 bytes73,584 written, 0.1 ms
  61. 713.9→ clientCLOSEfile 3closed, 0.2 ms
  62. 735.6→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.2 ms
  63. 814.6→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.0 ms
  64. 899.2→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.1 ms
  65. 939.7→ clientSTDERR[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg2.ts' for writing
  66. 939.8→ clientOPEN/transcodes/test-pattern/seg2.ts (write, create, truncate)opened, 0 bytes, 0.3 ms
  67. 940.4→ clientSEEKfile 4 to byte 0at byte 0, 0.0 ms
  68. 941.0→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.2 ms
  69. 941.7→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.4 ms
  70. 942.6→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.2 ms
  71. 943.1→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.2 ms
  72. 943.8→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.2 ms
  73. 944.4→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.2 ms
  74. 945.1→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.2 ms
  75. 945.7→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.2 ms
  76. 946.4→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.2 ms
  77. 947.1→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.3 ms
  78. 947.8→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.2 ms
  79. 948.3→ clientWRITEfile 4, 262,144 bytes262,144 written, 0.2 ms
  80. 948.7→ clientWRITEfile 4, 2,332 bytes2,332 written, 0.0 ms
  81. 948.9→ clientCLOSEfile 4closed, 0.1 ms
  82. 969.7→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.2 ms
  83. 1047.9→ clientSTDERRframe= 331 fps=326 q=-0.0 size=N/A time=00:00:13.75 bitrate=N/A speed=13.6x elapsed=0:00:01.01
  84. 1048.0→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.4 ms
  85. 1118.5→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.0 ms
  86. 1178.1→ clientSTDERR[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg3.ts' for writing
  87. 1178.2→ clientOPEN/transcodes/test-pattern/seg3.ts (write, create, truncate)opened, 0 bytes, 0.2 ms
  88. 1178.7→ clientSEEKfile 5 to byte 0at byte 0, 0.0 ms
  89. 1179.2→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  90. 1179.9→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  91. 1180.6→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  92. 1181.4→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  93. 1182.0→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  94. 1182.9→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.4 ms
  95. 1183.6→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  96. 1184.2→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  97. 1184.7→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  98. 1185.4→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  99. 1185.9→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  100. 1186.5→ clientWRITEfile 5, 262,144 bytes262,144 written, 0.2 ms
  101. 1186.9→ clientWRITEfile 5, 79,976 bytes79,976 written, 0.1 ms
  102. 1187.2→ clientCLOSEfile 5closed, 0.2 ms
  103. 1197.1→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.2 ms
  104. 1272.5→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.0 ms
  105. 1346.6→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.2 ms
  106. 1416.1→ clientSTDERR[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg4.ts' for writing
  107. 1416.1→ clientOPEN/transcodes/test-pattern/seg4.ts (write, create, truncate)opened, 0 bytes, 0.8 ms
  108. 1416.2→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.3 ms
  109. 1417.3→ clientSEEKfile 6 to byte 0at byte 0, 0.4 ms
  110. 1418.9→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.2 ms
  111. 1419.5→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.4 ms
  112. 1422.1→ clientWRITEfile 6, 262,144 bytes262,144 written, 8.6 ms
  113. 1431.2→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.2 ms
  114. 1431.9→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.2 ms
  115. 1432.5→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.2 ms
  116. 1433.1→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.2 ms
  117. 1433.7→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.2 ms
  118. 1434.2→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.2 ms
  119. 1435.0→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.2 ms
  120. 1435.6→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.2 ms
  121. 1436.2→ clientWRITEfile 6, 262,144 bytes262,144 written, 0.2 ms
  122. 1436.7→ clientWRITEfile 6, 72,080 bytes72,080 written, 0.1 ms
  123. 1437.0→ clientCLOSEfile 6closed, 0.2 ms
  124. 1485.7→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.4 ms
  125. 1558.0→ clientSTDERRframe= 537 fps=352 q=-0.0 size=N/A time=00:00:22.33 bitrate=N/A speed=14.7x elapsed=0:00:01.52
  126. 1565.0→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.1 ms
  127. 1655.0→ clientSTDERR[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg5.ts' for writing
  128. 1655.1→ clientOPEN/transcodes/test-pattern/seg5.ts (write, create, truncate)opened, 0 bytes, 0.3 ms
  129. 1655.8→ clientSEEKfile 7 to byte 0at byte 0, 0.0 ms
  130. 1656.4→ clientWRITEfile 7, 262,144 bytes262,144 written, 0.2 ms
  131. 1657.1→ clientWRITEfile 7, 262,144 bytes262,144 written, 0.2 ms
  132. 1657.8→ clientWRITEfile 7, 262,144 bytes262,144 written, 0.2 ms
  133. 1658.4→ clientWRITEfile 7, 262,144 bytes262,144 written, 0.3 ms
  134. 1659.1→ clientWRITEfile 7, 262,144 bytes262,144 written, 0.2 ms
  135. 1659.4→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.2 ms
  136. 1659.8→ clientWRITEfile 7, 262,144 bytes262,144 written, 1.0 ms
  137. 1662.0→ clientWRITEfile 7, 262,144 bytes262,144 written, 0.2 ms
  138. 1662.7→ clientWRITEfile 7, 262,144 bytes262,144 written, 0.2 ms
  139. 1663.3→ clientWRITEfile 7, 262,144 bytes262,144 written, 0.1 ms
  140. 1664.0→ clientWRITEfile 7, 262,144 bytes262,144 written, 0.2 ms
  141. 1664.6→ clientWRITEfile 7, 262,144 bytes262,144 written, 0.2 ms
  142. 1665.2→ clientWRITEfile 7, 260,904 bytes260,904 written, 0.2 ms
  143. 1665.5→ clientCLOSEfile 7closed, 0.2 ms
  144. 1733.2→ clientREADfile 1, up to 1,310,720 bytes1,310,720 bytes, 1.0 ms
  145. 1812.5→ clientREADfile 1, up to 1,072,215 bytes1,072,215 bytes, 0.8 ms
  146. 1892.9→ clientSTDERR[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg6.ts' for writing
  147. 1893.0→ clientOPEN/transcodes/test-pattern/seg6.ts (write, create, truncate)opened, 0 bytes, 0.2 ms
  148. 1893.4→ clientSEEKfile 8 to byte 0at byte 0, 0.0 ms
  149. 1893.9→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.2 ms
  150. 1894.6→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.5 ms
  151. 1895.5→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.2 ms
  152. 1896.2→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.2 ms
  153. 1896.8→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.2 ms
  154. 1897.4→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.2 ms
  155. 1898.2→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.2 ms
  156. 1898.7→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.2 ms
  157. 1899.3→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.2 ms
  158. 1900.0→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.3 ms
  159. 1900.7→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.2 ms
  160. 1901.2→ clientWRITEfile 8, 262,144 bytes262,144 written, 0.2 ms
  161. 1901.7→ clientWRITEfile 8, 77,344 bytes77,344 written, 0.1 ms
  162. 1901.9→ clientCLOSEfile 8closed, 0.2 ms
  163. 1912.4→ clientREADfile 1, up to 1,310,720 bytes0 bytes, 0.1 ms
  164. 1912.8→ clientREADfile 1, up to 1,310,720 bytes0 bytes, 0.1 ms
  165. 2010.9→ clientSTDERR[hls @ 0x75b4c40280] Opening '/transcodes/test-pattern/seg7.ts' for writing
  166. 2010.9→ clientOPEN/transcodes/test-pattern/seg7.ts (write, create, truncate)opened, 0 bytes, 0.3 ms
  167. 2011.4→ clientSEEKfile 9 to byte 0at byte 0, 0.0 ms
  168. 2011.8→ clientWRITEfile 9, 262,144 bytes262,144 written, 0.3 ms
  169. 2012.5→ clientWRITEfile 9, 262,144 bytes262,144 written, 0.2 ms
  170. 2013.1→ clientWRITEfile 9, 262,144 bytes262,144 written, 0.2 ms
  171. 2013.7→ clientWRITEfile 9, 262,144 bytes262,144 written, 0.2 ms
  172. 2014.3→ clientWRITEfile 9, 262,144 bytes262,144 written, 0.2 ms
  173. 2014.9→ clientWRITEfile 9, 262,144 bytes262,144 written, 1.6 ms
  174. 2016.8→ clientWRITEfile 9, 30,588 bytes30,588 written, 0.1 ms
  175. 2017.1→ clientCLOSEfile 9closed, 0.2 ms
  176. 2017.4→ clientOPEN/transcodes/test-pattern/main.m3u8 (write, create, truncate)opened, 0 bytes, 0.2 ms
  177. 2017.8→ clientSEEKfile 10 to byte 0at byte 0, 0.0 ms
  178. 2018.0→ clientWRITEfile 10, 321 bytes321 written, 0.0 ms
  179. 2018.2→ clientCLOSEfile 10closed, 0.1 ms
  180. 2018.5→ clientSTDERR[out#0/hls @ 0x75b4c08840] video:21985KiB audio:704KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
  181. 2018.6→ clientSTDERRframe= 720 fps=363 q=-0.0 Lsize=N/A time=00:00:29.95 bitrate=N/A speed=15.1x elapsed=0:00:01.98
  182. 2019.9→ clientSTDERR[aac @ 0x75b4d94700] Qavg: 780.367
  183. 2019.9→ clientCLOSEfile 1closed, 0.1 ms
  184. 2023.6→ clientEXIT_CODEffmpeg exited with code 0
Read from the client's disk
30,694,487 bytes in 27 READs
Written to the client's disk
23,910,161 bytes in 97 WRITEs
Files opened on the client
10
stderr chunks forwarded
24

In this recording, the handshake was done 1.7 ms after the client connected. ffmpeg opened the input 19.8 ms after the command was accepted, read all 30,694,487 bytes of it in 27 READ requests, and wrote 8 HLS segments and a playlist in 97 WRITE requests. The READ sizes grow from 512 KiB to 1.25 MiB, the default read-ahead limit for files under 1 GiB. The client exited with ffmpeg's exit code, 0, 2,023.6 ms after connecting.

How this was recorded: the client was built for linux/arm64 from the v7.0.0 tag and mounted as /usr/bin/ffmpeg in an Alpine container on OrbStack. The input and output directories were on the host and mounted into the container, so the server's ffmpeg could reach them only through the client. The server and its ffmpeg came from the macos-arm64 release package. The input was a 30-second 1080p test pattern, H.264 and AAC in Matroska. A logging proxy inside the container, between client and server, recorded the messages. OrbStack forwards the container's connections to the host's loopback address, which is why the server logged 127.0.0.1. Each server log line is shown at the message that led to it. The client pane applies carriage returns the way a terminal too wide to wrap lines does, which is why the ends of overwritten progress lines stay visible.

Configuration

Each side reads a JSONC file (JSON that allows comments and trailing commas) or environment variables. The smallest working setup is an address and a secret that matches on both sides.

ffmpeg-over-ip.server.jsonc
{
  "address": "0.0.0.0:5050",
  "authSecret": "pick-a-strong-secret"
}
ffmpeg-over-ip.client.jsonc
{
  "address": "192.168.1.100:5050",  // your server's IP
  "authSecret": "pick-a-strong-secret"
}
rewrites (server)
Replaces whole arguments before ffmpeg starts, for example h264_nvenc with h264_qsv when the server has an Intel GPU instead of an NVIDIA one.
fallbackToLocal (client)
Runs the client machine's own ffmpeg when the server can't be reached. Only a failed connection triggers it; a transcode that has started is never restarted locally.
log, debug (both)
Send logs to stdout, stderr or a file. With debug, the server logs each command's original and rewritten arguments.
unix:/path (address)
Connects over a Unix socket instead of TCP, for example when the server runs on a host and the client in one of its containers.
FFMPEG_OVER_IP_CLIENT_ADDRESS (environment)
With FFMPEG_OVER_IP_CLIENT_AUTH_SECRET (or the SERVER pair), replaces the config file, which suits Docker. Rewrites still need a file.
ffprobe (file name)
A symlink or copy of the client whose name contains "ffprobe" runs ffprobe on the server instead of ffmpeg.

The configuration reference covers every option, the search paths for config files and the read-ahead settings.

Security

  • Client and server each prove that they know the shared secret before a command runs, and the client acts on file requests only after the server's proof. The secret itself is never sent.
  • Nothing is encrypted. Someone who can intercept the connection can read and change command lines and file contents. Across a network you don't trust, run it through a VPN or an SSH tunnel.
  • Use a long random secret, such as the output of openssl rand -hex 32. Someone who records a session can test guesses of the secret against it offline.
  • Anyone with the secret can run ffmpeg on the server with any arguments, and can pose as the server to read, write or delete any file the client's user can reach.
  • Only the server listens on a port. The client only makes outbound connections.
  • A few ffmpeg options open files on the server rather than the client, such as -vstats_file and the two-pass stats files of libx264. Troubleshooting lists them.

Platforms

Each release has a client and a server package for Linux (x86_64 and arm64), macOS (arm64 and x86_64) and Windows (x86_64). The server package includes ffmpeg and ffprobe built with jellyfin-ffmpeg's build scripts, with hardware acceleration such as NVENC, QSV, VAAPI, AMF and VideoToolbox, depending on the platform. The bundled ffmpeg needs glibc 2.28 or newer on Linux and macOS 12.0 or newer.