|
| 1 | +#!/usr/bin/env python |
| 2 | +# Copyright 2024 TeiaCare |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +from conans import ConanFile |
| 17 | + |
| 18 | +class FFMPEG(ConanFile): |
| 19 | + requires = "ffmpeg/6.1.1" |
| 20 | + generators = "CMakeDeps" |
| 21 | + settings = "os", "compiler", "build_type", "arch" |
| 22 | + options = {"shared": [True, False], "fPIC": [True, False]} |
| 23 | + default_options = {"shared": False, "fPIC": True} |
| 24 | + |
| 25 | + def config_options(self): |
| 26 | + if self.settings.os == "Windows": |
| 27 | + del self.options.fPIC |
| 28 | + |
| 29 | + def configure(self): |
| 30 | + if self.options.shared: |
| 31 | + del self.options.fPIC |
| 32 | + |
| 33 | + self.options["ffmpeg"].disable_all_encoders=True |
| 34 | + self.options["ffmpeg"].enable_encoders='libx264' |
| 35 | + |
| 36 | + self.options["ffmpeg"].disable_all_decoders=True |
| 37 | + self.options["ffmpeg"].enable_decoders='h264,hevc,mpegvideo,mpeg1video,mpeg2video,mpeg4,mjpeg' |
| 38 | + |
| 39 | + self.options["ffmpeg"].disable_all_muxers=True |
| 40 | + self.options["ffmpeg"].enable_muxers='rtp,rtsp,mov,h264,hevc,matroska,mp4' |
| 41 | + |
| 42 | + self.options["ffmpeg"].disable_all_demuxers=True |
| 43 | + self.options["ffmpeg"].enable_demuxers='rtp,rtsp,h264,hevc,mov,matroska,mjpeg,mpeg,mpegvideo' |
| 44 | + |
| 45 | + self.options["ffmpeg"].disable_all_protocols=True |
| 46 | + self.options["ffmpeg"].enable_protocols='rtp,srtp,udp,tcp,file,async' |
| 47 | + |
| 48 | + self.options["ffmpeg"].disable_all_parsers=True |
| 49 | + self.options["ffmpeg"].disable_all_hardware_accelerators=True |
| 50 | + self.options["ffmpeg"].disable_all_bitstream_filters=True |
| 51 | + self.options["ffmpeg"].disable_all_devices=True |
| 52 | + self.options["ffmpeg"].disable_all_filters=True |
| 53 | + |
| 54 | + self.options["ffmpeg"].avformat=True |
| 55 | + self.options["ffmpeg"].avcodec=True |
| 56 | + self.options["ffmpeg"].swscale=True |
| 57 | + self.options["ffmpeg"].avdevice=False |
| 58 | + self.options["ffmpeg"].avfilter=False |
| 59 | + self.options["ffmpeg"].swresample=False |
| 60 | + |
| 61 | + self.options["ffmpeg"].with_asm=True |
| 62 | + self.options["ffmpeg"].with_zlib=True |
| 63 | + self.options["ffmpeg"].with_bzip2=True |
| 64 | + self.options["ffmpeg"].with_lzma=False |
| 65 | + self.options["ffmpeg"].with_libiconv=False |
| 66 | + self.options["ffmpeg"].with_freetype=False |
| 67 | + self.options["ffmpeg"].with_openjpeg=False |
| 68 | + self.options["ffmpeg"].with_openh264=True |
| 69 | + self.options["ffmpeg"].with_opus=False |
| 70 | + self.options["ffmpeg"].with_vorbis=False |
| 71 | + self.options["ffmpeg"].with_zeromq=False |
| 72 | + self.options["ffmpeg"].with_sdl=False |
| 73 | + self.options["ffmpeg"].with_libx264=True |
| 74 | + self.options["ffmpeg"].with_libx265=True |
| 75 | + self.options["ffmpeg"].with_libvpx=False |
| 76 | + self.options["ffmpeg"].with_libmp3lame=False |
| 77 | + self.options["ffmpeg"].with_libfdk_aac=False |
| 78 | + self.options["ffmpeg"].with_libwebp=False |
| 79 | + self.options["ffmpeg"].with_ssl='openssl' |
| 80 | + self.options["ffmpeg"].with_xcb=False |
| 81 | + self.options["ffmpeg"].with_programs=True |
| 82 | + self.options["ffmpeg"].with_libsvtav1=False |
| 83 | + self.options["ffmpeg"].with_libaom=False |
| 84 | + self.options["ffmpeg"].with_libdav1d=False |
| 85 | + |
| 86 | + if self.settings.os == "Linux": |
| 87 | + self.options["ffmpeg"].with_libalsa=False |
| 88 | + self.options["ffmpeg"].with_pulse=False |
| 89 | + self.options["ffmpeg"].with_vaapi=False |
| 90 | + self.options["ffmpeg"].with_vdpau=False |
| 91 | + self.options["ffmpeg"].with_vulkan=False |
0 commit comments