
Recherche avancée
Médias (91)
-
Chuck D with Fine Arts Militia - No Meaning No
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Paul Westerberg - Looking Up in Heaven
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Le Tigre - Fake French
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Thievery Corporation - DC 3000
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Dan the Automator - Relaxation Spa Treatment
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Gilberto Gil - Oslodum
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (53)
-
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
L’utiliser, en parler, le critiquer
10 avril 2011La première attitude à adopter est d’en parler, soit directement avec les personnes impliquées dans son développement, soit autour de vous pour convaincre de nouvelles personnes à l’utiliser.
Plus la communauté sera nombreuse et plus les évolutions seront rapides ...
Une liste de discussion est disponible pour tout échange entre utilisateurs. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (9457)
-
Ffmpeg - how to call av_read_frame() when streamed data is not yet available ?
16 janvier 2024, par CheekyChipsI am streaming audio data and using the ffmpeg/libav libraries to process it in C++. I create a
CustomIOContext
and aread_packet
function to provide the streamed data to ffmpeg, and I create anAVFormatContext
using thatCustomIOContext
.

I want to loop through all available data and extract packets using
av_read_frame()
, and then when there is not enough data left to create a packet I want to wait until I receive more data and then loop again through the new data. However, I can't figure out what to return in myread_packet
function below to tell ffmpeg to wait until more data is available. Ffmpeg seems to require all data to be available now. When I have no data to return, ffmpeg seems to think it's the end of the file, when actually it just isn't ready yet. I have tried returningAVERROR(EAGAIN)
but I still have problems. It seems like I get random decoder-specific error messages, because it thinks the input is invalid (when actually it is just not available yet), and then once I have the input and I try callingav_read_frame()
again, it immediately returns a negative error code because it got into a bad state.

What do I need to do to be able to loop through all the available data using
av_read_frame()
, and then pause and wait until more data arrives ? How do I keep ffmpeg happy ?

// -------- Set up --------
size_t ioContextBufferSize = 4096;
avioContextBuffer = avAllocateEmptyBuffer(ioContextBufferSize);
avioContext = avio_alloc_context(avioContextBuffer.ptr,
 ioContextBufferSize,
 0, // bWriteable (1=true,0=false)
 &(opaque),
 read_packet,
 0, // Write callback function
 0)}; // Seek function not provided

AVFormatContext* inContext = avformat_alloc_context();
inContext->pb = avioContext;
inContext->flags = AVFMT_FLAG_CUSTOM_IO;

avformat_open_input(&inContext, "", nullptr, nullptr);
inputPacket = av_packet_alloc();



// -------- Loop and read data -------
// (the second time we reach this while loop, it never enters the loop :(
//
while ((ret = av_read_frame(inContext, inputPacket)) >= 0) {
 .. do stuff with inputPacket
}



// -------- read_packet function -----
// copies data into ffmpeg's internal buffer. What do I return here???
//
static int read_packet(void* opaque, uint8_t* avioContextBuffer, int ioContextBufferSize) {
 OpaqueDataWrapper* streamedData = static_cast(opaque);

 size_t bytesToRead = std::min((size_t)ioContextBufferSize, streamedData->remainingBytes());

 if (!bytesToRead) {
 // We need to wait for more data to arrive! What do I return here to tell ffmpeg to wait a while? 
 if (streamedData->streamStillOpen()) {
 return AVERROR(EAGAIN);
 } else {
 return AVERROR_EOF;
 }
 }
 ... otherwise copy the next bit of data
}



-
clean up data when tearing down
9 avril 2014, par brandonaaronclean up data when tearing down
-
clean up data when tearing down
9 avril 2014, par brandonaaronclean up data when tearing down