Codecs
Info
Most of the parameters set for the codecs are those established by default in ffmpeg official docs. However, some parameters have been modified in order to achieve an improvement in performance.
# HLS default constants
# https://developer.apple.com/documentation/http-live-streaming/hls-authoring-specification-for-apple-devices
HLS_TIME = 10
HLS_LIST_SIZE = 0
HLS_TAG_VIDEO_FORMAT = 'hvc1'
HLS_PLAYLIST_TYPE = 'vod'
DEFAULT_AUDIO_CODEC = 'aac'
# The range of the CRF scale is 0–51, where 0 is lossless (higher quality)
DEFAULT_CRF = 0
# The preset determines compression efficiency and therefore affects encoding speed
# This option itemizes a range of choices from veryfast (best speed) to
# veryslow (best quality).
DEFAULT_PRESET = 'medium'
# keyframes minimum every 100 frames
DEFAULT_KEY_MIN = 100
# maximum amount of GOP size, maximum every 100 frames there will be a
# keyframe, together with -keyint_min this gives a keyframe every 100
# frames
DEFAULT_GOP = 100
# ffmpeg has scene detection. 0 (stands for false)
DEFAULT_SC_THRESHOLD = 0
Copy
Used to copy
the codec from the source to the output.
Special value copy (output only) to indicate that the stream is not to be re-encoded.
Usage:
copy_audio_stream = Copy("a")
copy_video_stream = Copy("v")
Source code in nucleus/sdk/processing/video/codecs.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
H264
Represents a H264 codec.
Usage:
h264 = H264()
Source code in nucleus/sdk/processing/video/codecs.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
HEVC
Represents a HEVC codec.
Usage:
hevc = HEVC()
Source code in nucleus/sdk/processing/video/codecs.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
VP9
Represents a VP9 codec.
Usage:
vp9 = VP9()
Source code in nucleus/sdk/processing/video/codecs.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|