Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (97)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

Sur d’autres sites (7612)

  • C# Bitmap to AVI / WMV with Compression

    18 juillet 2016, par Digitalsa1nt

    Prelude :

    I’m going to preface this with, I have been learning C# in my spare time at work, and that I have been staring at code for a solid two days trying to wrap my head around this problem. I am developing some software to be used with a visualiser that connects by USB to a standard Desktop PC, the software detects the capture device and loads frames into bitmap using a New Frame Event, this is then displayed in a ’picture box’ as a live video stream. The problem as it sits is trying to encorporate the ability to record the stream and save to file, preferably a WMV or a compressed AVI.

    What’s been tried :

    I have considered and looked into the following :

    SharpAVI - cant seem to get this to compress or save the frames properly as it appears to mainly look at existing AVI files.

    AForge.Video.VFW - AVI files can be created but are far too large to be used, due to restrictions on the user areas of the individuals who will be using this software.

    AForge.Video.FFMPEG - Again due to considerations of those using this software I can’t have unmanaged DLL’s sat in the output folder with the Executable file, and unfortunately this particular DLL cant be compiled properly using Costura Fody.

    AVIFile Library Wrapper (From Code Project) - Again can’t seem to get this to compress a stream correctly from Bitmaps from the New Frame Events.

    DirectShow - Appears to use C++ and unfortunately is beyond my skill level at this time.

    The Relevant Code Snippets :

    Current References :

    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Resources;
    using System.Drawing.Imaging;
    using System.IO;
    //Aforge Video DLL's
    using AForge.Video;
    using AForge.Video.VFW;
    using AForge.Video.DirectShow;
    //Aforge Image DLL's
    using AForge.Imaging;
    using AForge.Imaging.Formats;
    using AForge.Imaging.Filters;
    //AviLibrary
    using AviFile;

    Global Variables :

       #region Global Variables

       private FilterInfoCollection CaptureDevice; // list of available devices
       private VideoCaptureDevice videoSource;
       public System.Drawing.Image CapturedImage;

       bool toggleMic = false;

       bool toggleRec = false;
       //aforge
       AVIWriter aviWriter;
       Bitmap image;


       #endregion

    Code for Displaying Stream

       #region Displays the Stream

       void videoSource_NewFrame(object sender, NewFrameEventArgs eventArgs)
       {
           picBoxStream.SizeMode = PictureBoxSizeMode.Zoom;
           picBoxStream.Image = (Bitmap)eventArgs.Frame.Clone();// clones the bitmap


           if (toggleRec == true)
           {
               image = (Bitmap)eventArgs.Frame.Clone();
               aviWriter.AddFrame(image);
           }
       }

       #endregion

    Current Code for Recording Stream

       #region Record Button

       private void btnRecord_Click(object sender, EventArgs e)
       {
           if (toggleRec == false)
           {
               saveAVI = new SaveFileDialog();
               saveAVI.Filter = "AVI Files (*.avi)|*.avi";

               if (saveAVI.ShowDialog() == DialogResult.OK)
               {
                   aviWriter = new AVIWriter();
                   aviWriter.Open(saveAVI.FileName, 1280, 720);

                   toggleRec = true;
                   Label lblRec = new Label();
               }

           }
           else if (toggleRec == true)
           {
               aviWriter.Close();
               toggleRec = false;
           }
       }

       #endregion

    I apoligise if the above code doesn’t look quite right, I have been swapping, changing and recoding those three sections a lot in order to find a working combination. This means that it’s rather untidy but I didn’t see the point in cleaning it all up until I had the code working. That being said really any help that you can provide is greatfully recieved, even if it’s a case of what I want to do just cannot be done.

    Thank you in advance.

    EDIT : PostScript :

    I will be actively working on this monday to friday, so If I make any breakthroughs I will update this Question accordingly, this seems to be a frequently sort after answer so hopefully we can overcome the issues.

  • dockerfile apt-get install ffmpeg unmet dependencies

    8 juillet 2020, par Martin

    I have a Dockerfile which looks like this :

    &#xA;

    FROM node:carbon&#xA;VOLUME ["/root"]&#xA;ADD setup-ffmpeg.sh /root&#xA;RUN /root/setup-ffmpeg.sh&#xA;# Create app directory&#xA;WORKDIR /usr/src/app&#xA;# Install app dependencies&#xA;# A wildcard is used to ensure both package.json AND package-lock.json are copied&#xA;# where available (npm@5&#x2B;)&#xA;COPY package*.json ./&#xA;RUN npm install&#xA;# If you are building your code for production&#xA;# RUN npm install --only=production&#xA;# Bundle app source&#xA;COPY . .&#xA;EXPOSE 8080&#xA;CMD [ "npm", "start" ]&#xA;

    &#xA;

    Which tries to run the file setup-ffmpeg.sh :

    &#xA;

    #!/usr/bin/env bash&#xA;echo &#x27;deb http://www.deb-multimedia.org jessie main non-free&#x27; >> /etc/apt/sources.list&#xA;echo &#x27;deb-src http://www.deb-multimedia.org jessie main non-free&#x27; >> /etc/apt/sources.list&#xA;apt-get update&#xA;apt-get install -y --force-yes deb-multimedia-keyring&#xA;apt-get remove -y --force-yes ffmpeg&#xA;apt-get install -y --force-yes build-essential libmp3lame-dev libvorbis-dev libtheora-dev     libspeex-dev yasm pkg-config libfaac-dev libx264-dev libav-tools &#xA;echo "ffmpeg time"&#xA;apt-get install ffmpeg &#xA;

    &#xA;

    I am on Ubuntu 20.04 LTS, and try to run this the Dockerfile, from terminal, with the command :

    &#xA;

    docker build -t alien35/node-web-app .&#xA;

    &#xA;

    This causes an error when reaching the ffmpeg part though :

    &#xA;

    Sending build context to Docker daemon  9.793MB&#xA;Step 1/10 : FROM node:carbon&#xA; ---> 8eeadf3757f4&#xA;Step 2/10 : VOLUME ["/root"]&#xA; ---> Using cache&#xA; ---> 3658672462de&#xA;Step 3/10 : ADD setup-ffmpeg.sh /root&#xA; ---> c9c192aa97c5&#xA;Step 4/10 : RUN /root/setup-ffmpeg.sh&#xA; ---> Running in b9240ac8d351&#xA;Ign:1 http://deb.debian.org/debian stretch InRelease&#xA;Get:2 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]&#xA;Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]&#xA;Get:4 http://deb.debian.org/debian stretch Release [118 kB]&#xA;Get:5 http://deb.debian.org/debian stretch Release.gpg [2410 B]&#xA;Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [529 kB]&#xA;Get:7 http://deb.debian.org/debian stretch-updates/main amd64 Packages [28.2 kB]&#xA;Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7083 kB]&#xA;Get:9 http://www.deb-multimedia.org jessie InRelease [24.6 kB]&#xA;Ign:9 http://www.deb-multimedia.org jessie InRelease&#xA;Get:10 http://www.deb-multimedia.org jessie/main Sources [60.8 kB]&#xA;Get:11 http://www.deb-multimedia.org jessie/non-free Sources [2480 B]&#xA;Get:12 http://www.deb-multimedia.org jessie/main amd64 Packages [82.8 kB]&#xA;Get:13 http://www.deb-multimedia.org jessie/non-free amd64 Packages [1776 B]&#xA;Fetched 8080 kB in 2s (3402 kB/s)&#xA;Reading package lists...&#xA;W: GPG error: http://www.deb-multimedia.org jessie InRelease: The following signatures couldn&#x27;t be verified because the public key is not available: NO_PUBKEY 5C808C2B65558117&#xA;W: The repository &#x27;http://www.deb-multimedia.org jessie InRelease&#x27; is not signed.&#xA;Reading package lists...&#xA;Building dependency tree...&#xA;Reading state information...&#xA;The following NEW packages will be installed:&#xA;  deb-multimedia-keyring&#xA;0 upgraded, 1 newly installed, 0 to remove and 56 not upgraded.&#xA;Need to get 10.7 kB of archives.&#xA;After this operation, 25.6 kB of additional disk space will be used.&#xA;WARNING: The following packages cannot be authenticated!&#xA;  deb-multimedia-keyring&#xA;Get:1 http://www.deb-multimedia.org jessie/main amd64 deb-multimedia-keyring all 2016.8.1 [10.7 kB]&#xA;debconf: delaying package configuration, since apt-utils is not installed&#xA;Fetched 10.7 kB in 0s (23.3 kB/s)&#xA;Selecting previously unselected package deb-multimedia-keyring.&#xA;(Reading database ... 29962 files and directories currently installed.)&#xA;Preparing to unpack .../deb-multimedia-keyring_2016.8.1_all.deb ...&#xA;Unpacking deb-multimedia-keyring (2016.8.1) ...&#xA;Setting up deb-multimedia-keyring (2016.8.1) ...&#xA;W: --force-yes is deprecated, use one of the options starting with --allow instead.&#xA;W: --force-yes is deprecated, use one of the options starting with --allow instead.&#xA;Reading package lists...&#xA;Building dependency tree...&#xA;Reading state information...&#xA;Package &#x27;ffmpeg&#x27; is not installed, so not removed&#xA;0 upgraded, 0 newly installed, 0 to remove and 56 not upgraded.&#xA;Reading package lists...&#xA;Building dependency tree...&#xA;Reading state information...&#xA;pkg-config is already the newest version (0.29-4&#x2B;b1).&#xA;pkg-config set to manually installed.&#xA;Some packages could not be installed. This may mean that you have&#xA;requested an impossible situation or if you are using the unstable&#xA;distribution that some required packages have not yet been created&#xA;or been moved out of Incoming.&#xA;The following information may help to resolve the situation:&#xA;&#xA;The following packages have unmet dependencies:&#xA; libav-tools : Depends: ffmpeg (= 10:2.6.9-dmo1&#x2B;deb8u2) but it is not going to be installed&#xA;E: Unable to correct problems, you have held broken packages.&#xA;ffmpeg time&#xA;Reading package lists...&#xA;Building dependency tree...&#xA;Reading state information...&#xA;Some packages could not be installed. This may mean that you have&#xA;requested an impossible situation or if you are using the unstable&#xA;distribution that some required packages have not yet been created&#xA;or been moved out of Incoming.&#xA;The following information may help to resolve the situation:&#xA;&#xA;The following packages have unmet dependencies:&#xA; ffmpeg : Depends: libavcodec56 (>= 10:2.6.9) but it is not going to be installed&#xA;          Depends: libavdevice56 (>= 10:2.6.9) but it is not going to be installed&#xA;          Depends: libavfilter5 (>= 10:2.6.9) but it is not going to be installed&#xA;          Depends: libavformat56 (>= 10:2.6.9) but it is not going to be installed&#xA;E: Unable to correct problems, you have held broken packages.&#xA;The command &#x27;/bin/sh -c /root/setup-ffmpeg.sh&#x27; returned a non-zero code: 100&#xA;

    &#xA;

    I have tried adding the dependencies to apt-get install in my Dockerfile, and adding -f to the ffmpeg command as well, but I am still getting this error

    &#xA;

  • 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.

    &#xA;

    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.

    &#xA;

    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.

    &#xA;

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

    &#xA;&#xA;

    FROM python:3.7-slim&#xA;&#xA;# Set optimization flags and number of cores globally&#xA;ENV CFLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \&#xA;    CXXFLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \&#xA;    LDFLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \&#xA;    MAKEFLAGS="-j\$(nproc)"&#xA;&#xA;# Combine all system dependencies in a single layer&#xA;RUN apt-get update &amp;&amp; apt-get install -y --no-install-recommends \&#xA;    build-essential \&#xA;    cmake \&#xA;    git \&#xA;    wget \&#xA;    unzip \&#xA;    yasm \&#xA;    pkg-config \&#xA;    libsm6 \&#xA;    libxext6 \&#xA;    libxrender-dev \&#xA;    libglib2.0-0 \&#xA;    libavcodec-dev \&#xA;    libavformat-dev \&#xA;    libswscale-dev \&#xA;    libavutil-dev \&#xA;    libswresample-dev \&#xA;    nasm \&#xA;    mercurial \&#xA;    libnuma-dev \&#xA;    espeak \&#xA;    libespeak-dev \&#xA;    libtiff5-dev \&#xA;    libjpeg62-turbo-dev \&#xA;    libopenjp2-7-dev \&#xA;    zlib1g-dev \&#xA;    libfreetype6-dev \&#xA;    liblcms2-dev \&#xA;    libwebp-dev \&#xA;    tcl8.6-dev \&#xA;    tk8.6-dev \&#xA;    python3-tk \&#xA;    libharfbuzz-dev \&#xA;    libfribidi-dev \&#xA;    libxcb1-dev \&#xA;    python3-dev \&#xA;    python3-setuptools \&#xA;    libsndfile1 \&#xA;    libavdevice-dev \&#xA;    libavfilter-dev \&#xA;    libpostproc-dev \&#xA;    &amp;&amp; apt-get clean \&#xA;    &amp;&amp; rm -rf /var/lib/apt/lists/*&#xA;&#xA;# Build x264 with optimizations&#xA;RUN cd /tmp &amp;&amp; \&#xA;    wget https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2 &amp;&amp; \&#xA;    tar xjf x264-master.tar.bz2 &amp;&amp; \&#xA;    cd x264-master &amp;&amp; \&#xA;    ./configure \&#xA;        --enable-shared \&#xA;        --enable-pic \&#xA;        --enable-asm \&#xA;        --enable-lto \&#xA;        --enable-strip \&#xA;        --enable-optimizations \&#xA;        --bit-depth=8 \&#xA;        --disable-avs \&#xA;        --disable-swscale \&#xA;        --disable-lavf \&#xA;        --disable-ffms \&#xA;        --disable-gpac \&#xA;        --disable-lsmash \&#xA;        --extra-cflags="-O3 -march=native -ffast-math -fomit-frame-pointer -flto -fno-fat-lto-objects" \&#xA;        --extra-ldflags="-O3 -flto -fno-fat-lto-objects" &amp;&amp; \&#xA;    make &amp;&amp; \&#xA;    make install &amp;&amp; \&#xA;    cd /tmp &amp;&amp; \&#xA;    # Build FFmpeg with optimizations&#xA;    wget https://ffmpeg.org/releases/ffmpeg-7.1.tar.bz2 &amp;&amp; \&#xA;    tar xjf ffmpeg-7.1.tar.bz2 &amp;&amp; \&#xA;    cd ffmpeg-7.1 &amp;&amp; \&#xA;    ./configure \&#xA;        --enable-gpl \&#xA;        --enable-libx264 \&#xA;        --enable-shared \&#xA;        --enable-nonfree \&#xA;        --enable-pic \&#xA;        --enable-asm \&#xA;        --enable-optimizations \&#xA;        --enable-lto \&#xA;        --enable-pthreads \&#xA;        --disable-debug \&#xA;        --disable-static \&#xA;        --disable-doc \&#xA;        --disable-ffplay \&#xA;        --disable-ffprobe \&#xA;        --disable-filters \&#xA;        --disable-programs \&#xA;        --disable-postproc \&#xA;        --extra-cflags="-O3 -march=native -ffast-math -fomit-frame-pointer -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \&#xA;        --extra-ldflags="-O3 -flto -fno-fat-lto-objects -Wl,--gc-sections" \&#xA;        --prefix=/usr/local &amp;&amp; \&#xA;    make &amp;&amp; \&#xA;    make install &amp;&amp; \&#xA;    ldconfig &amp;&amp; \&#xA;    rm -rf /tmp/*&#xA;&#xA;# Install Python dependencies first&#xA;RUN pip install --no-cache-dir --upgrade pip setuptools wheel &amp;&amp; \&#xA;    pip install --no-cache-dir numpy py-spy&#xA;&#xA;# Build OpenCV with optimized configuration&#xA;RUN cd /tmp &amp;&amp; \&#xA;    # Download specific OpenCV version archives&#xA;    wget -O opencv.zip https://github.com/opencv/opencv/archive/4.8.0.zip &amp;&amp; \&#xA;    wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.8.0.zip &amp;&amp; \&#xA;    unzip opencv.zip &amp;&amp; \&#xA;    unzip opencv_contrib.zip &amp;&amp; \&#xA;    mv opencv-4.8.0 opencv &amp;&amp; \&#xA;    mv opencv_contrib-4.8.0 opencv_contrib &amp;&amp; \&#xA;    rm opencv.zip opencv_contrib.zip &amp;&amp; \&#xA;    cd opencv &amp;&amp; \&#xA;    mkdir build &amp;&amp; cd build &amp;&amp; \&#xA;    cmake \&#xA;        -D CMAKE_BUILD_TYPE=RELEASE \&#xA;        -D CMAKE_C_FLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \&#xA;        -D CMAKE_CXX_FLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections -Wno-deprecated" \&#xA;        -D CMAKE_EXE_LINKER_FLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \&#xA;        -D CMAKE_SHARED_LINKER_FLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \&#xA;        -D CMAKE_INSTALL_PREFIX=/usr/local \&#xA;        -D ENABLE_FAST_MATH=ON \&#xA;        -D CPU_BASELINE_DETECT=ON \&#xA;        -D CPU_BASELINE=SSE3 \&#xA;        -D CPU_DISPATCH=SSE4_1,SSE4_2,AVX,AVX2,AVX512_SKX,FP16 \&#xA;        -D WITH_OPENMP=ON \&#xA;        -D OPENCV_ENABLE_NONFREE=ON \&#xA;        -D WITH_FFMPEG=ON \&#xA;        -D FFMPEG_ROOT=/usr/local \&#xA;        -D OPENCV_EXTRA_MODULES_PATH=/tmp/opencv_contrib/modules \&#xA;        -D PYTHON_EXECUTABLE=/usr/local/bin/python3.7 \&#xA;        -D PYTHON3_EXECUTABLE=/usr/local/bin/python3.7 \&#xA;        -D PYTHON3_INCLUDE_DIR=/usr/local/include/python3.7m \&#xA;        -D PYTHON3_LIBRARY=/usr/local/lib/libpython3.7m.so \&#xA;        -D PYTHON3_PACKAGES_PATH=/usr/local/lib/python3.7/site-packages \&#xA;        -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.7/site-packages/numpy/core/include \&#xA;        -D BUILD_opencv_python3=ON \&#xA;        -D INSTALL_PYTHON_EXAMPLES=OFF \&#xA;        -D BUILD_TESTS=OFF \&#xA;        -D BUILD_PERF_TESTS=OFF \&#xA;        -D BUILD_EXAMPLES=OFF \&#xA;        -D BUILD_DOCS=OFF \&#xA;        -D BUILD_opencv_apps=OFF \&#xA;        -D WITH_OPENCL=OFF \&#xA;        -D WITH_CUDA=OFF \&#xA;        -D WITH_IPP=OFF \&#xA;        -D WITH_TBB=OFF \&#xA;        -D WITH_V4L=OFF \&#xA;        -D WITH_QT=OFF \&#xA;        -D WITH_GTK=OFF \&#xA;        -D BUILD_LIST=core,imgproc,imgcodecs,videoio,python3 \&#xA;        .. &amp;&amp; \&#xA;    make &amp;&amp; \&#xA;    make install &amp;&amp; \&#xA;    ldconfig &amp;&amp; \&#xA;    rm -rf /tmp/*&#xA;&#xA;# Set working directory and copy application code&#xA;WORKDIR /app&#xA;&#xA;COPY requirements.txt .&#xA;&#xA;RUN apt-get update &amp;&amp; apt-get install -y --no-install-recommends ffmpeg&#xA;&#xA;RUN pip install --no-cache-dir aeneas afaligner &amp;&amp; \&#xA;    pip install --no-cache-dir -r requirements.txt&#xA;&#xA;COPY . .&#xA;&#xA;# Make entrypoint executable&#xA;RUN chmod &#x2B;x entrypoint.sh&#xA;ENTRYPOINT ["./entrypoint.sh"]&#xA;

    &#xA;

    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.

    &#xA;

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

    &#xA;