Skip to content

Error generating phash/sprites/screenshot for short videos #6499

@CynicalAtropos

Description

@CynicalAtropos

Describe the bug

When running generate tasks (Scene Cover, Sprites, PHash), a large amount of videos (short webm's with low numbers of i-frames as far as I can tell) fail to generate with errors and stall out for up to several minutes per video:
Error generating screenshot: error running ffmpeg command <-v error -y -ss 2 -i /video_1080p.webm -frames:v 1 -q:v 2 -f image2 /generated/tmp/3893940106.jpg>: exit status 69

Steps to reproduce

  1. Have identified videos (short webm's) in library
  2. Go to 'Tasks > Generated Content'
  3. Click Generate with Generate Scene Cover, Scene Scrubber Sprites, or PHash options selected

Expected behaviour

Scene Cover, Sprites, and PHash generate for the included videos without errors

Screenshots or additional context

I have also reproduced this on a dev build on windows. I was able to solve the issue on the dev build by swapping the -ss arg to after the -i arg in ffmpeg in ScreenshotTime() in pkg\ffmpeg\transcoder\screenshot.go though I am rather new to GO and the codebase, so I am unaware if there is a better place. This is changing ffmpeg from fast seek to accurate seek which solves the issue of lower numbers of i-frames at the cost of time.

My initial ideas for a fix would be either 1) an automatic fallback option similar to the Preview Generation Fallback already present or 2) Add a 'Accurate/Slow Seek' switch for generation so it can be optionally enabled when needed

Stash version

v0.30.1 - b23b026

Device details

Docker Image on Synology NAS accessed with Chrome

Relevant log output

2026-01-16 23:46:15
Info    
Retrieved latest version: v0.30.1 (b23b0267)
2026-01-16 23:33:22
Info    
Generate finished (436.755552ms)
2026-01-16 23:33:22
Error   
command stderr: [vist#0:0/vp8 @ 0x7fe5f28e4cc0] [dec:vp8 @ 0x7fe5f245de40] Error submitting packet to decoder: Invalid data found when processing input
    Last message repeated 447 times
[vist#0:0/vp8 @ 0x7fe5f28e4cc0] [dec:vp8 @ 0x7fe5f245de40] Decoding error: Invalid data found when processing input
    Last message repeated 7 times
[vist#0:0/vp8 @ 0x7fe5f28e4cc0] [dec:vp8 @ 0x7fe5f245de40] Decode error rate 1 exceeds maximum 0.666667
[vist#0:0/vp8 @ 0x7fe5f28e4cc0] [dec:vp8 @ 0x7fe5f245de40] Task finished with error code: -1145393733 (No error information)
[vist#0:0/vp8 @ 0x7fe5f28e4cc0] [dec:vp8 @ 0x7fe5f245de40] Terminating thread with return code -1145393733 (No error information)
2026-01-16 23:33:22
Error   
Error generating phash: generating sprite screenshot: error running ffmpeg command <-v error -y -ss 0.5 -i /video_1080p.webm -frames:v 1 -vf scale=160:-2 -c:v bmp -f rawvideo ->: exit status 69
2026-01-16 23:33:22
Info    
[generator] generating phash sprite for /video_1080p.webm
2026-01-16 23:33:22
Error   
error generating sprite: error running ffmpeg command <-v error -y -ss 0.12345679012345678 -i /video_1080p.webm -frames:v 1 -vf scale=160:-2 -c:v bmp -f rawvideo ->: exit status 69
2026-01-16 23:33:22
Error   
command stderr: [vist#0:0/vp8 @ 0x7f3d3d9cdcc0] [dec:vp8 @ 0x7f3d3d546e40] Error submitting packet to decoder: Invalid data found when processing input
    Last message repeated 466 times
[vist#0:0/vp8 @ 0x7f3d3d9cdcc0] [dec:vp8 @ 0x7f3d3d546e40] Decoding error: Invalid data found when processing input
    Last message repeated 7 times
[vist#0:0/vp8 @ 0x7f3d3d9cdcc0] [dec:vp8 @ 0x7f3d3d546e40] Decode error rate 1 exceeds maximum 0.666667
[vist#0:0/vp8 @ 0x7f3d3d9cdcc0] [dec:vp8 @ 0x7f3d3d546e40] Task finished with error code: -1145393733 (No error information)
[vist#0:0/vp8 @ 0x7f3d3d9cdcc0] [dec:vp8 @ 0x7f3d3d546e40] Terminating thread with return code -1145393733 (No error information)
2026-01-16 23:33:22
Info    
[generator] generating sprite image for /video_1080p.webm
2026-01-16 23:33:21
Error   
command stderr: [vist#0:0/vp8 @ 0x7fbc64f10e40] [dec:vp8 @ 0x7fbc643edb40] Error submitting packet to decoder: Invalid data found when processing input
    Last message repeated 375 times
[vist#0:0/vp8 @ 0x7fbc64f10e40] [dec:vp8 @ 0x7fbc643edb40] Decoding error: Invalid data found when processing input
    Last message repeated 7 times
[vist#0:0/vp8 @ 0x7fbc64f10e40] [dec:vp8 @ 0x7fbc643edb40] Decode error rate 1 exceeds maximum 0.666667
[vist#0:0/vp8 @ 0x7fbc64f10e40] [dec:vp8 @ 0x7fbc643edb40] Task finished with error code: -1145393733 (No error information)
[vist#0:0/vp8 @ 0x7fbc64f10e40] [dec:vp8 @ 0x7fbc643edb40] Terminating thread with return code -1145393733 (No error information)
[mjpeg @ 0x7fbc6d35db40] Non full-range YUV is non-standard, set strict_std_compliance to at most unofficial to use it.
[mjpeg @ 0x7fbc648248c0] ff_frame_thread_encoder_init failed
[vost#0:0/mjpeg @ 0x7fbc648528c0] [enc:mjpeg @ 0x7fbc67733ec0] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0x7fbc64340580] Error sending frames to consumers: Invalid argument
[vf#0:0 @ 0x7fbc64340580] Task finished with error code: -22 (Invalid argument)
[vf#0:0 @ 0x7fbc64340580] Terminating thread with return code -22 (Invalid argument)
[vost#0:0/mjpeg @ 0x7fbc648528c0] [enc:mjpeg @ 0x7fbc67733ec0] Could not open encoder before EOF
[vost#0:0/mjpeg @ 0x7fbc648528c0] Task finished with error code: -22 (Invalid argument)
[vost#0:0/mjpeg @ 0x7fbc648528c0] Terminating thread with return code -22 (Invalid argument)
[out#0/image2 @ 0x7fbc6a5197c0] Nothing was written into output file, because at least one of its streams received no packets.
2026-01-16 23:33:21
Error   
Error generating screenshot: error running ffmpeg command <-v error -y -ss 2 -i /video_1080p.webm -frames:v 1 -q:v 2 -f image2 /generated/tmp/3893940106.jpg>: exit status 69
2026-01-16 23:33:21
Info    
Creating screenshot for /videob_1080p.webm
2026-01-16 23:33:21
Info    
Generating 1 covers 1 sprites 0 previews 0 markers 1 phashes
2026-01-16 23:33:21
Info    
Generate started with 1 parallel tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug reportBug reports that are not yet verified

    Type

    No type

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions