forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
38 lines (29 loc) · 1.19 KB
/
config.py
File metadata and controls
38 lines (29 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def ffmpeg(source, version=None, requires=None, default=False, alias=[]):
"""
Configure container to install FFmpeg utilities from one of these sources:
* apt - the built-in OS version from Ubuntu apt repo
* git - pulls/builds a version from github (or jetson-ai-lab build cache)
* jetpack - version from NVIDIA JetPack with hw decode support for Jetson
The 'source' argument should be string with one 'apt', 'git', 'jetpack'
This returns a dict with the configuration to build container for ffmpeg.
"""
pkg = package.copy()
if requires:
pkg['requires'] = requires
if source == 'git':
if not version:
raise ValueError('ffmpeg version is required to build from git sources')
pkg['build_args'] = {'FFMPEG_VERSION': version}
pkg['depends'] = pkg['depends'] + ['cmake', 'video-codec-sdk']
tag = version
else:
tag = source
pkg['name'] = f'ffmpeg:{tag}'
pkg['alias'] = alias + (['ffmpeg'] if default else [])
pkg['build_args'] = {**pkg.get('build_args', {}), 'FFMPEG_INSTALL': source}
return pkg
package = [
# ffmpeg('apt', default=True),
ffmpeg('git', version='8.0', alias=['ffmpeg:git'], default=True),
ffmpeg('jetpack', requires='==36.*'),
]