[MPlayer-users] Possible bug in -vo jpeg and -vo png

Jason Pfeil jason.pfeil at gmail.com
Fri Jul 14 14:15:56 CEST 2006


RC,

On 7/14/06, RC <rcooley at spamcop.net> wrote:
> On Thu, 13 Jul 2006 11:21:30 -0400
> "Jason Pfeil" <jason.pfeil at gmail.com> wrote:
>
[...snip...]
> This thread seems to be going further and futher off-target.  I can see
> the desync, but that is besides the point.
[...snip...]

My point is that because mplayer is not exporting the correct number
of frames, the resulting audio and video are not in sync.  I provided
the prior examples to show the overall effect, not to try and take the
thread off target.  If it appears that I have done so, then I
apologize.

[...snip...]
> I don't see any indication that MPlayer is failing to output any of the
> video's frames.  I also can't what might cause you to reach that
> conclusion.
[...snip...]

To provide further evidence to help you see that mplayer is not
outputting all of the frames, I have created two more source .avi
files which are both 3.5 seconds cut from the same original .avi.  The
first one has all black frames, is cut from the first 3.5 seconds of
the source .avi, and is called lost.s01e15-3.5s-all-black-source.avi.
The second one has moving frames, is 3.5 seconds cut from the same
.avi, but 2 minutes and 40 seconds into it, and is called
lost.s01e15-3.5s-motion-source.avi.  I have again created two shell
scripts, one called Steps-shows-problem-with-splitting-frames.txt,
which splits the frames of the all black .avi, and one called
Steps-no-problem-with-splitting-frames.txt, which splits the frames of
the motion .avi.  Simply execute them and you will see that the files,
containing the same number of frames (84), expand into different
numbers of frames.  The file I just sent is called Problem2.zip.

Here is the evidence:

* the files are 3.5 seconds long
* mplayer reports each file as being 84 frames long
* when the all black file is expanded into PNG frames, mplayer outputs
*only* 56 PNGs
* when the motion file is expanded into PNG frames, mplayer outputs 83 PNGs

Here is the output from running mplayer to expand the frames for the
all black file:

