Recherche avancée

Médias (91)

Autres articles (101)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (7421)

  • Anomalie #4546 : image_recadre perd l’EXIF de rotation

    19 septembre 2020, par jluc -

    Le 19/07/2020, cerdic dit « 
    On pourrait envisager que conserver les exifs à travers chaque filtre image, mais c’est aussi dangereux du point de vue des données personnelles. Je verrais plutôt un filtre qui permettrait de recopier certains exifs d’une image source sur l’image finale, sur le mode :

    <span class="CodeRay">[(#FICHIER|image_reduire{…}|image_recadre{…}|image_copie_exif{#FICHIER,’author’})]
    </span>


    (syntaxe exacte à définir)
     »

  • Why AudioSegment doesn't read 'mp3' ?

    22 octobre 2020, par freshITmeat

    I tried to read file that I give with absolute path.&#xA;When I run my code first that I see is this message :

    &#xA;

    D:\prog\datascience\anaconda\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn&#x27;t find ffmpeg or avconv - defaulting to ffmpeg, but may not work&#xA;  warn("Couldn&#x27;t find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)&#xA;

    &#xA;

    I tried this :

    &#xA;

    PATH_TO_FFMPEG = &#x27;D:\\prog\\ffmpeg-win-2.2.2\\ffmpeg.exe&#x27;&#xA;pydub.AudioSegment.converter = r&#x27;D:\\prog\\ffmpeg-win-2.2.2\\ffmpeg.exe&#x27;&#xA;

    &#xA;

    And I separately installed ffmpeg with pip. But it didn't help.&#xA;When I try this :

    &#xA;

    raw_sound = pydub.AudioSegment.from_mp3(file=track_path)&#xA;

    &#xA;

    where track_path is correct absolute path generated automatically.&#xA;So I got this this error :

    &#xA;

    Traceback (most recent call last):&#xA;  File "D:\prog\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1448, in _exec&#xA;    pydev_imports.execfile(file, globals, locals)  # execute the script&#xA;  File "D:\prog\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile&#xA;    exec(compile(contents&#x2B;"\n", file, &#x27;exec&#x27;), glob, loc)&#xA;  File "D:/testtask2/test_task/testtask/get_mffc.py", line 165, in <module>&#xA;    slice_all_in_a_dir(&#x27;May 27 2020 LNC/Hydrophone 1/raw_records&#x27;)&#xA;  File "D:/testtask2/test_task/testtask/get_mffc.py", line 70, in slice_all_in_a_dir&#xA;    slice_samples(track_path= [file],&#xA;  File "D:/testtask2/test_task/testtask/get_mffc.py", line 48, in slice_samples&#xA;    raw_sound = pydub.AudioSegment.from_mp3(file=track_path)&#xA;  File "D:\prog\datascience\anaconda\lib\site-packages\pydub\audio_segment.py", line 738, in from_mp3&#xA;    return cls.from_file(file, &#x27;mp3&#x27;, parameters=parameters)&#xA;  File "D:\prog\datascience\anaconda\lib\site-packages\pydub\audio_segment.py", line 680, in from_file&#xA;    stdin_data = file.read()&#xA;AttributeError: &#x27;list&#x27; object has no attribute &#x27;read&#x27;&#xA;python-BaseException&#xA;</module>

    &#xA;

    Full code when I use it :

    &#xA;

    def slice_samples(track_path: list, save_path: str,&#xA;                  sample_folder_name: str, interval: float, given_format, name: str = "part", export_format = &#x27;wav&#x27;):&#xA;    """&#xA;    This metod slice given track to parts.&#xA;    :param track_path: str, a path to the track you want to slice&#xA;    :param save_path: str, a path to folder, where you want save sliced tracks&#xA;    :param sample_folder_name: str, you don&#x27;t need to create a folder for sliced tracks,&#xA;    you can just write the name of the folder in this argument where you want to save tracks&#xA;    :param interval: float, measure in seconds, the length of sliced tracks&#xA;    :param name: str, name of sliced tacks&#xA;    :param given_format: str, I strongly recommend use .wav format initially, when you record sounds&#xA;    :return: folder with sliced tracks&#xA;    """&#xA;&#xA;    # it cuts a file in mp3 or wav formats (wav recommended)&#xA;&#xA;    interval_secs = interval * 10 ** 3&#xA;    raw_sound = None&#xA;    if given_format == "WAV":&#xA;        raw_sound = pydub.AudioSegment.from_wav(file=track_path)&#xA;    elif given_format == "MP3":&#xA;        raw_sound = pydub.AudioSegment.from_mp3(file=track_path)&#xA;    else:&#xA;        raise Exception("It&#x27;s temporarily unsupported given_format: " &#x2B; given_format)&#xA;    start = 0&#xA;    end = interval_secs&#xA;    i = 0&#xA;    while end &lt; len(raw_sound):&#xA;        save_to = save_path &#x2B; sample_folder_name &#x2B; "/" &#x2B; name &#x2B; str(i)&#xA;        part = raw_sound[start:end]&#xA;        part.export(save_to, format=export_format)&#xA;        i &#x2B;= 1&#xA;        start &#x2B;= interval_secs&#xA;        end &#x2B;= interval_secs&#xA;    return save_path &#x2B; sample_folder_name&#xA;&#xA;def slice_all_in_a_dir(tracks_folder: str):&#xA;    files = os.listdir(tracks_folder)&#xA;    for file in files:&#xA;        folder_name = file.split(&#x27;.&#x27;)&#xA;        f_name = folder_name[0]&#xA;        file = tracks_folder&#x2B;&#x27;/&#x27;&#x2B;file&#xA;        file = os.path.abspath(file)&#xA;        slice_samples(track_path= [file],&#xA;                      save_path= PATH_FOR_SLICED,&#xA;                      sample_folder_name= f_name,&#xA;                      interval=5,&#xA;                      given_format=folder_name[1])&#xA;&#xA;if __name__ == "__main__":&#xA;    slice_all_in_a_dir(&#x27;May 27 2020 LNC/Hydrophone 1/raw_records&#x27;)&#xA;

    &#xA;

  • On Heroku I got FFMPEG::Error (Failed encoding.Errors : encoded file is invalid. Full output : )

    8 octobre 2020, par Ruslan Valeev

    The code is :

    &#xA;

    tempfile = Tempfile.open(&#x27;content&#x27;)&#xA;tempfile.write(content)&#xA;movie = FFMPEG::Movie.new(tempfile.path)&#xA;screenshot_temp_file = Tempfile.open(&#x27;screenshot&#x27;)&#xA;movie.screenshot(screenshot_temp_file.path)&#xA;

    &#xA;

    everything works fine locally, but when I try this on Heroku I got error at last row :

    &#xA;

    irb(main):013:0> movie.screenshot(screenshot_temp_file.path)&#xA;I, [2020-10-07T15:48:27.132114 #7]  INFO -- : Running transcoding...&#xA;["/app/vendor/ffmpeg/ffmpeg", "-y", "-i", "/tmp/content20201007-7-1g1955b", "-vframes", "1", "-f", "image2", "/tmp/screenshot20201007-7-1mmts7s"]&#xA;&#xA;E, [2020-10-07T15:48:27.190572 #7] ERROR -- : Failed encoding...&#xA;["/app/vendor/ffmpeg/ffmpeg", "-y", "-i", "/tmp/content20201007-7-1g1955b", "-vframes", "1", "-f", "image2", "/tmp/screenshot20201007-7-1mmts7s"]&#xA;&#xA;&#xA;Errors: encoded file is invalid. &#xA;&#xA;Traceback (most recent call last):&#xA;        7: from /app/bin/irb:30:in `<main>&#x27;&#xA;        6: from /app/bin/irb:30:in `load&#x27;&#xA;        5: from /app/vendor/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top>&#x27;&#xA;        4: from (irb):13&#xA;        3: from /app/vendor/bundle/ruby/2.6.0/gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/movie.rb:204:in `screenshot&#x27;&#xA;        2: from /app/vendor/bundle/ruby/2.6.0/gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/transcoder.rb:45:in `run&#x27;&#xA;        1: from /app/vendor/bundle/ruby/2.6.0/gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/transcoder.rb:112:in `validate_output_file&#x27;&#xA;FFMPEG::Error (Failed encoding.Errors: encoded file is invalid. Full output: )&#xA;</top></main>

    &#xA;

    I've try to pass some options, like :seek_time and validate: false but nothing changed. What am I doing wrong ? Thank you so much !

    &#xA;

    EDIT :&#xA;After Full output: ) there is nothing.&#xA;I've install FFMPEG buildpack on Heroku, and can see it in ui :

    &#xA;

    enter image description here

    &#xA;