Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (60)

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

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (7885)

  • M4a (mp4) audio file encoded with pydub+ffmpeg doesn't play on Android

    6 juillet 2020, par Evelyn

    I have a python script to split up some wav files and export to m4a using pydub. I'm able to get these files to play on several devices, but not on an Android device (using Google Pixel 3). When I try encoding with straight ffmpeg in terminal, that works fine on the Android device.

    


    What is the difference in these two files, and since pydub is using ffmpeg, what do I need to change to make it do exactly the same as the ffmpeg command ?

    


    Not working

    


    from pydub import AudioSegment
>>> audio = AudioSegment.from_wav("input.wav")
>>> slice = audio[1000:3000]
>>> slice.export("pydub_export.m4a", format="mp4", parameters=["-ac", "1", "-c:a", "libfdk_aac", "-profile:a", "aac_he", "-vbr", "2"])


    


    mediainfo output :

    


    General
Complete name                            : pydub_export.m4a
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/mp41)
File size                                : 11.7 KiB
Duration                                 : 2 s 115 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 45.1 kb/s
Writing application                      : Lavf58.29.100

Audio
ID                                       : 1
Format                                   : AAC LC SBR
Format/Info                              : Advanced Audio Codec Low Complexity with Spectral Band Replication
Commercial name                          : HE-AAC
Format settings                          : NBC
Codec ID                                 : mp4a-40-5
Duration                                 : 2 s 115 ms
Duration_LastFrame                       : -22 ms
Bit rate mode                            : Constant
Bit rate                                 : 41.4 kb/s
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 44.1 kHz
Frame rate                               : 21.533 FPS (2048 SPF)
Compression mode                         : Lossy
Stream size                              : 10.7 KiB (92%)
Default                                  : Yes
Alternate group                          : 1


    


    Working

    


    $ffmpeg -i input.wav -acodec copy -ss 1 -to 3 input_slice.wav
$ffmpeg -i input_slice.wav -ac 1 -c:a libfdk_aac -profile:a aac_he -vbr 2 ffmpeg_export.m4a


    


    mediainfo output :

    


    General
Complete name                            : ffmpeg_export.m4a
Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (isom/iso2)
File size                                : 11.2 KiB
Duration                                 : 2 s 112 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 43.6 kb/s
Writing application                      : Lavf58.29.100

