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

Jason Pfeil jason.pfeil at gmail.com
Wed Jul 12 00:30:58 CEST 2006


Greetings!

I am using mplayer to create custom DVD menus in a scriptable manner.
Mplayer enters the picture when I want to split the .avi files I am
using for the scene thumbnails into the component images.  Here is
what I am attempting.

I want to make a DVD containing several titles on it.  Each button
will be an thumbnail from the file which it represents.  To make the
thumbnails, one per title, I am using the following process:

1. use mplayer to break the source .avi file into a sequence of PNG
images, scaled, and to split the audio for each sequence into its own
file
2. compose each frame of the .mpg from the individual PNGs broken out by mplayer
3. create the .m2v file from the composited frames
4. use an audio tool to pick the first minute from the first .wav, the
second minute from the second .wav, and the third minute from the
third .wav and produce a final .wav file
5. encode the composite .wav as an .ac3 file
6. finally, multiplex the .m2v and the .ac3 file into the resulting
.mpg file for the DVD menu

All of this works like a *charm*, except when the scene crosses a
portion of the DVD which is composed of "black" frames.  It appears
that when mplayer is dumping the series of PNG images, it is dropping
duplicate frames.  The problem was the same with JPEG images, but
because of bugs in jpeg2yuv causing random segraults, I switched to
PNG images.

I have a zipfile (52MB in size) which contains a sample source .avi.
It contains the commands I used to generate the test.mpg which
illustrate the issue as well as a few of the temp files.  Because of
the sizes of the files involved, I can't post them publicly, but I
would be happy to provide them to you if you contact me.

I can provide any further information that you need.  I can also
provide a sample of the DVD menu .mpg files in their fully constituted
forms, but, again because of filesize, I can't post them publicly.

Here is the sequence of commands I use:

# Split the .mpg into .png files, one per frame for the first 1800 frames
mplayer -vo png -ao pcm:file=test.wav -frames 1800 source.avi

# Recombine the .png frames into the .m2v file for later multiplexing
png2yuv -v 0 -b 1 -f 24 -I p -j %08d.png | yuvscaler -v 0 -n n -M
WIDE2STD -O DVD | mpeg2enc -v 0 -F 1 -f 8 -o test.m2v

# Convert the .wav file into the .ac3 file for later multiplexing
ffmpeg -y -ab 128 -ac 2 -i test.wav test.ac3

# Finally, this command mplexes the .m2v file with the .ac3 file into the .mpg
mplex -O 300ms -f 8 -o test.mpg test.m2v test.ac3

In the case of the one .mpg, I was able to fix it manually by
duplicating the last "black" frame from the logo sequence 14 times and
inserting the duplicates into the list of PNGs which I then
reconstituted.  However, that is not algorthmically scriptable . . .
as the number of frames varies and I have no way of algorithmically
detecting when I need to "fix" a file.

If this is a bug, I hope it's a simple one that can be fixed quickly.
If it's not a bug, and I can fix it or work around it with different
tools, I'd be happy to learn what they are.

Thank you, and have a great day!

--Jason

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



More information about the MPlayer-users mailing list