Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (100)

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

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (7407)

  • avdevice : add info about media types(s) to AVDeviceInfo

    21 décembre 2021, par Diederick Niehorster
    avdevice : add info about media types(s) to AVDeviceInfo
    

    An avdevice, regardless of whether its category says its an audio or
    video device, may provide access to devices providing different media
    types, or even single devices providing multiple media types. Also, some
    devices may provide no media types. dshow is an example encompassing all
    of these cases. Users should be provided with this information, so
    AVDeviceInfo is extended to provide it.

    Bump avdevice version

    Signed-off-by : Diederick Niehorster <dcnieho@gmail.com>
    Reviewed-by : Roger Pack <rogerdpack2@gmail.com>

    • [DH] libavdevice/avdevice.c
    • [DH] libavdevice/avdevice.h
    • [DH] libavdevice/version.h
  • avformat_write_header return error code when trying to write video with G711U audio avi file

    10 décembre 2024, par denn

    I'm trying to make an avi file from a video/audio stream. When audio is AAC it works fine. But I cannot pack G711U audio.

    &#xA;

      av_register_all();&#xA;  avcodec_register_all();&#xA;  av_log_set_callback(nullptr);&#xA;&#xA;  av_format_context_ = avformat_alloc_context();&#xA;  if (!av_format_context_)&#xA;  {&#xA;    std::string error_msg = "Failed to allocate avformat context";&#xA;    log_->Error(error_msg);&#xA;    throw std::runtime_error(error_msg.c_str());&#xA;  }&#xA;&#xA;  av_format_context_->oformat = av_guess_format("mp4", filename.c_str(), NULL);&#xA;  strcpy(av_format_context_->filename, filename.c_str());&#xA;&#xA;  AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_PCM_MULAW);&#xA;  av_format_context_->oformat->audio_codec = codec->id;&#xA;&#xA;  audio_stream_ = avformat_new_stream(av_format_context_, codec);&#xA;  if (audio_stream_ == nullptr)&#xA;  {&#xA;    log_->Error("Can not create audiostream.");&#xA;    return false;&#xA;  }&#xA;&#xA;  AVCodecContext&amp; codec_context = *audio_stream_->codec;&#xA;  if (avcodec_copy_context(audio_stream_->codec, av_format_context_->streams[1]->codec) != 0)&#xA;  {&#xA;    log_->Error("Failed to Copy Context");&#xA;    return false;&#xA;  }&#xA;&#xA;  audio_stream_->time_base = { 1, codec_context.sample_rate };&#xA;&#xA;  if (av_format_context_->oformat->flags &amp; AVFMT_GLOBALHEADER)&#xA;    codec_context.flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;&#xA;  log_->Info("Init output {}", filename);&#xA;  av_dump_format(av_format_context_, 0, filename.c_str(), 1);&#xA;&#xA;  int ret = avio_open(&amp;av_format_context_->pb, filename.c_str(), AVIO_FLAG_WRITE);&#xA;  if (ret &lt; 0)&#xA;  {&#xA;    log_->Error("Can not open file for writing.");&#xA;    return false;&#xA;  }&#xA;&#xA;  ret = avformat_write_header(av_format_context_, NULL);&#xA;  if (ret &lt; 0)&#xA;  {&#xA;    log_->Error("Can not write header.");&#xA;    return false;&#xA;  }&#xA;&#xA;

    &#xA;

    Here avformat_write_header() returns -22. What's wrong here ? Which data should I supply to this function ?

    &#xA;

  • Python : How to decode a mp3 chunk into PCM samples ?

    30 mars 2021, par Bendzko

    I'm trying to catch chunks of an mp3 webstream and decoding them into PCM samples for signal processing. I tried to catch the audio via requests and io.BytesIO to save the data as .wav file.

    &#xA;&#xA;

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

    &#xA;&#xA;

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

    &#xA;&#xA;

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

    &#xA;&#xA;

    Here's my code :

    &#xA;&#xA;

    import requests&#xA;import io&#xA;import soundfile as sf&#xA;import struct&#xA;import wave&#xA;import numpy as np&#xA;&#xA;&#xA;def main():&#xA;    stream_url = r&#x27;http://dg-wdr-http-dus-dtag-cdn.cast.addradio.de/wdr/1live/diggi/mp3/128/stream.mp3&#x27;&#xA;    r = requests.get(stream_url, stream=True)&#xA;    sample_array = []&#xA;    try:&#xA;        for block in r.iter_content(1024):&#xA;            data, samplerate = sf.read(io.BytesIO(block), format="RAW", channels=2, samplerate=44100, subtype=&#x27;FLOAT&#x27;,&#xA;                                       dtype=&#x27;float32&#x27;)&#xA;            sample_array = np.append(sample_array, data)&#xA;&#xA;    except KeyboardInterrupt:&#xA;        print("...saving")&#xA;        obj = wave.open(&#x27;sounds/stream1.wav&#x27;, &#x27;w&#x27;)&#xA;        obj.setnchannels(1)  # mono&#xA;        obj.setsampwidth(2)  # bytes&#xA;        obj.setframerate(44100)&#xA;&#xA;        data_max = np.nanmax(abs(sample_array))&#xA;&#xA;        # fill WAV with samples from sample_array&#xA;        for sample in sample_array:&#xA;            if (np.isnan(sample) or np.isnan(32760 * sample / data_max)) is True:&#xA;                continue&#xA;            try:&#xA;                value = int(32760 * sample / data_max)  # normalization INT16&#xA;            except ValueError:&#xA;                value = 1&#xA;            finally:&#xA;                data = struct.pack(&#x27;code>

    &#xA;&#xA;

    Do you have an idea how to handle this problem ?

    &#xA;