Recherche avancée

Médias (91)

Autres articles (79)

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (4564)

  • Error 'paquete de entrada dañado en la secuencia 1' en FFMPEG [closed]

    25 septembre 2022, par Samuel Moya Donoso

    Tengo un videoclip que pesa 1.84 GB, no me dice el tiempo de duración pero calculo que dura 15 minutos y estoy tratando de ejecutar el siguiente comando :

    


    ffmpeg.exe -r 50.000 -i result.h264 -i result.aac -bsf:a aac_adtstoasc -c:v copy -c:a copy result.mov


    


    Pero entonces obtengo el siguiente error :

    


    Error applying bitstream filters to an output packet for stream #0:1.
result.aac: Invalid data found when processing input

Error applying bitstream filters to an output packet for stream #0:1.
[aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header!


    


    ¿Cómo soluciono esto ? ¿Qué significa el error ? Aquí está la salida completa de FFMPEG :
ffmpeg version 2022-06-22-git-fed07efcde-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers built with gcc 11.3.0 (Rev1, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband libavutil      57. 27.100 / 57. 27.100 libavcodec     59. 33.100 / 59. 33.100 libavformat    59. 25.100 / 59. 25.100 libavdevice    59.  6.100 / 59.  6.100 libavfilter     8. 41.100 /  8. 41.100 libswscale      6.  6.100 /  6.  6.100 libswresample   4.  6.100 /  4.  6.100 libpostproc    56.  5.100 / 56.  5.100 [h264 @ 0000028de0daed00] top block unavailable for requested intra mode -1 [h264 @ 0000028de0daed00] error while decoding MB 50 0 [h264 @ 0000028de0daed00] concealing 3007 DC, 3007 AC, 3007 MV errors in I frame [h264 @ 0000028de0daed00] mb_skip_run 7095 is invalid [h264 @ 0000028de0daed00] error while decoding MB 5 5 [h264 @ 0000028de0daed00] concealing 2732 DC, 2732 AC, 2732 MV errors in P frame [h264 @ 0000028de0daed00] concealing 1158 DC, 1158 AC, 1158 MV errors in P frame [h264 @ 0000028de0daed00] out of range intra chroma pred mode [h264 @ 0000028de0daed00] error while decoding MB 31 1 [h264 @ 0000028de0daed00] concealing 2962 DC, 2962 AC, 2962 MV errors in P frame [h264 @ 0000028de0daed00] corrupted macroblock 11 2 (total_coeff=16) [h264 @ 0000028de0daed00] error while decoding MB 11 2 [h264 @ 0000028de0daed00] concealing 2918 DC, 2918 AC, 2918 MV errors in P frame [h264 @ 0000028de0daed00] cbp too large (54) at 10 28 [h264 @ 0000028de0daed00] error while decoding MB 10 28 [h264 @ 0000028de0daed00] concealing 1255 DC, 1255 AC, 1255 MV errors in P frame [h264 @ 0000028de0daed00] P sub_mb_type 30 out of range at 4 28 [h264 @ 0000028de0daed00] error while decoding MB 4 28 [h264 @ 0000028de0daed00] concealing 1261 DC, 1261 AC, 1261 MV errors in P frame Input #0, h264, from 'result.h264': Duration: N/A, bitrate: N/A Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(tv, bt709, progressive), 1024x752 [SAR 1:1 DAR 64:47], 25 fps, 25 tbr, 1200k tbn [aac @ 0000028de0eb6700] Estimating duration from bitrate, this may be inaccurate Input #1, aac, from 'result.aac': Duration: 00:21:05.50, bitrate: 164 kb/s Stream #1:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 164 kb/s Output #0, mov, to 'result.mov': Metadata: encoder         : Lavf59.25.100 Stream #0:0: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1024x752 [SAR 1:1 DAR 64:47], q=2-31, 25 fps, 25 tbr, 12800 tbn Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 164 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #1:0 -> #0:1 (copy) Press [q] to stop, [?] for help [mov @ 0000028de1191a00] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Input packet too small Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Input packet too small Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Input packet too small Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Error parsing ADTS frame header! Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. [aac_adtstoasc @ 0000028de0d85000] Multiple RDBs per frame with CRC is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Error applying bitstream filters to an output packet for stream #0:1. result.aac: Invalid data found when processing input frame=32932 fps=574 q=-1.0 Lsize= 1919740kB time=00:10:58.62 bitrate=23878.0kbits/s speed=11.5x video:1908995kB audio:10215kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.027647%

    


  • How can I build a custom version of opencv while enabling CUDA and opengl ? [closed]

    10 février, par Josh

    I have a hard requirement of python3.7 for certain libraries (aeneas & afaligner). I've been using the regular opencv-python and ffmpeg libraries in my program and they've been working find.

    


    Recently I wanted to adjust my program to use h264 instead of mpeg4 and ran down a licensing rabbit hole of how opencv-python uses a build of ffmpeg with opengl codecs off to avoid licensing issues. x264 is apparently opengl, and is disabled in the opencv-python library.

    


    In order to solve this issue, I built a custom build of opencv using another custom build of ffmpeg both with opengl enabled. This allowed me to use the x264 encoder with the VideoWriter in my python program.

    


    Here's the dockerfile of how I've been running it :

    



    FROM python:3.7-slim

# Set optimization flags and number of cores globally
ENV CFLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
    CXXFLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
    LDFLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
    MAKEFLAGS="-j\$(nproc)"

# Combine all system dependencies in a single layer
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    cmake \
    git \
    wget \
    unzip \
    yasm \
    pkg-config \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libglib2.0-0 \
    libavcodec-dev \
    libavformat-dev \
    libswscale-dev \
    libavutil-dev \
    libswresample-dev \
    nasm \
    mercurial \
    libnuma-dev \
    espeak \
    libespeak-dev \
    libtiff5-dev \
    libjpeg62-turbo-dev \
    libopenjp2-7-dev \
    zlib1g-dev \
    libfreetype6-dev \
    liblcms2-dev \
    libwebp-dev \
    tcl8.6-dev \
    tk8.6-dev \
    python3-tk \
    libharfbuzz-dev \
    libfribidi-dev \
    libxcb1-dev \
    python3-dev \
    python3-setuptools \
    libsndfile1 \
    libavdevice-dev \
    libavfilter-dev \
    libpostproc-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Build x264 with optimizations
RUN cd /tmp && \
    wget https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2 && \
    tar xjf x264-master.tar.bz2 && \
    cd x264-master && \
    ./configure \
        --enable-shared \
        --enable-pic \
        --enable-asm \
        --enable-lto \
        --enable-strip \
        --enable-optimizations \
        --bit-depth=8 \
        --disable-avs \
        --disable-swscale \
        --disable-lavf \
        --disable-ffms \
        --disable-gpac \
        --disable-lsmash \
        --extra-cflags="-O3 -march=native -ffast-math -fomit-frame-pointer -flto -fno-fat-lto-objects" \
        --extra-ldflags="-O3 -flto -fno-fat-lto-objects" && \
    make && \
    make install && \
    cd /tmp && \
    # Build FFmpeg with optimizations
    wget https://ffmpeg.org/releases/ffmpeg-7.1.tar.bz2 && \
    tar xjf ffmpeg-7.1.tar.bz2 && \
    cd ffmpeg-7.1 && \
    ./configure \
        --enable-gpl \
        --enable-libx264 \
        --enable-shared \
        --enable-nonfree \
        --enable-pic \
        --enable-asm \
        --enable-optimizations \
        --enable-lto \
        --enable-pthreads \
        --disable-debug \
        --disable-static \
        --disable-doc \
        --disable-ffplay \
        --disable-ffprobe \
        --disable-filters \
        --disable-programs \
        --disable-postproc \
        --extra-cflags="-O3 -march=native -ffast-math -fomit-frame-pointer -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
        --extra-ldflags="-O3 -flto -fno-fat-lto-objects -Wl,--gc-sections" \
        --prefix=/usr/local && \
    make && \
    make install && \
    ldconfig && \
    rm -rf /tmp/*

# Install Python dependencies first
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
    pip install --no-cache-dir numpy py-spy

# Build OpenCV with optimized configuration
RUN cd /tmp && \
    # Download specific OpenCV version archives
    wget -O opencv.zip https://github.com/opencv/opencv/archive/4.8.0.zip && \
    wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.8.0.zip && \
    unzip opencv.zip && \
    unzip opencv_contrib.zip && \
    mv opencv-4.8.0 opencv && \
    mv opencv_contrib-4.8.0 opencv_contrib && \
    rm opencv.zip opencv_contrib.zip && \
    cd opencv && \
    mkdir build && cd build && \
    cmake \
        -D CMAKE_BUILD_TYPE=RELEASE \
        -D CMAKE_C_FLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
        -D CMAKE_CXX_FLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections -Wno-deprecated" \
        -D CMAKE_EXE_LINKER_FLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
        -D CMAKE_SHARED_LINKER_FLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
        -D CMAKE_INSTALL_PREFIX=/usr/local \
        -D ENABLE_FAST_MATH=ON \
        -D CPU_BASELINE_DETECT=ON \
        -D CPU_BASELINE=SSE3 \
        -D CPU_DISPATCH=SSE4_1,SSE4_2,AVX,AVX2,AVX512_SKX,FP16 \
        -D WITH_OPENMP=ON \
        -D OPENCV_ENABLE_NONFREE=ON \
        -D WITH_FFMPEG=ON \
        -D FFMPEG_ROOT=/usr/local \
        -D OPENCV_EXTRA_MODULES_PATH=/tmp/opencv_contrib/modules \
        -D PYTHON_EXECUTABLE=/usr/local/bin/python3.7 \
        -D PYTHON3_EXECUTABLE=/usr/local/bin/python3.7 \
        -D PYTHON3_INCLUDE_DIR=/usr/local/include/python3.7m \
        -D PYTHON3_LIBRARY=/usr/local/lib/libpython3.7m.so \
        -D PYTHON3_PACKAGES_PATH=/usr/local/lib/python3.7/site-packages \
        -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.7/site-packages/numpy/core/include \
        -D BUILD_opencv_python3=ON \
        -D INSTALL_PYTHON_EXAMPLES=OFF \
        -D BUILD_TESTS=OFF \
        -D BUILD_PERF_TESTS=OFF \
        -D BUILD_EXAMPLES=OFF \
        -D BUILD_DOCS=OFF \
        -D BUILD_opencv_apps=OFF \
        -D WITH_OPENCL=OFF \
        -D WITH_CUDA=OFF \
        -D WITH_IPP=OFF \
        -D WITH_TBB=OFF \
        -D WITH_V4L=OFF \
        -D WITH_QT=OFF \
        -D WITH_GTK=OFF \
        -D BUILD_LIST=core,imgproc,imgcodecs,videoio,python3 \
        .. && \
    make && \
    make install && \
    ldconfig && \
    rm -rf /tmp/*

# Set working directory and copy application code
WORKDIR /app

COPY requirements.txt .

RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg

RUN pip install --no-cache-dir aeneas afaligner && \
    pip install --no-cache-dir -r requirements.txt

COPY . .

# Make entrypoint executable
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]


    


    My trouble now, is I've been considering running parts of my program on my GPU, it's creating graphics for a video after all. I have no idea how to edit my Dockerfile to make the opencv build run with CUDA enabled, every combination I try leads to issues.

    


    How can I tell which version of CUDA, opencv and ffmpeg are compatible with python 3.7 ? I've tried so so many combinations and they all lead to different issues, I've asked various AI agents and they all flounder. Where can I find a reliable source of information about this ?

    


  • How can I build a custom version of opencv while enabling CUDA and opengl ?

    1er avril, par Josh

    I have a hard requirement of python3.7 for certain libraries (aeneas & afaligner). I've been using the regular opencv-python and ffmpeg libraries in my program and they've been working find.

    


    Recently I wanted to adjust my program to use h264 instead of mpeg4 and ran down a licensing rabbit hole of how opencv-python uses a build of ffmpeg with opengl codecs off to avoid licensing issues. x264 is apparently opengl, and is disabled in the opencv-python library.

    


    In order to solve this issue, I built a custom build of opencv using another custom build of ffmpeg both with opengl enabled. This allowed me to use the x264 encoder with the VideoWriter in my python program.

    


    Here's the dockerfile of how I've been running it :

    



    FROM python:3.7-slim

# Set optimization flags and number of cores globally
ENV CFLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
    CXXFLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
    LDFLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
    MAKEFLAGS="-j\$(nproc)"

# Combine all system dependencies in a single layer
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    cmake \
    git \
    wget \
    unzip \
    yasm \
    pkg-config \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libglib2.0-0 \
    libavcodec-dev \
    libavformat-dev \
    libswscale-dev \
    libavutil-dev \
    libswresample-dev \
    nasm \
    mercurial \
    libnuma-dev \
    espeak \
    libespeak-dev \
    libtiff5-dev \
    libjpeg62-turbo-dev \
    libopenjp2-7-dev \
    zlib1g-dev \
    libfreetype6-dev \
    liblcms2-dev \
    libwebp-dev \
    tcl8.6-dev \
    tk8.6-dev \
    python3-tk \
    libharfbuzz-dev \
    libfribidi-dev \
    libxcb1-dev \
    python3-dev \
    python3-setuptools \
    libsndfile1 \
    libavdevice-dev \
    libavfilter-dev \
    libpostproc-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Build x264 with optimizations
RUN cd /tmp && \
    wget https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2 && \
    tar xjf x264-master.tar.bz2 && \
    cd x264-master && \
    ./configure \
        --enable-shared \
        --enable-pic \
        --enable-asm \
        --enable-lto \
        --enable-strip \
        --enable-optimizations \
        --bit-depth=8 \
        --disable-avs \
        --disable-swscale \
        --disable-lavf \
        --disable-ffms \
        --disable-gpac \
        --disable-lsmash \
        --extra-cflags="-O3 -march=native -ffast-math -fomit-frame-pointer -flto -fno-fat-lto-objects" \
        --extra-ldflags="-O3 -flto -fno-fat-lto-objects" && \
    make && \
    make install && \
    cd /tmp && \
    # Build FFmpeg with optimizations
    wget https://ffmpeg.org/releases/ffmpeg-7.1.tar.bz2 && \
    tar xjf ffmpeg-7.1.tar.bz2 && \
    cd ffmpeg-7.1 && \
    ./configure \
        --enable-gpl \
        --enable-libx264 \
        --enable-shared \
        --enable-nonfree \
        --enable-pic \
        --enable-asm \
        --enable-optimizations \
        --enable-lto \
        --enable-pthreads \
        --disable-debug \
        --disable-static \
        --disable-doc \
        --disable-ffplay \
        --disable-ffprobe \
        --disable-filters \
        --disable-programs \
        --disable-postproc \
        --extra-cflags="-O3 -march=native -ffast-math -fomit-frame-pointer -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
        --extra-ldflags="-O3 -flto -fno-fat-lto-objects -Wl,--gc-sections" \
        --prefix=/usr/local && \
    make && \
    make install && \
    ldconfig && \
    rm -rf /tmp/*

# Install Python dependencies first
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
    pip install --no-cache-dir numpy py-spy

# Build OpenCV with optimized configuration
RUN cd /tmp && \
    # Download specific OpenCV version archives
    wget -O opencv.zip https://github.com/opencv/opencv/archive/4.8.0.zip && \
    wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.8.0.zip && \
    unzip opencv.zip && \
    unzip opencv_contrib.zip && \
    mv opencv-4.8.0 opencv && \
    mv opencv_contrib-4.8.0 opencv_contrib && \
    rm opencv.zip opencv_contrib.zip && \
    cd opencv && \
    mkdir build && cd build && \
    cmake \
        -D CMAKE_BUILD_TYPE=RELEASE \
        -D CMAKE_C_FLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
        -D CMAKE_CXX_FLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections -Wno-deprecated" \
        -D CMAKE_EXE_LINKER_FLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
        -D CMAKE_SHARED_LINKER_FLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
        -D CMAKE_INSTALL_PREFIX=/usr/local \
        -D ENABLE_FAST_MATH=ON \
        -D CPU_BASELINE_DETECT=ON \
        -D CPU_BASELINE=SSE3 \
        -D CPU_DISPATCH=SSE4_1,SSE4_2,AVX,AVX2,AVX512_SKX,FP16 \
        -D WITH_OPENMP=ON \
        -D OPENCV_ENABLE_NONFREE=ON \
        -D WITH_FFMPEG=ON \
        -D FFMPEG_ROOT=/usr/local \
        -D OPENCV_EXTRA_MODULES_PATH=/tmp/opencv_contrib/modules \
        -D PYTHON_EXECUTABLE=/usr/local/bin/python3.7 \
        -D PYTHON3_EXECUTABLE=/usr/local/bin/python3.7 \
        -D PYTHON3_INCLUDE_DIR=/usr/local/include/python3.7m \
        -D PYTHON3_LIBRARY=/usr/local/lib/libpython3.7m.so \
        -D PYTHON3_PACKAGES_PATH=/usr/local/lib/python3.7/site-packages \
        -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.7/site-packages/numpy/core/include \
        -D BUILD_opencv_python3=ON \
        -D INSTALL_PYTHON_EXAMPLES=OFF \
        -D BUILD_TESTS=OFF \
        -D BUILD_PERF_TESTS=OFF \
        -D BUILD_EXAMPLES=OFF \
        -D BUILD_DOCS=OFF \
        -D BUILD_opencv_apps=OFF \
        -D WITH_OPENCL=OFF \
        -D WITH_CUDA=OFF \
        -D WITH_IPP=OFF \
        -D WITH_TBB=OFF \
        -D WITH_V4L=OFF \
        -D WITH_QT=OFF \
        -D WITH_GTK=OFF \
        -D BUILD_LIST=core,imgproc,imgcodecs,videoio,python3 \
        .. && \
    make && \
    make install && \
    ldconfig && \
    rm -rf /tmp/*

# Set working directory and copy application code
WORKDIR /app

COPY requirements.txt .

RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg

RUN pip install --no-cache-dir aeneas afaligner && \
    pip install --no-cache-dir -r requirements.txt

COPY . .

# Make entrypoint executable
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]


    


    My trouble now, is I've been considering running parts of my program on my GPU, it's creating graphics for a video after all. I have no idea how to edit my Dockerfile to make the opencv build run with CUDA enabled, every combination I try leads to issues.

    


    How can I tell which version of CUDA, opencv and ffmpeg are compatible with python 3.7 ?