Discussion:
[MPlayer-users] smooth looping with mplayer
Dean S. Messing
2002-12-07 10:56:01 UTC
Permalink
I hope this is not a "RTFM" (which I have diligently tried to do!) question.

I have some short, experimental, research clips (mostly
raw/uncompressed .avi files) on which I wish to loop indefinately for
some visual experiments. I know about `-loop 0' but it is not doing
what I want. With `-loop 0', mplayer seems to "restart" at the end of
the clip which makes it (and the video sequence) flash annoyingly. Also
the display window is repositioned from where I moved it.

Anyway, if I play the clip with ImageMagick `animate' it loops quite
smoothly, as though the clip was simply concatinated to itelf an
infinite number of times.

Also I discovered that I can almost get the smooth looping in
mplayer by (in the gui) hitting the "go to beginning and start
again" botton. The transition to the beginning is instantaneous.
But this is a pain when you are running psycho-physical experiments.

What I would like is for mplayer to automatically do precisely this
"go to beginning and start again" just as it finishes displaying the
last frame of the sequence.

Is there anyway to do this?

Dean S. Messing
Display Algorithms & Visual Optimization Lab
Information Systems Technologies Dept.
Sharp Laboratories of America
D Richard Felker III
2002-12-07 12:22:02 UTC
Permalink
[Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
I hope this is not a "RTFM" (which I have diligently tried to do!) question.
I have some short, experimental, research clips (mostly
raw/uncompressed .avi files) on which I wish to loop indefinately for
some visual experiments. I know about `-loop 0' but it is not doing
what I want. With `-loop 0', mplayer seems to "restart" at the end of
the clip which makes it (and the video sequence) flash annoyingly. Also
the display window is repositioned from where I moved it.
-fixed-vo. It might crash though with broken vo drivers.

Rich
Arpi
2002-12-07 19:54:02 UTC
Permalink
Hi,
[Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
I hope this is not a "RTFM" (which I have diligently tried to do!) question.
I have some short, experimental, research clips (mostly
raw/uncompressed .avi files) on which I wish to loop indefinately for
some visual experiments. I know about `-loop 0' but it is not doing
what I want. With `-loop 0', mplayer seems to "restart" at the end of
the clip which makes it (and the video sequence) flash annoyingly. Also
the display window is repositioned from where I moved it.
mplayer -loop 0 filename (looping playlist) will restart every time, but
mplayer filename -loop 0 (looping single file) won't.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
Dean S. Messing
2002-12-08 08:22:02 UTC
Permalink
D Richard Felker III writez;
:: On Fri, Dec 06, 2002 at 07:23:09PM -0800, Dean S. Messing wrote:
:: > [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
:: >
:: > I hope this is not a "RTFM" (which I have diligently tried to do!) question.
:: >
:: > I have some short, experimental, research clips (mostly
:: > raw/uncompressed .avi files) on which I wish to loop indefinately for
:: > some visual experiments. I know about `-loop 0' but it is not doing
:: > what I want. With `-loop 0', mplayer seems to "restart" at the end of
:: > the clip which makes it (and the video sequence) flash annoyingly. Also
:: > the display window is repositioned from where I moved it.
::
:: -fixed-vo. It might crash though with broken vo drivers.


Thanks Rich for your help! Your suggestion helps a lot
but I'm not "there" yet

Several questions arise (pls remember I'm an mplayer newbie who has tried
to read the docs but its a pretty overwhelming task. :-)

1. Where is -fixed-vo documented? I don't see it in my man or web
pages. (My CVS (CVS-021202-17:05-3.2) is the very latest but its
pretty current.

2. -fixed-vo does, indeed prevent the display window from being killed
and re-drawn, but it does not prevent mplayer from going through
some startup stuff at beginning of each loop iteration. So the
avi stops momentarily as mplayer prints startup info to the screen
and then starts again. Essentially, the window is not killed and re-drawn
but the sequence is not played perfectly smoothly either.

3. Number 2 is _not_ strictly true. In fact, upon startup, mplayer draws
a window in the upper left corner of the screen. Then, at the beginning
of the first loop the window is killed and redrawn at the middle
of screen 0. All loops after that don't redraw the window---it
stays put at mid-screen0 for the duration. Why this behaviour?

Note that I'm running two screens in xinerama---actually I'm
using nvidia's "twinview" which enables xinerama w/in X.)


4. The -geometry flag seems to have no effect. (Aside: I tried the
"-hue" and "-satuation" flags just for fun and they don't seem to
have an effect either but that's not "on topic" right now.

Ok I have many more questions but we'll stop here for now.

The input .avi file was made by a colleague from 120 raw .rgb files.
MPlayer plays it flawlessly after

Here is the commandline I'm using:

mplayer -geometry 25%:25% -loop 0 -fixed-vo -nofs -xineramascreen 1 \
lady_bench_circ_120frm_400x493.avi

Here is the output I get on each loop:

Playing lady_bench_circ_120frm_400x493.avi
Cache fill: 0.00% (0 bytes) Detected AVI file format!
AVI_NI: No Audio stream found... -> no sound
AVI: No Audio stream found... -> no sound
VIDEO: [] 400x493 24bpp 30.00 fps 141984.0 kbps (17332.0 kbyte/s)
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 400 x 493 (preferred csp: BGR 24-bit)
Couldn't find matching colorspace - retrying with -vop scale...
Opening video filter: [scale]
Sorry, selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 400 x 493 (preferred csp: BGR 24-bit)
Couldn't find matching colorspace - retrying with -vop scale...
Opening video filter: [scale]
Sorry, selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 400 x 493 (preferred csp: BGR 24-bit)
Couldn't find matching colorspace - retrying with -vop scale...
Opening video filter: [scale]
Sorry, selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 400 x 493 (preferred csp: BGR 24-bit)
Couldn't find matching colorspace - retrying with -vop scale...
Opening video filter: [scale]
Sorry, selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 400 x 493 (preferred csp: BGR 24-bit)
VDec: using BGR 24-bit as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 400x493 => 400x493 BGR 24-bit [flip]
Selected video codec: [rawbgr24] vfm:raw (RAW BGR24)
==========================================================================
Audio: no sound!!!
Start playing...
V: 4.0 120 0% 10% 0.0% 0 0 0%

Not sure what all the "VDecoder init failed :(" messsages are.
Mplaye seems to finally settle on the "right thing" at the end.

Question: what commandline flag do I give to make it know the right decoder
straight off?


System Information:

* Linux distribution:
o Mdk 9.0
* kernel version:
Linux medulla 2.4.19-16mdksmp #1 SMP Wed Sep 24 12:26:01 EDT 2003
i686 unknown unknown GNU/Linux
* libc version:
/lib/libc-2.2.5.so
* X version:
XFree86 Version 4.2.1
* gcc and ld versions:
gcc -v:
Reading specs from /usr/lib/gcc-lib/athlon-mandrake-linux-gnu/3.2/specs
gcc version 3.2 (Mandrake Linux 9.0 3.2-4mdk)
ld -v:
GNU ld version 2.12.90.0.15 20020717
* binutils version:
GNU assembler 2.12.90.0.15 20020717
* Window manager type and version
KDE 3.0.3
xinerama enabled (via nvidia twinview)

Hardware & drivers:

* CPU info (this works on Linux only):
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : AMD Athlon(tm) MP 1500+
stepping : 2
cpu MHz : 1333.410
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de tsc msr pae mce cx8 apic
sep mtrr pge mca cmov pat pse36 mmx
fxsr sse syscall mmxext 3dnowext 3dnow
bogomips : 2660.76

processor : 1
same thing as processor 0.
* Video card manufacturer and model, e.g.:
VisionTex Xtasy (Chip: nvidia GeForce4 Ti 4600, 128 MB DDR ram)
* Video driver type & version:
NVIDIA_kernel-1.0-3123
NVIDIA_GLX-1.0-3123
Dean S. Messing
2002-12-08 08:25:03 UTC
Permalink
D Richard Felker III writez;
:: On Fri, Dec 06, 2002 at 07:23:09PM -0800, Dean S. Messing wrote:
:: > [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
:: >
:: > I hope this is not a "RTFM" (which I have diligently tried to do!) question.
:: >
:: > I have some short, experimental, research clips (mostly
:: > raw/uncompressed .avi files) on which I wish to loop indefinately for
:: > some visual experiments. I know about `-loop 0' but it is not doing
:: > what I want. With `-loop 0', mplayer seems to "restart" at the end of
:: > the clip which makes it (and the video sequence) flash annoyingly. Also
:: > the display window is repositioned from where I moved it.
::
:: -fixed-vo. It might crash though with broken vo drivers.

There was a typo in my last message.

"-xineramascreen 1" should have been "-xineramascreen 0" in the
example commandline I gave.
Arpi
2002-12-08 08:43:02 UTC
Permalink
Hi,
Post by Dean S. Messing
1. Where is -fixed-vo documented? I don't see it in my man or web
pages. (My CVS (CVS-021202-17:05-3.2) is the very latest but its
pretty current.
it isn't, as it's not ready for users yet
(it's for developers to test some new libvo functions)
Post by Dean S. Messing
3. Number 2 is _not_ strictly true. In fact, upon startup, mplayer draws
a window in the upper left corner of the screen. Then, at the beginning
of the first loop the window is killed and redrawn at the middle
of screen 0. All loops after that don't redraw the window---it
stays put at mid-screen0 for the duration. Why this behaviour?
why didn't you read my answer?

write -loop 0 _AFTER_ the filename, not before...


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
Dean S. Messing
2002-12-08 09:19:03 UTC
Permalink
:: Hi,
::
:: > [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
:: >
:: > I hope this is not a "RTFM" (which I have diligently tried to do!) question.
:: >
:: > I have some short, experimental, research clips (mostly
:: > raw/uncompressed .avi files) on which I wish to loop indefinately for
:: > some visual experiments. I know about `-loop 0' but it is not doing
:: > what I want. With `-loop 0', mplayer seems to "restart" at the end of
:: > the clip which makes it (and the video sequence) flash annoyingly. Also
:: > the display window is repositioned from where I moved it.
::
:: mplayer -loop 0 filename (looping playlist) will restart every time, but
:: mplayer filename -loop 0 (looping single file) won't.
::
:: A'rpi / Astral & ESP-team

Excellent! Even better than the -fixed-vo advice. But this
introduces another problem. At the beginning of each loop, after the
first run-through, "white bars" [|||||||||] get inserted in the playing
video for half a second or so. I don't see an option to inhibit
these. Is there a way to turn this off.

Thanks so much for your help.

(It goes without saying that MPlayer is just superb! Looks like it
will be a wonderful tool for our research here at Sharp Laboratories
(Sharp Corp.'s U.S. Research Laboratory).

Dean S. Messing
Display Algorithms & Visual Optimization Lab
Information Systems Technologies Dept.
Sharp Laboratories of America
E-Mail: ***@sharplabs.com
D Richard Felker III
2002-12-08 10:53:03 UTC
Permalink
[Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
:: Hi,
:: > [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
:: >
:: > I hope this is not a "RTFM" (which I have diligently tried to do!) question.
:: >
:: > I have some short, experimental, research clips (mostly
:: > raw/uncompressed .avi files) on which I wish to loop indefinately for
:: > some visual experiments. I know about `-loop 0' but it is not doing
:: > what I want. With `-loop 0', mplayer seems to "restart" at the end of
:: > the clip which makes it (and the video sequence) flash annoyingly. Also
:: > the display window is repositioned from where I moved it.
:: mplayer -loop 0 filename (looping playlist) will restart every time, but
:: mplayer filename -loop 0 (looping single file) won't.
:: A'rpi / Astral & ESP-team
Excellent! Even better than the -fixed-vo advice. But this
introduces another problem. At the beginning of each loop, after the
first run-through, "white bars" [|||||||||] get inserted in the playing
video for half a second or so. I don't see an option to inhibit
these. Is there a way to turn this off.
Well you can use -osdlevel 0 to disable osd entirely. Apparently
there's a stupid 10l bug in the osd that makes it display for a few
seconds when transitioning from one movie to the next (or next loop
iteration).

Rich
Diego Zuccato
2002-12-09 15:42:02 UTC
Permalink
Post by Dean S. Messing
Excellent! Even better than the -fixed-vo advice. But this
introduces another problem. At the beginning of each loop, after the
first run-through, "white bars" [|||||||||] get inserted in the playing
video for half a second or so. I don't see an option to inhibit
these. Is there a way to turn this off.
"-osdlevel 0" doesn't work?

BYtE,
Diego.

Dean S. Messing
2002-12-09 14:01:02 UTC
Permalink
Rich Felker writes:

<snip>
:: > Excellent! Even better than the -fixed-vo advice. But this
:: > introduces another problem. At the beginning of each loop, after the
:: > first run-through, "white bars" [|||||||||] get inserted in the playing
:: > video for half a second or so. I don't see an option to inhibit
:: > these. Is there a way to turn this off.
::
:: Well you can use -osdlevel 0 to disable osd entirely. Apparently
:: there's a stupid 10l bug in the osd that makes it display for a few
:: seconds when transitioning from one movie to the next (or next loop
:: iteration).
::
:: Rich

Oops. I should have figured that out. I saw the -osdlevel switch
but it never occurred to me that the [|||||||||] was part of the
OSD. I think of OSD as being associated only with DVDs. My mistake.
Anyway, sounds like a bug that needs to be fixed anyway since looping
should not, I would think, display [|||||||||] each time around.

Thanks for the help!

Dean
Dean S. Messing
2002-12-09 14:01:14 UTC
Permalink
Arp'i writes:
:: > 3. Number 2 is _not_ strictly true. In fact, upon startup, mplayer draws
:: > a window in the upper left corner of the screen. Then, at the beginning
:: > of the first loop the window is killed and redrawn at the middle
:: > of screen 0. All loops after that don't redraw the window---it
:: > stays put at mid-screen0 for the duration. Why this behaviour?
::
:: why didn't you read my answer?
::
:: write -loop 0 _AFTER_ the filename, not before...
::
::
:: A'rpi / Astral & ESP-team
::

Sorry A'rpi. I get this mailing list as a digest. So things are not
instantaneous. Also I travel a great deal and so I may go a day or so
before seeing secondary or tertiary answers to my e-mail queries.

I had read Rich Felker's email, tried his idea, composed my e-mail reply, and
sent it before I saw your and tried your answer.
Again thanks for your help. I appreciate taking the time to answer
my newbie questions.

Dean S. Messing
Display Algorithms & Visual Optimization Lab
Information Systems Technologies Dept.
Sharp Laboratories of America
Loading...