Recherche avancée

Médias (91)

Autres articles (50)

  • Modifier la date de publication

    21 juin 2013, par

    Comment changer la date de publication d’un média ?
    Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
    Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
    Dans la rubrique "Champs à ajouter, cocher "Date de publication "
    Cliquer en bas de la page sur Enregistrer

  • 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

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

Sur d’autres sites (4950)

  • Unable to use Multithread for librosa melspectrogram

    15 avril 2019, par Raven Cheuk

    I have over 1000 audio files (it’s just a initial development, in the future, there will be even more audio files), and would like to convert them to melspectrogram.

    Since my workstation has a Intel® Xeon® Processor E5-2698 v3, which has 32 threads, I would like to use multithread to do my job.

    My code

    import os
    import librosa
    from librosa.display import specshow
    from natsort import natsorted
    import numpy as np
    import sys
    # Libraries for multi thread
    from multiprocessing.dummy import Pool as ThreadPool
    import subprocess
    pool = ThreadPool(20)

    songlist = os.listdir('../opensmile/devset_2015/')
    songlist= natsorted(songlist)

    def get_spectrogram(song):
       print("start")
       y, sr = librosa.load('../opensmile/devset_2015/' + song)

       ## Add some function to cut y
       y_list = y
       ##

       for i, y_i in enumerate([y_list]): # can remove for loop if no audio is cut
           S = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128,fmax=8000)
           try:
               np.save('./Test/' + song + '/' + str(i), S)
           except:
               os.makedirs('./Test/' + song)
               np.save('./Test/' + song + '/' + str(i), S)
           print("done saving")

    pool.map(get_spectrogram, songlist)

    My Problem

    However, my script freezes after finished the first conversion.

    To debug what’s going on, I commented out S = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128,fmax=8000) and replace it by S=0.
    Then the multi-thread code works fine.

    What’s wrong with the librosa.feature.melspectrogram function ? Does it not support multi-thread ? Or is it a problem of ffmpeg ? (When using librosa, it asks me to install ffmpeg before.)

  • How can i use ffmpeg to add voice note to another mp3 at specific time , let everything play without reducing the original mp3

    29 juin 2020, par Adike maduabuchi

    I have used some code which does not give me what I want, I used PHP shell to execute the code

    


                 $var = 'ffmpeg -y -i ' . $voice_note_tag . ' -i ' . $original_music_path . '  -filter_complex "[0]asplit[a][b]; [a]atrim=duration=' . $time_come_vioce . ',volume=\'1-max(0*(t-1),0)\':eval=frame[pre];  [b]atrim=start=' . $time_come_vioce . ',asetpts=PTS-STARTPTS[song];  [song][1]amix=inputs=2:duration=first:dropout_transition=2[post]; [pre][post]concat=n=2:v=0:a=1[mixed]"  -map "[mixed]" ' . $output . ' 2>&1';
                            shell_exec($var);


    


  • Returns wrong frame while seeking in FFMPEG Player

    5 février 2015, par user543

    I have implemented an audio player which supports all the formats using FFMPEG. But while seeking the audio, the application is getting the wrong frame at that target duration. Here is my code for the seek functionality.

            int64_t seekTime = av_rescale_q(seekValue * AV_TIME_BASE,
                       AV_TIME_BASE_Q,
                       fmt_ctx->streams[seekStreamIndex]->time_base);

               int64_t seekStreamDuration =
                       fmt_ctx->streams[seekStreamIndex]->duration;

               int flags = AVSEEK_FLAG_BACKWARD;
               if (seekTime > 0 && seekTime < seekStreamDuration)
                   flags |= AVSEEK_FLAG_ANY;

               int ret = av_seek_frame(fmt_ctx, seekStreamIndex, seek_target,
                       flags);

               if (ret < 0)
                   ret = av_seek_frame(fmt_ctx, seekStreamIndex, seekTime,
                           flags);

             avcodec_flush_buffers(dec_ctx);

    It is working fine for most of the songs.
    But some of the mp3 songs are getting the wrong timespan.

    For instance : If the song total duration is 2 minutes, if I play the song without seeking it works fine. But while playing, if we seek the song to some position, this will make the song ends with 2 mins and 10 seconds.

    I am getting this issue with only mp3 songs. I am using FFMPEG 2.1. The code for the seek functionality is working fine on FFMPEG 0.11.1.

    Please provide any information about this issue.