Recherche avancée

Médias (1)

Mot : - Tags -/publicité

Autres articles (59)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

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

Sur d’autres sites (6490)

  • avformat_open_input for 24-bit audio fails intermittently with avfoundation due to "audio format is not supported"

    27 septembre 2019, par NaderNader

    My application uses the ffmpeg APIs (avformat, avdevice, etc) to open a selected audio input for encoding. For audio inputs configured for 24-bit I can reliably open them the first time, but when I close and reopen that input later, the avformat_open_input() call fails due to "audio format is not supported". My testing shows that it never fails the first time after starting my, and has only about a 50% chance of success when reopening.

    The failure only occurs when I configure my "Built-in Microphone" audio input for 24-bit integer. 16-bit integer and 32-bit float work reliably. Changing the number of channels and sample rate has no effect.

    I have read the documentation and see that the proper way to free the resources after opening is to call avformat_close_input. The only way I have found to guarantee success is to only open the input once.

    I have written a test program to recreate these failures.

    int main() {

       avdevice_register_all();

       cout << "Running open audio test" << endl;


       int i;
       for(i = 0; i< 10; i++) {

           AVDictionary* options = NULL;
           AVInputFormat* inputFormat = av_find_input_format("avfoundation");
           if (!inputFormat) {
               cout << "avfoundation inputFormat=null" << endl;
           }

           AVFormatContext* formatContext = avformat_alloc_context();
           int result = avformat_open_input(&formatContext, ":1", inputFormat, &options);
           if (result < 0) {
               char error[256];
               av_strerror(result, error, sizeof(error));
               cout << "result=" << result << " " << error << endl;
           } else {
               cout << "input opened successfully" << endl;
           }

           sleep(1);

           avformat_close_input(&formatContext);

           sleep(1);

       }

       return 0;
    }

    I would expect the main loop to succeed each time but a typical output shows a high failure rate :

    Running open audio test

    input opened successfully
    [avfoundation @ 0x7fdeb281de00] audio format is not supported
    result=-5 Input/output error
    [avfoundation @ 0x7fdeb2001400] audio format is not supported
    result=-5 Input/output error
    [avfoundation @ 0x7fdeb2001400] audio format is not supported
    result=-5 Input/output error
    input opened successfully
    input opened successfully
    input opened successfully
    [avfoundation @ 0x7fdeb2068800] audio format is not supported
    result=-5 Input/output error
    input opened successfully
    input opened successfully

    I have tried increasing the sleep time between close and open to 5 seconds, but saw no difference in behavior. While this program runs, I can use the MacOS Audio MIDI Setup to change the microphone input configuration and watch the output change from all success to intermittent errors.

    The source of the failure is https://github.com/FFmpeg/FFmpeg/blob/master/libavdevice/avfoundation.m#L672

    It appears avfoundation.m internally is opening an input stream and grabbing an audio frame to determine the format, but the value returned is not valid sometimes, when the process has previously opened and closed that input.

    Am I not closing the resources properly ? Do I have a hardware issue specific to my macbook ?

    Additional Details :

    Tested MacBook Pro with MacOS Mojave 10.14.6
    Tested with Ffmpeg 3.4.1, 4.0, and 4.1

    list_devices :

    [AVFoundation input device @ 0x7f80fff066c0] AVFoundation video devices:
    [AVFoundation input device @ 0x7f80fff066c0] [0] FaceTime HD Camera
    [AVFoundation input device @ 0x7f80fff066c0] [1] Capture screen 0
    [AVFoundation input device @ 0x7f80fff066c0] AVFoundation audio devices:
    [AVFoundation input device @ 0x7f80fff066c0] [0] Behringer Duplex
    [AVFoundation input device @ 0x7f80fff066c0] [1] Built-in Microphone
    [AVFoundation input device @ 0x7f80fff066c0] [2] USB Audio CODEC
  • TCP or UDP ? Delays building up on production for video stream

    31 janvier 2020, par Ben Beri

    I am creating a video stream from a camera with FFMPEG and nodejs stream Duplex class.

    this.ffmpegProcess = spawn('"ffmpeg"', [

     '-i', '-',
     '-loglevel', 'info',

     /**
      * MJPEG Stream
      */

     '-map', '0:v',
     '-c:v', 'mjpeg',
     '-thread_type', 'frame', // suggested for performance on StackOverflow.
     '-q:v', '20', // force quality of image. 2-31 when 2=best, 31=worst
     '-r', '25', // force framerate
     '-f', 'mjpeg',
     `-`,

    ], {
     shell: true,
     detached: false,
    });

    On local network, we are testing it with a few computers and every thing works very stable with latency of maximum 2 seconds.

    However, we have imported the service to AWS production, when we connect the first computer we have a latency of around 2 seconds, but if another client connects to the stream, they both start delaying a lot, where the latency builds up to 10+ seconds, and in addition the video is very slow, as in the motion between frames.

    Now I asked about TCP or UDP is because we are using TCP for the stream, which means that every packet that is sent is implementing the TCP syn-ack-synack protocol and sequence.

    My question is, could TCP really be causing such an issue that the delays get up to 10 seconds with very slow motion ? because on local network it works very just fine.

  • FFmpeg eats all the memory and crash within a minute while recording chrome activity

    17 avril 2020, par Thomas Petit

    I'm using ffmpeg to capture the activity of chrome (thanks to chrome driver) and record it into an mp4 file. However, the memory consumed by ffmpeg is quickly blowing up, and after a minute or so my 8GB of memory get saturated and I have to reboot the PC.

    



    Unbuntu 16.0
