Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (17)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (3230)

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

    


  • Documentation #3374 (Nouveau) : "PHP Warning : Cannot modify header information" récurrentes

    14 janvier 2015, par Eric Camus

    Sur une machine Windows + IIS 6, avec des SPIP 3.0.17 + Sarka 3.2.28.

    On subit à longueur de journée des erreurs :
    [13-Jan-2015 10:29:07 Europe/Paris] PHP Warning:  Cannot modify header information - headers already sent by (output started at D:\wwwwww\yyyyyyy\ecrire\public.php:154) in D:\ wwwwww\yyyyyyy \ecrire\inc\headers.php on line 152

    Après une analyse du code et des essais en production, j’ai identifié que ces erreurs proviennent toutes (quel que soit le site SPIP sur les 180 actuellement en production) de l’écriture du fichier " tmp/cache/chemin.txt" qui termine le calcul de la page. Ci-dessous un debug_backtrace() :

    Array
    (
        [0] => Array
            (
                [file] => D :\wwwwww\yyyyyyy\ecrire\inc\flock.php
                [line] => 233
                [function] => http_status
                [args] => Array
                    (
                        [0] => 401
                    )
    

    )

    [1] => Array
    (
    [file] => D :\wwwwww\yyyyyyy\ecrire\inc\flock.php
    [line] => 193
    [function] => raler_fichier
    [args] => Array
    (
    [0] => tmp/cache/chemin.txt
    )

    )

    [2] => Array
    (
    [file] => D :\wwwwww\yyyyyyy\ecrire\inc\utils.php
    [line] => 1032
    [function] => ecrire_fichier
    [args] => Array
    (
    [0] => tmp/cache/chemin.txt
    [1] => a:2 :s:32 :"6f0bd1a59e3585679ea73508e8a166ba"...
    )

    )

    [3] => Array
    (
    [file] => D :\wwwwww\yyyyyyy\ecrire\public.php
    [line] => 184
    [function] => save_path_cache
    [args] => Array
    (
    )

    )

    [4] => Array
    (
    [file] => D :\wwwwww\yyyyyyy\spip.php
    [line] => 24
    [args] => Array
    (
    [0] => D :\wwwwww\yyyyyyy\ecrire\public.php
    )

    [function] => include
    )

    )

    Ayant placé ce code dans la fonction " http_status " :

    if(headers_sent())   // APmodif debug mode
        $f=$_SERVER[’DOCUMENT_ROOT’].’\debug_header.txt’ ;
        $out=date(’******************[d/m/Y H:i:s]’)."\r\n" ;
        $out.=’PHP_SELF=’.$_SERVER[’PHP_SELF’]."\r\n" ;
        $out.=’QUERY_STRING=’.$_SERVER[’QUERY_STRING’]."\r\n" ;
        $out.=’-----ob_get_contents---------------------------------------------’."\r\n".ob_get_contents()."\r\n".
              ’-----headers_list------------------------------------------------’."\r\n" ;
        $out.=print_r(headers_list(),true)."\r\n".
              ’-----------------------------------------------------------------’."\r\n" ;
        $out.=’STATUS_STRING=’.$status_string[$status]."\r\n" ;
        $out.=’*****FIN*********************************************************’."\r\n" ;
        file_put_contents($f,$out,FILE_APPEND) ;
        file_put_contents($_SERVER[’DOCUMENT_ROOT’].’\debug_backtrace.txt’,print_r(debug_backtrace(),true)) ;
    
    else 
        if ($php_cgi)
            header("Status : ".$status_string[$status]) ;
        else
            header("HTTP/1.0 ".$status_string[$status]) ;
    
    

    Un extrait de "debug_header.txt" :

    ******************[14/01/2015 08:40:53]
    PHP_SELF=/yyyyyyy/spip.php
    QUERY_STRING=page=style.css

    ob_get_contents---------------------------------------------


    headers_list------------------------------------------------
    Array
    (
    [0] => X-Powered-By : PHP/5.4.35
    [1] => Composed-By : SPIP @ www.spip.net
    [2] => X-Spip-Cache : 7776000
    [3] => Content-Type : text/css ; charset=iso-8859-15
    [4] => Vary : Accept-Encoding
    [5] => Last-Modified : Wed, 14 Jan 2015 07:40:52 GMT
    )


    STATUS_STRING=401 Unauthorized
    *****FIN*********************************************************

    Cette analyse montre que ces erreurs passent toutes par l’appel de la fonction "raler_fichier" dans " ecrire_fichier" du fichier "flock.php" :

        if (!$ignorer_echec) 
            include_spip(’inc/autoriser’) ;
            if (autoriser(’chargerftp’))
                raler_fichier($fichier) ;
            spip_unlink($fichier) ;
        
    

    Maintenant les questions :

    - Pourquoi seuls les administrateurs affichent cette erreur qui en plus arrête le processus par un "exit" dans "raler_fichier", donc les codes suivant ne sont pas exécuter (suppression et log SPIP) ? Sans compter que l’on ne voit rien car la plupart du temps elle arrive dans un fichier de CSS !!!
    - Pourquoi supprimer un fichier qui n’est pas obligatoirement en erreur car c’est probablement un problème de LOCK (deux processus en même temps) ?
    - Peut-on désactivé cette portion de code sans risque de problème ?

    Pour la part, je prends sur moi de supprimer cette portion de code.

  • Random Fatal signal 11 (SIGSEGV) error in app using ffmpeg through ndk

    20 janvier 2015, par grzebyk

    I am getting a nasty but well known error while working with FFmpeg and NDK :

    A/libc(9845): Fatal signal 11 (SIGSEGV), code 1, fault addr 0xa0a9f000 in tid 9921 (AsyncTask #4)

    What am I doing ?

    I am developing an application that streams live video feed from a webcam and enables user to pan and tilt the remote camera. I am using FFmpeg library built with NDK to achieve smooth playback with little delay.

    I am using FFMpeg library to connect to the video stream. Then the ndk part creates bitmap, does the image processing and render frames on the SurfaceView videoSurfaceView object which is located in the android activity (java part).

    To move the webcam I created a separate class - public class CameraMover implements Runnable{/**/}. This class is a separate thread that connects through sockets with the remote camera and manages tasks connected ONLY with pan-tilt movement.

    Next in the main activity i created a touch listener

    videoSurfaceView.setOnTouchListener(new View.OnTouchListener() {/**/
    cameraMover.setPanTilt(some parameters);
    /**/}

    which reads user’s finger movement and sends commands to the camera.

    All tasks - moving camera around, touch interface and video playback are working perfectly when the one of the others is disabled, i.e. when I disable possibility to move camera, I can watch video streaming and register touch events till the end of time (or battery at least). The problem occurs only when task are configured to work simultaneously.

    I am unable to find steps to reproduce the problem. It just happens, but only after user touches the screen to move camera. It can be 15 seconds after first interaction, but sometimes it takes app 10 or more minutes to crash. Usually it is something around a minute.

    What have I done ?

    • I tried to display millions of logs in logcat to find an error but
      the last log was always different.
    • I created a transparent surface, that I put over the videoSurfaceView and assigned touch listener to it. It all ended in the same error.
    • As I mentioned before, I turned off some functionalities to find which one produces the error, but it appears that error occurs only when everything is working simultaneously.

    Types of the error

    Almost every time the error looks like this :

    A/libc(11528): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9aa9f00c in tid 11637 (AsyncTask #4)

    the difference between two errors is the number right after libc, addr number and tid number. Rarely the AsyncTask number varies - i received #1 couple times but I was unable to reproduce it.

    Question

    How can i avoid this error ? What can be the source of it ?