Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (77)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

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

  • Encoding AV1 to h264 error : Assertion pkt failed at D :/code/ffmpeg/src/fftools/ffmpeg_dec.c:518 [closed]

    1er mars 2024, par KyonGiang

    I used below code to convert from AV1 to x264 mp4, and I got error message : "Assertion pkt failed at D :/code/ffmpeg/src/fftools/ffmpeg_dec.c:518"

    


    ffmpeg -i input.mp4 -c:v h264_nvenc -c:a copy output.mp4 


    


      

    • I'm using Windows 10 64b, Command Prompt, ffmpeg version 2024-01-20-git-6c4388b468-full_build-www.gyan.dev
    • 


    


    I removed h264_nvenc, Run as Administrator but the result is same.

    


    ffmpeg -i input.mp4 -c:v -c:a copy output.mp4

    


  • FFmpeg : Specify pixel format for STD_IN input

    27 février 2024, par ShadowMagic896

    This is the current command :

    


    ffmpeg -i pipe:0 -pix_fmt yuv420p -f mp4 -vf "transpose=1" -f matroska pipe:1

    


    Essentially, it takes an MP4 file, rotates it 90 degrees, and converts it back to mtk and outputs it to STD_OUT.

    


    This is the error :

    


    WARNING:root:[mov,mp4,m4a,3gp,3g2,mj2 @ 000001ff9979dd00] stream 0, offset 0x50: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001ff9979dd00] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 170x144, 32 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:0':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp41isom
    creation_time   : 2024-02-26T20:53:03.000000Z
  Duration: 00:00:03.88, start: 0.000000, bitrate: N/A
  Stream #0:0[0x1](und): Video: h264 (avc1 / 0x31637661), none, 170x144, 32 kb/s, 30 fps, 30 tbr, 30k tbn (default)
      Metadata:
        creation_time   : 2024-02-26T20:53:03.000000Z
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
        encoder         : AVC Coding
  Stream #0:1[0x2](und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
      Metadata:
        creation_time   : 2024-02-26T20:53:03.000000Z
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> vorbis (libvorbis))
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001ff9979dd00] stream 0, offset 0x50: partial file
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 000001ff9978b080] Error during demuxing: Invalid data found when processing input
Cannot determine format of input 0:0 after EOF
[vf#0:0 @ 000001ff997d6040] Task finished with error code: -1094995529 (Invalid data found when processing input)
[vf#0:0 @ 000001ff997d6040] Terminating thread with return code -1094995529 (Invalid data found when processing input)
[aost#0:1/libvorbis @ 000001ff99cd1780] No filtered frames for output stream, trying to initialize anyway.
[vost#0:0/libx264 @ 000001ff997d4fc0] Could not open encoder before EOF
[vost#0:0/libx264 @ 000001ff997d4fc0] Task finished with error code: -22 (Invalid argument)
[vost#0:0/libx264 @ 000001ff997d4fc0] Terminating thread with return code -22 (Invalid argument)
[out#0/matroska @ 000001ff997a6180] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A    
Conversion failed!


    


    I am running this via Python, this is the script :

    


        async def send_proc_pipe(self) -> bytes:

        command = f"ffmpeg -hide_banner -loglevel error -i pipe:0 -pix_fmt yuv420p -f mp4 -vf \"transpose=1\" -f matroska pipe:1"

        proc = await asyncio.create_subprocess_shell(
            cmd=command,
            stdin=asyncio.subprocess.PIPE,
            stdout=asyncio.subprocess.PIPE,
            stderr=asyncio.subprocess.PIPE
        )
        
        std_in = self.blob

        c_out, c_err = await proc.communicate(std_in)
        if c_err:
            logging.warning(c_err.decode("utf-8"))

        return c_out


    


    I'm not really use what else to try here. I've re-ordered the parameters and tried different pixel formats with no success.

    


  • Unknown input format : 'rawvideo' when trying to save animation

    8 juin 2022, par John Klint

    So, I get a strange error trying to save animations created with matplotlib.FuncAnimation using FFMpegWriter.

    


    /home/j/PycharmProjects/venvtest/venv/bin/python /home/j/PycharmProjects/venvtest/main.py&#xA;MovieWriter stderr:&#xA;Unknown input format: &#x27;rawvideo&#x27;&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/animation.py", line 234, in saving&#xA;    yield self&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/animation.py", line 1093, in save&#xA;    writer.grab_frame(**savefig_kwargs)&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/animation.py", line 351, in grab_frame&#xA;    self.fig.savefig(self._proc.stdin, format=self.frame_format,&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/figure.py", line 3046, in savefig&#xA;    self.canvas.print_figure(fname, **kwargs)&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 2319, in print_figure&#xA;    result = print_method(&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 1648, in wrapper&#xA;    return func(*args, **kwargs)&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/_api/deprecation.py", line 415, in wrapper&#xA;    return func(*inner_args, **inner_kwargs)&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/backends/backend_agg.py", line 486, in print_raw&#xA;    fh.write(renderer.buffer_rgba())&#xA;BrokenPipeError: [Errno 32] Broken pipe&#xA;&#xA;During handling of the above exception, another exception occurred:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/home/j/PycharmProjects/venvtest/main.py", line 24, in <module>&#xA;    anim.save(&#x27;basic_animation.mp4&#x27;, writer=FFwriter)&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/animation.py", line 1093, in save&#xA;    writer.grab_frame(**savefig_kwargs)&#xA;  File "/usr/lib/python3.9/contextlib.py", line 137, in __exit__&#xA;    self.gen.throw(typ, value, traceback)&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/animation.py", line 236, in saving&#xA;    self.finish()&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/animation.py", line 342, in finish&#xA;    self._cleanup()  # Inline _cleanup() once cleanup() is removed.&#xA;  File "/home/j/PycharmProjects/venvtest/venv/lib/python3.9/site-packages/matplotlib/animation.py", line 373, in _cleanup&#xA;    raise subprocess.CalledProcessError(&#xA;subprocess.CalledProcessError: Command &#x27;[&#x27;/usr/bin/ffmpeg&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;-vcodec&#x27;, &#x27;rawvideo&#x27;, &#x27;-s&#x27;, &#x27;640x480&#x27;, &#x27;-pix_fmt&#x27;, &#x27;rgba&#x27;, &#x27;-r&#x27;, &#x27;5&#x27;, &#x27;-loglevel&#x27;, &#x27;error&#x27;, &#x27;-i&#x27;, &#x27;pipe:&#x27;, &#x27;-vcodec&#x27;, &#x27;h264&#x27;, &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;, &#x27;-y&#x27;, &#x27;basic_animation.mp4&#x27;]&#x27; returned non-zero exit status 1.&#xA;&#xA;Process finished with exit code 1&#xA;</module>

    &#xA;

    I am confident it has nothing to do with the animation data, the error occurs even when I create a simple test animation :

    &#xA;

    import numpy as np&#xA;from matplotlib import pyplot as plt&#xA;from matplotlib import animation&#xA;# plt.rcParams[&#x27;animation.ffmpeg_path&#x27;] = &#x27;/usr/bin/ffmpeg&#x27;&#xA;&#xA;fig = plt.figure()&#xA;ax = plt.axes(xlim=(0, 2), ylim=(-2, 2))&#xA;line, = ax.plot([], [], lw=2)&#xA;&#xA;&#xA;def init():&#xA;    line.set_data([], [])&#xA;    return line,&#xA;&#xA;&#xA;def animate(i):&#xA;    x = np.linspace(0, 2, 1000)&#xA;    y = np.sin(2 * np.pi * (x - 0.01 * i))&#xA;    line.set_data(x, y)&#xA;    return line,&#xA;&#xA;&#xA;anim = animation.FuncAnimation(fig, animate, init_func=init,&#xA;                           frames=200, interval=20, blit=True)&#xA;&#xA;FFwriter = animation.FFMpegWriter()&#xA;anim.save(&#x27;basic_animation.mp4&#x27;, writer=FFwriter)&#xA;

    &#xA;

    I am currently using PyCharm in LinuxMint and I have a fairly new version of FFMpeg (4.2.4) installed. Given that FFMpeg complains about 'rawvideo' which as far as I understand it is just a bunch of images in series, it seems unlikely this has anything to do with codecs. If I run ffmpeg -formats, sure enough rawvideo is in the list.

    &#xA;

    I have tried manually setting plt.rcParams, like in the commented line in the code above, with no success. I have also tried setting up both anaconda and venv environments, but I get the same error.&#xA;Annoyingly, I did not have this problem a few months ago when I was using Ubuntu. I have also verified that it works on my friends Ubuntu desktop, using the same simple venv as I set up for myself.

    &#xA;

    Any ideas ?

    &#xA;

    EDIT : I use the fish shell, if that is relevant...

    &#xA;

    Well this is peculiar. If I start a terminal from within PyCharm and check supported formats, I get the following :

    &#xA;

    (venv) ffmpeg -formats&#xA;ffmpeg version 4.3.4 Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 11.3.0 (GCC)&#xA;  configuration: --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --disable-debug --disable-doc --disable-static --enable-optimizations --enable-shared --disable-everything --enable-ffplay --enable-ffprobe --enable-gnutls --enable-libaom --enable-libdav1d --enable-libfdk-aac --enable-libmp3lame --enable-libfontconfig --enable-libfreetype --enable-libopus --enable-libpulse --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-openal --enable-opengl --enable-sdl2 --enable-vulkan --enable-zlib --enable-libv4l2 --enable-libxcb --enable-vdpau --enable-vaapi --enable-encoder=&#x27;ac3,alac,flac,libfdk_aac,g723_1,mp2,libmp3lame,libopus,libspeex,pcm_alaw,pcm_mulaw,pcm_f32le,pcm_s16be,pcm_s24be,pcm_s16le,pcm_s24le,pcm_s32le,pcm_u8,tta,libvorbis,wavpack,&#x27; --enable-encoder=&#x27;ass,ffv1,libaom_av1,libvpx_vp8,libvpx_vp9,mjpeg_vaapi,rawvideo,theora,vp8_vaapi,libopenh264&#x27; --enable-decoder=&#x27;adpcm_g722,alac,flac,g723_1,g729,libfdk_aac,libopus,libspeex,mp2,mp3,m4a,pcm_alaw,pcm_mulaw,pcm_f16le,pcm_f24le,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_s16be,pcm_s16be_planar,pcm_s24be,pcm_s16le,pcm_s16le_planar,pcm_s24le,pcm_s24le_planar,pcm_s32le,pcm_s32le_planar,pcm_s64be,pcm_s64le,pcm_s8,pcm_s8_planar,pcm_u8,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,tta,vorbis,wavpack,&#x27; --enable-decoder=&#x27;ass,ffv1,mjpeg,mjpegb,libaom_av1,libdav1d,libvpx_vp8,libvpx_vp9,rawvideo,theora,vp8,vp9,libopenh264&#x27; --enable-encoder=&#x27;bmp,gif,jpegls,png,tiff,webp,&#x27; --enable-decoder=&#x27;bmp,gif,jpegls,png,tiff,webp,&#x27; --enable-hwaccel=&#x27;vp8_vaapi,mjpeg_vaapi,&#x27; --enable-parser=&#x27;aac,ac3,flac,mjpeg,mpegaudio,mpeg4video,opus,vp3,vp8,vp9,vorbis,&#x27; --enable-muxer=&#x27;ac3,ass,flac,g722,gif,matroska,mp3,mpegvideo,rtp,ogg,opus,pcm_s16be,pcm_s16le,wav,webm,&#x27; --enable-demuxer=&#x27;aac,ac3,ass,flac,g722,gif,image_jpeg_pipe,image_png_pipe,image_webp_pipe,matroska,mjpeg,mov,mp3,mpegvideo,ogg,pcm_mulaw,pcm_alaw,pcm_s16be,pcm_s16le,rtp,wav,&#x27; --enable-filter=&#x27;crop,scale,overlay,amix,amerge,aresample,format,aformat,fps,transpose,pad,&#x27; --enable-protocol=&#x27;crypto,file,pipe,rtp,srtp,rtsp,tcp,udp,unix,&#x27; --arch=x86_64 --enable-libopenh264&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;File formats:&#xA; D. = Demuxing supported&#xA; .E = Muxing supported&#xA; --&#xA; D  aac             raw ADTS AAC (Advanced Audio Coding)&#xA; DE ac3             raw AC-3&#xA; D  alaw            PCM A-law&#xA; D  asf             ASF (Advanced / Active Streaming Format)&#xA; DE ass             SSA (SubStation Alpha) subtitle&#xA; DE flac            raw FLAC&#xA; DE g722            raw G.722&#xA; DE gif             CompuServe Graphics Interchange Format (GIF)&#xA; D  jpeg_pipe       piped jpeg sequence&#xA;  E matroska        Matroska&#xA; D  matroska,webm   Matroska / WebM&#xA; D  mjpeg           raw MJPEG video&#xA; D  mov,mp4,m4a,3gp,3g2,mj2 QuickTime / MOV&#xA; DE mp3             MP3 (MPEG audio layer 3)&#xA; D  mpegts          MPEG-TS (MPEG-2 Transport Stream)&#xA; D  mpegvideo       raw MPEG video&#xA; D  mulaw           PCM mu-law&#xA; DE ogg             Ogg&#xA;  E opus            Ogg Opus&#xA; D  png_pipe        piped png sequence&#xA; D  rm              RealMedia&#xA; DE rtp             RTP output&#xA; DE s16be           PCM signed 16-bit big-endian&#xA; DE s16le           PCM signed 16-bit little-endian&#xA; D  sdp             SDP&#xA; DE wav             WAV / WAVE (Waveform Audio)&#xA;  E webm            WebM&#xA; D  webp_pipe       piped webp sequence&#xA;&#xA;

    &#xA;

    As is evident, there is no support for 'rawvideo' in the list above ! Very strange indeed, I do not know which ffmpeg this list belongs to, perhaps it is a version integrated into matplotlib's animation class ?

    &#xA;

    Anyway, if I uncomment the line setting the ffmpeg_path I am back at the old error. I did get it to work however, by changing the path from '/usr/bin/ffmpeg' to '/home/j/.conda/envs/venvtest/bin/ffmpeg'. Then I get the file to run, create the animation and save it. This works for my real files as well, which do not even run that particular conda-environment. They do not recognize or find the ffmpeg I have in /usr/bin though. I have no clue why but at least I have a workaround now.

    &#xA;

    Final edit :&#xA;It is solved. It was flatpak's fault. Lesson is, don't use flatpak (or snap for that matter) to install Pycharm.

    &#xA;