Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (48)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (7266)

  • Screen capture (video screencast) with FFMPEG with very low FPS

    20 septembre 2023, par jesusda

    I recently changed PCs, I went from having an Intel Core i5 4460 with integrated graphics card to a Xeon E5 2678 v3 with AMD RADEON RX 550 graphics.

    


    On paper, the new PC is on the order of 3 to 7 times more powerful than the old one and I can attest that this is the case in daily use, video and image editing etc. The advantage of having so many cores and threads available is palpable. In terms of games I haven't tried it because I'm not really a gamer and the few games I use are the typical free ones that come with Debian and some emulators that, honestly, already worked fine with the old PC.

    


    However there is one task that brings me head over heels for its terrible performance : video screen capture.

    


    With my old PC I was able to capture at over 60 fps at full screen while doing any task I needed to record.

    


    Even with my lenovo thinkpad x230 I am able to capture screen at over 80fps with total fluency.

    


    The command I have always used is :

    


    ffmpeg  -f x11grab -draw_mouse 1 -framerate 60 -video_size 1920x1200 -i :0.0+1680,0  -qscale 0 -pix_fmt yuv420p -c:v libx264 -preset medium -qp 0 -q:v 1 -s 1920x1200 -f matroska -threads 4 video.mkv


    


    notes :

    


    -video_size 1920x1200 -i :0.0+1680,0 y -s 1920x1200 are the dimensions and position of the region to capture (my right monitor).

    


    Notice that I even used -preset medium and software encoding, so I got very good quality even with that parameter setting and without ever going below 60 fps.

    


    What happens to me now ?

    


    The equipment is unable to capture more than 20 fps which makes any video invalid, with frame drops and not even reach 30fps, which would be the minimum required.

    


    In addition, it is quite noticeable the decrease in responsiveness of the PC as soon as I launch the command. That is, all that fluidity and smoothness that is appreciated when working normally, disappears and even moving a window from one side to another is rough and stumbling.

    


    I have tried with different parameters of ffmpeg, to capture raw, without encoding.

    


    I have tried saving the resulting video directly to RAM disk in order to avoid the possible bottleneck of writing to disk. It doesn't affect it at all.

    


    So, does anyone have any suggestions as to at least where I can dig further to find a solution to the problem ?

    


    Additional data, in case it helps :

    


    $ → inxi
CPU: 12-Core Intel Xeon E5-2678 v3 (-MT MCP-)
speed/min/max: 1201/1200/3300 MHz Kernel: 5.10.0-0.bpo.4-amd64 x86_64
Up: 1d 6h 55m Mem: 6427.6/32012.4 MiB (20.1%)
Storage: 13.76 TiB (55.9% used) Procs: 433 Shell: bash 5.0.18 inxi: 3.0.32


$ → ffmpeg -v
ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-libopencv --disable-outdev=sdl2 --disable-podpages --disable-sndio --disable-stripping --enable-libaom --enable-avfilter --enable-avresample --enable-gcrypt --disable-gnutls --enable-openssl --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libzimg --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opencl --enable-opengl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --enable-libwebp --incdir=/usr/include/x86_64-linux-gnu --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --toolchain=hardened --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --enable-vaapi --enable-libmfx --enable-libvmaf --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100


    


    I have the free amdgpu drivers (not amdgpu-pro), but I activated OpenCL just in case.

    


    I followed this tutorial.

    


    $ → glxinfo | grep OpenGL
