Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (88)

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

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

Sur d’autres sites (8063)

  • ffmpeg - pipe metadata about stream

    4 février 2021, par Mike S.

    I'm in process of writing an app which should process live AV stream and do some magic. Well, it should just display some audio levels.

    &#xA;

    So far, everything works with one exception. The problem is that I'm piping the stream from basically unknown source (it may be whatever) and I can only guess the channel count and the sample rate.

    &#xA;

    Is there a way how ffmpeg can tell me this ? Right now, I'm using following command to execute ffmpeg :

    &#xA;

    ffmpeg -loglevel 40 -hide_banner -re -i pipe:0 -vn -f s16le -acodec pcm_s16le&#xA; pipe:3 -progress pipe:4 -f ffmetadata pipe:5&#xA;

    &#xA;

    But ffmetadata is empty and progress does not contain any of required info. I've found ffprobe, which could tell me all I need and then I would kill it, but I believe there is a way to achieve the same with just ffmpeg (and without parsing its stdout).

    &#xA;

    Thank you !

    &#xA;

  • Batch file - Using pipe command after opening a cmd prompt

    20 janvier 2021, par Julien nist

    I am currently trying to create a batch file which will do the following :

    &#xA;

      &#xA;
    1. Open a cmd prompt
    2. &#xA;

    3. Execute a ffmpeg | sox (audio shenanigans for my project)
    4. &#xA;

    5. Open another cmd prompt
    6. &#xA;

    7. Execute the same ffmpeg | sox with different parameters
    8. &#xA;

    9. ...
    10. &#xA;

    &#xA;

    My current script is as follow :

    &#xA;

    start /min cmd /k "ffmpeg -i http://localhost:8000/xxx -f flac - | sox - -t flac E:\Extracts\xxx.flac silence 1 0.50 0.1% 1 2.0 0.1% : newfile : restart"&#xA;

    &#xA;

    But when executing this, only the first ffmpeg part will be effectively executed in the new prompt. The command is working well if launched manually though.

    &#xA;

    Any idea on why the redirection doesn't work ? I tried to split the cmd with variable names, and a couple workaround but no solution atm.

    &#xA;

    Thanks a lot

    &#xA;

    Julien

    &#xA;

  • FFMPEG raises exception only when writing to pipe

    13 janvier 2021, par user14893379

    I am currently writing a small application in Python that gets audio from a Youtube Link and converts this into wave data for visualization. I am using Pafy to get the appropriate URL, ffmpeg-python for the conversion, and matplotlib for visualization.

    &#xA;

    Currently, I am trying to skip the step of downloading the file to a local directory and instead want to write it directly into ffmpeg's pipe, so I can process it directly.

    &#xA;

    The function is the following :

    &#xA;

    import pafy&#xA;import os&#xA;import ffmpeg&#xA;import numpy as np&#xA;import matplotlib.pyplot as plt&#xA;import wave&#xA;&#xA;def getaudio(url, filename=&#x27;temp.wav&#x27;):&#xA;    if os.path.exists(filename):&#xA;        os.remove(filename)&#xA;    source = pafy.new(url).getbestaudio(preftype=&#x27;m4a&#x27;).url&#xA;    try:&#xA;        out, _ = (&#xA;            ffmpeg.input(source)&#xA;            .output(filename, format=&#x27;wav&#x27;)&#xA;            .run(capture_stdout=True, capture_stderr=True)&#xA;        )&#xA;    except ffmpeg._run.Error as e:&#xA;        print(e.stderr.decode(&#x27;utf-8&#x27;))&#xA;        raise e&#xA;    w = wave.open(&#x27;temp.wav&#x27;, &#x27;r&#x27;).readframes(-1)&#xA;    audio = np.frombuffer(w, dtype=np.int16)&#xA;    return audio&#xA;&#xA;&#xA;url = &#x27;https://www.youtube.com/watch?v=bhZs3ALdL7Y&#x27;&#xA;audio = getaudio(url)&#xA;plt.plot(audio)&#xA;plt.show()&#xA;&#xA;

    &#xA;

    This works in general - however this does two things : It returns the audio so it can be opened with the wave package, and it also saves it as 'temp.wav' to the current directory, which I would like to skip by replacing the 'temp.wav' output with 'pipe :' :

    &#xA;

        try:&#xA;        out, _ = (&#xA;            ffmpeg.input(source)&#xA;            .output(&#x27;pipe:&#x27;, format=&#x27;wav&#x27;)&#xA;            .run(capture_stdout=True, capture_stderr=True)&#xA;        )&#xA;    except ffmpeg._run.Error as e:&#xA;        print(e.stderr.decode(&#x27;utf-8&#x27;))&#xA;        raise e&#xA;

    &#xA;

    This raises an exception with the following output for stderr :

    &#xA;

    ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers&#xA;  built with gcc 9.2.1 (GCC) 20200122&#xA;  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid &#xA;--enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;https://r4---sn-h0jelne7.googlevideo.com/videoplayback?expire=1610319670&amp;ei=1jL7X_uZIoeC6dsP9Z6nsA8&amp;ip=2a02%3A810d%3Aabbf%3Abeed%3A98a1%3Ae204%3A805c%3Aa5b1&amp;id=o-AGmTIS4LdQhQz5h7nplFZ0h5iWHR3KxieH44x8mIvXab&amp;itag=140&amp;source=youtube&amp;requiressl=yes&amp;mh=dj&amp;mm=31%2C26&amp;mn=sn-h0jelne7%2Csn-4g5e6nzz&amp;ms=au%2Conr&amp;mv=m&amp;mvi=4&amp;pl=33&amp;initcwndbps=1885000&amp;vprv=1&amp;mime=audio%2Fmp4&amp;ns=qyAm3FG5c0DyOAH11rcQFxYF&amp;gir=yes&amp;clen=55649&amp;dur=3.459&amp;lmt=1508976590967371&amp;mt=1610297792&amp;fvip=4&amp;keepalive=yes&amp;c=WEB&amp;n=YvU_SOWuTrPG1W&amp;sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&amp;sig=AOq0QJ8wRAIgLR-oEO3oWoBfBGslerzo-jO57JhY-xbfKxQJ1GcnpscCIAhuoixcr1X_uDGiUuJ5IbPD2zynF-R8Qp5BjQqSWUaF&amp;lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&amp;lsig=AG3C_xAwRgIhAO9pxuDZZeOd6pESsk4tjlpzDJeCnSqPv4G1-zJKoDI1AiEAjjwkSBZeeEivgAU_DRdnI-GokWQ3P-6gKhdGHe9Za7o%3D&amp;ratebypass=yes&#x27;:&#xA;  Metadata:&#xA;    major_brand     : dash&#xA;    minor_version   : 0&#xA;    compatible_brands: iso6mp41&#xA;    creation_time   : 2017-10-26T00:09:50.000000Z&#xA;  Duration: 00:00:03.46, start: 0.000000, bitrate: 128 kb/s&#xA;    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2017-10-26T00:09:50.000000Z&#xA;      handler_name    : SoundHandler&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (aac (native) -> pcm_s16le (native))&#xA;Press [q] to stop, [?] for help&#xA;Output #0, wav, to &#x27;pipe:&#x27;:&#xA;  Metadata:&#xA;    major_brand     : dash&#xA;    minor_version   : 0&#xA;    compatible_brands: iso6mp41&#xA;    ISFT            : Lavf58.29.100&#xA;    Stream #0:0(und): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2017-10-26T00:09:50.000000Z&#xA;      handler_name    : SoundHandler&#xA;      encoder         : Lavc58.54.100 pcm_s16le&#xA;size=     596kB time=00:00:03.45 bitrate=1411.4kbits/s speed= 316x&#xA;video:0kB audio:596kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.012781%&#xA;&#xA;Traceback (most recent call last):&#xA;  File "e:/Coding Projects/YTStream/Test2.py", line 27, in <module>&#xA;    audio = getaudio(url)&#xA;  File "e:/Coding Projects/YTStream/Test2.py", line 20, in getaudio&#xA;    raise e&#xA;  File "e:/Coding Projects/YTStream/Test2.py", line 16, in getaudio&#xA;    .run(capture_stdout=True, capture_stderr=True)&#xA;  File "C:\Users\xxx\anaconda3\lib\site-packages\ffmpeg\_run.py", line 325, in run&#xA;    raise Error(&#x27;ffmpeg&#x27;, out, err)&#xA;ffmpeg._run.Error: ffmpeg error (see stderr output for detail)&#xA;</module>

    &#xA;

    I am confused how to deal with this exception as there is no obvious error message here (at least to me). It simply stops, as opposed to when I give an obvious error (such as an invalid format that is not supported by ffmpeg -formats).&#xA;Help would be much appreciated !

    &#xA;