summaryrefslogtreecommitdiff
path: root/internal/media/ffmpeg.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-07-30 14:18:29 +0000
committerLibravatar GitHub <noreply@github.com>2024-07-30 16:18:29 +0200
commit0b4a951b487c6d26a69a1044c8cd39214498ea23 (patch)
treeb385c3339693611e07dae92cde9742b403d6184b /internal/media/ffmpeg.go
parent[feature] persist worker queues to db (#3042) (diff)
downloadgotosocial-0b4a951b487c6d26a69a1044c8cd39214498ea23.tar.xz
[performance] limit ffprobe read time to at most 1s after start of file (#3155)
Diffstat (limited to 'internal/media/ffmpeg.go')
-rw-r--r--internal/media/ffmpeg.go5
1 files changed, 5 insertions, 0 deletions
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,
},