Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (50)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

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

Sur d’autres sites (9608)

  • Python : How to convert a mp3 chunk from webstream to .wav samples ?

    13 novembre 2019, par Bendzko

    I’m trying to catch chunks of an mp3 webstream and coverting them into wav samples for signal processing. I tried to catch the audio via requests and io.BytesIO to save the data as .wav file.
    But I think, that I have to convert the mp3 data to wav data, but I don’t know how. (My goal is not to record a .wav file, i am just doing this to test the algorithm.)

    I found the pymedia lib, but it is very old (last commit in 2006), using python 2.7 and for me not installable.

    Maybe it is possible with ffmpeg-python, but I have just seen examples using files as input and output.

    Here’s my code :

    import requests
    import io
    import soundfile as sf
    import struct
    import wave
    import numpy as np


    def main():
       stream_url = r'http://dg-wdr-http-dus-dtag-cdn.cast.addradio.de/wdr/1live/diggi/mp3/128/stream.mp3'
       r = requests.get(stream_url, stream=True)
       sample_array = []
       try:
           for block in r.iter_content(1024):
               data, samplerate = sf.read(io.BytesIO(block), format="RAW", channels=2, samplerate=44100, subtype='FLOAT',
                                          dtype='float32')
               sample_array = np.append(sample_array, data)

       except KeyboardInterrupt:
           print("...saving")
           obj = wave.open('sounds/stream1.wav', 'w')
           obj.setnchannels(1)  # mono
           obj.setsampwidth(2)  # bytes
           obj.setframerate(44100)

           data_max = np.nanmax(abs(sample_array))

           # fill WAV with samples from sample_array
           for sample in sample_array:
               if (np.isnan(sample) or np.isnan(32760 * sample / data_max)) is True:
                   continue
               try:
                   value = int(32760 * sample / data_max)  # normalization INT16
               except ValueError:
                   value = 1
               finally:
                   data = struct.pack('code>

    Do you have an idea how to handle this problem ?

  • Revision 28933 : on bouge

    31 mai 2009, par ben.spip@… — Log

    on bouge

  • Using FFmpeg in .net ?

    17 juin, par daniel

    So I know its a fairly big challenge but I want to write a basic movie player/converter in c# using the FFmpeg library. However, the first obstacle I need to overcome is wrapping the FFmpeg library in c#. I've downloaded ffmpeg but couldn't compile it on Windows, so I downloaded a precompiled version for me. Ok awesome. Then I started looking for C# wrappers.

    



    I have looked around and have found a few wrappers such as SharpFFmpeg (http://sourceforge.net/projects/sharpffmpeg/) and ffmpeg-sharp (http://code.google.com/p/ffmpeg-sharp/). First of all, I wanted to use ffmpeg-sharp as its LGPL and SharpFFmpeg is GPL. However, it had quite a few compile errors. Turns out it was written for the mono compiler, I tried compiling it with mono but couldn't figure out how. I then started to manually fix the compiler errors myself, but came across a few scary ones and thought I'd better leave those alone. So I gave up on ffmpeg-sharp.

    



    Then I looked at SharpFFmpeg and it looks like what I want, all the functions P/Invoked for me. However its GPL ? Both the AVCodec.cs and AVFormat.cs files look like ports of avcodec.c and avformat.c which I reckon I could port myself ? Then not have to worry about licencing.

    



    But I want to get this right before I go ahead and start coding. Should I :

    



      

    1. Write my own C++ library for interacting with ffmpeg, then have my C# program talk to the C++ library in order to play/convert videos etc.
    2. 


    



    OR

    



      

    1. Port avcodec.h and avformat.h (is that all i need ?) to c# by using a whole lot of DllImports and write it entirely in C# ?
    2. 


    



    First of all consider that I'm not great at C++ as I rarely use it but I know enough to get around. The reason I'm thinking #1 might be the better option is that most FFmpeg tutorials are in C++ and I'd also have more control over memory management than if I was to do it in c#.

    



    What do you think ?
Also would you happen to have any useful links (perhaps a tutorial) for using FFmpeg ?