Libmpeg2 and ffplay broken with SDL-1.3

Hi,

I’m trying to play video with ffplay and mpeg2dec (from libmpeg2) with
SDL-1.3, and it doesn’t work.

  • ffplay can play audio but not video
  • mpeg2dec complains of unaligned buffers:

*id = overlay = SDL_CreateYUVOverlay (instance->width, instance->height,
SDL_YV12_OVERLAY,
instance->surface);
buf[0] = overlay->pixels[0];
buf[1] = overlay->pixels[2];
buf[2] = overlay->pixels[1];

if (((long)buf[0] & 15) || ((long)buf[1] & 15) || ((long)buf[2] & 15)) {
    fprintf (stderr, "Unaligned buffers. Anyone know how to fix this

?\n");
exit (1);
}

Does anyone know who where to begin fixing this? I don’t have enough
experience with graphics…

Thanks for reporting this, someone reported this recently assuming it
was an iPhone-specific issue (or I assumed that when I read it,
anyhow.) For posterity can you also post your platform, ffmpeg
version, and SDL subversion revision?On Tue, Dec 16, 2008 at 8:11 PM, Yonas <googelly.eyes at gmail.com> wrote:

Hi,

I’m trying to play video with ffplay and mpeg2dec (from libmpeg2) with
SDL-1.3, and it doesn’t work.

  • ffplay can play audio but not video
  • mpeg2dec complains of unaligned buffers:

*id = overlay = SDL_CreateYUVOverlay (instance->width, instance->height,
SDL_YV12_OVERLAY,
instance->surface);
buf[0] = overlay->pixels[0];
buf[1] = overlay->pixels[2];
buf[2] = overlay->pixels[1];

if (((long)buf[0] & 15) || ((long)buf[1] & 15) || ((long)buf[2] & 15)) {
fprintf (stderr, “Unaligned buffers. Anyone know how to fix this
?\n”);
exit (1);
}

Does anyone know who where to begin fixing this? I don’t have enough
experience with graphics…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

Ubuntu 8.10, Linux yonas-laptop 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00
UTC 2008 i686 GNU/Linux
ffmpeg - svn Dec 16, 2008
libmpeg2 - 0.5.1
SDL - svn Dec 16, 2008

I had problems playing it on Mac OS X and iPhone too. Again, audio works
well, but video doesn’t show up at all in linux, or is a blank white
rectangle in Mac OS X.

Donny Viszneki wrote:>

Thanks for reporting this, someone reported this recently assuming it
was an iPhone-specific issue (or I assumed that when I read it,
anyhow.) For posterity can you also post your platform, ffmpeg
version, and SDL subversion revision?

On Tue, Dec 16, 2008 at 8:11 PM, Yonas <@Yonas> wrote:

Hi,

I’m trying to play video with ffplay and mpeg2dec (from libmpeg2) with
SDL-1.3, and it doesn’t work.

  • ffplay can play audio but not video
  • mpeg2dec complains of unaligned buffers:

*id = overlay = SDL_CreateYUVOverlay (instance->width, instance->height,
SDL_YV12_OVERLAY,
instance->surface);
buf[0] = overlay->pixels[0];
buf[1] = overlay->pixels[2];
buf[2] = overlay->pixels[1];

if (((long)buf[0] & 15) || ((long)buf[1] & 15) || ((long)buf[2] & 15))
{
fprintf (stderr, “Unaligned buffers. Anyone know how to fix this
?\n”);
exit (1);
}

Does anyone know who where to begin fixing this? I don’t have enough
experience with graphics…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


View this message in context: http://www.nabble.com/libmpeg2-and-ffplay-broken-with-SDL-1.3-tp21045319p21046445.html
Sent from the SDL mailing list archive at Nabble.com.

Ubuntu 8.10, Linux yonas-laptop 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00
UTC 2008 i686 GNU/Linux
ffmpeg - svn Dec 16, 2008
libmpeg2 - 0.5.1
SDL - svn Dec 16, 2008

I had problems playing it on Mac OS X and iPhone too. Again, audio works
well, but video doesn’t show up at all in linux, or is a blank white
rectangle in Mac OS X.

Can you put together an archive of the broken software and test video?
I’ve been working on video playback in SDL 1.3 recently and it’s working
fine for me.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

My copy of the software is all from svn, no modifications. I’ve tried with
mpeg’s from websites pulled from Google, for eg. :
http://home.in.tum.de/~paula/mpeg/wg_gdo_1.mpg

Can you send me your copy of SDL? :slight_smile: Or is it in svn already?

Sam Lantinga-2 wrote:>

Ubuntu 8.10, Linux yonas-laptop 2.6.27-9-generic #1 SMP Thu Nov 20
21:57:00
UTC 2008 i686 GNU/Linux
ffmpeg - svn Dec 16, 2008
libmpeg2 - 0.5.1
SDL - svn Dec 16, 2008

I had problems playing it on Mac OS X and iPhone too. Again, audio works
well, but video doesn’t show up at all in linux, or is a blank white
rectangle in Mac OS X.

Can you put together an archive of the broken software and test video?
I’ve been working on video playback in SDL 1.3 recently and it’s working
fine for me.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


View this message in context: http://www.nabble.com/libmpeg2-and-ffplay-broken-with-SDL-1.3-tp21045319p21065790.html
Sent from the SDL mailing list archive at Nabble.com.

I could not even get the latest ffmpeg to build with SDL 1.3 SVN
revision 4225 on Debian Etch

gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_ISOC9X_SOURCE -I"/home/donny/ffmpeg" -I"/home/donny/ffmpeg"
-I"/home/donny/ffmpeg"/libavcodec -I"/home/donny/ffmpeg"/libavdevice
-I"/home/donny/ffmpeg"/libavfilter -I"/home/donny/ffmpeg"/libavformat
-I"/home/donny/ffmpeg"/libavutil -I"/home/donny/ffmpeg"/libpostproc
-I"/home/donny/ffmpeg"/libswscale -fomit-frame-pointer -g
-Wdeclaration-after-statement -Wall -Wno-switch
-Wdisabled-optimization -Wpointer-arith -Wredundant-decls
-Wno-pointer-sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno
-I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -c -o ffplay.o
ffplay.c
ffplay.c: In function ‘main’:
ffplay.c:2549: error: ‘SDL_VideoInfo’ has no member named 'current_w’
ffplay.c:2550: error: ‘SDL_VideoInfo’ has no member named 'current_h’
ffplay.c:2560: warning: assignment discards qualifiers from pointer target type
make: *** [ffplay.o] Error 1On Wed, Dec 17, 2008 at 9:19 PM, Yonas <googelly.eyes at gmail.com> wrote:

My copy of the software is all from svn, no modifications. I’ve tried with
mpeg’s from websites pulled from Google, for eg. :
http://home.in.tum.de/~paula/mpeg/wg_gdo_1.mpg

Can you send me your copy of SDL? :slight_smile: Or is it in svn already?

Sam Lantinga-2 wrote:

Ubuntu 8.10, Linux yonas-laptop 2.6.27-9-generic #1 SMP Thu Nov 20
21:57:00
UTC 2008 i686 GNU/Linux
ffmpeg - svn Dec 16, 2008
libmpeg2 - 0.5.1
SDL - svn Dec 16, 2008

I had problems playing it on Mac OS X and iPhone too. Again, audio works
well, but video doesn’t show up at all in linux, or is a blank white
rectangle in Mac OS X.

Can you put together an archive of the broken software and test video?
I’ve been working on video playback in SDL 1.3 recently and it’s working
fine for me.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


View this message in context: http://www.nabble.com/libmpeg2-and-ffplay-broken-with-SDL-1.3-tp21045319p21065790.html
Sent from the SDL mailing list archive at Nabble.com.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

The code in ffplay.c is:

2578 if (!display_disable) {
2579 #ifdef HAVE_SDL_VIDEO_SIZE
2580 const SDL_VideoInfo *vi = SDL_GetVideoInfo();
2581 fs_screen_width = vi->current_w;
2582 fs_screen_height = vi->current_h;
2583 #endif
2584 }

My ~/ffmpeg-2008-12-15/config.h has:
#define ENABLE_SDL_VIDEO_SIZE 0

with sdl-config --version:
1.3.0

Is config.h showing “#define ENABLE_SDL_VIDEO_SIZE 1” ?

Donny Viszneki wrote:>

I could not even get the latest ffmpeg to build with SDL 1.3 SVN
revision 4225 on Debian Etch

gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_ISOC9X_SOURCE -I"/home/donny/ffmpeg" -I"/home/donny/ffmpeg"
-I"/home/donny/ffmpeg"/libavcodec -I"/home/donny/ffmpeg"/libavdevice
-I"/home/donny/ffmpeg"/libavfilter -I"/home/donny/ffmpeg"/libavformat
-I"/home/donny/ffmpeg"/libavutil -I"/home/donny/ffmpeg"/libpostproc
-I"/home/donny/ffmpeg"/libswscale -fomit-frame-pointer -g
-Wdeclaration-after-statement -Wall -Wno-switch
-Wdisabled-optimization -Wpointer-arith -Wredundant-decls
-Wno-pointer-sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno
-I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -c -o ffplay.o
ffplay.c
ffplay.c: In function ‘main’:
ffplay.c:2549: error: ‘SDL_VideoInfo’ has no member named 'current_w’
ffplay.c:2550: error: ‘SDL_VideoInfo’ has no member named 'current_h’
ffplay.c:2560: warning: assignment discards qualifiers from pointer target
type
make: *** [ffplay.o] Error 1

On Wed, Dec 17, 2008 at 9:19 PM, Yonas <@Yonas> wrote:

My copy of the software is all from svn, no modifications. I’ve tried
with
mpeg’s from websites pulled from Google, for eg. :
http://home.in.tum.de/~paula/mpeg/wg_gdo_1.mpg

Can you send me your copy of SDL? :slight_smile: Or is it in svn already?

Sam Lantinga-2 wrote:

Ubuntu 8.10, Linux yonas-laptop 2.6.27-9-generic #1 SMP Thu Nov 20
21:57:00
UTC 2008 i686 GNU/Linux
ffmpeg - svn Dec 16, 2008
libmpeg2 - 0.5.1
SDL - svn Dec 16, 2008

I had problems playing it on Mac OS X and iPhone too. Again, audio
works
well, but video doesn’t show up at all in linux, or is a blank white
rectangle in Mac OS X.

Can you put together an archive of the broken software and test video?
I’ve been working on video playback in SDL 1.3 recently and it’s working
fine for me.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


View this message in context:
http://www.nabble.com/libmpeg2-and-ffplay-broken-with-SDL-1.3-tp21045319p21065790.html
Sent from the SDL mailing list archive at Nabble.com.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


View this message in context: http://www.nabble.com/libmpeg2-and-ffplay-broken-with-SDL-1.3-tp21045319p21067607.html
Sent from the SDL mailing list archive at Nabble.com.

The code in ffplay.c is:

2578 if (!display_disable) {
2579 #ifdef HAVE_SDL_VIDEO_SIZE
2580 const SDL_VideoInfo *vi = SDL_GetVideoInfo();
2581 fs_screen_width = vi->current_w;
2582 fs_screen_height = vi->current_h;
2583 #endif
2584 }

There was a plan to reintroduce current_w and current_h in the SDL_VideoInfo
struct if I remember correctly, I hope Sam will do it since there is a lot
of software that relies on it to setup initial screen resolution or to find
the monitor aspect ratio :)On Thu, Dec 18, 2008 at 7:19 AM, Yonas <googelly.eyes at gmail.com> wrote:


Bye,
Gabry

By the way, ffplay can display a bmp file.

Sam Lantinga-2 wrote:>

Ubuntu 8.10, Linux yonas-laptop 2.6.27-9-generic #1 SMP Thu Nov 20
21:57:00
UTC 2008 i686 GNU/Linux
ffmpeg - svn Dec 16, 2008
libmpeg2 - 0.5.1
SDL - svn Dec 16, 2008

I had problems playing it on Mac OS X and iPhone too. Again, audio works
well, but video doesn’t show up at all in linux, or is a blank white
rectangle in Mac OS X.

Can you put together an archive of the broken software and test video?
I’ve been working on video playback in SDL 1.3 recently and it’s working
fine for me.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


View this message in context: http://www.nabble.com/libmpeg2-and-ffplay-broken-with-SDL-1.3-tp21045319p21082232.html
Sent from the SDL mailing list archive at Nabble.com.