From 0b4a951b487c6d26a69a1044c8cd39214498ea23 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:18:29 +0000 Subject: [PATCH] [performance] limit ffprobe read time to at most 1s after start of file (#3155) --- internal/media/ffmpeg.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/media/ffmpeg.go b/internal/media/ffmpeg.go index 1cfaf891c..0de5797ab 100644 --- a/internal/media/ffmpeg.go +++ b/internal/media/ffmpeg.go @@ -243,6 +243,11 @@ func ffprobe(ctx context.Context, filepath string) (*result, error) { // side data stored. "side_data=rotation", + // Limit to reading the first + // 1s of data looking for "rotation" + // side_data tags (expensive part). + "-read_intervals", "%+1", + // Input file. "-i", filepath, },