Recherche avancée

Médias (0)

Mot : - Tags -/performance

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

Autres articles (103)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

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

Sur d’autres sites (8129)

  • input stream error _read() is not implemented : ffmpeg-fluent

    23 mai 2018, par Thomsheer Ahamed

    I have buffer object. I want to pass that buffer as readable stream to ffpmeg.

    var ffmpeg = require('fluent-ffmpeg');
       var ffmpegPath = require("ffmpeg-binaries").ffmpegPath()
       ffmpeg.setFfmpegPath(ffmpegPath);
       var command = new ffmpeg();

       command.input(my_buffer)
           .videoCodec('libx264')
           .size('520x?')
           .aspect('4:3')
           .inputFPS(8)
           .outputFPS(30)
           .output('new_video.mp4')
           .on('start', onStrat)
           .on('progress', onProgress)
           .on('end', onEnd)
           .on('error', onError)
           .run();

    If I pass buffer right away I will get "Error : Invalid input
    at FfmpegCommand.proto.mergeAdd.proto.addInput.proto.input
    "

    So I converted buffer into stream using

    function bufferToStream(buffer) {
       let Duplex = require('stream').Duplex;
       let stream = new Duplex();
       stream.push(new Buffer(buffer));
       stream.push(null);
       return stream;
    }
    var red = bufferToStream(finalResponse.file.buffer);

    and passed this steam to input

    command.input(red)

    Above Command throws "ffmpeg exited with code 1 : Error opening filters !" ;

    If I use my_buffer and save it in locally using fs.writeFile(’path’,my_buffer) and pass this path to input of ffmpeg then it works fine..

    But I dont want to store that file and then delete it after altering video.

    Can some one help me ?

    I Reffered this example

  • aacenc : implement Intensity Stereo encoding support

    2 juillet 2015, par Rostislav Pehlivanov
    aacenc : implement Intensity Stereo encoding support
    

    This commit implements intensity stereo coding support
    to the native aac encoder. This is a way to increase the efficiency
    of the encoder by zeroing the right channel’s spectral coefficients
    (in a channel pair) and rederiving them in the decoder using information
    from the scalefactor indices of special band types. This commit
    confomrs to the official ISO 13818-7 specifications, although due to
    their ambiguity certain deviations have been taken to ensure maximum
    sound quality. This commit has been extensively tested and has shown
    to not result in audiable audio artifacts unless in extreme cases.
    This commit also adds an option, aac_is, which has the value of
    0 by default. Intensity Stereo is part of the scalable aac profile
    and is thus non-default.

    The way IS coding works is that it rederives the right channel’s
    spectral coefficients from the left channel via the scalefactor
    index values left in the right channel. Since an entire band’s
    spectral coefficients do not need to be coded, the encoder’s
    efficiency jumps up and it unzeroes some high frequency values
    which it previously did not have enough bits to encode. That way
    less information is lost than the information lost by rederiving
    the spectral coefficients with some error. This is why the
    filesize of files encoded with IS do not decrease significantly.
    Users wishing that IS coding should reduce filesize are expected
    to reduce their encoding bitrates appropriately.

    This is V2 of the commit. The old version did not mark ms_mask as
    0 since M/S and IS coding are incompactible, which resulted in
    distortions with M/S coding enabled. This version also improves
    phase detection by measuring it for every spectral coefficient in
    the band and using a simple majority rule to determine whether the
    coefficients are in or out of phase. Also, the energy values per
    spectral coefficient were changed as to reflect the
    official specifications.

    Reviewed-by : Claudio Freire <klaussfreire@gmail.com>
    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] libavcodec/aaccoder.c
    • [DH] libavcodec/aacenc.c
    • [DH] libavcodec/aacenc.h
  • TypeError : must be real number, not NoneType using spyder anaconda

    13 août 2023, par faisal2k
    import moviepy.editor as mp&#xA;import tkinter as tk&#xA;from tkinter import filedialog&#xA;import math&#xA;from PIL import Image&#xA;import numpy&#xA;&#xA;&#xA;def zoom_in_effect(clip, zoom_ratio=0.02):&#xA;    def effect(get_frame, t):&#xA;        img = Image.fromarray(get_frame(t))&#xA;        base_size = img.size&#xA;&#xA;        new_size = [&#xA;            math.ceil(img.size[0] * (1 &#x2B; (zoom_ratio * t))),&#xA;            math.ceil(img.size[1] * (1 &#x2B; (zoom_ratio * t)))&#xA;        ]&#xA;&#xA;        # The new dimensions must be even.&#xA;        new_size[0] = new_size[0] &#x2B; (new_size[0] % 2)&#xA;        new_size[1] = new_size[1] &#x2B; (new_size[1] % 2)&#xA;&#xA;        img = img.resize(new_size, Image.LANCZOS)&#xA;&#xA;        x = math.ceil((new_size[0] - base_size[0]) / 2)&#xA;        y = math.ceil((new_size[1] - base_size[1]) / 2)&#xA;&#xA;        img = img.crop([&#xA;            x, y, new_size[0] - x, new_size[1] - y&#xA;        ]).resize(base_size, Image.LANCZOS)&#xA;&#xA;        #result = numpy.array(img)&#xA;        result = numpy.array(img, dtype=numpy.uint8)&#xA;&#xA;        img.close()&#xA;&#xA;        return result&#xA;&#xA;    return clip.fl(effect)&#xA;&#xA;&#xA;    &#xA;&#xA;def make_center_video():&#xA;    &#xA;    size = (1080, 1080)&#xA;&#xA;    audio_file = &#x27;/home/faisal/pythonfiles/audio/tts_voice.wav&#x27;&#xA;    audio = mp.AudioFileClip(audio_file)&#xA;   &#xA;    root = tk.Tk()&#xA;    root.withdraw()&#xA;     &#xA;    print("waiting for Image Selection....")&#xA;&#xA;    img = filedialog.askopenfilename()&#xA;&#xA;&#xA;    slide = mp.ImageClip(img).set_fps(29).set_duration(audio.duration).resize(size)&#xA;    slide = zoom_in_effect(slide, 0.02)&#xA;    slide.write_videofile(&#x27;/home/faisal/pythonfiles/videos/zoom-short.mp4&#x27;,codec=&#x27;libx264&#x27;,  fps=29)&#xA;    &#xA;    &#xA;    size = (600, 600)&#xA;&#xA; &#xA;&#xA;&#xA;    slide = mp.ImageClip(img).set_fps(29).set_duration(audio.duration).resize(size)&#xA;    slide = zoom_in_effect(slide, 0.02)&#xA;    slide.write_videofile(&#x27;/home/faisal/pythonfiles/videos/zoom-wide.mp4&#x27;,codec=&#x27;libx264&#x27;, fps=29)&#xA;    &#xA;import traceback&#xA;&#xA;try:&#xA;    make_center_video()&#xA;except Exception as e:&#xA;    traceback.print_exc()&#xA;    print(f"An error occurred: {e}")&#xA;

    &#xA;

    I'm trying to make the zoom video using image but facing

    &#xA;

    TypeError: must be real number, not NoneType.&#xA;

    &#xA;

    It used was to run but I don't remember if I might have updated numpy, ffmpeg, or any thing else that is now causing the error. I have tried the code on python 3.10 and 3.11 and get the same error in both. I was previously running it on python 3.10.

    &#xA;

    An error occurred: must be real number, not NoneType&#xA;Traceback (most recent call last):&#xA;  File "/home/faisal/pythonfiles/code/zoom_video.py", line 76, in <module>&#xA;    make_center_video()&#xA;  File "/home/faisal/pythonfiles/code/zoom_video.py", line 61, in make_center_video&#xA;    slide.write_videofile(&#x27;/home/faisal/pythonfiles/videos/zoom-short.mp4&#x27;,codec=&#x27;libx264&#x27;,  fps=29)&#xA;  File "/home/faisal/anaconda3/envs/py-310/lib/python3.10/site-packages/decorator.py", line 232, in fun&#xA;    return caller(func, *(extras &#x2B; args), **kw)&#xA;  File "/home/faisal/anaconda3/envs/py-310/lib/python3.10/site-packages/moviepy/decorators.py", line 54, in requires_duration&#xA;    return f(clip, *a, **k)&#xA;  File "/home/faisal/anaconda3/envs/py-310/lib/python3.10/site-packages/decorator.py", line 232, in fun&#xA;    return caller(func, *(extras &#x2B; args), **kw)&#xA;  File "/home/faisal/anaconda3/envs/py-310/lib/python3.10/site-packages/moviepy/decorators.py", line 135, in use_clip_fps_by_default&#xA;    return f(clip, *new_a, **new_kw)&#xA;  File "/home/faisal/anaconda3/envs/py-310/lib/python3.10/site-packages/decorator.py", line 232, in fun&#xA;    return caller(func, *(extras &#x2B; args), **kw)&#xA;  File "/home/faisal/anaconda3/envs/py-310/lib/python3.10/site-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB&#xA;    return f(clip, *a, **k)&#xA;  File "/home/faisal/anaconda3/envs/py-310/lib/python3.10/site-packages/moviepy/video/VideoClip.py", line 300, in write_videofile&#xA;    ffmpeg_write_video(self, filename, fps, codec,&#xA;  File "/home/faisal/anaconda3/envs/py-310/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_writer.py", line 213, in ffmpeg_write_video&#xA;    with FFMPEG_VideoWriter(filename, clip.size, fps, codec = codec,&#xA;  File "/home/faisal/anaconda3/envs/py-310/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_writer.py", line 88, in __init__&#xA;    &#x27;-r&#x27;, &#x27;%.02f&#x27; % fps,&#xA;TypeError: must be real number, not NoneType&#xA;</module>

    &#xA;