
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (55)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (8367)
-
Error installing package in anaconda : Attempted to make prefix record for unknown package type
25 janvier 2020, par ashwinidsI’m getting the error below for doing any operation install, update or uninstall
ERROR conda.core.link:_execute(700) : An error occurred while
uninstalling package ’::ffmpeg-3.2.4-2’. Rolling back
transaction : doneValueError(’Attempted to make prefix record for unknown package type :
ffmpeg-3.2.4-2’,)Details about the environment :
OS : ubuntu 18.04
python version : intelpython3Conda info
active environment : base
active env location : /home/p****/intelpython3
shell level : 1
user config file : /home/p****/.condarc
populated config files : /home/p****/.condarc
conda version : 4.7.12
conda-build version : not installed
python version : 3.6.8.final.0
virtual packages : __cuda=10.1
base environment : /home/p****/intelpython3 (writable)
channel URLs : https://conda.anaconda.org/intel/linux-64
https://conda.anaconda.org/intel/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /home/p****/intelpython3/pkgs
/home/p****/.conda/pkgs
envs directories : /home/p****/intelpython3/envs
/home/p****/.conda/envs
platform : linux-64
user-agent : conda/4.7.12 requests/2.20.1 CPython/3.6.8 Linux/5.0.0-36-generic ubuntu/18.04.3 glibc/2.27
UID:GID : 1000:1000
netrc file : None
offline mode : FalseConda list
# packages in environment at /home/p****/intelpython3:
#
# Name Version Build Channel
_tflow_select 2.1.0 gpu anaconda
absl-py 0.8.0 py36_0 anaconda
affine 2.3.0 pypi_0 pypi
asn1crypto 0.24.0 py36_3 intel
astor 0.8.0 py36_0 anaconda
atomicwrites 1.3.0 pypi_0 pypi
attrs 19.3.0 pypi_0 pypi
audioread 2.1.6 py36_0 <unknown>
awscli 1.16.292 pypi_0 pypi
backcall 0.1.0 py36_2 <unknown>
backports 1.0 py36_9 <unknown>
bayesian-optimization 1.0.1 pypi_0 pypi
bleach 2.1.3 py36_2 <unknown>
boto3 1.10.19 pypi_0 pypi
botocore 1.13.28 pypi_0 pypi
bzip2 1.0.6 17 intel
c-ares 1.15.0 h7b6447c_1001 anaconda
causalgraphicalmodels 0.0.4 pypi_0 pypi
certifi 2018.1.18 py36_2 intel
cffi 1.11.5 py36_3 intel
chardet 3.0.4 py36_3 intel
click 7.0 pypi_0 pypi
click-plugins 1.1.1 pypi_0 pypi
cligj 0.5.0 pypi_0 pypi
colorama 0.4.1 pypi_0 pypi
conda 4.7.12 py36_0
conda-env 2.6.0 1
conda-package-handling 1.6.0 py36h7b6447c_0 anaconda
cryptography 2.3 py36_1 intel
cudatoolkit 10.1.243 h6bb024c_0
cudnn 7.6.0 cuda10.1_0 anaconda
cupti 10.1.168 0 anaconda
cvxopt 1.2.3 pypi_0 pypi
cycler 0.10.0 py36_7 intel
cython 0.29.6 py36h7b7c402_0 intel
daal 2019.4 intel_243 <unknown>
daal4py 2019.4 py36h7b7c402_0 intel
dbus 1.13.12 h746ee38_0
decorator 4.3.0 py36_3 <unknown>
descartes 1.1.0 pypi_0 pypi
docutils 0.15.2 pypi_0 pypi
dowhy 0.1.1 pypi_0 pypi
entrypoints 0.2.3 py36_2 <unknown>
expat 2.2.6 he6710b0_0
ffmpeg 3.2.4 2 <unknown>
fiona 1.8.11 pypi_0 pypi
fontconfig 2.12.6 h49f89f6_0
freetype 2.8 hab7d2ae_1
funcsigs 1.0.2 py36_7 intel
gast 0.3.2 py_0 anaconda
geopandas 0.6.2 pypi_0 pypi
get_terminal_size 1.0.0 py36_7 <unknown>
glib 2.63.1 h5a9c865_0
google-pasta 0.1.7 py_0 anaconda
grpcio 1.14.1 py36h9ba97e2_0 anaconda
gst-plugins-base 1.12.4 h33fb286_0
gstreamer 1.12.4 hb53b477_0
h5py 2.9.0 py36h7918eee_0 anaconda
hdf5 1.10.4 hb1b8bf9_0 anaconda
html5lib 1.0.1 py36_4 <unknown>
icc_rt 2019.4 intel_243 <unknown>
icu 58.2 h9c2bf20_1
idna 2.6 py36_3 intel
imageio 2.6.1 pypi_0 pypi
imgaug 0.2.6 pypi_0 pypi
impi_rt 2019.4 intel_243 <unknown>
importlib-metadata 0.23 pypi_0 pypi
intel-openmp 2019.4 intel_243 <unknown>
intelpython 2019.4 0 intel
ipp 2019.4 intel_243 <unknown>
ipykernel 4.6.1 py36_2 <unknown>
ipython 6.3.1 py36_3 <unknown>
ipython_genutils 0.2.0 py36_2 <unknown>
jedi 0.12.0 py36_2 <unknown>
jinja2 2.10.3 pypi_0 pypi
jmespath 0.9.4 pypi_0 pypi
joblib 0.13.2 pypi_0 pypi
jpeg 9b h024ee3a_2
json5 0.8.5 pypi_0 pypi
jsonschema 3.2.0 pypi_0 pypi
jupyter 1.0.0 py36_7 intel
jupyter_client 5.1.0 py36_5 <unknown>
jupyter_console 5.1.0 py36_2 <unknown>
jupyter_core 4.4.0 py36_6 <unknown>
jupyterlab 1.2.3 pypi_0 pypi
jupyterlab-server 1.0.6 pypi_0 pypi
keras 2.3.1 pypi_0 pypi
keras-applications 1.0.8 py_0 anaconda
keras-bert 0.80.0 pypi_0 pypi
keras-embed-sim 0.7.0 pypi_0 pypi
keras-layer-normalization 0.14.0 pypi_0 pypi
keras-multi-head 0.22.0 pypi_0 pypi
keras-pos-embd 0.11.0 pypi_0 pypi
keras-position-wise-feed-forward 0.6.0 pypi_0 pypi
keras-preprocessing 1.1.0 py_1 anaconda
keras-rectified-adam 0.17.0 pypi_0 pypi
keras-self-attention 0.41.0 pypi_0 pypi
keras-transformer 0.31.0 pypi_0 pypi
kiwisolver 1.0.1 py36_2 intel
libffi 3.2.1 11 intel
libgcc-ng 9.1.0 hdf63c60_0 anaconda
libgfortran-ng 7.3.0 hdf63c60_0 anaconda
libiconv 1.14 4 <unknown>
libpng 1.6.36 2 intel
libprotobuf 3.9.2 hd408876_0 anaconda
librosa 0.6.3 pypi_0 pypi
libsodium 1.0.16 3 <unknown>
libstdcxx-ng 9.1.0 hdf63c60_0 anaconda
libtiff 4.0.9 he85c1e1_1
libxcb 1.13 h1bed415_1
libxml2 2.9.8 hf84eae3_0
lightgbm 2.3.1 pypi_0 pypi
llvmlite 0.27.1 py36_0 intel
markdown 3.1.1 py36_0 anaconda
markupsafe 1.0 py36_3 <unknown>
matplotlib 2.1.0 py36hba5de38_0
mercantile 1.1.2 pypi_0 pypi
metaflow 2.0.0 pypi_0 pypi
mistune 0.8.3 py36_2 <unknown>
mkl 2019.4 intel_243 <unknown>
mkl-service 1.0.0 py36h7b7c402_11 intel
mkl_fft 1.0.11 py36h7b7c402_2 intel
mkl_random 1.0.2 py36h7b7c402_4 intel
more-itertools 7.2.0 pypi_0 pypi
mpi4py 3.0.0 py36_3 intel
mpmath 1.1.0 pypi_0 pypi
munch 2.5.0 pypi_0 pypi
nbconvert 5.2.1 py36_2 <unknown>
nbformat 4.4.0 py36_2 <unknown>
networkx 2.4 pypi_0 pypi
ninja 1.9.0 py36hfd86e86_0
noisyopt 0.2.2 pypi_0 pypi
notebook 5.2.2 py36_1 intel
numba 0.42.1 np116py36_2 intel
numexpr 2.6.8 py36_2 intel
numpy 1.16.2 py36h7b7c402_0 intel
numpy-base 1.16.2 py36_0 intel
oauthlib 3.1.0 pypi_0 pypi
olefile 0.46 py_0
openssl 1.0.2r 2 intel
packaging 19.2 pypi_0 pypi
pandas 0.24.1 py36_3 intel
pandocfilters 1.4.1 py36_2 <unknown>
parso 0.2.0 py36_2 <unknown>
path.py 11.0.1 py36_2 <unknown>
pcre 8.43 he6710b0_0
pexpect 4.2.1 py36_4 <unknown>
pickleshare 0.7.4 py36_3 <unknown>
pillow 6.2.1 pypi_0 pypi
pip 19.3.1 pypi_0 pypi
pluggy 0.13.1 pypi_0 pypi
prompt_toolkit 1.0.15 py36_2 <unknown>
protobuf 3.9.2 py36he6710b0_0 anaconda
ptyprocess 0.5.2 py36_2 <unknown>
pulp 2.0 pypi_0 pypi
py 1.8.0 pypi_0 pypi
pyasn1 0.4.8 pypi_0 pypi
pycosat 0.6.3 py36_3 intel
pycparser 2.18 py36_2 intel
pydot 1.4.1 pypi_0 pypi
pyeditline 2.0.0 py36_0 intel
pygments 2.2.0 py36_5 <unknown>
pygmy 0.2.0 pypi_0 pypi
pyopenssl 17.5.0 py36_2 intel
pyparsing 2.2.0 py36_2 intel
pyportfolioopt 0.4.3 pypi_0 pypi
pyproj 2.4.2.post1 pypi_0 pypi
pyqt 5.6.0 py36h22d08a2_6
pyrsistent 0.15.6 pypi_0 pypi
pysocks 1.6.7 py36_1 intel
pytesseract 0.3.0 pypi_0 pypi
pytest 4.6.6 pypi_0 pypi
python 3.6.8 7 intel
python-dateutil 2.6.0 py36_12 intel
python-graphviz 0.13 pypi_0 pypi
pytorch 1.3.1 py3.6_cuda10.1.243_cudnn7.6.3_0 pytorch
pytz 2018.4 py36_3 intel
pywavelets 1.1.1 pypi_0 pypi
pyyaml 4.1 py36_3 intel
pyzmq 16.0.2 py36_6 <unknown>
qt 5.6.2 hd25b39d_14
rasterio 1.1.1 pypi_0 pypi
regex 2019.11.1 pypi_0 pypi
requests 2.20.1 py36_1 intel
requests-oauthlib 1.3.0 pypi_0 pypi
resampy 0.2.1 pypi_0 pypi
rio-cogeo 1.1.6 pypi_0 pypi
rsa 3.4.2 pypi_0 pypi
ruamel_yaml 0.11.14 py36_4 intel
s3transfer 0.2.1 pypi_0 pypi
sacremoses 0.0.35 pypi_0 pypi
scikit-image 0.16.2 pypi_0 pypi
scikit-learn 0.20.3 py36h7b7c402_5 intel
scipy 1.3.3 pypi_0 pypi
seaborn 0.9.0 pypi_0 pypi
sentencepiece 0.1.83 pypi_0 pypi
setuptools 39.0.1 py36_0 intel
shapely 1.6.4.post2 pypi_0 pypi
simplegeneric 0.8.1 py36_7 <unknown>
sip 4.18.1 py36hf484d3e_2
six 1.11.0 py36_3 intel
smp 0.1.4 py36_0 intel
snuggs 1.4.7 pypi_0 pypi
sqlite 3.27.2 4 intel
supermercado 0.0.5 pypi_0 pypi
sympy 1.4 pypi_0 pypi
tbb 2019.6 intel_243 <unknown>
tbb4py 2019.6 py36_intel_0 <unknown>
tcl 8.6.4 24 intel
tensorboard 1.14.0 py36hf484d3e_0 anaconda
tensorflow 1.14.0 gpu_py36h3fb9ad6_0 anaconda
tensorflow-base 1.14.0 gpu_py36he45bfe2_0 anaconda
tensorflow-estimator 1.14.0 py_0 anaconda
tensorflow-gpu 1.14.0 h0d30ee6_0 anaconda
termcolor 1.1.0 py36_1 anaconda
terminado 0.8.1 py36_2 <unknown>
testpath 0.3.1 py36_2 <unknown>
tk 8.6.4 29 intel
torchvision 0.4.2 py36_cu101 pytorch
tornado 4.5.2 py36_5 <unknown>
tqdm 4.36.1 py_0 anaconda
traitlets 4.3.2 py36_3 <unknown>
transformers 2.1.1 pypi_0 pypi
tweepy 3.8.0 pypi_0 pypi
urllib3 1.22 pypi_0 pypi
wcwidth 0.1.7 py36_6 <unknown>
webencodings 0.5.1 py36_0 <unknown>
werkzeug 0.16.0 py_0 anaconda
wheel 0.31.0 py36_3 intel
widgetsnbextension 3.2.0 py36_1 <unknown>
wrapt 1.11.2 py36h7b6447c_0 anaconda
x264 20131218 0 <unknown>
xgboost 0.81 py36_0 intel
xz 5.2.3 2 intel
yaml 0.1.7 2 intel
zipp 0.6.0 pypi_0 pypi
zlib 1.2.11 5 intel
</unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown></unknown> -
FFMPEG Audio/video out of sync after cutting and concatonating even after transcoding
4 mai 2020, par Ham789I am attempting to take cuts from a set of videos and concatonate them together with the concat demuxer.



