Skip to content

Commit

Permalink
feat: Do not use libaom options, prefer libsvt-av1
Browse files Browse the repository at this point in the history
libsvt-av1 can encode in real time with no special options, and does
not recognize the options we used in libaom to get as little as 0.2x
encoding in our "Player History" live stream.

From now on, let's assume that anyone who wants to use AV1 is using
libsvt-av1, which seems to be the only reasonable encoder.  If someone
is still using libaom, it will still work, but it will be using slower
default settings.
  • Loading branch information
joeyparrish committed Sep 12, 2023
1 parent 2f38022 commit 88f4f17
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions streamer/transcoder_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,25 +284,6 @@ def _encode_video(self, stream: VideoOutputStream, input: Input) -> List[str]:
# speeds up encoding, balancing against quality
'-speed', '2',
]
elif stream.codec == VideoCodec.AV1:
args += [
# According to graphs at https://bit.ly/2BmIVt6, this AV1 setting
# results in almost no reduction in quality (0.8%), but a significant
# boost in speed (20x).
'-cpu-used', '8',
# According to the wiki (https://trac.ffmpeg.org/wiki/Encode/AV1),
# this allows threaded encoding in AV1, which makes better use of CPU
# resources and speeds up encoding. This will be ignored by libaom
# before version 1.0.0-759-g90a15f4f2, and so there may be no benefit
# unless libaom and ffmpeg are built from source (as of Oct 2019).
'-row-mt', '1',
# According to the wiki (https://trac.ffmpeg.org/wiki/Encode/AV1),
# this allows for threaded _decoding_ in AV1, which will provide a
# smoother playback experience for the end user.
'-tiles', '2x2',
# AV1 is considered "experimental".
'-strict', 'experimental',
]

keyframe_interval = int(self._pipeline_config.segment_size *
input.frame_rate)
Expand Down

0 comments on commit 88f4f17

Please sign in to comment.