FFMPEG consistently fails video editing tasks via Video Studio

I tried to add a watermark on a testing video to test video studio, and ffmpeg crashed every single time.
Available formats of the video on the server:

  • Original file (16:9 1080p MP4)
  • HLS (transcoded successfully by the server):
    • 1080p
    • 720p
    • 480p
    • audio-only

Information about watermark file:
1920x1080p PNG with transparency (created with GIMP)

Tested on PeerTube docker images: v7.1.0-bookworm and v6.3.3-bookworm. No remote transcoders were used.

This error causes videos to be forever stuck in [Privacy] - to edit state, so Public - to edit, Private - to edit, Unlisted - to edit etc. Video can be viewed as if nothing has changed, because nothing has changed. But there is a banner warning about video is being edited.


Also the Studio option is not available in the three-dots menu of that video since video supposedly being already edited at the moment.

Error Logs:

error[21/03/2025, 10:12:39] Error in ffmpeg.
{
  "err": {
    "stack": "Error: ffmpeg exited with code 1: Stream specifier '' in filtergraph description [1][0]scale2ref=w=oh*mdar:h=ih*0.1[watermark][video];[video][watermark]overlay=x=main_w - overlay_w - (main_h * 0.05):y=main_h * 0.05 matches no streams.\n\n    at ChildProcess.<anonymous> (/app/node_modules/fluent-ffmpeg/lib/processor.js:180:22)\n    at ChildProcess.emit (node:events:517:28)\n    at ChildProcess._handle.onexit (node:internal/child_process:292:12)",
    "message": "ffmpeg exited with code 1: Stream specifier '' in filtergraph description [1][0]scale2ref=w=oh*mdar:h=ih*0.1[watermark][video];[video][watermark]overlay=x=main_w - overlay_w - (main_h * 0.05):y=main_h * 0.05 matches no streams.\n"
  },
  "stdout": "",
  "stderr": "ffmpeg version 5.1.6-0+deb12u1 Copyright (c) 2000-2024 the FFmpeg developers\n  built with gcc 12 (Debian 12.2.0-14)\n  configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared\n  libavutil      57. 28.100 / 57. 28.100\n  libavcodec     59. 37.100 / 59. 37.100\n  libavformat    59. 27.100 / 59. 27.100\n  libavdevice    59.  7.100 / 59.  7.100\n  libavfilter     8. 44.100 /  8. 44.100\n  libswscale      6.  7.100 /  6.  7.100\n  libswresample   4.  7.100 /  4.  7.100\n  libpostproc    56.  6.100 / 56.  6.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/streaming-playlists/hls/private/2dc0d6fb-3cb8-4f28-9704-1d4a4990ca52/995feb74-ed7e-43dc-99ce-9a8c1d58944c-1080-fragmented.mp4':\n  Metadata:\n    major_brand     : iso5\n    minor_version   : 512\n    compatible_brands: iso5iso6mp41\n    encoder         : Lavf59.27.100\n  Duration: 00:07:50.50, start: 0.066016, bitrate: 2326 kb/s\n  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 2311 kb/s, 30 fps, 30 tbr, 15360 tbn (default)\n    Metadata:\n      handler_name    : VideoHandler\n      vendor_id       : [0][0][0][0]\n      encoder         : Lavc59.37.100 libx264\nInput #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/streaming-playlists/hls/private/2dc0d6fb-3cb8-4f28-9704-1d4a4990ca52/62ff2b80-0136-4725-8489-ad45d3cefb23-0-fragmented.mp4':\n  Metadata:\n    major_brand     : iso5\n    minor_version   : 512\n    compatible_brands: iso5iso6mp41\n    encoder         : Lavf59.27.100\n  Duration: 00:07:50.55, start: 0.000000, bitrate: 130 kb/s\n  Stream #1:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)\n    Metadata:\n      handler_name    : SoundHandler\n      vendor_id       : [0][0][0][0]\nInput #2, png_pipe, from '/data/tmp-persistent/cc811bd69fb12b2ba7f9935382641042.png':\n  Duration: N/A, bitrate: N/A\n  Stream #2:0: Video: png, rgba(pc), 739x230, 25 fps, 25 tbr, 25 tbn\nStream specifier '' in filtergraph description [1][0]scale2ref=w=oh*mdar:h=ih*0.1[watermark][video];[video][watermark]overlay=x=main_w - overlay_w - (main_h * 0.05):y=main_h * 0.05 matches no streams.\n",
  "shellCommand": "ffmpeg -n 15 /usr/bin/ffmpeg -i /data/streaming-playlists/hls/private/2dc0d6fb-3cb8-4f28-9704-1d4a4990ca52/995feb74-ed7e-43dc-99ce-9a8c1d58944c-1080-fragmented.mp4 -i /data/streaming-playlists/hls/private/2dc0d6fb-3cb8-4f28-9704-1d4a4990ca52/62ff2b80-0136-4725-8489-ad45d3cefb23-0-fragmented.mp4 -i /data/tmp-persistent/cc811bd69fb12b2ba7f9935382641042.png -y -filter_complex [1][0]scale2ref=w=oh*mdar:h=ih*0.1[watermark][video];[video][watermark]overlay=x=main_w - overlay_w - (main_h * 0.05):y=main_h * 0.05 -acodec copy -vcodec libx264 -threads 1 -f mp4 -movflags faststart -max_muxing_queue_size 1024 -map_metadata -1 -pix_fmt yuv420p -preset veryfast -maxrate:v 3024305.7 -bufsize:v 6048611.4 -b_strategy 1 -bf 16 -r 30 -g:v 60 /data/tmp/54384739-f368-4a39-a444-239a6be1dfa5.mp4",
  "tags": [
    "ffmpeg"
  ]
}

Hi,

Thanks for the post! It should be fixed by Fix adding studio watermark · Chocobozzz/PeerTube@70871e4 · GitHub

1 « J'aime »

Should this fix retroactively check the videos which are currently tagged as being edited, but actually failed?

In my case, I was trying to see how watermark was applied, whether it would scale up to fit to video frame or the PNGs would needed to have the same dimensions as the video. But there might be other people who attempted to watermark their videos in production, and now just waiting for them to be fixed somehow.

I guess I will need to comeback and update this entry after docker image with this fix becomes available.