Skip to content

Commit

Permalink
Use STV-AV1 encoder for AV1.
Browse files Browse the repository at this point in the history
STV-AV1 is much, much faster than the reference libaom encoder. In most real-world cases libaom is too slow to be practical, often struggling to achieve 0.1fps for 1080p content.

I suspect this is what was intended in f1ca179 when AV1 support was originally added as it sets the `-svtav1-params` flag which is ignored unless using the STV-AV1 encoder. Furthermore there is lots of discussion about STV-AV1 in the PR thread.
  • Loading branch information
kevincox committed Oct 14, 2024
1 parent 452ce73 commit 5becd5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/services/media.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ describe(MediaService.name, () => {
expect.objectContaining({
inputOptions: expect.any(Array),
outputOptions: expect.arrayContaining([
'-c:v av1',
'-c:v libsvtav1',
'-movflags faststart',
'-fps_mode passthrough',
'-map 0:0',
Expand Down
4 changes: 4 additions & 0 deletions server/src/utils/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ export class VP9Config extends BaseConfig {
}

export class AV1Config extends BaseConfig {
getVideoCodec(): string {
return 'libsvtav1';
}

getPresetOptions() {
const speed = this.getPresetIndex() + 4; // Use 4 as slowest, giving us an effective range of 4-12 which is far more useful than 0-8
if (speed >= 0) {
Expand Down

0 comments on commit 5becd5f

Please sign in to comment.