summaryrefslogtreecommitdiff
path: root/internal/media/ffmpeg.go
AgeCommit message (Collapse)AuthorFiles
2024-12-28[bugfix] Advertise audio/mpeg as supported (#3632)Libravatar Daenney1
This will be either an mp1, mp2 or mp3 file. In practice it'll probably be mp3, but this handles mp1 too for good measure. We don't advertise audio/mp1 as a supported media type since best I can tell that was never a MIME type that's been used. This also changes the returned MIME-type for mp2 and mp3 to audio/mpeg, to match what's expected and supported by most things nowadays. Fixes: #3531
2024-11-06[chore] update go ffmpreg to v0.6.0 (#3515)Libravatar kim1
* pull in go-ffmpreg v0.6.0 * add code comment * grrr linter * set empty module name when calling ffmpeg / ffprobe
2024-11-04[bugfix] determine mime-type to use during ffprobe evaluation stage, don't ↵Libravatar kim1
bother checking against file extension (#3506) * determine mime-type to use during ffprobe evaluation stage, don't bother rechecking by file extension * set mjpeg content-type * fix up tests expecting differing default values
2024-10-28[bugfix] support classifying correct video codec without audio as webm (#3494)Libravatar kim1
* for webm support video:[vp8,vp9,av1] and audio:[NONE,vorbis,opus] * improved unsupported data type error output
2024-10-18[chore] Thumbnail only first frame of animated media (#3448)Libravatar tobi1
2024-10-16[chore] Upgrade golangci-lint, ignore existing int overflow warnings (#3420)Libravatar Markus Unterwaditzer1
* [chore] Bump tooling versions, bump go -> v1.23.0 * undo silly change * sign * bump go version in go.mod * allow overflow in imaging * goreleaser deprecation notices * [chore] Upgrade golangci-lint, ignore existing int overflow warnings There is a new lint for unchecked int casts. Integer overflows are bad, but the old code that triggers this lint seems to be perfectly fine. Instead of disabling the lint entirely for new code as well, grandfather in existing code. * fix golangci-lint documentation link * revert unrelated changes * revert another unrelated change * get rid of remaining nolint:gosec * swagger updates * apply review feedback * fix wrong formatting specifier thing * fix the linter for real --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-09-27[bugfix] better handle ogg container format (#3365)Libravatar kim1
2024-09-23[bugfix] add support for media with rotation contained in stream side data ↵Libravatar kim1
(#3335) * add support for media with embedded rotation data in stream side data list * *grumble grumble* linter
2024-08-30[security] Implement `allowFiles` fs for better isolation of ffmpeg / ↵Libravatar tobi1
ffprobe (#3251) * [chore] Implement readOneFile fs * further isolation * remove fmt call * tweaks
2024-08-23[performance] ffmpeg ffprobe wrapper improvements (#3225)Libravatar kim1
* use a single instance of wazero runtime and compiled modules * remove test output :facepalm: * undo process-{media,emoji} changes * update test runner to include wazero compilation cache * sign drone.yml --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-08-16[bugfix] permit unspecified orientation data (#3205)Libravatar kim1
2024-08-08[performance] move thumbnail generation to go code where possible (#3183)Libravatar kim1
* wrap thumbnailing code to handle generation natively where possible * more code comments! * add even more code comments! * add code comments about blurhash generation * maintain image rotation if contained in exif data * move rotation before resizing * ensure pix_fmt actually selected by ffprobe, check for alpha layer with gifs * use linear instead of nearest-neighbour for resizing * work with image "orientation" instead of "rotation". use default 75% quality for both webp and jpeg generation * add header to new file * use thumb extension when getting thumb mime type * update test models and tests with new media processing * add suggested code comments * add note about thumbnail filter count reducing memory usage
2024-08-08[feature] Use gifv type for short soundless mp4 videos (#3182)Libravatar tobi1
2024-08-02[chore] add back exif-terminator and use only for jpeg,png,webp (#3161)Libravatar kim1
* add back exif-terminator and use only for jpeg,png,webp * fix arguments passed to terminateExif() * pull in latest exif-terminator * fix test * update processed img --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-07-31[chore] Take account of rotation data when calculating full size image ↵Libravatar tobi1
dimensions (#3159) * [chore] Take account of rotation data when calculating full size image dimensions * boobies
2024-07-30[performance] limit ffprobe read time to at most 1s after start of file (#3155)Libravatar kim1
2024-07-28[bugfix] take into account rotation when generating thumbnail (#3147)Libravatar kim1
* take into account rotation when generating thumbnail, simplify ffprobe output to show only fields we need * only show rotation side data * remove unnecessary comment * fix code comments * remove debug logging
2024-07-28[bugfix] moves file rename to earlier in media pipeline so ffmpeg calls ↵Libravatar kim1
ALWAYS have extension (#3146)
2024-07-26ensure ffmpeg muxer gets set correctly by setting input file extension ↵Libravatar kim1
before clean (#3142)
2024-07-21[feature] add flac support (#3121)Libravatar kim1
* add flac support to the ffprobe format/stream -> filetype parser * also add audio/flac for flac (not just x-flac) * update tests --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-07-19[feature] use webp for thumbnails (#3116)Libravatar kim1
* update to use webp for thumbnails * bump webp quality up to 40% from 12% (it's a bit different to jpeg quality setting) * update to use yuva colorspace, and use thumbnail=n=10 to select frame * fix missing comma in ffmpeg args * add links to appropriate ffmpeg docs * update tests * add file size tests for thumbnails --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2024-07-16give read-only access to /dev for ffmpeg to access /dev/urandom (#3109)Libravatar kim1
2024-07-15[feature] more filetype support! (#3107)Libravatar kim1
* add more supported file types to our media processor that ffmpeg supports, update supported mime type lists * add code comments to the supported mime types slice * don't check for zero value string, just parse * remove some unneeded consts which make the code a bit harder to read * fix test expected instance media mime types, use compact ffprobe json, simple media processing by type * final tweaks to media processing code * don't use safe divide where we don't need to
2024-07-15[feature/frontend] Add player for audio files; use thumbnail for `poster` ↵Libravatar tobi1
(#3099) * [feature/frontend] Audio player for audio media types * use video preview images for previews instead of video itself * don't preload * update tests for new zork status * collapse media gallery into single row when small
2024-07-12[feature] support processing of (many) more media types (#3090)Libravatar kim1
* initial work replacing our media decoding / encoding pipeline with ffprobe + ffmpeg * specify the video codec to use when generating static image from emoji * update go-storage library (fixes incompatibility after updating go-iotools) * maintain image aspect ratio when generating a thumbnail for it * update readme to show go-ffmpreg * fix a bunch of media tests, move filesize checking to callers of media manager for more flexibility * remove extra debug from error message * fix up incorrect function signatures * update PutFile to just use regular file copy, as changes are file is on separate partition * fix remaining tests, remove some unneeded tests now we're working with ffmpeg/ffprobe * update more tests, add more code comments * add utilities to generate processed emoji / media outputs * fix remaining tests * add test for opus media file, add license header to utility cmds * limit the number of concurrently available ffmpeg / ffprobe instances * reduce number of instances * further reduce number of instances * fix envparsing test with configuration variables * update docs and configuration with new media-{local,remote}-max-size variables