Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (14)

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

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

Sur d’autres sites (2553)

  • ffmpeg : Input link parameters do not match the corresponding output link parameters, when concatenating same size videos

    4 mars 2021, par mSourire

    I'm trying to combine a video and an audio, using the following command :

    


    ffmpeg -y -i 1.mkv -i 1.mka 
-max_muxing_queue_size 10000 -preset veryfast -r 30 -crf 20 -b:a 96000 -vbr on
-strict experimental
-filter_complex '
color=black:s=320x240:d=7ms[black0];
aevalsrc=0:d=15ms[silence1];
[black0][0]concat=n=2:v=1:a=0[video];
[1][silence1]concat=n=2:v=0:a=1[audio]'
-map [video] -map [audio] -c:v libvpx -c:a libopus output.webm


    


    But ffmpeg returns an error :

    


    [Parsed_concat_2 @ 0x7f8004506d00] Input link in0:v0 parameters (size 640x480, SAR 1:1) do not match the corresponding output link in0:v0 parameters (320x240, SAR 1:1)
[Parsed_concat_2 @ 0x7f8004506d00] Failed to configure output pad on Parsed_concat_2
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
[libopus @ 0x7f800500c000] 1 frames left in the queue on closing
Conversion failed!


    


    It looks like ffmpeg is unable to concatenate video and black frames, complaining, that video has a distinct resolution, but that's not true :

    


    #> ffprobe 1.mkv
Input #0, matroska,webm, from '1.mkv':
  Metadata:
    encoder         : GStreamer matroskamux version 1.8.1.1
    creation_time   : 2021-03-02T13:44:03.000000Z
  Duration: 00:01:48.41, start: 0.710000, bitrate: 757 kb/s
    Stream #0:0(eng): Video: vp8, yuv420p(progressive), 320x240, SAR 1:1 DAR 4:3, 120 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      title           : Video


    


    So, both the input source and the filter has the same resolution.

    


    When I'm trying to change the color filter to "color=s=640x480", ffmpeg says an opposite thing :

    


    [Parsed_concat_2 @ 0x7fca3ca185c0] Input link in0:v0 parameters (size 320x240, SAR 1:1) do not match the corresponding output link in0:v0 parameters (640x480, SAR 1:1)
[Parsed_concat_2 @ 0x7fca3ca185c0] Failed to configure output pad on Parsed_concat_2
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument


    


    Help please to solve this !

    


    Full listing :

    


    ffmpeg -y -i 1.mkv -i 1.mka
-max_muxing_queue_size 10000
-preset veryfast -r 30 -crf 20 -b:a 96000 -vbr on
-strict experimental
-filter_complex '
color=black:s=320x240:d=7ms[black0];
aevalsrc=0:d=15ms[silence1];
[black0][0]concat=n=2:v=1:a=0[video];
[1][silence1]concat=n=2:v=0:a=1[audio]'
-map [video] -map [audio] -c:v libvpx -c:a libopus output.webm

ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_9 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, matroska,webm, from '1.mkv':
  Metadata:
    encoder         : GStreamer matroskamux version 1.8.1.1
    creation_time   : 2021-03-02T13:44:03.000000Z
  Duration: 00:01:48.41, start: 0.710000, bitrate: 757 kb/s
    Stream #0:0(eng): Video: vp8, yuv420p(progressive), 320x240, SAR 1:1 DAR 4:3, 120 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      title           : Video
Input #1, matroska,webm, from '1.mka':
  Metadata:
    encoder         : GStreamer matroskamux version 1.8.1.1
    creation_time   : 2021-03-02T13:44:03.000000Z
  Duration: 00:01:48.40, start: 0.703000, bitrate: 38 kb/s
    Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
    Metadata:
      title           : Audio
Codec AVOption preset (Configuration preset) specified for output file #0 (output.webm) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
  Stream #0:0 (vp8) -> concat:in1:v0
  Stream #1:0 (opus) -> concat:in0:a0
  concat -> Stream #0:0 (libvpx)
  concat -> Stream #0:1 (libopus)
Press [q] to stop, [?] for help
[libvpx @ 0x7fe08a80bc00] v1.9.0
[libvpx @ 0x7fe08a80bc00] Bitrate not specified for constrained quality mode, using default of 256kbit/sec
Output #0, webm, to 'output.webm':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: vp8 (libvpx), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=-1--1, 256 kb/s, 30 fps, 1k tbn, 30 tbc (default)
    Metadata:
      encoder         : Lavc58.91.100 libvpx
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
    Stream #0:1: Audio: opus (libopus), 48000 Hz, stereo, flt, 96 kb/s (default)
    Metadata:
      encoder         : Lavc58.91.100 libopus
