Recherche avancée

Médias (0)

Mot : - Tags -/serveur

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (95)

  • Soumettre bugs et patchs

    10 avril 2011

    Un logiciel n’est malheureusement jamais parfait...
    Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
    Si vous pensez avoir résolu vous même le bug (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Que fait exactement ce script ?

    18 janvier 2011, par

    Ce script est écrit en bash. Il est donc facilement utilisable sur n’importe quel serveur.
    Il n’est compatible qu’avec une liste de distributions précises (voir Liste des distributions compatibles).
    Installation de dépendances de MediaSPIP
    Son rôle principal est d’installer l’ensemble des dépendances logicielles nécessaires coté serveur à savoir :
    Les outils de base pour pouvoir installer le reste des dépendances Les outils de développements : build-essential (via APT depuis les dépôts officiels) ; (...)

Sur d’autres sites (6042)

  • How does ffmpeg read stdin pipe ?

    17 novembre 2017, par ciclopez

    I’m working on a Python script that generates an image sequence based on user real time remote interaction, and uses ffmpeg to compress and stream this image sequence over the network for the user to watch it.
    As soon as an image is generated the script writes it to ffmpeg’s stdin and this action is repeated inside a loop to form a video.

    I was wondering what happens when ffmpeg is busy processing the previous image when I write to stdin.

    • Does the .stdin.write() command block execution until ffmpeg finishes processing the previous image ? (Consequence of the pipe buffer filling up)
    • What’s the buffer size of subprocess.PIPE ?
    • Is it editable ?
    • Is it possible to overwrite this buffer if it’s full, instead of blocking execution ?
    • Does ffmpeg continually read it’s input in a parallel process and buffers it until it’s free to take care of it ?
    • If that’s the case, what’s the size of ffmpeg’s input buffer and how can I change it ?

    I’m asking this because I want to fully understand how the data travels between Python and ffmpeg to reduce the latency to its minimum.

    Here is the part of the code I’m using to start ffmpeg :

    cmd = ['ffmpeg',
       '-f', 'rawvideo',
       '-s', '%dx%d'%(width, height),
       '-pix_fmt', 'rgba',
       '-r', '%d'%fps,
       '-i', '-',
       '-an',
       '-vcodec', 'libx264',
       '-tune', 'zerolatency',
       '-preset', 'ultrafast',
       '-bf', '0',
       '-f', 'mpegts',
       'udp://xxx.xxx.xxx.xxx:xxxxx']

    proc = subprocess.Popen(cmd, stdin=subprocess.PIPE)

    And this is what I call inside a loop when I want to pass an image to ffmpeg :

    proc.stdin.write(image)
  • ffmpeg libx264 neon optimization breaks execution

    27 janvier 2014, par nmxprime

    Hi use libx264 source obtained from x264-snapshot-20140122-2245 and compiling using below script

    NDK=~/Android/android-ndk-r7c
    PLATFORM=$NDK/platforms/android-9/arch-arm/
    PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
    function build_one
    {
    ./configure --prefix=$PREFIX \
    --sysroot=$PLATFORM \
    --disable-avs \
    --disable-lavf \
    --disable-ffms \
    --disable-gpac \
    --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
    --host=arm-linux \
    --enable-static \
    --libdir=$PLATFORM/usr/lib \
    --includedir=$PLATFORM/usr/include \
    --extra-cflags="-march=armv7-a -mfloat-abi=softfp -mfpu=neon -mvectorize-with-neon-quad" \
    --extra-ldflags="-Wl,--fix-cortex-a8" \
    --enable-debug

    The config log is :

    platform:      ARM
    system:        LINUX
    cli:           yes
    libx264:       internal
    shared:        no
    static:        yes
    asm:           yes
    interlaced:    yes
    avs:           no
    lavf:          no
    ffms:          no
    mp4:           no
    gpl:           yes
    thread:        no
    opencl:        yes
    filters:       crop select_every
    debug:         yes
    gprof:         no
    strip:         no
    PIC:           no
    bit depth:     8
    chroma format: all

    You can run 'make' or 'make fprofiled' now.

    I hope the above code compiles and optimizes for NEON execution

    Doubts :

    Why Threads is no, because i didn't specified --disable-thread

    What is cli and it's significance here, also significance of opencl, such that libx264 uses opencl features ?


    Then i built ffmpeg 1.2.5with following script

    ./configure --target-os=linux \
    --prefix=$PREFIX \
    --enable-cross-compile \
    --extra-libs="-lgcc" \
    --arch=arm \
    --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
    --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
    --nm=$PREBUILT/bin/arm-linux-androideabi-nm \
    --sysroot=$PLATFORM \
    --extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \
    --disable-shared \
    --enable-static \
    --extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog -lx264 $EXTRA_LD_FLAG" \
    --disable-ffplay \
    --disable-everything \
    --enable-avformat \
    --enable-avcodec \
    --enable-libx264 \
    --enable-gpl \
    --enable-encoder=libx264 \
    --enable-encoder=libx264rgb \
    --enable-decoder=h264 \
    --disable-network \
    --disable-avfilter \
    --disable-avdevice \
    --enable-debug=3 \
    $ADDITIONAL_CONFIGURE_FLAG

    where

    ADDITIONAL_CONFIGURE_FLAG = --enable-debug=3
    OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -march=$CPU -mvectorize-with-neon-quad"

    The log shows NEON supported.

    When i run the code (called in a while loop),

    ret = avcodec_encode_video2(c, &pkt, picture, &got_output);//avcodec_encode_video(c, finalout, outbuf_size, picture);

    fprintf(stderr,"ret = %d, got-out = %d \n",ret,got_output);
    if (ret < 0)
           fprintf(stderr, "error encoding frame\n");

       if (got_output)
           fprintf(stderr,"encoding frame %3d (size=%5d): (ret=%d)\n", 1, pkt.size,ret);

    it runs for 2 or 3 time(during which if(got_output) is not true), then i get SIGSEGV. Tried addr2line and ndk-stack but no use[Though i enabled debug info, ndk-stack cannot find routine info].

    I edited libx264's encoder.c code with some fprintf statements.
    Posting snippet of code

      if( h->frames.i_input <= h->frames.i_delay + 1 - h->i_thread_frames )
       {
           /* Nothing yet to encode, waiting for filling of buffers */
           pic_out->i_type = X264_TYPE_AUTO;
    fprintf(stderr,"EditLog:: Returns as waiting for filling \n"); //edit
           return 0;
       }
    }

    else
    {
       /* signal kills for lookahead thread */
       x264_pthread_mutex_lock( &h->lookahead->ifbuf.mutex );
       h->lookahead->b_exit_thread = 1;
       x264_pthread_cond_broadcast( &h->lookahead->ifbuf.cv_fill );
       x264_pthread_mutex_unlock( &h->lookahead->ifbuf.mutex );
    }
    fprintf(stderr,"After wait for fill \n");
    fprintf(stderr,"h: %p \n",h); //edit
    fprintf(stderr,"h->i_frame = %p \n",&h->i_frame); //edit
    h->i_frame++;
    fprintf(stderr,"after i_frame++");

    in log, i don't see after i_frame++, here occurs (may be) the SIGSEGV.

    Please help in solving it. The same works without neon optimization !!

  • ffmpeg libx264 neon optimization breaks execution

    27 janvier 2014, par nmxprime

    Hi use libx264 source obtained from x264-snapshot-20140122-2245 and compiling using below script

    NDK=~/Android/android-ndk-r7c
    PLATFORM=$NDK/platforms/android-9/arch-arm/
    PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
    function build_one
    {
    ./configure --prefix=$PREFIX \
    --sysroot=$PLATFORM \
    --disable-avs \
    --disable-lavf \
    --disable-ffms \
    --disable-gpac \
    --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
    --host=arm-linux \
    --enable-static \
    --libdir=$PLATFORM/usr/lib \
    --includedir=$PLATFORM/usr/include \
    --extra-cflags="-march=armv7-a -mfloat-abi=softfp -mfpu=neon -mvectorize-with-neon-quad" \
    --extra-ldflags="-Wl,--fix-cortex-a8" \
    --enable-debug

    The config log is :

    platform:      ARM
    system:        LINUX
    cli:           yes
    libx264:       internal
    shared:        no
    static:        yes
    asm:           yes
    interlaced:    yes
    avs:           no
    lavf:          no
    ffms:          no
    mp4:           no
    gpl:           yes
    thread:        no
    opencl:        yes
    filters:       crop select_every
    debug:         yes
    gprof:         no
    strip:         no
    PIC:           no
    bit depth:     8
    chroma format: all

    You can run 'make' or 'make fprofiled' now.

    I hope the above code compiles and optimizes for NEON execution

    Doubts :

    Why Threads is no, because i didn't specified --disable-thread

    What is cli and it's significance here, also significance of opencl, such that libx264 uses opencl features ?


    Then i built ffmpeg 1.2.5with following script

    ./configure --target-os=linux \
    --prefix=$PREFIX \
    --enable-cross-compile \
    --extra-libs="-lgcc" \
    --arch=arm \
    --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
    --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
    --nm=$PREBUILT/bin/arm-linux-androideabi-nm \
    --sysroot=$PLATFORM \
    --extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \
    --disable-shared \
    --enable-static \
    --extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog -lx264 $EXTRA_LD_FLAG" \
    --disable-ffplay \
    --disable-everything \
    --enable-avformat \
    --enable-avcodec \
    --enable-libx264 \
    --enable-gpl \
    --enable-encoder=libx264 \
    --enable-encoder=libx264rgb \
    --enable-decoder=h264 \
    --disable-network \
    --disable-avfilter \
    --disable-avdevice \
    --enable-debug=3 \
    $ADDITIONAL_CONFIGURE_FLAG

    where

    ADDITIONAL_CONFIGURE_FLAG = --enable-debug=3
    OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -march=$CPU -mvectorize-with-neon-quad"

    The log shows NEON supported.

    When i run the code (called in a while loop),

    ret = avcodec_encode_video2(c, &pkt, picture, &got_output);//avcodec_encode_video(c, finalout, outbuf_size, picture);

    fprintf(stderr,"ret = %d, got-out = %d \n",ret,got_output);
    if (ret < 0)
           fprintf(stderr, "error encoding frame\n");

       if (got_output)
           fprintf(stderr,"encoding frame %3d (size=%5d): (ret=%d)\n", 1, pkt.size,ret);

    it runs for 2 or 3 time(during which if(got_output) is not true), then i get SIGSEGV. Tried addr2line and ndk-stack but no use[Though i enabled debug info, ndk-stack cannot find routine info].

    I edited libx264's encoder.c code with some fprintf statements.
    Posting snippet of code

      if( h->frames.i_input <= h->frames.i_delay + 1 - h->i_thread_frames )
       {
           /* Nothing yet to encode, waiting for filling of buffers */
           pic_out->i_type = X264_TYPE_AUTO;
    fprintf(stderr,"EditLog:: Returns as waiting for filling \n"); //edit
           return 0;
       }
    }

    else
    {
       /* signal kills for lookahead thread */
       x264_pthread_mutex_lock( &h->lookahead->ifbuf.mutex );
       h->lookahead->b_exit_thread = 1;
       x264_pthread_cond_broadcast( &h->lookahead->ifbuf.cv_fill );
       x264_pthread_mutex_unlock( &h->lookahead->ifbuf.mutex );
    }
    fprintf(stderr,"After wait for fill \n");
    fprintf(stderr,"h: %p \n",h); //edit
    fprintf(stderr,"h->i_frame = %p \n",&h->i_frame); //edit
    h->i_frame++;
    fprintf(stderr,"after i_frame++");

    in log, i don't see after i_frame++, here occurs (may be) the SIGSEGV.

    Please help in solving it. The same works without neon optimization !!