
Recherche avancée
Médias (1)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (65)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...)
Sur d’autres sites (8118)
-
Do we have to return full buffers each time our AVIO `read_packet()` callback from FFMPEG is called ?
8 janvier 2023, par Alexis WilkeI allocate an AVIO context with my own
read_packet()
implementation. Only my implementation is such that I may return with acount
smaller than the required inputbuf_size
. Is that allowed ? Or do we have to fill the buffer as much as possible each time outread_packet()
function gets called ?

// initialization
 [...snip...]
 m_avio_context.reset(avio_alloc_context(
 avio_buffer
 , avio_buffer_size
 , 0 // write flag
 , this // opaque
 , &FFMPEGDecoder::decoder_read_static
 , nullptr // write func.
 , nullptr)); // seek func.
 [...snip...]

// implementation of static function
int FFMPEGDecoder::decoder_read_static(void * opaque, std::uint8_t * buf, int size)
{
 return reinterpret_cast<ffmpegdecoder>(opaque)->decoder_read(buf, size);
}

// the actual read_packet()
int FFMPEGDecoder::decoder_read(std::uint8_t * buf, int size)
{
 // in flushing mode, we won't receive any more packets
 //
 if(m_flushing)
 {
 return 0;
 }

 // m_packet is my own packet implementation (an std::vector<>)
 //
 while(m_packet == nullptr
 || static_cast(m_read_pos) >= m_packet->size())
 {
 if(!m_incoming_packets.pop_front(m_packet, -1))
 {
 return 0;
 }
 if(m_packet->is_flush())
 {
 m_flushing = true;
 return 0;
 }
 m_read_pos = 0;
 }

 // the number of bytes to copy size `size` or less if there are
 // less bytes available in my m_packet
 //
 int const copy(std::min(static_cast(size), m_packet->size() - m_read_pos));

 memcpy(buf, m_packet->data().data() + m_read_pos, copy);

 m_read_pos += copy;

 return copy;
}
</ffmpegdecoder>


I'm not looking for a way to fill the buffer, I'm going to implement it that way now. I'm looking for confirmation (or not) that the FFMPEG libraries are not capable of accepting less than
size
bytes inbuf
when ourread_packet()
gets called.

Do you know ?


-
Port r17546 from Tremor ; although pieces had made it over to libvorbis, a comprehensive
3 février 2012, par MontyPort r17546 from Tremor ; although pieces had made it over to libvorbis, a comprehensive port and verification was called for. This patch provided some additional floor0 hardening :
floor0 code could potentially use a book where the number of vals it
needed to decode was not an integer number of dims wide. This caused
it to overflow the output vector as the termination condition was in
the outer loop of vorbis_book_decodev_set.None of the various vorbis_book_decodeXXXX calls internally guard
against this case either, but in every other use the calling code does
properly guard (and avoids putting more checks in the tight inner
decode loop).For floor0, move the checks into the inner loop as there’s little
penalty for doing so.[an equivalent change was already in libvorbis, but I’ve
harmonized the code with tremor]For floor0, move the checks into the inner loop as there’s little
penalty for doing so. Add commentary indicating where guarding is
done for each call variant.git-svn-id : http://svn.xiph.org/trunk/vorbis@18183 0101bb08-14d6-0310-b084-bc0e0c8e3800
-
Build Live Audio Stream Player
5 décembre 2011, par KurtFor an internship project i've been trying to develop a simple audio player for audio live stream.
Currently i'm using a homemade three buffering (of 1/3 s each) solution played by QAudioOutput, which recall himself after finished his reading.
void VideoServer::getBuf(QBuffer * p_buf)
{
audio_chunk* ac = NULL;
std::vector v;
v.clear();
for (int i = 0; i < 20;)
{
ac = _audioPreviewSharedData->deQueueAudio();
if (ac)
{
v.insert(v.end(), ac->v_buf.begin(), ac->v_buf.end());
i++;
delete ac;
}
else
usleep(50000);
}
p_buf->close();
p_buf->setData((const char *)(&v[0]), v.size()*2);
p_buf->open(QIODevice::ReadOnly);
}-
void VideoServer::slot_launchAudioPreviewBuffering()
{
getBuf(_buf1);
getBuf(_buf2);
_state = 2;
connect(_audioPreviewTimer, SIGNAL(timeout()), this, SLOT(slot_audioPreviewBuffering()));
_audioPreviewTimer->start(0);
connect(_audioOut, SIGNAL(stateChanged(QAudio::State)), this, SLOT(finishedPlaying(QAudio::State)));
}-
void VideoServer::finishedPlaying(QAudio::State state)
{
if(state == QAudio::IdleState) {
slot_audioPreviewBuffering();
}
}-
void VideoServer::slot_audioPreviewBuffering()
{
switch (_state) {
case 0:
{
_audioOut->start(_buf2);
getBuf(_buf1);
_state = 1;
break;
}
case 1:
{
_audioOut->start(_buf3);
getBuf(_buf2);
_state = 2;
break;
}
case 2:
{
_audioOut->start(_buf1);
getBuf(_buf3);
_state = 0;
break;
}
}
}But i'm suffering of choppy sound (little interruption between audio chunk).
How to play this flux without interruption () and with a reasonable delay between audio and video (less 1s) ? Is there a best way ? Am i doing wrong ?
Thank you !