OpenGL vendor string: AMD
OpenGL renderer string: Radeon RX550/550 Series (POLARIS12, DRM 3.40.0, 5.10.0-0.bpo.4-amd64, LLVM 11.0.1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.3.4
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.3.4
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.3.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:





$ → clinfo
Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 20.3.4
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 1
  Device Name                                     Radeon RX550/550 Series (POLARIS12, DRM 3.40.0, 5.10.0-0.bpo.4-amd64, LLVM 11.0.1)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 20.3.4
  Driver Version                                  20.3.4
  Device OpenCL C Version                         OpenCL C 1.1
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Max compute units                               8
  Max clock frequency                             1183MHz
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple              64
  Preferred / native vector sizes
    char                                                16 / 16
    short                                                8 / 8
    int                                                  4 / 4
    long                                                 2 / 2
    half                                                 0 / 0        (n/a)
    float                                                4 / 4
    double                                               2 / 2        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              3221225472 (3GiB)
  Error Correction support                        No
  Max memory allocation                           1717986918 (1.6GiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       32768 bits (4096 bytes)
  Global Memory cache type                        None
  Image support                                   No
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max number of constant args                     16
  Max constant buffer size                        67108864 (64MiB)
  Max size of kernel argument                     1024
  Queue properties
    Out-of-order execution                        No
    Profiling                                     Yes
  Profiling timer resolution                      0ns
  Execution capabilities
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  Device Extensions cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp64

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 Clover
    Device Name                                   Radeon RX550/550 Series (POLARIS12, DRM 3.40.0, 5.10.0-0.bpo.4-amd64, LLVM 11.0.1)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 Clover
    Device Name                                   Radeon RX550/550 Series (POLARIS12, DRM 3.40.0, 5.10.0-0.bpo.4-amd64, LLVM 11.0.1)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 Clover
    Device Name                                   Radeon RX550/550 Series (POLARIS12, DRM 3.40.0, 5.10.0-0.bpo.4-amd64, LLVM 11.0.1)

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.12
  ICD loader Profile                              OpenCL 2.2


    


    This would not be a tearing problem, as no tearing is visible when playing videos and the TearFree driver policy is enabled.

    


    $ → xrandr --verbose | grep TearFree
    TearFree: on
    TearFree: on
    TearFree: on


    


  • FFMPEG Inverts colors when converting tiff pictures to png

    1er juin 2021, par Mounia Jaiti

    We need to convert thousands of tiff pictures to png. To accomplish that we are using FFMPEG. We've noticed recently that for very few of the converted files (in png), the colors are inverted : the input tiff file is all black and white (a technical drawing in black with a white background), and the output png file is white and black (the drawing becomes white and the background becomes black). Of course we don't want that, we need the colors to stay the same.

    


    Here is the command we are using :

    


    ffmpeg -y -v warning -i in_file.tif out_file.png


    


    We've tested the 'negate' parameter on those files, and the pictures are correctly converted. But we can't apply this parameter to all of the input tiff files.
Here is the command with the negate parameter :

    


    ffmpeg -y -v verbose -i input.tif -vf negate output.png


    


    The Code Java we're using :

    


                String ffmpegPath="/Users/user11/ffmpeg//ffmpeg";&#xA;            List<string> commandArgs = new ArrayList<string>();&#xA;            commandArgs.add(ffmpegPath);&#xA;            //overwrite output file if it exists&#xA;            commandArgs.add("-y");      &#xA;            commandArgs.add("-v");&#xA;            commandArgs.add("verbose");&#xA;            //set input file &#xA;            commandArgs.add("-i"); &#xA;            commandArgs.add(picture.getAbsolutePath());&#xA;            commandArgs.add(dest.getAbsolutePath());&#xA;            &#xA;            String cmd = "";&#xA;            for(String cmdArg : commandArgs) {&#xA;                cmd &#x2B;= cmdArg &#x2B; " ";&#xA;            }&#xA;&#xA;&#xA;</string></string>

    &#xA;

    Logs for tif having the bug :

    &#xA;

    &#xA;31, 2021 2:15:51 PM &#xA;INFO: Executing : /Users/user11/ffmpeg/ffmpeg -y -v verbose -i /Users/user11/ffmpeg/input.tif /Users/user11/ffmpeg/output.png &#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: ffmpeg version 4.4-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2021 the FFmpeg developers&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   built with Apple clang version 11.0.0 (clang-1100.0.33.17)&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   libavutil      56. 70.100 / 56. 70.100&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   libavcodec     58.134.100 / 58.134.100&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   libavformat    58. 76.100 / 58. 76.100&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   libavdevice    58. 13.100 / 58. 13.100&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   libavfilter     7.110.100 /  7.110.100&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   libswscale      5.  9.100 /  5.  9.100&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   libswresample   3.  9.100 /  3.  9.100&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   libpostproc    55.  9.100 / 55.  9.100&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: [tiff_pipe @ 0x7fa7f6008200] parser not found for codec tiff, packets or times may be invalid.&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:     Last message repeated 1 times&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: Input #0, tiff_pipe, from &#x27;/Users/user11/ffmpeg/input.tif&#x27;:&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   Duration: N/A, bitrate: N/A&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   Stream #0:0: Video: tiff, 1 reference frame, monob, 2008x2481 [SAR 1:1 DAR 2008:2481], 25 fps, 25 tbr, 25 tbn, 25 tbc&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: Stream mapping:&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   Stream #0:0 -> #0:0 (tiff (native) -> png (native))&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: Press [q] to stop, [?] for help&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: [graph 0 input from stream 0:0 @ 0x7fa7f4c08300] w:2008 h:2481 pixfmt:monob tb:1/25 fr:25/1 sar:1/1&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: Output #0, image2, to &#x27;/Users/user11/ffmpeg/output.png&#x27;:&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   Metadata:&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:     encoder         : Lavf58.76.100&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   Stream #0:0: Video: png, 1 reference frame, monob(progressive), 2008x2481 (0x0) [SAR 1:1 DAR 2008:2481], q=2-31, 200 kb/s, 25 fps, 25 tbn&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:     Metadata:&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:       encoder         : Lavc58.134.100 png&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: frame=    1 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: No more output streams to write to, finishing.&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: [AVIOContext @ 0x7fa7f4c14180] Statistics: 0 seeks, 1 writeouts&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: frame=    1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=1.31x    &#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: video:37kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: Input file #0 (/Users/user11/ffmpeg/input.tif):&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   Input stream #0:0 (video): 1 packets read (18100 bytes); 1 frames decoded; &#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   Total: 1 packets (18100 bytes) demuxed&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: Output file #0 (/Users/user11/ffmpeg/output.png):&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (38013 bytes); &#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output:   Total: 1 packets (38013 bytes) muxed&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: ReencodePicture output: [AVIOContext @ 0x7fa7f4f041c0] Statistics: 18100 bytes read, 0 seeks&#xA;May 31, 2021 2:15:51 PM &#xA;INFO: BinaryRepositoryHelper.convertPixTo ffmpeg Process returned : java.lang.UNIXProcess@27ddd392, ended with code 0, and returned in 160 ms, out=/Users/user11/ffmpeg/output.png exists=true&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;

    &#xA;

    So our questions are :

    &#xA;

      &#xA;
    1. Is there a way to identify the tiff files that will be converted to png with inverted colors ? So that we can know to which files the 'negate' parameter must be applied.
    2. &#xA;

    3. Are there any other FFMPEG parameter that we can use.
    4. &#xA;

    &#xA;

    This issue has been driving us mad for the last couple of days. Any help would be highly appreciated.&#xA;Thanks.

    &#xA;

    Example of Tif picture

    &#xA;

    https://drive.google.com/file/d/1U1a91gTk1gaJb-XAPavNq6UhmjWXZjbM/view?usp=sharing

    &#xA;

  • Possible bug in OpenCV2.4 capturing frames from video

    23 septembre 2013, par Jav_Rock

    Could it be that there is a bug in OpenCV2.4 highgui for capturing frames from video in windows ?

    I installed both the precompiled libraries, the ones compiled by me, I can compile everything perfectly and I can run my programs if

    they are image based. The problem is only for videos. OpenCV crashes in this function always :

    virtual IplImage* retrieveFrame(int)
       {
           unsigned char* data = 0;
           int step=0, width=0, height=0, cn=0;

           if(!ffmpegCapture ||
              !icvRetrieveFrame_FFMPEG_p(ffmpegCapture,&amp;data,&amp;step,&amp;width,&amp;height,&amp;cn)) &lt;-------CRASHES HERE
              return 0;
           cvInitImageHeader(&amp;frame, cvSize(width, height), 8, cn);
           cvSetData(&amp;frame, data, step);
           return &amp;frame;
       }

    This is inside the class cap_ffmpeg.cpp and is called by VideoCapture.

    I tried versions 2.4.2 and 2.4.9. My programes were working finde with opencv2


    More information

    • Windows 7

    • Build the projects with cmake (important as it could be that cmake is not building/finding the right codecs)

    • VisualStudio 9 2008

    • OpenCV 2.4.2

    EDIT

    It looks like it is actually a bug, so, how can I solve this problem and change my code to be able to read avi files ?