Recherche avancée

Médias (91)

Autres articles (102)

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

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (8687)

  • Change Encoding of StandardInput.WriteLine

    25 avril 2018, par abdullah cinar

    I am trying to run ffmpeg executable using the Process to convert an input audio file to mp3 format. Below is the example call that works very well when I do it from the cmd.exe in Windows :

    "ffmpeg.dll -i "inputPath\input.wav" -vn -ar 44100 -ac 2 -ab 320k -f mp3 -y "outputPath\output.mp3"

    The input or output file paths can contain Turkish characters like ş ö ç ğ. So I have to take care of the encodings of StreamWriter.

    My snippet for the StreamWriter is :

    Process cmd = new Process();
    cmd.StartInfo.FileName = "cmd.exe";
    cmd.StartInfo.RedirectStandardInput = true;
    cmd.StartInfo.CreateNoWindow = false;
    cmd.StartInfo.UseShellExecute = false;
    cmd.Start();

    Encoding tr_encoding = Encoding.GetEncoding("iso-8859-9");

    using (StreamWriter sw = new StreamWriter(cmd.StandardInput.BaseStream, tr_encoding))
    {
       sw.WriteLine(ffmpeg_cmd + " & exit");
    }

    cmd.WaitForExit();

    But I always get No such file or directory error from the ffmpeg because the filepath contains a folder named as şşşş but my StreamWriter sends that folder name as ■■■.

    How to send command-line arguments in different arguments ?

  • How to create a spectrogram image from an audio file in Python just like how FFMPEG does ?

    2 mai 2020, par hamandishe Mk

    My code :

    



    import matplotlib.pyplot as plt
from matplotlib.pyplot import specgram
import librosa
import librosa.display
import numpy as np
import io
from PIL import Image

samples, sample_rate = librosa.load('thabo.wav')
fig = plt.figure(figsize=[4, 4])
ax = fig.add_subplot(111)
ax.axes.get_xaxis().set_visible(False)
ax.axes.get_yaxis().set_visible(False)
ax.set_frame_on(False)
S = librosa.feature.melspectrogram(y=samples, sr=sample_rate)
librosa.display.specshow(librosa.power_to_db(S, ref=np.max))
buf = io.BytesIO()
plt.savefig(buf,  bbox_inches='tight',pad_inches=0)

# plt.close('all')
buf.seek(0)
im = Image.open(buf)
# im = Image.open(buf).convert('L')
im.show()
buf.close()


    



    Spectrogram produced

    



    enter image description here

    



    Using FFMPEG

    



    ffmpeg -i thabo.wav -lavfi showspectrumpic=s=224x224:mode=separate:legend=disabled spectrogram.png

    



    Spectrogram produced

    



    enter image description here

    



    Please help, i want a spectrogram that is exactly the same as the one produced by FFMPEG, for use with a speech recognition model exported from google's teachable machine.
Offline recognition

    


  • Out-of-range channels being referenced when decoding AAC AUs

    3 février 2017, par SoxInCincy

    As part of a proprietary data stream, I have variable length AUs of raw AAC encoded data. The data is single channel and I have the configuration information on how the data was encoded. I need to decode this data to PCM for playback. Right now, I am trying to do so using ffmpeg’s libavcodec, but to no avail. The error I get from ffmpeg(libavcodec) when trying to decode is "channel element 3.7 is not allocated." As I am trying to decode single channel data, have the context set as single channel and channel layout of mono, I am not entirely sure why the decoder is looking for channels beyond 1.

    Can anyone point me in the right direction ? I appreciate any help !

    Prototype Code :

    //Initialize the decoder before sending AUs
    bool AAC_Decoder::initialize()
    {
       //register codecs
       avcodec_register_all();
       c=NULL;
       //attempt to find AAC decoder
       codec = avcodec_find_decoder(AV_CODEC_ID_AAC);
       if (codec==NULL)
       {
           std::cout<<"Could Not Find Codec"</setup codec context using known information about the stream
       c=avcodec_alloc_context3(codec);
       c->bit_rate=32000;
       c->channels=1;
       c->channel_layout=AV_CH_LAYOUT_MONO;
       c->sample_rate=16000;

       //attempt to open the codec using the prescribed context and no options
       if (avcodec_open2(c,codec,NULL)<0)
       {
           std::cout<<"Could Not Open Codec"</decode a single AU sent in a buffer
    bool AAC_Decoder::decode(uint8_t *sampleBuffer, uint32_t size)
    {
       //setup single AU packet
       AVPacket avPacket;
       av_init_packet(&avPacket);
       AVFrame * frame;
       pkt.size = size;
       pkt.data = sampleBuffer;

       //attempt to setup a frame
       frame = av_frame_alloc();
       if (!frame)
       {
           std::cout<<"Could not Allocate Frame"</attempt to decode the frame
       int gotFrame =0;
       int len = 0;
       len = avcodec_decode_audio4(c,frame,&gotFrame,&pkt);

       if (len < 0)//could not decode frame.  Currently getting -22 as response
       {
           std::cout<<"decoding error"</verify the frame was decoded.  
       {
           std::cout<<"don't have frame"</successfully decoded.  for now, cout the size as verification.
       {
           int data_size = av_samples_get_buffer_size(NULL, c->channels, frame->nb_samples, c->sample_fmt, 1);
           std::cout</free frame and return
       av_frame_free(&frame);
       return true;
    }