[MPlayer-users] How to start playing files why they are still being recorded? How to stream?

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Feb 28 21:59:06 CET 2014

On 28.02.2014, at 21:35, Christian Jaeger <chrjae at gmail.com> wrote:
> Hi
> Due to not finding a single GUI program that worked with a USB video
> grabbing device, and the fact that mencoder worked, I've written a new
> GUI program[1] to use mencoder and mplayer (and arecord, aplay, oggenc
> and ogg123) to make this usable for a 'normal' user. This worked
> pretty perfectly on my Debian stable machine, but failed on that other
> person's Ubuntu installation.

Are you compiling yourself?
Because the default MPlayer version in both Debian and Ubuntu are incredibly outdated and should have really serious bugs for this use-case.

> # (A) does work fine on Debian, but on Ubuntu, stops playing back
> after 3 seconds,
> # since it seems to be snapshotting the length of the file when
> starting to play and
> # then stop playing even if the file has grown by the time it reaches the end:
> mencoder $opts -o file - & sleep 3; mplayer -wid xyz file

Yep, that is exactly one of the issues old MPlayer versions will have.
You can try if using mplayer ffmpeg://file works as a workaround instead, but I suspect it will rather cause you additional issues.

> # (B) using pipes, does not work (on Debian) unless sleep is very big,
> and then also only
> # 'works' by first showing tons of blocky garbage until it finally
> starts showing real video:
> mencoder $opts -o - - | cat > file & sleep 3; tail -f -c 20000000 file
> | mplayer -wid xyz -

If that works at all and how well depends on mencoder options.
Why aren't you using "tee" instead to pipe directly into MPlayer while also recording into a file?
Use -cache options to avoid it blocking mencoder and avoid some of the issues caused by using a pipe as input.

> mplayer on our Ubuntu station is: Version: 2.0-554-gf63dbad-1ubuntu1

That isn't MPlayer but a badly named independent fork called "MPlayer2", possibly now unmaintained.

> If I can't make it work reasonably with mencoder and mplayer, I'll
> consider using libraries instead (SDL?, ...?); I fear this is going to
> take a lot of work to get right, though, suggestions very welcome.

I have some doubts that will be easier than providing users with working/maintained versions of MPlayer.

More information about the MPlayer-users mailing list