我正在尝试开发一个可以与ffmpeg同时播放多个视频的代码。 我需要在2x2矩阵背景上播放视频,并在其左上角播放另一个视频。 问题:左上角的视频轻弹且不够稳定。 top-left video is flicking while playing 代码:
SDL_Surface *screen = SDL_SetVideoMode(640, 480, 24, 0);
void video_display(VideoState *is) {
SDL_Rect rect;
VideoPicture *vp;
int w, h, x, y;
h = screen->h;
w = ((int)rint(h * aspect_ratio)) ;
if(w > screen->w) {
w = screen->w;
h = ((int)rint(w / aspect_ratio)) ;
}
rect.x = (screen->w - w) / 2;
rect.y = (screen->h - h) / 2;
if( is->video_id == 0 ){
rect.w = w;
rect.h = h;
SDL_DisplayYUVOverlay(vp->bmp, &rect); // i think the problem is over here
}
else if( is->video_id == 1 ){
rect.w = w/2;
rect.h = h/2;
SDL_DisplayYUVOverlay(vp->bmp, &rect);
}
当我选择0/1时,我只在音频之间移动。 我的问题是:为了让左上角的视频稳定可见,我应该编码什么?