However, the audio is out of sync of the video in the output. The audio seems to drift further out of sync as the video progresses. Interestingly, if I click to seek another time in the video with the progress bar on the player, the audio becomes synced up with the video but then gradually drifts out of sync again. Seeking to a new time in the player seems to reset the audio/video. It is like they are being played back at different rates or something. I get this behaviour in both Quicktime and VLC players.



For each video, I decode it, trim a clip from it and then encode it to 4k resolution at 25 fps with its audio :



ffmpeg -ss 0.5 -t 0.5 -i input_video1.mp4 -r 25 -vf scale=3840:2160 output_video1.mp4



I then take each of these videos and concatonate them together with the concat demuxer :



ffmpeg -f concat -safe 0 -i cut_videos.txt -c copy -y output.mp4



I am taking short cuts of each video (approximately 0.5s)



I am using Python's subprocess to automate the cutting and concatonating of the videos.



I am not sure if this happens because of the trimming or concatenation steps but when I play back the intermediate cut video files (
output_video1.mp4
in the above command), there seems to be some silence before the audio comes in at the start of the video.


When I concatonate the videos, I sometimes get a lot of these warnings however the audio still becomes out of sync even when I do not get them :



[mp4 @ 0000021a252ce080] Non-monotonous DTS in output stream 0:1; previous: 51792, current: 50009; changing to 51793. This may result in incorrect timestamps in the output file.



