[MPlayer-users] RE : Re: Creating animated gif thumbnails of movies

Joey Parrish joey.parrish at gmail.com
Tue Oct 23 15:48:56 CEST 2007


On 10/23/07, tom wang <tomawng at yahoo.fr> wrote:
> Thanks,
>
> I tried to use framestep and I'm getting good result,
> but there is something still baffling me:
>
> I have a video file that when analyzed with
> mplayer small-DSCF1226.AVI -identify -frames 0 -vc
> null -vo null -ao null -nosound
> returns:
> MPlayer dev-SVN-rUNKNOWN-4.1.2 (C) 2000-2007 MPlayer
> Team
> CPU: Intel(R) Pentium(R) 4 CPU 2.80GHz (Family: 15,
> Model: 2, Stepping: 7)
> CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1
> SSE2: 1
> Compiled for x86 CPU with extensions: MMX MMX2 SSE
> SSE2
> 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 small-DSCF1226.AVI.
> AVI file format detected.
> ID_VIDEO_ID=0
> ID_AUDIO_ID=1
> VIDEO:  [MJPG]  320x240  24bpp  30.000 fps  4618.1
> kbps (563.7 kbyte/s)
> ID_FILENAME=small-DSCF1226.AVI
> ID_DEMUXER=avi
> ID_VIDEO_FORMAT=MJPG
> ID_VIDEO_BITRATE=4618088
> ID_VIDEO_WIDTH=320
> ID_VIDEO_HEIGHT=240
> ID_VIDEO_FPS=30.000
> ID_VIDEO_ASPECT=0.0000
> ID_AUDIO_FORMAT=1
> ID_AUDIO_BITRATE=128000
> ID_AUDIO_RATE=0
> ID_AUDIO_NCH=0
> ID_LENGTH=78.00
>
>
> So according to ID_LENGTH and ID_VIDEO_FPS, the video
> has 30 * 78 = 2380 frames
>
> So to get a five frames evenly spaced gif animation
> from the video, I should do (if I understood
> correctly)
>
> mplayer small-DSCF1226.AVI -nosound -vo
> gif89a:output=test.gif:fps=1.0 -vf framestep=595
>
> with 595 = 2380/4
>
> but if I do that the gif file returned is corrupted
> and does not work...
>
> I tried experimenting and this
>
> mplayer small-DSCF1226.AVI -nosound -vo
> gif89a:output=test.gif:fps=1.0 -vf framestep=15
>
> worked and outputed a gif animation with 5 frames, but
> I have no idea where the 15 comes from
>
> Can anybody explain me what i'm doing wrong?

The gif output module will use your fps setting to reduce the number
of frames it stores.  It checks the FPS of the stream it's getting and
throws away frames it does not need.

So, if your video is 30 fps and you use -vo gif89a:fps=1.0, then every
30th frame will be output into the GIF.  AFAIK, framestep should not
be needed.

If your output GIF is not as long as it should be, then perhaps
MPlayer is crashing or quitting the stream early.  Or perhaps the GIF
output code is buggy.  But I tend to suspect the former, since the
output module just encodes the frames it gets.

Perhaps you could post a sample file so that we could test with the
same input as you?

--Joey



More information about the MPlayer-users mailing list