Skip to content

Commit

Permalink
test image uploads (#718)
Browse files Browse the repository at this point in the history
* fix image uploads

* false alarm

* test doesn't know resulting image filenames

* fix verifyImages call

* fix storage location for download

* add FilenamePrefix to ImagesInfo

* update protocol
  • Loading branch information
frostbyte73 authored Jul 5, 2024
1 parent 41e7c34 commit 0a55a3d
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 57 deletions.
8 changes: 7 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/gorilla/websocket v1.5.2
github.com/livekit/livekit-server v1.6.0
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
github.com/livekit/protocol v1.19.0
github.com/livekit/protocol v1.19.2-0.20240705155036-b272353929aa
github.com/livekit/psrpc v0.5.3-0.20240526192918-fbdaf10e6aa5
github.com/livekit/server-sdk-go/v2 v2.2.1-0.20240628022514-ad17d3f0adad
github.com/pion/rtp v1.8.6
Expand All @@ -38,15 +38,19 @@ require (
)

require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.33.0-20240401165935-b983156c5e99.1 // indirect
cloud.google.com/go v0.114.0 // indirect
cloud.google.com/go/auth v0.5.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/iam v1.1.8 // indirect
github.com/Azure/azure-pipeline-go v0.2.3 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bep/debounce v1.2.1 // indirect
github.com/bufbuild/protovalidate-go v0.6.1 // indirect
github.com/bufbuild/protoyaml-go v0.1.9 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chromedp/sysutil v1.0.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
Expand All @@ -65,6 +69,7 @@ require (
github.com/gobwas/ws v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/cel-go v0.20.1 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
Expand Down Expand Up @@ -103,6 +108,7 @@ require (
github.com/puzpuzpuz/xsync/v3 v3.1.0 // indirect
github.com/redis/go-redis/v9 v9.5.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/twitchtv/twirp v8.1.3+incompatible // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
Expand Down
22 changes: 20 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.33.0-20240401165935-b983156c5e99.1 h1:2IGhRovxlsOIQgx2ekZWo4wTPAYpck41+18ICxs37is=
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.33.0-20240401165935-b983156c5e99.1/go.mod h1:Tgn5bgL220vkFOI0KPStlcClPeOJzAv4uT+V8JXGUnw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY=
cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E=
Expand Down Expand Up @@ -31,6 +33,8 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible h1:8psS8a+wKfiLt1iVDX79F7Y6wUM49Lcha2FMXt4UM8g=
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=
github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g=
github.com/aws/aws-sdk-go v1.51.28 h1:x3CV5xjnL4EbVLaPXulBOxqiq2dkc9o6+50xxT3tvXY=
github.com/aws/aws-sdk-go v1.51.28/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o=
Expand All @@ -43,6 +47,10 @@ github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/bufbuild/protovalidate-go v0.6.1 h1:uzW8r0CDvqApUChNj87VzZVoQSKhcVdw5UWOE605UIw=
github.com/bufbuild/protovalidate-go v0.6.1/go.mod h1:4BR3rKEJiUiTy+sqsusFn2ladOf0kYmA2Reo6BHSBgQ=
github.com/bufbuild/protoyaml-go v0.1.9 h1:anV5UtF1Mlvkkgp4NWA6U/zOnJFng8Orq4Vf3ZUQHBU=
github.com/bufbuild/protoyaml-go v0.1.9/go.mod h1:KCBItkvZOK/zwGueLdH1Wx1RLyFn5rCH7YjQrdty2Wc=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
Expand Down Expand Up @@ -72,6 +80,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=
github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=
Expand Down Expand Up @@ -113,14 +123,18 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84=
github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
Expand Down Expand Up @@ -170,8 +184,8 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
github.com/livekit/mediatransportutil v0.0.0-20240613015318-84b69facfb75 h1:p60OjeixzXnhGFQL8wmdUwWPxijEDe9ZJFMosq+byec=
github.com/livekit/mediatransportutil v0.0.0-20240613015318-84b69facfb75/go.mod h1:jwKUCmObuiEDH0iiuJHaGMXwRs3RjrB4G6qqgkr/5oE=
github.com/livekit/protocol v1.19.0 h1:EPcFQAa6ymVknKn21NbSeFuUsHTA8r3DH+RmP72yRrU=
github.com/livekit/protocol v1.19.0/go.mod h1:cN8WmGQR+kWz1+UWcAQdFFUcbW76PnfZDdkLAbYIqd4=
github.com/livekit/protocol v1.19.2-0.20240705155036-b272353929aa h1:rkX4blO/giAiqWM/E5T0N7SU0OA9pMHjWekhv+a6byI=
github.com/livekit/protocol v1.19.2-0.20240705155036-b272353929aa/go.mod h1:bNjJi+8frdvC84xG0CJ/7VfVvqerLg2MzjOks0ucyC4=
github.com/livekit/psrpc v0.5.3-0.20240526192918-fbdaf10e6aa5 h1:mTZyrjk5WEWMsvaYtJ42pG7DuxysKj21DKPINpGSIto=
github.com/livekit/psrpc v0.5.3-0.20240526192918-fbdaf10e6aa5/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0=
github.com/livekit/server-sdk-go/v2 v2.2.1-0.20240628022514-ad17d3f0adad h1:SfX8OBXfUx9WHGEIsJi+rpWMsPhgtlRlQpHk3bnEZrI=
Expand Down Expand Up @@ -259,6 +273,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
Expand Down Expand Up @@ -445,6 +461,8 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
13 changes: 7 additions & 6 deletions pkg/config/output_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ func (p *PipelineConfig) getImageConfig(images *livekit.ImageOutput) (*ImageConf
return nil, err
}

filenamePrefix := clean(images.FilenamePrefix)
conf := &ImageConfig{
outputConfig: outputConfig{
OutputType: outputType,
},

Id: utils.NewGuid(""),
ImagesInfo: &livekit.ImagesInfo{},
ImagePrefix: clean(images.FilenamePrefix),
Id: utils.NewGuid(""),
ImagesInfo: &livekit.ImagesInfo{
FilenamePrefix: filenamePrefix,
},
ImagePrefix: filenamePrefix,
ImageSuffix: images.FilenameSuffix,
DisableManifest: images.DisableManifest,
UploadConfig: p.getUploadConfig(images),
Expand Down Expand Up @@ -111,11 +114,10 @@ func (o *ImageConfig) updatePrefix(p *PipelineConfig) error {
identifier, replacements := p.getFilenameInfo()

o.ImagePrefix = stringReplace(o.ImagePrefix, replacements)

o.ImagesInfo.FilenamePrefix = stringReplace(o.ImagesInfo.FilenamePrefix, replacements)
o.ImageExtension = types.FileExtensionForOutputType[o.OutputType]

imagesDir, imagesPrefix := path.Split(o.ImagePrefix)

o.StorageDir = imagesDir

// ensure playlistName
Expand All @@ -133,7 +135,6 @@ func (o *ImageConfig) updatePrefix(p *PipelineConfig) error {
// there is more than one image output
// os.ModeDir creates a directory with mode 000 when mapping the directory outside the container
// Append a "/" to the path for consistency with the "UploadConfig == nil" case

o.LocalDir = path.Join(TmpDir, p.Info.EgressId, o.Id) + "/"
}

Expand Down
1 change: 1 addition & 0 deletions pkg/config/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ func (p *PipelineConfig) UpdateInfoFromSDK(identifier string, replacements map[s
o.LocalDir = stringReplace(o.LocalDir, replacements)
o.StorageDir = stringReplace(o.StorageDir, replacements)
o.ImagePrefix = stringReplace(o.ImagePrefix, replacements)
o.ImagesInfo.FilenamePrefix = stringReplace(o.ImagesInfo.FilenamePrefix, replacements)
if o.Width == 0 {
if w != 0 {
o.Width = int32(w)
Expand Down
1 change: 0 additions & 1 deletion pkg/pipeline/sink/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func (s *ImageSink) handleNewImage(update *imageUpdate) error {
}
filename = newFilename
imageLocalPath = newImageLocalPath

}

imageStoragePath := path.Join(s.StorageDir, filename)
Expand Down
52 changes: 13 additions & 39 deletions test/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package test

import (
"fmt"
"path"
"testing"
"time"

Expand All @@ -43,55 +45,27 @@ func (r *Runner) runImagesTest(t *testing.T, req *rpc.StartEgressRequest, test *
p, err := config.GetValidatedPipelineConfig(r.ServiceConfig, req)
require.NoError(t, err)

r.verifyImages(t, p, test.imageFilenameSuffix, res)
r.verifyImages(t, p, res)
}

func (r *Runner) verifyImages(t *testing.T, p *config.PipelineConfig, filenameSuffix livekit.ImageFileSuffix, res *livekit.EgressInfo) {
func (r *Runner) verifyImages(t *testing.T, p *config.PipelineConfig, res *livekit.EgressInfo) {
// egress info
require.Equal(t, res.Error == "", res.Status != livekit.EgressStatus_EGRESS_FAILED)
require.NotZero(t, res.StartedAt)
require.NotZero(t, res.EndedAt)

// segments info
// image info
require.Len(t, res.GetImageResults(), 1)
images := res.GetImageResults()[0]

require.Greater(t, images.ImageCount, int64(0))

// r.verifyImagesOutput(t, p, filenameSuffix, segments.PlaylistName, segments.PlaylistLocation, int(segments.SegmentCount), res, m3u8.PlaylistTypeEvent)
// r.verifyManifest(t, p, segments.PlaylistName)
imageConfig := p.GetImageConfigs()[0]
if uploadConfig := imageConfig.UploadConfig; uploadConfig != nil {
for i := range images.ImageCount {
storagePath := fmt.Sprintf("%s_%05d%s", images.FilenamePrefix, i, imageConfig.ImageExtension)
localPath := path.Join(r.FilePrefix, path.Base(storagePath))
download(t, uploadConfig, localPath, storagePath)
}
}
}

// func (r *Runner) verifyManifest(t *testing.T, p *config.PipelineConfig, plName string) {
// localPlaylistPath := path.Join(r.FilePrefix, plName)
//
// if uploadConfig := p.GetSegmentConfig().UploadConfig; uploadConfig != nil {
// download(t, uploadConfig, localPlaylistPath+".json", plName+".json")
// }
// }

// func (r *Runner) verifySegmentOutput(t *testing.T, p *config.PipelineConfig, filenameSuffix livekit.SegmentedFileSuffix, plName string, plLocation string, segmentCount int, res *livekit.EgressInfo, plType m3u8.PlaylistType) {
// require.NotEmpty(t, plName)
// require.NotEmpty(t, plLocation)

// storedPlaylistPath := plName
// localPlaylistPath := plName

// // download from cloud storage
// if uploadConfig := p.GetSegmentConfig().UploadConfig; uploadConfig != nil {
// localPlaylistPath = path.Join(r.FilePrefix, storedPlaylistPath)
// download(t, uploadConfig, localPlaylistPath, storedPlaylistPath)
// if plType == m3u8.PlaylistTypeEvent {
// // Only download segments once
// base := storedPlaylistPath[:len(storedPlaylistPath)-5]
// for i := 0; i < int(segmentCount); i++ {
// cloudPath := fmt.Sprintf("%s_%05d.ts", base, i)
// localPath := path.Join(r.FilePrefix, cloudPath)
// download(t, uploadConfig, localPath, cloudPath)
// }
// }
// }

// verify
// verify(t, localPlaylistPath, p, res, types.EgressTypeSegments, r.Muting, r.sourceFramerate, plType == m3u8.PlaylistTypeLive)
// }
2 changes: 1 addition & 1 deletion test/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ func (r *Runner) runMultipleTest(
r.verifySegments(t, p, filenameSuffix, res, false)
}
if images {
r.verifyImages(t, p, 0, res)
r.verifyImages(t, p, res)
}
}
27 changes: 20 additions & 7 deletions test/track_composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ func (r *Runner) testTrackCompositeImages(t *testing.T) {
t.Run("4D/TrackComposite/Images", func(t *testing.T) {
for _, test := range []*testCase{
{
name: "VP8",
name: "H264",
audioCodec: types.MimeTypeOpus,
videoCodec: types.MimeTypeH264,
filename: "tcs_{publisher_identity}_vp8_{time}",
filename: "tc_{publisher_identity}_h264",
},
} {
r.runTrackTest(t, test.name, test.audioCodec, test.videoCodec,
Expand All @@ -266,11 +266,24 @@ func (r *Runner) testTrackCompositeImages(t *testing.T) {
aID = audioTrackID
}

imageOutput := &livekit.ImageOutput{
CaptureInterval: 5,
Width: 1280,
Height: 720,
FilenamePrefix: path.Join(r.FilePrefix, test.filename),
var imageOutput *livekit.ImageOutput
if r.S3Upload != nil {
imageOutput = &livekit.ImageOutput{
CaptureInterval: 5,
Width: 1280,
Height: 720,
FilenamePrefix: path.Join(uploadPrefix, test.filename),
Output: &livekit.ImageOutput_S3{
S3: r.S3Upload,
},
}
} else {
imageOutput = &livekit.ImageOutput{
CaptureInterval: 5,
Width: 1280,
Height: 720,
FilenamePrefix: path.Join(r.FilePrefix, test.filename),
}
}

trackRequest := &livekit.TrackCompositeEgressRequest{
Expand Down

0 comments on commit 0a55a3d

Please sign in to comment.