Recherche avancée

Médias (0)

Mot : - Tags -/organisation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (74)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

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

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (7577)

  • Cannot use pydub.AudioSegment on audio files downloaded by youtube-dl library

    26 octobre 2018, par Han M

    After I download a audio clip from a youtube link by the youtube-dl library, I cannot use pydub.AudioSegment to slice the audio file. The following is the information about my code.

    import youtube_dl
    options = {
           'format': 'bestaudio/best',
           'extractaudio': True,  # only keep the audio
           'audio-format': "wav",  # convert to wav
           'outtmpl': whole_path,  # name the file the ID of the video
           'noplaylist': True,  # only download single song, not playlist
           'audioquality': 1
    }
    with youtube_dl.YoutubeDL(options) as ydl:
       print('url is:', web_url)
       ydl.download([web_url])

    from pydub import AudioSegment
    audio_data = AudioSegment.from_wav(path_to_downloaded_file)

    Then, I got an error as follows first on Mac and second on Linux :

    b'avconv version 12.3, Copyright (c) 2000-2018 the Libav developers\n  built on Jul 26 2018 18:08:50 with Apple LLVM version 9.1.0 (clang-902.0.39.2)\n/Users/***/random17560390.wav: Invalid data found when processing input\n'

    b'ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers\n  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609\n  configuration: --prefix=/usr --e
    xtra-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-li
    bbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmod
    plug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-li
    bspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --e
    nable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv\n  libavutil      54. 31.100 / 54.
    31.100\n  libavcodec     56. 60.100 / 56. 60.100\n  libavformat    56. 40.101 / 56. 40.101\n  libavdevice    56.  4.100 / 56.  4.100\n  libavfilter     5. 40.101 /  5. 40.101\n  libavresa
    mple   2.  1.  0 /  2.  1.  0\n  libswscale      3.  1.101 /  3.  1.101\n  libswresample   1.  2.101 /  1.  2.101\n  libpostproc    53.  3.100 / 53.  3.100\n[wav @ 0x20854c0] invalid start
    code [0][0][0][28] in RIFF header\n/home/users/test_download/random10485395.wav: Invalid data found when processing input\n'

    I think the problem might be about the encoding on the downloaded files by youtube-dl. I can use pydub.AudioSegment on other normal .wav files. After checking the details of the downloaded file by youtube-dl, I found the following feature :

    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)

    It is different from other normal .wav files, which have the following :

    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s
  • vvcdec : add vvc decoder

    28 décembre 2023, par Nuo Mi
    vvcdec : add vvc decoder
    

    vvc decoder plug-in to avcodec.
    split frames into slices/tiles and send them to vvc_thread for further decoding
    reorder and wait for the frame decoding to be done and output the frame

    Features :
    + Support I, P, B frames
    + Support 8/10/12 bits, chroma 400, 420, 422, and 444 and range extension
    + Support VVC new tools like MIP, CCLM, AFFINE, GPM, DMVR, PROF, BDOF, LMCS, ALF
    + 295 conformace clips passed
    - Not support RPR, IBC, PALETTE, and other minor features yet

    Performance :
    C code FPS on an i7-12700K (x86) :
    BQTerrace_1920x1080_60_10_420_22_RA.vvc 93.0
    Chimera_8bit_1080P_1000_frames.vvc 184.3
    NovosobornayaSquare_1920x1080.bin 191.3
    RitualDance_1920x1080_60_10_420_32_LD.266 150.7
    RitualDance_1920x1080_60_10_420_37_RA.266 170.0
    Tango2_3840x2160_60_10_420_27_LD.266 33.7

    C code FPS on a M1 Mac Pro (ARM) :
    BQTerrace_1920x1080_60_10_420_22_RA.vvc 58.7
    Chimera_8bit_1080P_1000_frames.vvc 153.3
    NovosobornayaSquare_1920x1080.bin 150.3
    RitualDance_1920x1080_60_10_420_32_LD.266 105.0
    RitualDance_1920x1080_60_10_420_37_RA.266 133.0
    Tango2_3840x2160_60_10_420_27_LD.266 21.7

    Asm optimizations still working in progress. please check
    https://github.com/ffvvc/FFmpeg/wiki#performance-data for the latest

    Contributors (based on code merge order) :
    Nuo Mi <nuomi2021@gmail.com>
    Xu Mu <toxumu@outlook.com>
    Frank Plowman <post@frankplowman.com>
    Shaun Loo <shaunloo10@gmail.com>
    Wu Jianhua <toqsxw@outlook.com>

    Thank you for reporting issues and providing performance reports :
    Łukasz Czech <lukaszcz18@wp.pl>
    Xu Fulong <839789740@qq.com>

    Thank you for providing review comments :
    Ronald S. Bultje <rsbultje@gmail.com>
    James Almer <jamrial@gmail.com>
    Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    Co-authored-by : Xu Mu <toxumu@outlook.com>
    Co-authored-by : Frank Plowman <post@frankplowman.com>
    Co-authored-by : Shaun Loo <shaunloo10@gmail.com>
    Co-authored-by : Wu Jianhua <toqsxw@outlook.com>

    • [DH] Changelog
    • [DH] configure
    • [DH] libavcodec/allcodecs.c
    • [DH] libavcodec/version.h
    • [DH] libavcodec/vvc/Makefile
    • [DH] libavcodec/vvc/vvcdec.c
  • Anomalie #4830 : extraire_date extravagant

    6 juillet 2021

    Pourquoi pas. Je te propose (ou quelqu’un) de faire une PR pour ça.
    Il faudrait ajouter en même temps des tests unitaires parce que bon.
    Ci dessous un code valide qui fait la demande.

    Ce qui me gène tout de même c’est le [^0-9]* dans la regex (déjà présente dans l’ancienne fonction) qui du coup peut chercher une date coupée dans un grand texte…
    Tel que : "En 2012 à l’orée du bois se trouvait 10 chevaux et 4 biches.", qui sort la date "2012-10-04" (ou 2012-10-01 avant cette proposition).
    Donc l’usage est possiblement assez limité de cette fonction si laissée telle quelle.

    1. <span class="CodeRay">
    2. <span class="comment">/**
    3.  * Extrait une date d'un texte et renvoie le résultat au format de date SQL
    4.  *
    5.  * L'année et le mois doivent être numériques.
    6.  * Le séparateur entre l'année et le mois peut être un `-`, un `:` ou un texte
    7.  * quelconque ne contenant pas de chiffres.
    8.  *
    9.  * Si un numéro de jour valide n'est pas indiqué, le résultat est alors le 1er du mois.
    10.  *
    11.  * @link https://www.spip.net/5516
    12.  * @param string $texte
    13.  *    Texte contenant une date tel que `2008-04`
    14.  * @return string
    15.  *    Date au format SQL tel que `2008-04-01`
    16.  **/</span>
    17. <span class="keyword">function</span> <span class="function">extraire_date</span>(<span class="local-variable">$texte</span>) {
    18.     <span class="comment">// format = 2001-08-12 ou 2001-08</span>
    19.     <span class="local-variable">$has_date</span> = <span class="predefined">preg_match</span>(
    20.         <span class="string"><span class="delimiter">"</span><span class="content">,
    21.        # une annee
    22.        (?P<annee>[1-2][0-9]</annee></span><span class="content">{</span><span class="content">3})
    23.        # des caracteres sans numeros
    24.        [^0-9]*
    25.        # un mois
    26.        (?P<mois>1[0-2]|0?[1-9])
    27.        (?:
    28.            # des caracteres sans numeros
    29.            [^0-9]*
    30.            # un jour
    31.            (?P<jour>3[0-1]|[1-2][0-9]|0?[1-9])
    32.        )?
    33.        ,x</jour></mois></span><span class="delimiter">"</span></span>,
    34.         <span class="local-variable">$texte</span>,
    35.         <span class="local-variable">$regs</span>
    36.     );
    37.     <span class="keyword">if</span> (<span class="local-variable">$has_date</span>) {
    38.         <span class="local-variable">$date</span> = [
    39.             <span class="local-variable">$regs</span>[<span class="string"><span class="delimiter">"</span><span class="content">annee</span><span class="delimiter">"</span></span>],
    40.             <span class="predefined">sprintf</span>(<span class="string"><span class="delimiter">"</span><span class="content">%02d</span><span class="delimiter">"</span></span>, <span class="local-variable">$regs</span>[<span class="string"><span class="delimiter">"</span><span class="content">mois</span><span class="delimiter">"</span></span>]),
    41.             <span class="predefined">sprintf</span>(<span class="string"><span class="delimiter">"</span><span class="content">%02d</span><span class="delimiter">"</span></span>, <span class="local-variable">$regs</span>[<span class="string"><span class="delimiter">"</span><span class="content">jour</span><span class="delimiter">"</span></span>] ?? <span class="string"><span class="delimiter">"</span><span class="content">01</span><span class="delimiter">"</span></span>)
    42.         ];
    43.         <span class="keyword">return</span> <span class="predefined">implode</span>(<span class="string"><span class="delimiter">"</span><span class="content">-</span><span class="delimiter">"</span></span>, <span class="local-variable">$date</span>);
    44.     }
    45. }
    46. </span>

    Télécharger


    #SQUELETTE

    #SET{liste,#LISTE{
       "Une date 2020 01",
       "Une date 2020 12 autre",
       "Une date 2020 autre 12 autre",
       "Une date 2021 12 01",
       "Une date 2021 12 00",
       "Une date 2021 12 31",
       "Une date 2021 12 32",
       "Une date 2021 autre 12 date 21",
       "En 2012 à l’orée du bois se trouvait 10 chevaux et 4 biches."
    }}

    <dl>

    <dt>#VALEUR</dt>
    <dd>[(#VALEUR|extraire_date)]</dd>

    </dl>

    Sortie :

    1. Une date 2020 01
    2.     2020-01-01
    3. Une date 2020 12 autre
    4.     2020-12-01
    5. Une date 2020 autre 12 autre
    6.     2020-12-01
    7. Une date 2021 12 01
    8.     2021-12-01
    9. Une date 2021 12 00
    10.     2021-12-01
    11. Une date 2021 12 31
    12.     2021-12-31
    13. Une date 2021 12 32
    14.     2021-12-03
    15. Une date 2021 autre 12 date 21
    16.     2021-12-21
    17. En 2012 à l’orée du bois se trouvait 10 chevaux et 4 biches.
    18.     2012-10-04

    Télécharger