Search code examples
linuxbashubuntuvideomplayer

Keep mplayer window open, chain sequential video files


I have a script that parses a bunch of events from a given movie file and uses the -ss and -endpos flags to play specific portions of the file. Let's say there is one file available. What I want to do is run a chained command like:

mplayer vidfile.mp4 -ss 110 -endpos 5 -fs;mplayer vidfile.mp4 -ss 130 -endpos 9

The idea is to have both sections of the video play in full screen, sequentially. However, there is major flicker between the two videos as it exits to the desktop briefly. (Ubuntu 12.04.)

How can I keep mplayer open or make the switch less jarring? Doing this with 30 clips would give someone a massive headache, and I'd like to see if it can be done this way without writing a script to cut the movies and put them together (which sounds like a nightmare, but if anyone has ideas, please post those in the comments).


Solution

  • I ended up solving it with a quick solution that a friend suggested - take the semi-colon out since mplayer supports multiple files AND flags. (Works for a few files for now, will update if I run into problems down the line.)

    mplayer vidfile.mp4 -ss 110 -endpos 5 -fs vidfile.mp4 -ss 130 -endpos 9 -fs