
Recherche avancée
Médias (39)
-
Stereo master soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (89)
-
L’espace de configuration de MediaSPIP
29 novembre 2010, parL’espace de configuration de MediaSPIP est réservé aux administrateurs. Un lien de menu "administrer" est généralement affiché en haut de la page [1].
Il permet de configurer finement votre site.
La navigation de cet espace de configuration est divisé en trois parties : la configuration générale du site qui permet notamment de modifier : les informations principales concernant le site (...) -
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 ) (...) -
Formulaire personnalisable
21 juin 2013, parCette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire. (...)
Sur d’autres sites (5557)
-
fftools/ffmpeg_filter : move filtering to a separate thread
8 juin 2023, par Anton Khirnovfftools/ffmpeg_filter : move filtering to a separate thread
As previously for decoding, this is merely "scaffolding" for moving to a
fully threaded architecture and does not yet make filtering truly
parallel - the main thread will currently wait for the filtering thread
to finish its work before continuing. That will change in future commits
after encoders are also moved to threads and a thread-aware scheduler is
added. -
FFmpeg C++ decoding in a separate thread
12 juin 2019, par BrigapesI’m trying to decode a video with FFmpeg and convert it to an openGL texture and display it inside a cocos2dx engine. I’ve managed to do that and it displays the video as i wanted to, now the problem is performance wise. I get a Sprite update every frame(game is fixed 60fps, video is 30fps) so what i did was i decoded and converted frame interchangeably, didn’t work great, now i have it set up to have a separate thread where i decode in an infinite
while
loop withsleep()
just so it doesn’t hog the cpu/program.
What i currently have set up is 2 pbo framebuffers and abool
flag to tell my ffmpeg thread loop to decode another frame since i don’t know how to manually wait when to decode another frame. I’ve searched online for a soultion to this kind of problem but didn’t manage to get any answers.I’ve looked at this : Decoding video directly into a texture in separate thread but it didn’t solve my problem since it was just converting YUV to RGB inside opengl shaders which i haven’t done yet but currently not an issue.
Additional info that might be useful is that i don’t need to end thread until application exit and i’m open to using any video format, including lossless.
Ok so main decoding loop looks like this :
//.. this is inside of a constructor / init
//adding thread to array in order to save the thread
global::global_pending_futures.push_back(std::async(std::launch::async, [=] {
while (true) {
if (isPlaying) {
this->decodeLoop();
}
else {
std::this_thread::sleep_for(std::chrono::milliseconds(3));
}
}
}));Reason why i use bool to check if frame was used is because main decoding function takes about 5ms to finish in debug and then should wait about 11 ms for it to display the frame, so i can’t know when the frame was displayed and i also don’t know how long did decoding take.
Decode function :
void video::decodeLoop() { //this should loop in a separate thread
frameData* buff = nullptr;
if (buf1.needsRefill) {
/// buf1.bufferLock.lock();
buff = &buf1;
buf1.needsRefill = false;
firstBuff = true;
}
else if (buf2.needsRefill) {
///buf2.bufferLock.lock();
buff = &buf2;
buf2.needsRefill = false;
firstBuff = false;
}
if (buff == nullptr) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
return;//error? //wait?
}
//pack pixel buffer?
if (getNextFrame(buff)) {
getCurrentRBGConvertedFrame(buff);
}
else {
loopedTimes++;
if (loopedTimes >= repeatTimes) {
stop();
}
else {
restartVideoPlay(&buf1);//restart both
restartVideoPlay(&buf2);
if (getNextFrame(buff)) {
getCurrentRBGConvertedFrame(buff);
}
}
}
/// buff->bufferLock.unlock();
return;
}As you can tell i first check if buffer was used using bool needsRefill and then decode another frame.
frameData struct :
struct frameData {
frameData() {};
~frameData() {};
AVFrame* frame;
AVPacket* pkt;
unsigned char* pdata;
bool needsRefill = true;
std::string name = "";
std::mutex bufferLock;
///unsigned int crrFrame
GLuint pboid = 0;
};And this is called every frame :
void video::actualDraw() { //meant for cocos implementation
if (this->isVisible()) {
if (this->getOpacity() > 0) {
if (isPlaying) {
if (loopedTimes >= repeatTimes) { //ignore -1 because comparing unsgined to signed
this->stop();
}
}
if (isPlaying) {
this->setVisible(true);
if (!display) { //skip frame
///this->getNextFrame();
display = true;
}
else if (display) {
display = false;
auto buff = this->getData();
width = this->getWidth();
height = this->getHeight();
if (buff) {
if (buff->pdata) {
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, buff->pboid);
glBufferData(GL_PIXEL_UNPACK_BUFFER, 3 * (width*height), buff->pdata, GL_DYNAMIC_DRAW);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, 0);///buff->pdata); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
}
buff->needsRefill = true;
}
}
}
else { this->setVisible(false); }
}
}
}getData func to tell which frambuffer it uses
video::frameData* video::getData() {
if (firstBuff) {
if (buf1.needsRefill == false) {
///firstBuff = false;
return &buf1;///.pdata;
}
}
else { //if false
if (buf2.needsRefill == false) {
///firstBuff = true;
return &buf2;///.pdata;
}
}
return nullptr;
}I’m not sure what else to include i pasted whole code to pastebin.
video.cpp : https://pastebin.com/cWGT6APn
video.h https://pastebin.com/DswAXwXVTo summarize the problem :
How do i properly implement decoding in a separate thread / how do i optimize current code ?
Currently video is lagging when some other thread or main thread gets heavy and then it does not decode fast enough.
-
Revision be83ef3104 : Merge "Moving subexp encoding functions in separate vp9_dsubexp.c file."
27 juin 2013, par Dmitry KovalevChanged Paths :
Modify /vp9/decoder/vp9_decodemv.c
Modify /vp9/decoder/vp9_decodframe.c
Modify /vp9/encoder/vp9_bitstream.c
Merge "Moving subexp encoding functions in separate vp9_dsubexp.c file."