
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (82)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
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 -
MediaSPIP Player : problèmes potentiels
22 février 2011, parLe lecteur ne fonctionne pas sur Internet Explorer
Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)
Sur d’autres sites (8737)
-
aacdec : don’t return frames without data
12 mai 2015, par Andreas Cadhalpunaacdec : don’t return frames without data
Since commit 676a395a aac->frame->data is not necessarily allocated at
the end of aac_decode_frame_int if avctx->channels is 0.In this case a bogus frame without any data, but non-zero nb_samples is
returned.Signed-off-by : Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by : Michael Niedermayer <michaelni@gmx.at> -
How to put audio data in AVFrame for encode
17 avril 2020, par easy_breezyI try to encode raw PCM sound to G711A and G711U and then decode it, with this codecs everything works fine because I can choose any value for AVCodecContext frame_size for encoding, but in case of Opus codec the AVCodecContext frame_size is equal to 120, so if I understood correctly if my input data array size is bigger than 120 then I need to do some kind of buffering and split my input data into several parts and then sequentially put it to AVFrame->data and pass the AVFrame to encoding.



In result I get a very bad sound and I get this result not only when I use Opus codec but also in G711 if I set it's AVCodecContext frame_size to some value that will be less than size of my input data.



So my question is : what it the correct way to encode input data if it's size if bigger than AVCodecContext frame_size ? Do I need to split my input data into some parts that <= AVCodecContext frame_size if so how should I do that ?



At this moment my code looks like this :



void encode(uint8_t *data, unsigned int length)
{
 int rawOffset = 0;
 int rawDelta = 0;
 int rawSamplesCount = frameEncode->nb_samples <= length ? frameEncode->nb_samples : length;

 while (rawSamplesCount > 0)
 {
 memcpy(frameEncode->data[0], &data[rawOffset], sizeof(uint8_t) * rawSamplesCount);

 encodeFrame();

 rawOffset += rawSamplesCount;
 rawDelta = length - rawOffset;
 rawSamplesCount = rawDelta > frameEncode->nb_samples ? frameEncode->nb_samples : rawDelta;
 }

 av_frame_unref(frameEncode);
}

void encodeFrame()
{
 /* send the frame for encoding */
 int ret = avcodec_send_frame(contextEncoder, frameEncode);
 if (ret < 0)
 {
 LOGE(TAG, "[encodeFrame] avcodec_send_frame error: %s", av_err2str(ret));
 return;
 }

 /* read all the available output packets (in general there may be any number of them) */
 while (ret >= 0)
 {
 ret = avcodec_receive_packet(contextEncoder, packetEncode);
 if (ret < 0 && ret != AVERROR(EAGAIN)) LOGE(TAG, "[encodeFrame] error in avcodec_receive_packet: %s", av_err2str(ret));
 if (ret < 0) break;
 std::pair p = std::pair();
 p.first = (uint8_t *)(malloc(sizeof(uint8_t) * packetEncode->size));
 memcpy(p.first, packetEncode->data, (size_t)packetEncode->size);
 p.second = (unsigned int)(packetEncode->size);

 listEncode.push_back(p); // place encoded data into list to finally create one array of encoded data from it
 }
 av_packet_unref(packetEncode);
}




You can see that I split my input data into several parts, then I put it in frame->data and then pass the frame to encoding but I'm not sure that is the correct way.



UPD : I noticed that when I use G711 if I set AVCodecContext frame_size to 160 and size of my input data is 160 or 320 everething works fine, but if input data size is 640 then i get bad buzzing sound.


-
Converting PCM-ALAW data to an audio file using ffmpeg
8 septembre 2020, par bbddIn my project, I processed the received RTP packets with the payload, and extracted all the payload to a separate buffer. This payload is - PCM ALAW (Type 8). How do I implement a class that will take as arguments - the file name and a buffer with raw data to create an audio file. Exactly what steps do I have to go through in order to encode raw data into an audio file ? As an example, I used this example.