ALSA loopback (installed by modprobe snd-aloop)
ffmpeg version 4.2.2-1ubuntu1 16.04.york0

    



    This is the command line to ffmpeg :

    



        ffmpeg -y -v info -f x11grab -draw_mouse 0 -r 30 -s 1280x720 -thread_queue_size 4096 
-i :0.0+0,0 -f alsa -thread_queue_size 4096 -i plug:cloop -acodec aac -strict -2 -ar 44100 
-c:v libx264 -preset veryfast -profile:v main -level 3.1 -pix_fmt yuv420p -r 30 
-crf 25 -g 60 -tune zerolatency -f mp4 file.mp4


    



    If I remove all the sound input (-i plug:cloop -acodec aac -strict -2 -ar 44100) then the memory is OK, stable, but the file generated can't be played with VLC or media player.

    



    The logs from ffmpeg looks normal to me :

    



    root$ ffmpeg -rtbufsize 15M -y -v info -f x11grab -draw_mouse 0 -r 30 -s 1280x720 -thread_queue_size 4096 -i :0.0+0,0 -f alsa -thread_queue_size 4096 -i hw:0 -acodec ac3_fixed -strict -2 -ar 44100 -c:v libx264 -preset veryfast -profile:v main -level 3.1 -pix_fmt yuv420p -r 30 -crf 25 -g 60 -tune zerolatency -f mp4 /tmp/recordings/stuff.mp4
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, x11grab, from ':0.0+0,0':
  Duration: N/A, start: 1587042601.295126, bitrate: N/A
    Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1280x720, 30 fps, 30 tbr, 1000k tbn, 30 tbc
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:0':
  Duration: N/A, start: 1587042601.304179, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
[libx264 @ 0x928ee0] using cpu capabilities: MMX2 SSE Cache64
[libx264 @ 0x928ee0] profile Main, level 3.1
Output #0, mpegts, to '/tmp/recordings/stuff.ts':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (libx264), yuv420p, 1280x720, q=-1--1, 30 fps, 90k tbn, 30 tbc
    Metadata:
      encoder         : Lavc56.60.100 libx264
    Stream #0:1: Audio: ac3 (ac3_fixed), 44100 Hz, stereo, s16p, 192 kb/s
    Metadata:
      encoder         : Lavc56.60.100 ac3_fixed
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> ac3 (ac3_fixed))
Press [q] to stop, [?] for help
frame=    7 fps=0.0 q=21.0 size=       5kB time=00:00:00.23 bitrate= 180.5kbits/s frame=   15 fps= 15 q=21.0 size=      15kB time=00:00:00.50 bitrate= 240.6kbits/s frame=   21 fps= 14 q=21.0 size=      21kB time=00:00:00.70 bitrate= 249.2kbits/s frame=   28 fps= 14 q=21.0 size=      28kB time=00:00:00.93 bitrate= 246.5kbits/s frame=   35 fps= 13 q=21.0 size=      35kB time=00:00:01.16 bitrate= 244.9kbits/s frame=   42 fps= 13 q=21.0 size=      44kB time=00:00:01.40 bitrate= 260.0kbits/s frame=   49 fps= 13 q=21.0 size=      51kB time=00:00:01.63 bitrate= 256.9kbits/s frame=   56 fps= 13 q=21.0 size=      58kB time=00:00:01.86 bitrate= 254.6kbits/s frame=   63 fps= 13 q=22.0 size=      66kB time=00:00:02.10 bitrate= 255.7kbits/s frame=   70 fps= 13 q=21.0 size=      75kB time=00:00:02.33 bitrate= 263.0kbits/s frame=   77 fps= 13 q=21.0 size=      82kB time=00:00:02.56 bitrate= 261.3kbits/s frame=   79 fps= 13 q=21.0 Lsize=      85kB time=00:00:02.63 bitrate= 264.4kbits/s
video:8kB audio:61kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 22.604090%
[libx264 @ 0x928ee0] frame I:2     Avg QP: 5.10  size:   760
[libx264 @ 0x928ee0] frame P:77    Avg QP: 6.78  size:    88
[libx264 @ 0x928ee0] mb I  I16..4: 99.9%  0.0%  0.1%
[libx264 @ 0x928ee0] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
[libx264 @ 0x928ee0] coded y,uvDC,uvAC intra: 0.0% 0.1% 0.0% inter: 0.0% 0.0% 0.0%
[libx264 @ 0x928ee0] i16 v,h,dc,p: 91%  0%  9%  0%
[libx264 @ 0x928ee0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  0%  0% 100%  0%  0%  0%  0%  0%  0%
[libx264 @ 0x928ee0] i8c dc,h,v,p: 98%  2%  0%  0%
[libx264 @ 0x928ee0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x928ee0] kb/s:25.23
Exiting normally, received signal 2.


    



    This is my .asoundrc file.

    



    # playback PCM device: using loopback subdevice 0,0
pcm.amix {
  type dmix
  ipc_key 219345
  slave.pcm "hw:Loopback,0,0"
}

# capture PCM device: using loopback subdevice 0,1
pcm.asnoop {
  type dsnoop
  ipc_key 219346
  slave.pcm "hw:Loopback,0,1"
}

# duplex device combining our PCM devices defined above
pcm.aduplex {
  type asym
  playback.pcm "amix"
  capture.pcm "asnoop"
}

# ------------------------------------------------------
# for jack alsa_in and alsa_out: looped-back signal at other ends
pcm.ploop {
  type plug
  slave.pcm "hw:Loopback,1,1"
}

pcm.cloop {
  type dsnoop
  ipc_key 219348
  slave.pcm "hw:Loopback,1,0"
}

# ------------------------------------------------------
# default device

pcm.!default {
  type plug
  slave.pcm "aduplex"
}


    



    I'm not sure how to debug this kind of issue, any idea why the memory blow up so fast like that ?