4

I watch most of my TV news on my computer. The videos are downloaded by my RSS reader and stored on disk until I decide to watch them.

The files look like this:

130704_hjo_446k_p20v11.mp4
130706_hjo_446k_p20v11.mp4
130708_hjo_446k_p20v11.mp4

The thing is I don't watch them daily, but whenever I feel like it. So sometimes I watch one sometimes three in a row.I watch them normally with mplayer2 by executing the following:

mplayer *hjo*.mp4

My problem is I always forget to delete the already watched files and then I have to remember when I last watched or I have to rewatch until I find the new files.

Now I am looking for a script or program which marks the completely watched files. As far as I know mplayer2 can't do this, since there is no hook to check if the video was watched to the end.

  • As variant: for file in *hjo*.mp4; do mplayer $file && rm -f $file; done – Eddy_Em Jul 10 '13 at 5:47
  • As an option you can use rm -i to get user confirmation before deletion. – rush Jul 10 '13 at 5:49
  • 1
    The problem is when I need to stop watching and quit mplayer the exit code is also 0 and since sometimes I have 3 hours or more of news I want to be able to quit watching. – Raphael Ahrens Jul 10 '13 at 5:58
5

You might want to install the package mplayer-resumer. This will allow you to resume a video from where you left off. When you're done watching the videos using this wrapper script, you can then safely delete them.

$ mplayer-resumer options path/to/file

excerpt from main site on rationale

Watching 90 % of a video and stopping causes you to return to the beginning again the next time you watch it. Remembering where you were in the video and resuming at that position is a much nicer behavior for the user. By default, mplayer spits out timecode information that tells you where you are in the video, to the tenth of a second. Mplayer also supports a seek feature on the command-line. We can make use of these features to write an mplayer wrapper that will remember the last position in a video file and resume to it on playback.

  • A that looks promising. But I need to port it to FreeBSD. I should have mentioned that. :) – Raphael Ahrens Jul 10 '13 at 7:11
  • @RaphaelAhrens - it's just a Perl script so it should be pretty easy. – slm Jul 10 '13 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.