[feature] support processing of (many) more media types (#3090)

* 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
This commit is contained in:
kim
2024-07-12 09:39:47 +00:00
committed by GitHub
parent 5bc567196b
commit cde2fb6244
376 changed files with 8026 additions and 54091 deletions

View File

@ -1,101 +0,0 @@
package iptc
import (
"errors"
)
// StreamTagInfo encapsulates the properties of each tag.
type StreamTagInfo struct {
// Description is the human-readable description of the tag.
Description string
}
var (
standardTags = map[StreamTagKey]StreamTagInfo{
{1, 120}: {"ARM Identifier"},
{1, 122}: {"ARM Version"},
{2, 0}: {"Record Version"},
{2, 3}: {"Object Type Reference"},
{2, 4}: {"Object Attribute Reference"},
{2, 5}: {"Object Name"},
{2, 7}: {"Edit Status"},
{2, 8}: {"Editorial Update"},
{2, 10}: {"Urgency"},
{2, 12}: {"Subject Reference"},
{2, 15}: {"Category"},
{2, 20}: {"Supplemental Category"},
{2, 22}: {"Fixture Identifier"},
{2, 25}: {"Keywords"},
{2, 26}: {"Content Location Code"},
{2, 27}: {"Content Location Name"},
{2, 30}: {"Release Date"},
{2, 35}: {"Release Time"},
{2, 37}: {"Expiration Date"},
{2, 38}: {"Expiration Time"},
{2, 40}: {"Special Instructions"},
{2, 42}: {"Action Advised"},
{2, 45}: {"Reference Service"},
{2, 47}: {"Reference Date"},
{2, 50}: {"Reference Number"},
{2, 55}: {"Date Created"},
{2, 60}: {"Time Created"},
{2, 62}: {"Digital Creation Date"},
{2, 63}: {"Digital Creation Time"},
{2, 65}: {"Originating Program"},
{2, 70}: {"Program Version"},
{2, 75}: {"Object Cycle"},
{2, 80}: {"By-line"},
{2, 85}: {"By-line Title"},
{2, 90}: {"City"},
{2, 92}: {"Sublocation"},
{2, 95}: {"Province/State"},
{2, 100}: {"Country/Primary Location Code"},
{2, 101}: {"Country/Primary Location Name"},
{2, 103}: {"Original Transmission Reference"},
{2, 105}: {"Headline"},
{2, 110}: {"Credit"},
{2, 115}: {"Source"},
{2, 116}: {"Copyright Notice"},
{2, 118}: {"Contact"},
{2, 120}: {"Caption/Abstract"},
{2, 122}: {"Writer/Editor"},
{2, 125}: {"Rasterized Caption"},
{2, 130}: {"Image Type"},
{2, 131}: {"Image Orientation"},
{2, 135}: {"Language Identifier"},
{2, 150}: {"Audio Type"},
{2, 151}: {"Audio Sampling Rate"},
{2, 152}: {"Audio Sampling Resolution"},
{2, 153}: {"Audio Duration"},
{2, 154}: {"Audio Outcue"},
{2, 200}: {"ObjectData Preview File Format"},
{2, 201}: {"ObjectData Preview File Format Version"},
{2, 202}: {"ObjectData Preview Data"},
{7, 10}: {"Size Mode"},
{7, 20}: {"Max Subfile Size"},
{7, 90}: {"ObjectData Size Announced"},
{7, 95}: {"Maximum ObjectData Size"},
{8, 10}: {"Subfile"},
{9, 10}: {"Confirmed ObjectData Size"},
}
)
var (
// ErrTagNotStandard indicates that the given tag is not known among the
// documented standard set.
ErrTagNotStandard = errors.New("not a standard tag")
)
// GetTagInfo return the info for the given tag. Returns ErrTagNotStandard if
// not known.
func GetTagInfo(recordNumber, datasetNumber int) (sti StreamTagInfo, err error) {
stk := StreamTagKey{uint8(recordNumber), uint8(datasetNumber)}
sti, found := standardTags[stk]
if found == false {
return sti, ErrTagNotStandard
}
return sti, nil
}