From this post, it seems to be a problem with cutting the videos and their timestamps. The solution proposed in the post is to decode, cut and then encode the video however I am already doing that.



How can I ensure the audio and video are in sync ? Am I transcoding incorrectly ? This seems to be the only solution I can find online however it does not seem to work.



UPDATE :



I took inspiration from this post and seperated the audio and video from
output_video1.mp4
using :


ffmpeg -i output_video1.mp4 -acodec copy -vn video.mp4



and



ffmpeg -i output_video1.mp4 -vcodec copy -an audio.mp4



I then compared the durations of
video.mp4
andaudio.mp4
and got 0.57s and 0.52s respectively. Since the video is longer, this explains why there is a period of silence in the videos. The post then suggests transcoding is the solution however as you can see from the code above that does not work for me.


Sample Output Log for the Trim Command



built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.0.1.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.0.1.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input_video1.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.29.100
 Duration: 00:00:04.06, start: 0.000000, bitrate: 14266 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 3840x2160, 14268 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : Core Media Video
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 94 kb/s (default)
 Metadata:
 handler_name : Core Media Audio
File 'output_video1.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7fcae4001e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fcae4001e00] profile High, level 5.1
[libx264 @ 0x7fcae4001e00] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output_video1.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.29.100
 Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 3840x2160, q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
 Metadata:
 handler_name : Core Media Video
 encoder : Lavc58.54.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 69 kb/s (default)
 Metadata:
 handler_name : Core Media Audio
 encoder : Lavc58.54.100 aac