[Parsed_color_0 @ 0x7fe089815940] EOF timestamp not reliable
[Parsed_concat_2 @ 0x7fe088501980] Input link in0:v0 parameters (size 640x480, SAR 1:1) do not match the corresponding output link in0:v0 parameters (320x240, SAR 1:1)
[Parsed_concat_2 @ 0x7fe088501980] Failed to configure output pad on Parsed_concat_2
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
[libopus @ 0x7fe08a810c00] 1 frames left in the queue on closing
Conversion failed!


    


  • electron ffmpeg mas build "Illegal instruction : 4"

    8 mars 2021, par Martin

    I am trying to release an electron app on the Mac Apple Store (mas), my electron app uses ffmpeg to render videos. In order to release my app on the mac apple store, It needs to be sandboxed, and by default ffmpeg makes calls to external libraries so I need to statically build ffmpeg and package it with my app. My code is on the 'mas-ffmpeg-fix' branch : https://github.com/MartinBarker/digify/tree/mas-ffmpeg-fix

    


    My static ffmpeg build works before I build my app, but after running electron-builder build --mac, the ffmpeg executable now fails with Illegal instruction: 4

    


    This is the full timeline of building/packaging/submitting my app to the mac apple store and where the error first appears :

    


      

    • In Digify repo :

      


    • 


    • clone, configure, and build static ffpmeg : “sudo rm -rf ffmpeg-mac/ && npm run download-ffmpeg”

      


    • 


    • download-ffmpeg command is inside package.json and runs this :
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg-mac && cd ffmpeg-mac && ./configure pkg_config='pkg-config --static' --pkg-config-flags='--static' --libdir=/usr/local/lib --extra-version=ntd_20150128 --disable-shared --disable-lzma --enable-gpl --enable-pthreads --enable-nonfree --enable-libass --enable-libfdk-aac  --enable-libmp3lame  --enable-libx264 --enable-static --enable-filters --enable-runtime-cpudetect && make && cd ..

      


    • 


    • Check if any dylibb files in the static ffmpeg build with command : “otool -L ffmpeg-mac/ffmpeg | grep /usr/local”

      


    • 


    • If there are any, move them to folder in desktop, run ‘otool’ again to ensure there are no dynamic libraries, rebuild static ffmpeg.

      


    • 


    • there will now be a folder 'ffmpeg-mac' which contains static versions of ffmpeg and ffprobe

      


    • 


    


    Using ffmpeg with electron UI : works
Using Ffmpeg with command-line command :
/Users/martinbarker/Documents/projects/digify-new/ffmpeg-mac/ffmpeg -h
Works

    


      

    • Build mac mass app with “npm run build-mas“
    • 


    • When this command finishes it will output two files inside the /dist/mas/ folder : Digify.app and Digify-01.20.pkg (or whatever version number it is)
Ffmpeg command-line check :
/Users/martinbarker/Documents/projects/digify-new/dist/mas/Digify.app/Contents/Resources/ffmpeg -h
Illegal instruction : 4
    • 


    


    This is the first place the error appears, after building my mac mac-apple-store app, ffmpeg fails with this err.

    


      

    • Sign built app with .sh file : “sh mas-sign-script.sh”
view .sh file here

        

      • the .sh file will output Digify-mac.pkg
      • 


      


    • 


    • Easier command to both build & sign : “sudo rm -rf dist/mas/ && npm run build-mas && sh mas-sign-script.sh”
    • 


    • Upload the outputted “Digify-mac.pkg” file & submit to apple for review
    • 


    


    Once this app gets published in the store, if you download it and try to run an ffmpeg command with the electron UI, it fails with this error :

    


    /Applications/Digify.app/Contents/Resources/app.asar/node_modules/execa/lib/error.js:59 Uncaught (in promise) Error: Command failed with exit code 1: /Applications/Digify.app/Contents/Resources/ffmpeg -i /Users/martinbarker/Downloads/Felix Lebarty - Bobo/01. Bobo.mp3 -y -filter_complex concat=n=1:v=0:a=1 -c:a libmp3lame -b:a 320k /Users/martinbarker/Downloads/Felix Lebarty - Bobo/output-064237.mp3
