[MPlayer-users] mplayer doesn't update the size of a growing file

The Wanderer wanderer at fastmail.fm
Sun Sep 16 03:55:16 EEST 2018


On 2018-09-15 at 11:31, arthurpeabody wrote:

> Quoth The Wanderer:
> 
>> mplayer - < /tmp/output.rip
> 
> When I do this mplayer doesn't respond to keyboard input, won't move
> forward or backward, won't quit.

It does for me - but only when I have the MPlayer window in focus; if I
switch focus to the terminal window from which I launched MPlayer, I get
the behavior you describe.

That's because when the terminal window is in focus, keypresses like
that get (buffered to be, and then) sent to the standard input of the
active process, which in this case means they get mixed in with the data
stream of the input file.

Do you really switch focus away from the actual video-playback window,
while the video is playing, enough that this is a problem?


Another workaround you might try is a FIFO:
  mkfifo /tmp/videostream.fifo
  cat output.rip > /tmp/videostream.fifo &
  mplayer -cache 65536 /tmp/videostream.fifo

(There may be alternate approaches which would let you skip the 'cat'
part, and if so they're probably better, but I don't know of one offhand
that I'd be confident would work.)

This will let you seek within however much of a time range your chosen
'-cache' value will accommodate. The further back you want to be able to
go, or the higher bitrate (et cetera) your video stream is, the bigger
the cache you'll need; however, the bigger the cache you specify, the
longer will be the delay before playback starts. Without '-cache', you
won't be able to seek backwards at all, or at least if you do it won't
work as expected.

Make sure you have enough RAM to accommodate however much of the stream
you let accumulate in the FIFO before starting playback, or while
playback is paused.

I can't guarantee that this won't have other unexpected or undesirable
characteristics, but it seems to work adequately well in my testing.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20180915/e582dcfb/attachment.sig>


More information about the MPlayer-users mailing list