[...BEGIN mplayer output...]
~/Desktop/Problem2$ sh -x ./Steps-shows-problem-with-splitting-frames.txt
+ rm '*.png'
rm: cannot remove `*.png': No such file or directory
+ mplayer -vo png -vf harddup -mc 0 -ao null lost.s01e15-3.5s-source.avi
MPlayer 2:0.99+1.0pre7try2+cvs20060117-0ubuntu8 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Athlon 64 Clawhammer; Athlon 64 X2 Toledo;
Turion Newark,Lancaster (Family: 15, Stepping: 10)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.


91 audio & 204 video codecs
Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission denied
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your
system startup scripts.
Opening joystick device /dev/input/js0
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support.
You will not be able to use your remote control.
Playing lost.s01e15-3.5s-source.avi.
AVI file format detected.
VIDEO:  [XVID]  640x352  12bpp  23.976 fps   14.9 kbps ( 1.8 kbyte/s)
Clip info:
 Software: MEncoder 2:0.99+1.0pre7try2+cvs20060117-0ubuntu8
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 32.0 kbit/2.08% (ratio: 4000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Opening video filter: [harddup]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
AO: [null] 48000Hz 2ch s16le (2 bytes per sample)
Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le...
Starting playback...
VDec: vo config request - 640 x 352 (preferred colorspace: Planar YV12)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.82:1 - prescaling to correct movie aspect.
SwScaler: using unscaled Planar YV12 -> BGR 24-bit special converter
VO: [png] 640x352 => 640x352 BGR 24-bit
PNG Warning: compression level set to 0, compression disabled!
PNG Info: Use -vo png:z=<n> to set compression level from 0 to 9.
PNG Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest
compression)
A:   3.5 V:   3.5 A-V:  0.088 ct:  0.000  84/ 84  3% 86%  0.7% 41 0

Exiting... (End of file)
[...END mplayer output...]

According to mplayer, it plays 84 frames.  At the frame rate of
24000/1001, 84 frames is 3.5 seconds.

Looking at the contents of the directory, we see that while mplayer
*played* 84 frames, it only *wrote* 56 frames.

[...BEGIN of ls ~/Desktop/Problem2...]
~/Desktop/Problem2$ ls -l *.png | wc -l
56
~/Desktop/Problem2$ ls
00000001.png  00000021.png  00000041.png
00000002.png  00000022.png  00000042.png
00000003.png  00000023.png  00000043.png
00000004.png  00000024.png  00000044.png
00000005.png  00000025.png  00000045.png
00000006.png  00000026.png  00000046.png
00000007.png  00000027.png  00000047.png
00000008.png  00000028.png  00000048.png
00000009.png  00000029.png  00000049.png
00000010.png  00000030.png  00000050.png
00000011.png  00000031.png  00000051.png
00000012.png  00000032.png  00000052.png
00000013.png  00000033.png  00000053.png
00000014.png  00000034.png  00000054.png
00000015.png  00000035.png  00000055.png
00000016.png  00000036.png  00000056.png
00000017.png  00000037.png  lost.s01e15-3.5s-all-black-source.avi
00000018.png  00000038.png  lost.s01e15-3.5s-motion-source.avi
00000019.png  00000039.png  Steps-no-problem-with-splitting-frames.txt
00000020.png  00000040.png  Steps-shows-problem-with-splitting-frames.txt
[...END of ls ~/Desktop/Problem2...]


Now, here is the output of mplayer expanding the motion .avi into
individual PNG frames:

[...BEGIN mplayer output...]
~/Desktop/Problem2$ sh -x ./Steps-no-problem-with-splitting-frames.txt
+ rm 00000001.png 00000002.png 00000003.png 00000004.png 00000005.png
00000006.png 00000007.png 00000008.png 00000009.png 00000010.png
00000011.png 00000012.png 00000013.png 00000014.png 00000015.png
00000016.png 00000017.png 00000018.png 00000019.png 00000020.png
00000021.png 00000022.png 00000023.png 00000024.png 00000025.png
00000026.png 00000027.png 00000028.png 00000029.png 00000030.png
00000031.png 00000032.png 00000033.png 00000034.png 00000035.png
00000036.png 00000037.png 00000038.png 00000039.png 00000040.png
00000041.png 00000042.png 00000043.png 00000044.png 00000045.png
00000046.png 00000047.png 00000048.png 00000049.png 00000050.png
00000051.png 00000052.png 00000053.png 00000054.png 00000055.png
00000056.png
+ mplayer -vo png -vf harddup -mc 0 -ao null lost.s01e15-3.5s-motion-source.avi
MPlayer 2:0.99+1.0pre7try2+cvs20060117-0ubuntu8 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Athlon 64 Clawhammer; Athlon 64 X2 Toledo;
Turion Newark,Lancaster (Family: 15, Stepping: 10)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.


91 audio & 204 video codecs
Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission denied
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your
system startup scripts.
Opening joystick device /dev/input/js0
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support.
You will not be able to use your remote control.
Playing lost.s01e15-3.5s-motion-source.avi.
AVI file format detected.
VIDEO:  [XVID]  640x352  12bpp  23.976 fps  635.9 kbps (77.6 kbyte/s)
Clip info:
 Software: MEncoder 2:0.99+1.0pre7try2+cvs20060117-0ubuntu8
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 160.0 kbit/10.42% (ratio: 20000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Opening video filter: [harddup]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
AO: [null] 48000Hz 2ch s16le (2 bytes per sample)
Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le...
Starting playback...
VDec: vo config request - 640 x 352 (preferred colorspace: Planar YV12)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.82:1 - prescaling to correct movie aspect.
SwScaler: using unscaled Planar YV12 -> BGR 24-bit special converter
VO: [png] 640x352 => 640x352 BGR 24-bit
PNG Warning: compression level set to 0, compression disabled!
PNG Info: Use -vo png:z=<n> to set compression level from 0 to 9.
PNG Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest
compression)
A:   3.1 V:   2.3 A-V:  0.767 ct:  0.000  56/ 56  6% 126%  1.3% 50 0

           ************************************************
           **** Your system is too SLOW to play this!  ****
           ************************************************

Possible reasons, problems, workarounds:
- Most common: broken/buggy _audio_ driver
  - Try -ao sdl or use the OSS emulation of ALSA.
  - Experiment with different values for -autosync, 30 is a good start.
- Slow video output
  - Try a different -vo driver (-vo help for a list) or try -framedrop!
- Slow CPU
  - Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts,
    e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all.
- Broken file
  - Try various combinations of -nobps -ni -forceidx -mc 0.
- Slow media (NFS/SMB mounts, DVD, VCD etc)
  - Try -cache 8192.
- Are you using -cache to play a non-interleaved AVI file?
  - Try -nocache.
Read DOCS/HTML/en/video.html for tuning/speedup tips.
If none of this helps you, read DOCS/HTML/en/bugreports.html.

A:   3.5 V:   3.5 A-V:  0.037 ct:  0.000  84/ 84  6% 117%  0.9% 52 0

Exiting... (End of file)
[...END mplayer output...]

[...BEGIN of ls ~/Desktop/Problem2...]
~/Desktop/Problem2$ ls -l *.png | wc -l
83
~/Desktop/Problem2$ ls
00000001.png  00000030.png  00000059.png
00000002.png  00000031.png  00000060.png
00000003.png  00000032.png  00000061.png
00000004.png  00000033.png  00000062.png
00000005.png  00000034.png  00000063.png
00000006.png  00000035.png  00000064.png
00000007.png  00000036.png  00000065.png
00000008.png  00000037.png  00000066.png
00000009.png  00000038.png  00000067.png
00000010.png  00000039.png  00000068.png
00000011.png  00000040.png  00000069.png
00000012.png  00000041.png  00000070.png
00000013.png  00000042.png  00000071.png
00000014.png  00000043.png  00000072.png
00000015.png  00000044.png  00000073.png
00000016.png  00000045.png  00000074.png
00000017.png  00000046.png  00000075.png
00000018.png  00000047.png  00000076.png
00000019.png  00000048.png  00000077.png
00000020.png  00000049.png  00000078.png
00000021.png  00000050.png  00000079.png
00000022.png  00000051.png  00000080.png
00000023.png  00000052.png  00000081.png
00000024.png  00000053.png  00000082.png
00000025.png  00000054.png  00000083.png
00000026.png  00000055.png  lost.s01e15-3.5s-all-black-source.avi
00000027.png  00000056.png  lost.s01e15-3.5s-motion-source.avi
00000028.png  00000057.png  Steps-no-problem-with-splitting-frames.txt
00000029.png  00000058.png  Steps-shows-problem-with-splitting-frames.txt
[...END of ls ~/Desktop/Problem2...]

That is the basis of my claim that mplayer is not outputting the
correct number of frames when the frames are "black."  When the frames
are all "black", mplayer plays 84 frames (3.5s) and only outputs 56
frames (2.34s), 2/3 of the frames which should be exported.  When 84
"frames worth" of audio are exported to the .wav file and only 56
frames of video are exported, you can understand how the sync would be
lost.  Even the "no problem" .avi is missing a frame, outputting 83
frames when mplayer played 84 frames, but that may be another issue
altogether and is so minimal that its effect on sync would not be
noticeable unless it occurred frequently and for my purposes, since
I'm only expanding 3 minutes of video into frames, it would not be
noticeable.

I hope that this helps you to understand how I came to conclude that
there was an issue with how mplayer was breaking out individual frames
and I hope that it can be resolved.  I *love* mplayer and am extremely
grateful for it and find it extremely useful, and I would like to be
able to continue to use it to create my DVD menus in this manner.

Please let me know if there is anything else that I can do to help
diagnose and fix this issue.

Have a great day!

--Jason

-- 
Jason A. Pfeil
jason.pfeil=at=gmail.com.NOSPAM



More information about the MPlayer-users mailing list