Audio
ID                                       : 1
Format                                   : AAC LC SBR
Format/Info                              : Advanced Audio Codec Low Complexity with Spectral Band Replication
Commercial name                          : HE-AAC
Format settings                          : NBC
Codec ID                                 : mp4a-40-5
Duration                                 : 2 s 112 ms
Duration_LastFrame                       : -25 ms
Bit rate mode                            : Constant
Bit rate                                 : 39.9 kb/s
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 44.1 kHz
Frame rate                               : 21.533 FPS (2048 SPF)
Compression mode                         : Lossy
Stream size                              : 10.3 KiB (91%)
Default                                  : Yes
Alternate group                          : 1


    


    I already tried moving metadata to the front with -movflags faststart on the broken file and it didn't make a difference.

    


  • avprobe : Print the display matrix from per-stream sidedata

    29 avril 2015, par Martin Storsjö
    avprobe : Print the display matrix from per-stream sidedata
    

    This is printed in a separate subgroup "displaymatrix" inside a
    new group named "sidedata". The subgroup has got two values,
    "rotation" (which is the parsed rotation from the matrix) and
    "matrix" containing the full actual values.

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] avprobe.c
  • Passing bytes to ffmpeg in python with io

    8 juin 2021, par Trykowo

    Sorry, new to stackoverflow

    &#xA;

    Just wondering if it's possible to pass byte data from io.
    &#xA;I'm trying to extract frames from a gif with ffmpeg then use Pillow to resize it.
    &#xA;I know you can extract frames from a gif with Pillow, but sometimes it butchers certain gifs. So I'm using ffmpeg as a fix.
    &#xA;As for why I'd like the gif to be read from memory is because I'm going to change this so gifs from urls will be wrapped in Bytesio instead of saving.
    &#xA;As for why I have the extra Pillow code, I did successfully get it working by passing an actual filename into the ffmpeg command.&#xA;

    &#xA;

    original_pil = Image.open("1.gif")&#xA;&#xA;bytes_io = open("1.gif", "rb")&#xA;bytes_io.seek(0)&#xA;&#xA;ffmpeg = &#x27;ffmpeg&#x27;&#xA;&#xA;cmd = [ffmpeg,&#xA;       &#x27;-i&#x27;, &#x27;-&#x27;,&#xA;       &#x27;-vsync&#x27;, &#x27;0&#x27;,&#xA;       &#x27;-f&#x27;, &#x27;image2pipe&#x27;,&#xA;       &#x27;-pix_fmt&#x27;, &#x27;rgba&#x27;,&#xA;       &#x27;-vcodec&#x27;, &#x27;png&#x27;,&#xA;       &#x27;-report&#x27;,&#xA;       &#x27;-&#x27;]&#xA;&#xA;depth = 4&#xA;width, height = original_pil.size&#xA;buf_size = depth * width * height &#x2B; 100&#xA;nbytes = width * height * 4&#xA;&#xA;proc = SP.Popen(cmd, stdout=SP.PIPE, stdin=SP.PIPE, stderr=SP.PIPE, bufsize=buf_size, shell=False)&#xA;out, err = proc.communicate(input=bytes_io.read(), timeout=None)&#xA;

    &#xA;

    FFMPEG report :

    &#xA;

    ffmpeg started on 2021-06-07 at 18:58:14&#xA;Report written to "ffmpeg-20210607-185814.log"&#xA;Command line:&#xA;ffmpeg -i - -vsync 0 -f image2pipe -pix_fmt rgba -vcodec png -report -&#xA;ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)&#xA;  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --ena  WARNING: library configuration mismatch&#xA;  avcodec     configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enab  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;  libavresample   4.  0.  0 /  4.  0.  0&#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;Splitting the commandline.&#xA;Reading option &#x27;-i&#x27; ... matched as input url with argument &#x27;-&#x27;.&#xA;Reading option &#x27;-vsync&#x27; ... matched as option &#x27;vsync&#x27; (video sync method) with argument &#x27;0&#x27;.&#xA;Reading option &#x27;-f&#x27; ... matched as option &#x27;f&#x27; (force format) with argument &#x27;image2pipe&#x27;.&#xA;Reading option &#x27;-pix_fmt&#x27; ... matched as option &#x27;pix_fmt&#x27; (set pixel format) with argument &#x27;rgba&#x27;.&#xA;Reading option &#x27;-vcodec&#x27; ... matched as option &#x27;vcodec&#x27; (force video codec (&#x27;copy&#x27; to copy stream)) with argument &#x27;png&#x27;.&#xA;Reading option &#x27;-report&#x27; ... matched as option &#x27;report&#x27; (generate a report) with argument &#x27;1&#x27;.&#xA;Reading option &#x27;-&#x27; ... matched as output url.&#xA;Finished splitting the commandline.&#xA;Parsing a group of options: global .&#xA;Applying option vsync (video sync method) with argument 0.&#xA;Applying option report (generate a report) with argument 1.&#xA;Successfully parsed a group of options.&#xA;Parsing a group of options: input url -.&#xA;Successfully parsed a group of options.&#xA;Opening an input file: -.&#xA;[NULL @ 0x55b59c38f7c0] Opening &#x27;pipe:&#x27; for reading&#xA;[pipe @ 0x55b59c390240] Setting default whitelist &#x27;crypto&#x27;&#xA;[gif @ 0x55b59c38f7c0] Format gif probed with size=2048 and score=100&#xA;[AVIOContext @ 0x55b59c398680] Statistics: 4614093 bytes read, 0 seeks&#xA;pipe:: Input/output error&#xA;

    &#xA;