[MPlayer-users] how can I disable the automatic -ni mode ?

Gautier gaulgo at gmail.com
Fri Jul 9 11:56:14 CEST 2010


Hi,

I'm making a video on demand p2p system in java and I want to use
mplayer in slave mode to display the video.

The idea is to make a kind of beetorrent in which you can read the
video while downloading it. To do so I cut the file in piece of 16kB
and I send them one by one to the downloader that saves them on his
hard-drive.
If I start mplayer (Runtime.getRuntime().exec("mplayer -slave -quiet
-idle -nocach movie.avi")) and ask it to read the video from the
beginning to the end there is no problem, but I don't find any
solution to seek correctly.

To seek I download the piece of the movie that are interesting for me
(doing so I miss some piece between the beginning of the file and the
part I want to read, but I still have the header and the index) and I
try to estimate what is the time position, corresponding to these
pieces, in the movie (set_property time_pos). The problem is that I'm
not very accurate in my estimation and very often mplayer pass
automatically in "-ni mode" and there is no way to recover.

So I would like to know :

- if there is a way to force it to never pass in "-ni mode", hoping
that the downloading of the next piece will help it to recover.

-if there is a way to know precisely which time position I can reach
in the movie when I know which part of the file I have.

Best regards,
Gautier

PS : if you have a better solution than reading the partial file with
mplayer that allow me to seek I'm interested.


More information about the MPlayer-users mailing list