Hello, I've been seeing some issues with MPEG playback and heavy distortions and would be happy if someone could point me to what the issue could be. I've been able to isolate the issue to MPEG, ffmpeg threads and MPlayer video filters. The combination of them produce different results and I hope that is some indication to the problem. The examples below are with a DVD but the issue is not limited to MPEG2 or dvdread/dvdnav. I can reproduce the same errors with a MPEG1 file as well. (This is all with the current SVN and a simple ./configure && make on OSX 10.6.1). (Full MPlayer output at the end of this post). 1. ./mplayer dvdnav://1//Movies/GoodMorning/VIDEO_TS Result: Plays perfectly, no issues. 2. ./mplayer dvdnav://1//Movies/GoodMorning/VIDEO_TS -lavdopts threads=4 Result: Distorted image, lots of green noise, lots of swscaler errors "Slices start in the middle!". Image: http://img34.imageshack.us/img34/1746/mpegthreads.png 3. ./mplayer dvdnav://1//Movies/GoodMorning/VIDEO_TS -lavdopts threads=4 -ass Result: Plays perfectly, no issues. 4. ./mplayer dvdnav://1//Movies/GoodMorning/VIDEO_TS -lavdopts threads=4 -vf screenshot Result: Distorted image, no noise or errors as in [2]. Image: http://img32.imageshack.us/img32/3396/mpegthreadswithass.png 5. ./mplayer dvdnav://1//Movies/GoodMorning/VIDEO_TS -ass -vf screenshot Result: Plays perfectly, no issues. Greetings, Adrian ---- MPlayer output: -- [1] ----------------------------------------------------------------------------------- MPlayer SVN-r29978-4.2.1 (C) 2000-2009 MPlayer Team Playing dvdnav://1//Movies/GoodMorning/VIDEO_TS. libdvdnav: Using dvdnav version MPlayer-custom libdvdread: Using libdvdcss version 1.2.10 for DVD access libdvdread: Couldn't find device name. libdvdnav: Can't read name block. Probably not a DVD-ROM device. libdvdnav: Unable to find map file '/Users/adrian/.dvdnav/.map' libdvdnav: DVD disk reports itself with Region mask 0x00c00000. Regions: 1 2 3 4 5 6 audio stream: 0 format: ac3 (mono) language: unknown aid: 128. subtitle ( sid ): 0 language: unknown INIT ERROR: couldn't get init pos New position not yet determined. Remember to disable MPlayer's cache when playing dvdnav:// streams (adding -nocache to your command line) DVDNAV, switched to title: 1 audio stream: 0 format: ac3 (mono) language: unknown aid: 128. subtitle ( sid ): 0 language: unknown MPEG-PS file format detected. VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 8500.0 kbps (1062.5 kbyte/s) ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. Try appending the scale filter to your filter list, e.g. -vf spp,scale instead of -vf spp. VDecoder init failed :( Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Unsupported PixelFormat -1 Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2) ========================================================================== ========================================================================== Opening audio decoder: [liba52] AC3 decoding with liba52 No accelerated IMDCT transform found Using MMX optimized resampler AUDIO: 48000 Hz, 2 ch, s16le, 224.0 kbit/14.58% (ratio: 28000->192000) Selected audio codec: [a52] afm: liba52 (AC3-liba52) ========================================================================== AO: [coreaudio] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. [swscaler @ 0x100851780]BICUBIC scaler, from yuv420p to yuyv422 using MMX2 VO: [corevideo] 720x480 => 720x540 Packed YUY2 [ASPECT] Warning: No suitable new res found! [mpeg2video @ 0x100848600]ac-tex damaged at 10 7 [mpeg2video @ 0x100848600]Warning MVs not available [mpeg2video @ 0x100848600]concealing 1035 DC, 1035 AC, 1035 MV errors A: 0.9 V: 0.9 A-V: 0.000 ct: 0.064 27/ 27 9% 6% 0.6% 0 0 Exiting... (Quit) -- [2] ----------------------------------------------------------------------------------- MPlayer SVN-r29978-4.2.1 (C) 2000-2009 MPlayer Team Playing dvdnav://1//Volumes/Permanent/Filme/GoodMorning/VIDEO_TS. libdvdnav: Using dvdnav version MPlayer-custom libdvdread: Using libdvdcss version 1.2.10 for DVD access libdvdread: Couldn't find device name. libdvdnav: Can't read name block. Probably not a DVD-ROM device. libdvdnav: Unable to find map file '/Users/adrian/.dvdnav/.map' libdvdnav: DVD disk reports itself with Region mask 0x00c00000. Regions: 1 2 3 4 5 6 audio stream: 0 format: ac3 (mono) language: unknown aid: 128. subtitle ( sid ): 0 language: unknown INIT ERROR: couldn't get init pos New position not yet determined. Remember to disable MPlayer's cache when playing dvdnav:// streams (adding -nocache to your command line) DVDNAV, switched to title: 1 audio stream: 0 format: ac3 (mono) language: unknown aid: 128. subtitle ( sid ): 0 language: unknown MPEG-PS file format detected. VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 8500.0 kbps (1062.5 kbyte/s) ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. Try appending the scale filter to your filter list, e.g. -vf spp,scale instead of -vf spp. VDecoder init failed :( Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Unsupported PixelFormat -1 Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2) ========================================================================== ========================================================================== Opening audio decoder: [liba52] AC3 decoding with liba52 No accelerated IMDCT transform found Using MMX optimized resampler AUDIO: 48000 Hz, 2 ch, s16le, 224.0 kbit/14.58% (ratio: 28000->192000) Selected audio codec: [a52] afm: liba52 (AC3-liba52) ========================================================================== AO: [coreaudio] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. [swscaler @ 0x100851780]BICUBIC scaler, from yuv420p to yuyv422 using MMX2 VO: [corevideo] 720x480 => 720x540 Packed YUY2 [ASPECT] Warning: No suitable new res found! [mpeg2video @ 0x100848600]ac-tex damaged at 10 7 [mpeg2video @ 0x100848600]Warning MVs not available [mpeg2video @ 0x100848600]concealing 1035 DC, 1035 AC, 1035 MV errors [swscaler @ 0x100851780][swscaler @ 0x100851780]Slices start in the middle! Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle!% ??% ??,?% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% ??% ??,?% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% ??% ??,?% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% ??% ??,?% 0 0 [swscaler @ 0x100851780][swscaler @ 0x100851780][swscaler @ 0x100851780]Slices start in the middle! Slices start in the middle! Slices start in the middle! [swscaler @ 0x100851780][swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle!% 9% 0.8% 0 0 [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780][swscaler @ 0x100851780]Slices start in the middle! Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780][swscaler @ 0x100851780]Slices start in the middle! Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle!% 8% 0.7% 0 0 [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle!% 8% 0.7% 0 0 [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780][swscaler @ 0x100851780][swscaler @ 0x100851780]Slices start in the middle! Slices start in the middle! Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle!% 7% 0.6% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% 7% 0.6% 0 0 [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle!% 6% 0.6% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% 6% 0.6% 0 0 [swscaler @ 0x100851780][swscaler @ 0x100851780][swscaler @ 0x100851780]Slices start in the middle! Slices start in the middle! Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle!% 6% 0.6% 0 0 [swscaler @ 0x100851780][swscaler @ 0x100851780]Slices start in the middle! Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle!% 5% 0.5% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% 5% 0.5% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% 5% 0.5% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% 5% 0.5% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% 4% 0.5% 0 0 [swscaler @ 0x100851780]Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle!% 4% 0.5% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% 4% 0.5% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% 4% 0.5% 0 0 [swscaler @ 0x100851780]Slices start in the middle!% 4% 0.5% 0 0 [swscaler @ 0x100851780][swscaler @ 0x100851780]Slices start in the middle! Slices start in the middle! [swscaler @ 0x100851780]Slices start in the middle!% 4% 0.5% 0 0 A: 1.5 V: 1.5 A-V: 0.011 ct: 0.079 47/ 47 8% 4% 0.5% 0 0 Exiting... (Quit) (etc...) -- [3] ----------------------------------------------------------------------------------- MPlayer SVN-r29978-4.2.1 (C) 2000-2009 MPlayer Team Playing dvdnav://1//Volumes/Permanent/Filme/GoodMorning/VIDEO_TS. libdvdnav: Using dvdnav version MPlayer-custom libdvdread: Using libdvdcss version 1.2.10 for DVD access libdvdread: Couldn't find device name. libdvdnav: Can't read name block. Probably not a DVD-ROM device. libdvdnav: Unable to find map file '/Users/adrian/.dvdnav/.map' libdvdnav: DVD disk reports itself with Region mask 0x00c00000. Regions: 1 2 3 4 5 6 audio stream: 0 format: ac3 (mono) language: unknown aid: 128. subtitle ( sid ): 0 language: unknown INIT ERROR: couldn't get init pos New position not yet determined. Remember to disable MPlayer's cache when playing dvdnav:// streams (adding -nocache to your command line) DVDNAV, switched to title: 1 audio stream: 0 format: ac3 (mono) language: unknown aid: 128. subtitle ( sid ): 0 language: unknown MPEG-PS file format detected. VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 8500.0 kbps (1062.5 kbyte/s) Opening video filter: [scale] [ass] auto-open [ass] Init [ass] Updating font cache. ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. Try appending the scale filter to your filter list, e.g. -vf spp,scale instead of -vf spp. VDecoder init failed :( Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Unsupported PixelFormat -1 Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2) ========================================================================== ========================================================================== Opening audio decoder: [liba52] AC3 decoding with liba52 No accelerated IMDCT transform found Using MMX optimized resampler AUDIO: 48000 Hz, 2 ch, s16le, 224.0 kbit/14.58% (ratio: 28000->192000) Selected audio codec: [a52] afm: liba52 (AC3-liba52) ========================================================================== AO: [coreaudio] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. [swscaler @ 0x100851780]BICUBIC scaler, from yuv420p to yuyv422 using MMX2 VO: [corevideo] 720x480 => 720x540 Packed YUY2 [ASPECT] Warning: No suitable new res found! [mpeg2video @ 0x100848600]ac-tex damaged at 10 7 [mpeg2video @ 0x100848600]Warning MVs not available [mpeg2video @ 0x100848600]concealing 1035 DC, 1035 AC, 1035 MV errors A: 2.4 V: 2.4 A-V: 0.002 ct: 0.079 73/ 73 2% 6% 0.4% 0 0 Exiting... (Quit) -- [4] ----------------------------------------------------------------------------------- MPlayer SVN-r29978-4.2.1 (C) 2000-2009 MPlayer Team Playing dvdnav://1//Volumes/Permanent/Filme/GoodMorning/VIDEO_TS. libdvdnav: Using dvdnav version MPlayer-custom libdvdread: Using libdvdcss version 1.2.10 for DVD access libdvdread: Couldn't find device name. libdvdnav: Can't read name block. Probably not a DVD-ROM device. libdvdnav: Unable to find map file '/Users/adrian/.dvdnav/.map' libdvdnav: DVD disk reports itself with Region mask 0x00c00000. Regions: 1 2 3 4 5 6 audio stream: 0 format: ac3 (mono) language: unknown aid: 128. subtitle ( sid ): 0 language: unknown INIT ERROR: couldn't get init pos New position not yet determined. Remember to disable MPlayer's cache when playing dvdnav:// streams (adding -nocache to your command line) DVDNAV, switched to title: 1 audio stream: 0 format: ac3 (mono) language: unknown aid: 128. subtitle ( sid ): 0 language: unknown MPEG-PS file format detected. VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 8500.0 kbps (1062.5 kbyte/s) Opening video filter: [scale] [ass] auto-open Opening video filter: [screenshot] [ass] Init [ass] Updating font cache. ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. Try appending the scale filter to your filter list, e.g. -vf spp,scale instead of -vf spp. VDecoder init failed :( Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Unsupported PixelFormat -1 Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2) ========================================================================== ========================================================================== Opening audio decoder: [liba52] AC3 decoding with liba52 No accelerated IMDCT transform found Using MMX optimized resampler AUDIO: 48000 Hz, 2 ch, s16le, 224.0 kbit/14.58% (ratio: 28000->192000) Selected audio codec: [a52] afm: liba52 (AC3-liba52) ========================================================================== AO: [coreaudio] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. [swscaler @ 0x100851780]BICUBIC scaler, from yuv420p to rgb24 using MMX2 VO: [corevideo] 720x480 => 720x540 Packed YUY2 [ASPECT] Warning: No suitable new res found! [mpeg2video @ 0x100848600]ac-tex damaged at 10 7 [mpeg2video @ 0x100848600]Warning MVs not available [mpeg2video @ 0x100848600]concealing 1035 DC, 1035 AC, 1035 MV errors A: 3.9 V: 3.9 A-V: -0.008 ct: 0.079 119/119 2% 7% 0.4% 0 0 Exiting... (Quit) -- [5] ----------------------------------------------------------------------------------- MPlayer SVN-r29978-4.2.1 (C) 2000-2009 MPlayer Team Playing dvdnav:////Volumes/Permanent/Filme/GoodMorning/VIDEO_TS. libdvdnav: Using dvdnav version MPlayer-custom libdvdread: Using libdvdcss version 1.2.10 for DVD access libdvdread: Couldn't find device name. libdvdnav: Can't read name block. Probably not a DVD-ROM device. libdvdnav: Unable to find map file '/Users/adrian/.dvdnav/.map' libdvdnav: DVD disk reports itself with Region mask 0x00c00000. Regions: 1 2 3 4 5 6 libdvdnav: *** pgci_ut handle is NULL *** libdvdnav: *** pgci_ut handle is NULL *** Remember to disable MPlayer's cache when playing dvdnav:// streams (adding -nocache to your command line) DVDNAV, switched to title: 1 audio stream: 0 format: ac3 (mono) language: unknown aid: 128. subtitle ( sid ): 0 language: unknown MPEG-PS file format detected. VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 8500.0 kbps (1062.5 kbyte/s) Opening video filter: [scale] [ass] auto-open Opening video filter: [screenshot] [ass] Init [ass] Updating font cache. ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. Try appending the scale filter to your filter list, e.g. -vf spp,scale instead of -vf spp. VDecoder init failed :( Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Unsupported PixelFormat -1 Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2) ========================================================================== ========================================================================== Opening audio decoder: [liba52] AC3 decoding with liba52 No accelerated IMDCT transform found Using MMX optimized resampler AUDIO: 48000 Hz, 2 ch, s16le, 224.0 kbit/14.58% (ratio: 28000->192000) Selected audio codec: [a52] afm: liba52 (AC3-liba52) ========================================================================== AO: [coreaudio] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. [swscaler @ 0x100851780]BICUBIC scaler, from yuv420p to rgb24 using MMX2 VO: [corevideo] 720x480 => 720x540 Packed YUY2 [ASPECT] Warning: No suitable new res found! [mpeg2video @ 0x100848600]ac-tex damaged at 10 7 [mpeg2video @ 0x100848600]Warning MVs not available [mpeg2video @ 0x100848600]concealing 1035 DC, 1035 AC, 1035 MV errors A: 2.8 V: 2.8 A-V: -0.001 ct: 0.079 84/ 84 3% 6% 0.4% 0 0 Exiting... (Quit)