[MPlayer-dev-eng] Saving position and Bookmark functionality.

Michal Majchrowicz m.majchrowicz at gmail.com
Wed Aug 22 14:35:02 CEST 2007


On 8/22/07, Alexander Roalter <alex at roalter.it> wrote:
> Michal Majchrowicz wrote:
> > Hi
> > I would like to help in implementing two things in mplayer:
> > 1) Saving the position of current file when quting the mplayer and
> > loading this position when the file is opened the next time.
> > 2) Add possibility to manually save/load file position at any moment
> > for instance using key combinations.
> > Here is an example of implementation that explains the details:
> > When mplayer plays some file it creates ".mplayer" directory in
> > current dir. So for instance we are playing file /opt/my_movie.avi so
> > we create the directory /opt/.mplayer/ In that directory we create a
> > file for every file we play. In our exmple we create file
> > /opt/.mplayer/my_movie.avi.pos These file contains something like
> > this:
> > 0  - 0
> > 1 - 1:30:00
> > 2 - 0:20:00
> > 3 - 0
> > ....
> > q - 1:34:12
> > Lines with numbers (from 0 to 9) refer to bookmarks(The format is
> > "bookmark number - position in file"). When user hits Ctrl+1 The
> > position of current playback is saved in second line (1 - 1:30:00).
> > When user hits Alt+1 the bookmark from second line is loaded (which
> > means settings the playback position to 1:30:00). It is very usefull
> > when every member of family wants to watch the same movie in different
> > moments. They only have to save/load their bookmarks and don't have to
> > wonder "when did I finish last night :)". The line with may be called
> > the "default bookmark" Everytime you quit mplayer it should save the
> > current position there and load it when opening the file again.
> > Similar functionality ("default bookmark") is added by this script:
> > http://www.spaceparanoids.org/trac/bend/wiki/mplayer-resume
> > I hope we can find some mplayer-friendly way of implementing it in mplayer :)
> > I count on your suggestions and advice.
> > Regards Michal.
>
> Seeking to a specified time can be very tricky, as video streams can
> reset themselves from time to time, I'd rather suggest a filepos in
> bytes or whatever serves this best.
>
> And as for a .mplayer-directory in every directory I play a file in: I
> don't think it's such a good idea (at least I'd not like the idea of
> having these directories all around). Here I'd stick to a central
> sub-tree in ~/.mplayer, just as some image viewing programs do with
> their thumbnails.
>
> mplayer already searches for a file when playing, but I don't know what
> mplayer expects in this file, but there might go also the handling for
> the bookmarks.
>
> And lastly, resuming should of course only work then specified with a
> -resume parameter or something else in this way. One could also
> implement a A-B-Repeat function using this (there's none such to my
> knowledge a.t.m.)
>
> --
> cheers,
> Alex
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>
I would also like to propose another solution "global bookmarks" which
means we save only ONE pos file in /home/user/.mplayer/default.pos and
save there only ten "number - pos" and one "q - pos" line where it is
quit position for last played file and bookmarks for the last time
user did save the bookmark. In that way we should also save the file
path we played.
Regards Michal.



More information about the MPlayer-dev-eng mailing list