frame= 14 fps=7.0 q=-1.0 Lsize= 928kB time=00:00:00.51 bitrate=14884.2kbits/s dup=0 drop=1 speed=0.255x 
video:922kB audio:5kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.194501%
[libx264 @ 0x7fcae4001e00] frame I:1 Avg QP:21.06 size:228519
[libx264 @ 0x7fcae4001e00] frame P:4 Avg QP:22.03 size: 85228
[libx264 @ 0x7fcae4001e00] frame B:9 Avg QP:22.88 size: 41537
[libx264 @ 0x7fcae4001e00] consecutive B-frames: 14.3% 0.0% 0.0% 85.7%
[libx264 @ 0x7fcae4001e00] mb I I16..4: 27.6% 64.3% 8.1%
[libx264 @ 0x7fcae4001e00] mb P I16..4: 9.1% 10.7% 0.2% P16..4: 48.5% 7.3% 3.9% 0.0% 0.0% skip:20.2%
[libx264 @ 0x7fcae4001e00] mb B I16..4: 1.1% 1.0% 0.0% B16..8: 44.5% 2.9% 0.2% direct: 8.3% skip:42.0% L0:45.6% L1:53.2% BI: 1.2%
[libx264 @ 0x7fcae4001e00] 8x8 transform intra:58.2% inter:93.4%
[libx264 @ 0x7fcae4001e00] coded y,uvDC,uvAC intra: 31.4% 62.2% 5.2% inter: 11.4% 30.9% 0.0%
[libx264 @ 0x7fcae4001e00] i16 v,h,dc,p: 15% 52% 12% 21%
[libx264 @ 0x7fcae4001e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 33% 32% 2% 2% 2% 4% 2% 4%
[libx264 @ 0x7fcae4001e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 39% 9% 3% 4% 4% 12% 3% 4%
[libx264 @ 0x7fcae4001e00] i8c dc,h,v,p: 43% 36% 18% 3%
[libx264 @ 0x7fcae4001e00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fcae4001e00] ref P L0: 69.3% 8.0% 14.8% 7.9%
[libx264 @ 0x7fcae4001e00] ref B L0: 88.1% 9.2% 2.6%
[libx264 @ 0x7fcae4001e00] ref B L1: 90.2% 9.8%
[libx264 @ 0x7fcae4001e00] kb/s:13475.29
[aac @ 0x7fcae4012400] Qavg: 125.000```



-
Statically built FFMPEG binary segmentation fault
12 février 2020, par stevendesuI want to create a custom build of FFMPEG which rips out everything except for the ability to transmux HLS videos to MP4, and I need this build to be 100% static with no external dependencies
I tried using the following configuration :
./configure \
--extra-cflags='-static -static-libstdc++ -static-libgcc' \
--extra-cxxflags='-static -static-libstdc++ -static-libgcc' \
--extra-ldflags='-static -static-libstdc++ -static-libgcc' \
--pkg-config-flags='--static' \
--enable-static \
--disable-shared \
--disable-runtime-cpudetect \
--disable-autodetect \
--disable-ffplay \
--disable-ffprobe \
--disable-doc \
--disable-avdevice \
--disable-swresample \
--disable-swscale \
--disable-postproc \
--disable-pthreads \
--disable-w32threads \
--disable-os2threads \
--enable-network \
--disable-dct \
--disable-dwt \
--disable-error-resilience \
--disable-lsp \
--disable-lzo \
--disable-mdct \
--disable-rdft \
--disable-fft \
--disable-faan \
--disable-pixelutils \
--disable-encoders \
--disable-decoders \
--disable-hwaccels \
--disable-muxers \
--enable-muxer=mov \
--enable-muxer=mp4 \
--disable-demuxers \
--enable-demuxer=hls \
--enable-demuxer=mpegts \
--enable-demuxer=h264 \
--enable-demuxer=aac \
--disable-parsers \
--enable-parser=h264 \
--enable-parser=aac \
--disable-bsfs \
--disable-protocols \
--enable-protocol=tcp \
--enable-protocol=tls \
--enable-protocol=http \
--enable-protocol=https \
--enable-protocol=hls \
--disable-indevs \
--disable-outdevs \
--disable-devices \
--disable-filters \
--disable-alsa \
--disable-appkit \
--disable-avfoundation \
--disable-bzlib \
--disable-coreimage \
--disable-iconv \
--disable-lzma \
--enable-openssl \
--disable-sndio \
--disable-sdl2 \
--disable-securetransport \
--disable-xlib \
--disable-zlib \
--disable-amf \
--disable-audiotoolbox \
--disable-cuda-llvm \
--disable-cuvid \
--disable-d3d11va \
--disable-dxva2 \
--disable-ffnvcodec \
--disable-nvdec \
--disable-nvenc \
--disable-v4l2-m2m \
--disable-vaapi \
--disable-vdpau \
--disable-videotoolbox \
--disable-debugThis looked about like what I wanted :
install prefix /usr/local
source path .
C compiler gcc
C library glibc
ARCH x86 (generic)
big-endian no
runtime cpu detection no
standalone assembly yes
x86 assembler nasm
MMX enabled yes
MMXEXT enabled yes
3DNow! enabled yes
3DNow! extended enabled yes
SSE enabled yes
SSSE3 enabled yes
AESNI enabled yes
AVX enabled yes
AVX2 enabled yes
AVX-512 enabled yes
XOP enabled yes
FMA3 enabled yes
FMA4 enabled yes
i686 features enabled yes
CMOV is fast yes
EBX available yes
EBP available yes
debug symbols no
strip symbols yes
optimize for size no
optimizations yes
static yes
shared no
postprocessing support no
network support yes
threading support no
safe bitstream reader yes
texi2html enabled no
perl enabled yes
pod2man enabled yes
makeinfo enabled no
makeinfo supports HTML no
External libraries:
openssl
External libraries providing hardware acceleration:
Libraries:
avcodec avfilter avformat avutil
Programs:
ffmpeg
Enabled decoders:
Enabled encoders:
Enabled hwaccels:
Enabled parsers:
aac h264
Enabled demuxers:
aac h264 hls mpegts
Enabled muxers:
mov mp4
Enabled protocols:
hls http https tcp tls
Enabled filters:
aformat anull atrim format hflip null transpose trim vflip
Enabled bsfs:
null
Enabled indevs:
Enabled outdevs:
License: LGPL version 2.1 or laterIt included several filters which I won’t ever need or use, but these filters are pulled in automatically if you don’t specify
--disable-avfilter
, and specifying--disable-avfilter
prevents theffmpeg
binary from being produced. So I’m stuck with those.Using these parameters and then running
make
, I received a binary that was about 5.9 MB in size and looked right :$> ldd ffmpeg
not a dynamic executableBut when I try to run it :
$> ./ffmpeg -version
Segmentation faultUsing valgrind to try and inspect the cause of the segmentation fault :
$> valgrind ./ffmpeg -version
.... lots of stuff ...
==61362== Jump to the invalid address stated on the next line
==61362== at 0x0: ???
==61362== by 0x70BB1B: ??? (in /src/FFmpeg/ffmpeg)
==61362== by 0x70B2E6: ??? (in /src/FFmpeg/ffmpeg)
==61362== by 0x4033F9: ??? (in /src/FFmpeg/ffmpeg)
==61362== by 0x1FFF000677: ???
==61362== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==61362==
==61362==
==61362== Process terminating with default action of signal 11 (SIGSEGV)
==61362== Bad permissions for mapped region at address 0x0
==61362== at 0x0: ???
==61362== by 0x70BB1B: ??? (in /src/FFmpeg/ffmpeg)
==61362== by 0x70B2E6: ??? (in /src/FFmpeg/ffmpeg)
==61362== by 0x4033F9: ??? (in /src/FFmpeg/ffmpeg)
==61362== by 0x1FFF000677: ???
==61362==
==61362== HEAP SUMMARY:
==61362== in use at exit: 0 bytes in 0 blocks
==61362== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==61362==
==61362== All heap blocks were freed -- no leaks are possible
==61362==
==61362== For counts of detected and suppressed errors, rerun with: -v
==61362== Use --track-origins=yes to see where uninitialised values come from
==61362== ERROR SUMMARY: 93 errors from 90 contexts (suppressed: 0 from 0)
Segmentation faultAttempting to access memory at location
0x0
sounds like trying to follow a null pointer. But I’m not sure how to fix this.gdb backtrace
When I first ran
gdb ./ffmpeg
gdb immediately gave me a segmentation fault and I wasn’t kicked into the gdb REPL, so I couldn’t investigateAfter rebuilding ffmpeg I was able to get in this time :
$> gdb ./ffmpeg
GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later /gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
/www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
/www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ffmpeg...done.
(gdb) r
Starting program: /src/FFmpeg/ffmpeg
warning: Error disabling address space randomization: Operation not permitted
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x0000000000f9a8d5 in __register_frame_info_bases.part.6 ()
#2 0x00000000004445fd in frame_dummy ()
#3 0x0000000000000001 in ?? ()
#4 0x0000000000ebd20c in __libc_csu_init ()
#5 0x0000000000ebc9d7 in __libc_start_main ()
#6 0x000000000044451a in _start ()
(gdb)I tried grep’ing the code base for
__register_frame_info_bases
and found nothing. So I’m not really sure where to go from hereA fix, but not an explanation
By randomly removing configuration parameters and rebuilding I discovered that
--disable-pthreads
was causing the segmentation fault. When I remove this, ffmpeg runs just fineI don’t know why this is the case, though. Why would they make it possible to remove something that you need to run ?