, :
++ -std = ++ 14 -pthread -Iinclude -Iinclude/ext -Llib test/mytest.cpp -lValkka -g -o bin/mytest -Wl, - unresolved-symbols = ignore-all
.
, , . , ? ?
, ffmpeg, ffmpeg configure script. , python script, . , :
"""
* Creates script "run_configure.bash" that launches ffmpeg "configure" script with correct parameters (enabling/disabling stuff)
* Run in the same directory where you have ffmpeg configure script
"""
import subprocess
import os
import re
def features(switch, adstring="", remove=[]):
p=subprocess.Popen(["./configure",switch],stdout=subprocess.PIPE)
st=p.stdout.read()
fst=""
for s in st.split():
ss=s.decode("utf-8")
ok=True
for rem in remove:
if (ss.find(rem)!=-1):
ok=False
if ok: fst+=adstring+ss+" "
return fst
def disable_external():
p=subprocess.Popen(["./configure","-h"],stdout=subprocess.PIPE)
st=p.stdout.read().decode("utf-8")
i1=st.find("themselves, not all their features will necessarily be usable by FFmpeg.")
i2=st.find("Toolchain options:")
st=st[i1:i2]
""" # debugging ..
print(st)
stop
"""
p=re.compile('--(enable|disable)-(\S*)')
switches=[]
for sw in p.findall(st):
if (sw[1] not in switches):
switches.append(sw[1])
fst=""
for sw in switches:
fst+="--disable-"+sw+" "
return fst
st ="./configure "
st+="--disable-everything --disable-doc --disable-gpl --disable-pthreads --enable-static --enable-shared "
st+= disable_external()
st+= features("--list-decoders",adstring="--enable-decoder=", remove=["vdpau","crystalhd","zlib"])
st+= features("--list-muxers", adstring="--enable-muxer=")
st+= features("--list-demuxers",adstring="--enable-demuxer=")
st+= features("--list-parsers", adstring="--enable-parser=")
f=open("run_configure.bash","w")
f.write("#!/bin/bash\n")
f.write(st+"\n")
f.close()
os.system("chmod a+x run_configure.bash")
print("\nNext run ./run_configure.bash\n")
"""
For cleaning up .a and .so files, use
find -name *.a -exec ls {} \;
find -name *.so* -exec ls {} \;
"""
, - . python3.