ffmpeg version N-101191-g51a9f487ae-ntd_20150128 Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
  configuration: pkg_config='pkg-config --static' --pkg-config-flags=--static --libdir=/usr/local/lib --extra-version=ntd_20150128 --disable-shared --disable-lzma --enable-gpl --enable-pthreads --enable-nonfree --disable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libx264 --enable-static --enable-filters --enable-runtime-cpudetect
  libavutil      56. 65.100 / 56. 65.100
  libavcodec     58.125.100 / 58.125.100
  libavformat    58. 68.100 / 58. 68.100
  libavdevice    58. 12.100 / 58. 12.100
  libavfilter     7.107.100 /  7.107.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[mp3 @ 0x7feeae809c00] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '/Users/martinbarker/Downloads/Felix Lebarty - Bobo/01. Bobo.mp3':
  Metadata:
    comment         : 
    album           : Bobo
    artist          : Felix Lebarty
    title           : Funkytown Eklablog
    genre           : Boogie
    date            : 1984
  Duration: 00:05:19.53, start: 0.000000, bitrate: 320 kb/s
  Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
/Users/martinbarker/Downloads/Felix Lebarty - Bobo/output-064237.mp3: Operation not permitted
    at makeError (/Applications/Digify.app/Contents/Resources/app.asar/node_modules/execa/lib/error.js:59)
    at handlePromise (/Applications/Digify.app/Contents/Resources/app.asar/node_modules/execa/index.js:114)
    at async file:/Applications/Digify.app/Contents/Resources/app.asar/src/js/newindex.js:1162


    


    Command failed with exit code 1: Operation not permitted

    


  • Generating timestamps in webm transport stream with ffmpeg

    16 mai 2024, par Vlad Feinstein

    I am recording screen capture of my Electron app to a file, as suggested here : Save captured video to file in Electron

    


    It works great, but the file is a “transport stream”. I can play it in Chrome browser, but can’t adjust the time slider.

    


    The suggestion was to use ffmpeg to post-process the file. The simplest, straight-forward command I found is :

    


    ffmpeg -fflags +genpts -i in.webm out.webm


    


    I thought that this simply generates timestamps. However, the out.webm file is 15 times smaller than in.webm ! I don’t see any change in the quality. The downside is - the processing takes about the same time as the duration of the video.

    


    Two questions :

    


      

    1. Is there any way I can speedup this “timestamping” process ?
    2. 


    3. Can I record a video that is already 15 times smaller in size ?
    4. 


    


    I specify maxFrameRate: 30 when calling webkitGetUserMedia().

    


    Here is the output of that ffmpeg command :

    


    vlad$ ffmpeg -fflags +genpts -i in.webm out.webm
ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, matroska,webm, from 'in.webm':
  Metadata:
    encoder         : Chrome
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv), 2560x1416, SAR 1:1 DAR 320:177, 1k tbr, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1
Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> vp9 (libvpx-vp9))
Press [q] to stop, [?] for help
[libvpx-vp9 @ 0x7f85f2012600] v1.9.0
[libvpx-vp9 @ 0x7f85f2012600] Neither bitrate nor constrained quality specified, using default CRF of 32
Output #0, webm, to 'out.webm':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0(eng): Video: vp9 (libvpx-vp9), yuv420p, 2560x1416 [SAR 1:1 DAR 320:177], q=-1--1, 1k fps, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1
      encoder         : Lavc58.91.100 libvpx-vp9
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=  209 fps=5.8 q=0.0 Lsize=     881kB time=00:00:17.81 bitrate= 405.0kbits/s speed=0.494x    
video:879kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.231567%


    


    And here is the information on both files from ffprobe :

    


    vlad$ ffprobe in.webm
ffprobe version 4.3.2 Copyright (c) 2007-2021 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, matroska,webm, from 'in.webm':
  Metadata:
    encoder         : Chrome
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv), 2560x1416, SAR 1:1 DAR 320:177, 1k tbr, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1


    


    and

    


    vlad$ ffprobe out.webm
ffprobe version 4.3.2 Copyright (c) 2007-2021 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, matroska,webm, from 'out.webm':
  Metadata:
    ENCODER         : Lavf58.45.100
  Duration: 00:00:17.82, start: 0.000000, bitrate: 405 kb/s
    Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv), 2560x1416, SAR 1:1 DAR 320:177, 1k tbr, 1k tbn, 1k tbc (default)
    Metadata:
      ALPHA_MODE      : 1
      ENCODER         : Lavc58.91.100 libvpx-vp9
      DURATION        : 00:00:17.815000000