Recherche avancée

Médias (91)

Autres articles (44)

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

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (5144)

  • cut fragment of mp3 from, to and apply fade in, fade out

    23 juin 2021, par Mevia

    I am in need of a tool that will complete following tasks

    


      

    1. provide source mp3
    2. 


    3. provide data of fragment to cut (start time, end time)
    4. 


    5. start cutting from source where start is
    6. 


    7. end cutting from source where end is
    8. 


    9. apply X seconds fade in beginning of start time
    10. 


    11. apply Y seconds fade out beginning Y seconds subtracted from end
    12. 


    


    By fade i mean increase / decrease volume between 0 - 100% / 100% - 0

    


    I already have an interface that allows to prepare data.

    


    On the backend side, I am working with node.js.

    


    After some research i found a tool FFmpeg that was widely recommended to achieve my goal.

    


    After further research i came up with following code :

    


    const { stdout, stderr } = await exec('ffmpeg -y -i "' + sourcePath + '" -ss ' + start + ' -to ' + end + ' -af "afade=in:st=' + start + ':d=' + fadeLength + ',afade=out:st=' + (end - 3) + ':d=' + fadeLength + '" "' + outputPath + '"');

/*
Breakdown:
    ffmpeg
        -y
        -i "sourcePath"
        -ss start
        -to end
        -af "afade=in:st=(start):d=(fadeLength),afade=out:st=(end - fadeLength):d=3"
        "outputPath"

Example:
    ffmpeg
        -y
        -i "/source/test.mp3"
        -ss 89.382716
        -to 172.817231
        -af "afade=in:st=89.382716:d=5,afade=out:st=(172.817231 - 5):d=5"
        "/output/test_cut.mp3"
*/


    


    It's working, but processor throws warnings :

    


    [mp3 @ 0x7fc50a80c800] Estimating duration from bitrate, this may be inaccurate
[swscaler @ 0x114800000] deprecated pixel format used, make sure you did set range correctly
[mp3 @ 0x7fc50a819a00] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2


    


    Full log :

    


    ffmpeg version 4.4 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.4_2 --enable-shared --enable-pthreads --enable-version3 --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-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
    libavutil      56. 70.100 / 56. 70.100
    libavcodec     58.134.100 / 58.134.100
    libavformat    58. 76.100 / 58. 76.100
    libavdevice    58. 13.100 / 58. 13.100
    libavfilter     7.110.100 /  7.110.100
    libavresample   4.  0.  0 /  4.  0.  0
    libswscale      5.  9.100 /  5.  9.100
    libswresample   3.  9.100 /  3.  9.100
    libpostproc    55.  9.100 / 55.  9.100
[mp3 @ 0x7fc50a80c800] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'test.mp3':
    Metadata:
        title           : Test
        artist          : Test
    Duration: 00:03:22.50, start: 0.000000, bitrate: 320 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
    Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 320x240, 90k tbr, 90k tbn, 90k tbc (attached pic)
        Metadata:
            comment         : Other
Stream mapping:
    Stream #0:1 -> #0:0 (mjpeg (native) -> png (native))
    Stream #0:0 -> #0:1 (mp3 (mp3float) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[swscaler @ 0x114800000] deprecated pixel format used, make sure you did set range correctly
