
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (100)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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, parPré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 2013Puis-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 Niehorsteravdevice : 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> -
avformat_write_header return error code when trying to write video with G711U audio avi file
10 décembre 2024, par dennI'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.


av_register_all();
 avcodec_register_all();
 av_log_set_callback(nullptr);

 av_format_context_ = avformat_alloc_context();
 if (!av_format_context_)
 {
 std::string error_msg = "Failed to allocate avformat context";
 log_->Error(error_msg);
 throw std::runtime_error(error_msg.c_str());
 }

 av_format_context_->oformat = av_guess_format("mp4", filename.c_str(), NULL);
 strcpy(av_format_context_->filename, filename.c_str());

 AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_PCM_MULAW);
 av_format_context_->oformat->audio_codec = codec->id;

 audio_stream_ = avformat_new_stream(av_format_context_, codec);
 if (audio_stream_ == nullptr)
 {
 log_->Error("Can not create audiostream.");
 return false;
 }

 AVCodecContext& codec_context = *audio_stream_->codec;
 if (avcodec_copy_context(audio_stream_->codec, av_format_context_->streams[1]->codec) != 0)
 {
 log_->Error("Failed to Copy Context");
 return false;
 }

 audio_stream_->time_base = { 1, codec_context.sample_rate };

 if (av_format_context_->oformat->flags & AVFMT_GLOBALHEADER)
 codec_context.flags |= AV_CODEC_FLAG_GLOBAL_HEADER;

 log_->Info("Init output {}", filename);
 av_dump_format(av_format_context_, 0, filename.c_str(), 1);

 int ret = avio_open(&av_format_context_->pb, filename.c_str(), AVIO_FLAG_WRITE);
 if (ret < 0)
 {
 log_->Error("Can not open file for writing.");
 return false;
 }

 ret = avformat_write_header(av_format_context_, NULL);
 if (ret < 0)
 {
 log_->Error("Can not write header.");
 return false;
 }




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


-
Python : How to decode a mp3 chunk into PCM samples ?
30 mars 2021, par BendzkoI'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.



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 ?