
Recherche avancée
Médias (3)
-
Elephants Dream - Cover of the soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (60)
-
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 (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.
Sur d’autres sites (6408)
-
How to save an SDL bitmap to memory and load it back ?
19 novembre 2012, par NavI have a bunch of RWops functions :
static int myseekfunc(SDL_RWops *context, int offset, int whence) { SDL_SetError("Can't seek in this kind of RWops"); return(-1); }
static int myreadfunc(SDL_RWops *context, void *ptr, int size, int maxnum) { memset(ptr,0,size*maxnum); return(maxnum); }
static int mywritefunc(SDL_RWops *context, const void *ptr, int size, int num) { return(num); }
static int myclosefunc(SDL_RWops *context)
{
if(context->type != 0xdeadbeef) { SDL_SetError("Wrong kind of RWops for myclosefunc()"); return(-1); }
free(context->hidden.unknown.data1);
SDL_FreeRW(context);
return(0);
}
// Note that this function is NOT static -- we want it directly callable from other source files
SDL_RWops *MyCustomRWop()
{
SDL_RWops *c=SDL_AllocRW();
if(c==NULL) return(NULL);
c->seek =myseekfunc;
c->read =myreadfunc;
c->write=mywritefunc;
c->close=myclosefunc;
c->type =0xdeadbeef;
printf("deadbeef=%d\n",c->type);
c->hidden.unknown.data1=malloc(256);//IS THIS CORRECT?
return(c);
}with which I'm trying to write a BMP into memory and then extract it back. The below code is from tutorial02.
Two problems I'm facing are :
1. Unless I callSDL_DisplayYUVOverlay
, theSDL_SaveBMP
function outputs a blank BMP file to the hard disk. How can I output a BMP file without having to callSDL_DisplayYUVOverlay
?
2. Although I'm able to save the BMP to memory withSDL_SaveBMP_RW
and free the memory with filestream->close, I'm unable to load the BMP back from memory withSDL_SaveBMP
. The application crashes while trying to load it. Is it because of thec->hidden.unknown.data1=malloc(256);
code above ? What would be the right way of allocating this memory ?AVFormatContext *pFormatCtx = NULL;
int i, videoStream;
AVCodecContext *pCodecCtx = NULL;
AVCodec *pCodec = NULL;
AVFrame *pFrame = NULL;
AVPacket packet;
SDL_Overlay *bmp = NULL;
SDL_Surface *screen = NULL;
SDL_Surface *screen2 = NULL;
SDL_Rect rect;
....
....
if(frameFinished)
{
SDL_LockYUVOverlay(bmp);//-----------lock
AVPicture pict;
pict.data[0] = bmp->pixels[0];
pict.data[1] = bmp->pixels[2];
pict.data[2] = bmp->pixels[1];
pict.linesize[0] = bmp->pitches[0];
pict.linesize[1] = bmp->pitches[2];
pict.linesize[2] = bmp->pitches[1];
// Convert the image into YUV format that SDL uses
sws_scale( sws_ctx, (uint8_t const * const *)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pict.data, pict.linesize );
SDL_UnlockYUVOverlay(bmp);//-----------unlock
rect.x = 0;
rect.y = 0;
rect.w = pCodecCtx->width;
rect.h = pCodecCtx->height;
SDL_DisplayYUVOverlay(bmp, &rect);
++i;
SDL_RWops *filestream = MyCustomRWop();//SDL_AllocRW();
SDL_SaveBMP_RW (screen, filestream, i);
screen2 = SDL_LoadBMP_RW(filestream,1);//LOADING IS THE PROBLEM HERE. DON'T KNOW WHY
filestream->close;
SDL_SaveBMP(screen, filepointer); -
FFMPEG - errors when combining videos
1er décembre 2012, par ethrbunnyI have two .OGG files of similar size, FPS and duration. My goal is to combine them into a side-by-side presentation using FFMPEG. To this end I've tried the following cmd :
ffmpeg -i subject.ogg -vf "[in]pad=3*iw:3*ih[left] ;movie=clinician.ogg[right] ;[left] [right]overlay=100:0[out]" combined.ogg
Suffice to say that the resultant video is non-playable. During the combination process FFMPEG prints lots of errors that read like :
[Parsed_overlay_2 @ 0x1eb7d3e0] Buffer queue overflow, dropping
What is this telling me ?
Note :
- both source files are playable
- I padded the 'output' to be rather large in an attempt to understand the params
- the placement of the 2nd video at 100:0 is arbitrary. Once I get the cmd working I'll move it to a better location in the output.
- both videos began life as .FLV recorded from web cameras. I converted them to .ogg as FFMPEG didn't want to combine two .FLV files. If there is a better route to this, please let me know.
So - what's wrong with my parameters and what am I doing to cause these FFMPEG errors ?
EDIT :
ffmpeg -i clinician.oggInput #0, ogg, from 'clinician.ogg' :
Duration : 00:05:20.98, start : 0.001000, bitrate : 2273 kb/s
Stream #0:0 : Video : theora, yuv420p, 500x500 [SAR 1:1 DAR 1:1], 1k tbr, 1k tbn, 1k tbc
Metadata :
SERVER : Red5 Server 1.0.0 RC1 $Rev : 4193 $
CANSEEKTOEND : true
ENCODER : Lavf54.31.100
Stream #0:1 : Audio : vorbis, 8000 Hz, stereo, s16
Metadata :
SERVER : Red5 Server 1.0.0 RC1 $Rev : 4193 $
CANSEEKTOEND : true
ENCODER : Lavf54.31.100ffmpeg -i subject.ogg
Input #0, ogg, from 'subject.ogg' :
Duration : 00:05:17.60, start : 0.001000, bitrate : 1341 kb/s
Stream #0:0 : Video : theora, yuv420p, 300x300 [SAR 1:1 DAR 1:1], 83.33 tbr, 1k tbn, 1k tbc
Metadata :
SERVER : Red5 Server 1.0.0 RC1 $Rev : 4193 $
CANSEEKTOEND : true
ENCODER : Lavf54.31.100
Stream #0:1 : Audio : vorbis, 8000 Hz, stereo, s16
Metadata :
SERVER : Red5 Server 1.0.0 RC1 $Rev : 4193 $
CANSEEKTOEND : true
ENCODER : Lavf54.31.100 -
Decoder crashes after ffmpeg upgrade
5 mai 2014, par Igor R.Recently I upgraded ffmpeg from 0.9 to 1.0 (tested on Win7x64 and on iOS), and now
avcodec_decode_video2
seagfaults. Long story short : the crash occurs every time the video dimensions change (eg. from 320x240 to 160x120 or vice versa).I receive mpeg4 video stream from some proprietary source and decode it like this :
// once, during initialization:
AVCodec *codec_ = avcodec_find_decoder(CODEC_ID_MPEG4);
AVCodecContext ctx_ = avcodec_alloc_context3(codec_);
avcodec_open2(ctx_, codec_, 0);
AVPacket packet_;
av_init_packet(&packet_);
AVFrame picture_ = avcodec_alloc_frame();
// on every frame:
int got_picture;
packet_.size = size;
packet_.data = (uint8_t *)buffer;
avcodec_decode_video2(ctx_, picture_, &got_picture, &packet_);Again, all the above had worked flawlessly until I upgraded to 1.0. Now every time the frame dimensions change -
avcodec_decode_video2
crashes. Note that I don’t assign width/height in AVCodecContext - neither in the beginning, nor when the stream changes - can it be the reason ?I’d appreciate any idea !
Update : setting ctx_.width and ctx_.height doesn’t help.
Update2 : just before the crash I get the following log messages :
mpeg4, level 24 : "Found 2 unreleased buffers !".
level 8 : "Assertion i < avci->buffer_count failed at libavcodec/utils.c:603"Update3 upgrading to 1.1.2 fixed this crash. The decoder is able again to cope with dimensions change on the fly.