[mp3 @ 0x7fc50a819a00] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
Output #0, mp3, to 'test (CUT).mp3':
    Metadata:
        TIT2            : Test
        TPE1            : Test
        TSSE            : Lavf58.76.100
    Stream #0:0: Video: png, rgb24, 320x240, q=2-31, 200 kb/s, 90k fps, 90k tbn (attached pic)
        Metadata:
            comment         : Other
            encoder         : Lavc58.134.100 png
    Stream #0:1: Audio: mp3, 44100 Hz, stereo, fltp
        Metadata:
            encoder         : Lavc58.134.100 libmp3lame
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:39.89 bitrate=   0.0kbits/s speed=31.4x    
[mp3 @ 0x7fc50a819a00] No packets were sent for some of the attached pictures.
frame=    0 fps=0.0 q=0.0 Lsize=     626kB time=00:00:40.02 bitrate= 128.2kbits/s speed=31.4x    
video:0kB audio:626kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.053810%


    


    So my question is, how to change execution command to have it executed properly (avoid warnings and errors) ?

    


    Important thing is that i am only interested in cutting it, if possible avoid re-encondig because i am already working with 320 mp3's that have been produced from master wav's.

    


  • Anomalie #4831 (Nouveau) : URLs arbo non mise à jour au changement de rubrique

    23 juin 2021, par Julien Tessier

    Etapes pour reproduire :

    • Utiliser les URL arbos
    • Créer un article "Lorem ipsum" dans la rubrique 1
    • Publier l’article, son URL est /rubrique-1/lorem-ipsum
    • Créer un article "Lorem ipsum" dans la rubrique 2
    • Proposer l’article à la publication, son URL est /rubrique-2/lorem-ipsum
    • Déplacer l’article dans la rubrique 1
    • SPIP génère une erreur dans les logs :
      2021-06-23 11:32:54 127.0.0.1 (pid 498) :Pri:ERREUR : Erreur 1062 de mysql : Duplicate entry ’1-lorem-ipsum’ for key ’PRIMARY’
      in .../plugins-dist/urls_etendues/action/editer_url.php L155 [sql_insertq(),url_insert(),declarer_url_arbo(),_generer_url_arbo(),urls_arbo_dist(),generer_url_entite(),html_af5c93b1e9d12543df40c819344ffc73(),public_parametrer_dist(),public_produire_page_dist(),inclure_page(),evaluer_fond(),recuperer_fond(),urls_afficher_fiche_objet(),minipipe(),execute_pipeline_afficher_fiche_objet(),pipeline(),f_afficher_blocs_ecrire(),f_recuperer_fond(),minipipe(),execute_pipeline_recuperer_fond(),pipeline(),recuperer_fond(),traiter_appels_inclusions_ajax()]
      
    • Publier l’article
    • L’URL du nouvel article est inchangée donc il est inaccessible (= son URL a déjà été "prise" par un autre)

    Comportement attendu

    Au changement de rubrique, URL arbos regénère une URL unique (avec l’ID donc).

    Résolution temporaire

    J’ai réglé ça de la manière suivante, via un plugin et la pipeline post_edition :

    1. <span class="CodeRay"><span class="keyword">function</span> <span class="function">plugin_post_edition</span>(<span class="local-variable">$e</span>) {
    2.     <span class="keyword">switch</span> (objet_type(<span class="local-variable">$e</span>[<span class="string"><span class="delimiter">'</span><span class="content">args</span><span class="delimiter">'</span></span>][<span class="string"><span class="delimiter">'</span><span class="content">table</span><span class="delimiter">'</span></span>])) {
    3.         <span class="keyword">case</span> <span class="string"><span class="delimiter">'</span><span class="content">article</span><span class="delimiter">'</span></span>;
    4.             <span class="keyword">if</span> (!<span class="predefined">empty</span>(<span class="local-variable">$e</span>[<span class="string"><span class="delimiter">'</span><span class="content">data</span><span class="delimiter">'</span></span>][<span class="string"><span class="delimiter">'</span><span class="content">id_rubrique</span><span class="delimiter">'</span></span>])) {
    5.                 <span class="local-variable">$id_rubrique</span> = <span class="predefined">intval</span>(<span class="local-variable">$e</span>[<span class="string"><span class="delimiter">'</span><span class="content">data</span><span class="delimiter">'</span></span>][<span class="string"><span class="delimiter">'</span><span class="content">id_rubrique</span><span class="delimiter">'</span></span>]);
    6.                 <span class="local-variable">$id_article</span> = <span class="predefined">intval</span>(<span class="local-variable">$e</span>[<span class="string"><span class="delimiter">'</span><span class="content">args</span><span class="delimiter">'</span></span>][<span class="string"><span class="delimiter">'</span><span class="content">id_objet</span><span class="delimiter">'</span></span>]);
    7.                 <span class="keyword">if</span> (<span class="local-variable">$url</span> = sql_fetsel(<span class="string"><span class="delimiter">'</span><span class="content">url</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">spip_urls</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">"</span><span class="content">type = 'article' AND id_objet = </span><span class="local-variable">$id_article</span><span class="delimiter">"</span></span>, <span class="string"><span class="delimiter">'</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">perma DESC, date DESC</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">1</span><span class="delimiter">'</span></span>)) {
    8.                     <span class="local-variable">$url</span> = <span class="local-variable">$url</span>[<span class="string"><span class="delimiter">'</span><span class="content">url</span><span class="delimiter">'</span></span>];
    9.                     <span class="keyword">if</span> (sql_countsel(<span class="string"><span class="delimiter">'</span><span class="content">spip_urls</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">"</span><span class="content">url = </span><span class="delimiter">"</span></span>.sql_quote(<span class="local-variable">$url</span>).<span class="string"><span class="delimiter">"</span><span class="content"> AND type = 'article' AND id_parent = </span><span class="local-variable">$id_rubrique</span><span class="content"> AND id_objet != </span><span class="local-variable">$id_article</span><span class="delimiter">"</span></span>)) {
    10.                         sql_delete(<span class="string"><span class="delimiter">'</span><span class="content">spip_urls</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">"</span><span class="content">type = 'article' AND id_objet = </span><span class="local-variable">$id_article</span><span class="content"> AND url = </span><span class="delimiter">"</span></span>.sql_quote(<span class="local-variable">$url</span>));
    11.                     }
    12.                 }
    13.             }
    14.             <span class="keyword">break</span>;
    15.         <span class="keyword">default</span>:
    16.             <span class="keyword">break</span>;
    17.     }
    18.     <span class="keyword">return</span> <span class="local-variable">$e</span>;
    19. }
    20. </span>

    Télécharger

    Ce n’est peut être pas élégant mais ça marche en attendant un fix :)

  • About Soundcloud scraping for uploading music to telegram group

    16 juin 2021, par so sa

    I am trying to automatically download the new uploaded file from the below soundcloud link and upload it to a telegram group :

    &#xA;

    https://soundcloud.com/radio-hamrah-1

    &#xA;

    so I have googled the :

    &#xA;

    &#xA;

    python script to download from soundcloud and import to telegram&#xA;group

    &#xA;

    &#xA;

    and tried the scdl python module by its instruction, but when I have tried its on this colab page I get this error :

    &#xA;

    !pip3 install git&#x2B;https://github.com/flyingrub/scdl&#xA;!scdl -l https://soundcloud.com/pandadub/sets/the-lost-ship --download-archive archive.txt -c&#xA;&#xA;Collecting git&#x2B;https://github.com/flyingrub/scdl&#xA;  Cloning https://github.com/flyingrub/scdl to /tmp/pip-req-build-0g64ql2f&#xA;  Running command git clone -q https://github.com/flyingrub/scdl /tmp/pip-req-build-0g64ql2f&#xA;Requirement already satisfied (use --upgrade to upgrade): scdl==1.6.12 from git&#x2B;https://github.com/flyingrub/scdl in /usr/local/lib/python3.7/dist-packages&#xA;Requirement already satisfied: docopt in /usr/local/lib/python3.7/dist-packages (from scdl==1.6.12) (0.6.2)&#xA;Requirement already satisfied: mutagen in /usr/local/lib/python3.7/dist-packages (from scdl==1.6.12) (1.45.1)&#xA;Requirement already satisfied: termcolor in /usr/local/lib/python3.7/dist-packages (from scdl==1.6.12) (1.1.0)&#xA;Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from scdl==1.6.12) (2.23.0)&#xA;Requirement already satisfied: clint in /usr/local/lib/python3.7/dist-packages (from scdl==1.6.12) (0.5.1)&#xA;Requirement already satisfied: chardet&lt;4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->scdl==1.6.12) (3.0.4)&#xA;Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,&lt;1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->scdl==1.6.12) (1.24.3)&#xA;Requirement already satisfied: idna&lt;3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->scdl==1.6.12) (2.10)&#xA;Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->scdl==1.6.12) (2021.5.30)&#xA;Requirement already satisfied: args in /usr/local/lib/python3.7/dist-packages (from clint->scdl==1.6.12) (0.1.0)&#xA;Building wheels for collected packages: scdl&#xA;  Building wheel for scdl (setup.py) ... done&#xA;  Created wheel for scdl: filename=scdl-1.6.12-cp37-none-any.whl size=19143 sha256=27ca560a7f3947830289d0df167db84137d1554fe1ab740c2afab3db0abedd74&#xA;  Stored in directory: /tmp/pip-ephem-wheel-cache-agspvyq5/wheels/49/44/6e/a5f6f709e7b231f3639ea9f9fc48a4699b958850715556e7f6&#xA;Successfully built scdl&#xA;Soundcloud Downloader&#xA;Failed to get item...&#xA;

    &#xA;

    enter image description here

    &#xA;

    and when I try by the Docker VPS by this commands :

    &#xA;

    pip3 install git&#x2B;https://github.com/flyingrub/scdl&#xA;pip3 install ffmpeg&#xA;scdl -l https://soundcloud.com/pandadub/sets/the-lost-ship --download-archive archive.txt -c&#xA;

    &#xA;

    pip3 install git+https://github.com/flyingrub/scdl pip3 install ffmpeg&#xA;scdl -l https://soundcloud.com/pandadub/sets/the-lost-ship —download-archive archive.txt -c

    &#xA;

    I get this error :

    &#xA;

    FileNotFoundError: [Errno 2] No such file or directory: &#x27;ffmpeg&#x27;&#xA;

    &#xA;

    enter image description here

    &#xA;

    So I asked abut how could i do it by scdl and soundcloude python module.

    &#xA;

    Update :

    &#xA;

    Based of my two comment on this question I get different result by using the scdl python module via the above colab page, sometimes it is working and sometimes not, which i guess it is because of soudncloud server setting for preventing huge scraping and needs some delay during the music scraping form the soundcloud.

    &#xA;

    Thanks.

    &#xA;