Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Use veryfast preset for default transcoding profile

Chocobozzza8537c622ed8
diff --git a/server/lib/video-transcoding-profiles.ts b/server/lib/video-transcoding-profiles.ts
index 76d38b6cae..b7f9178c4c 100644
--- a/server/lib/video-transcoding-profiles.ts
+++ b/server/lib/video-transcoding-profiles.ts
@@ -28,6 +28,7 @@ const defaultX264VODOptionsBuilder: EncoderOptionsBuilder = async ({ input, reso
return {
outputOptions: [
+ `-preset veryfast`,
`-r ${fps}`,
`-maxrate ${targetBitrate}`,
`-bufsize ${targetBitrate * 2}`
@@ -40,6 +41,7 @@ const defaultX264LiveOptionsBuilder: EncoderOptionsBuilder = async ({ resolution
return {
outputOptions: [
+ `-preset veryfast`,
`${buildStreamSuffix('-r:v', streamNum)} ${fps}`,
`${buildStreamSuffix('-b:v', streamNum)} ${targetBitrate}`,
`-maxrate ${targetBitrate}`,
diff --git a/server/tests/plugins/plugin-transcoding.ts b/server/tests/plugins/plugin-transcoding.ts
index 90ef01b92c..ecea21e694 100644
--- a/server/tests/plugins/plugin-transcoding.ts
+++ b/server/tests/plugins/plugin-transcoding.ts
@@ -203,10 +203,10 @@ describe('Test transcoding plugins', function () {
it('Should use the new vod encoders', async function () {
this.timeout(240000)
- const videoUUID = (await uploadVideoAndGetId({ server, videoName: 'video' })).uuid
+ const videoUUID = (await uploadVideoAndGetId({ server, videoName: 'video', fixture: 'video_short_240p.mp4' })).uuid
await waitJobs([ server ])
- const path = buildServerDirectory(server, join('videos', videoUUID + '-720.mp4'))
+ const path = buildServerDirectory(server, join('videos', videoUUID + '-240.mp4'))
const audioProbe = await getAudioStream(path)
expect(audioProbe.audioStream.codec_name).to.equal('opus')
diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts
index 392eddcc5a..110552c77a 100644
--- a/shared/extra-utils/videos/videos.ts
+++ b/shared/extra-utils/videos/videos.ts
@@ -641,10 +641,12 @@ async function uploadVideoAndGetId (options: {
nsfw?: boolean
privacy?: VideoPrivacy
token?: string
+ fixture?: string
}) {
const videoAttrs: any = { name: options.videoName }
if (options.nsfw) videoAttrs.nsfw = options.nsfw
if (options.privacy) videoAttrs.privacy = options.privacy
+ if (options.fixture) videoAttrs.fixture = options.fixture
const res = await uploadVideo(options.server.url, options.token || options.server.accessToken, videoAttrs)