[MPlayer-users] Playing Files Alternately

Ivo ivop at euronet.nl
Mon Feb 19 12:05:00 CET 2007


On Monday 19 February 2007 09:27, Dhiraj Kamble wrote:
> Hi,
>
> Is it possible to do the following with mplayer
>
> can we play two video files(say 60 mins each) alternately each for say 5
> minutes
>
> e.g:
>  file1.mpg (60 minutes video)
>  file2.mpg (60 minutes video)
>
> then can we play in the order
>
> file1(5mins).... file2(5mins)....file1(resume; 5 mins)....file2(resume; 5
> mins)....file1(resume; 5 mins)....file2(resume; 5 mins)....
> ..... and so on until the end of the clips.
>
>
> pls let me know if there is any command line syntax for this....
>
> any sort of help will be appreciated.

You could use:

mplayer -fixed-vo file1.avi -ss 0:00 -endpos 300 file2.avi -ss 0:00 -endpos 
300 file1.avi -ss 5:00 -endpos 300

...et cetera.

Or generate the command line with a script:

#! /bin/sh

file1=file1.avi
file2=file2.avi

j=` echo -n "mplayer -fixed-vo "
    for i in 0 5 10 15 20 25 30 35 40 45 50 55 ; do
        echo -n "$file1 -ss $i:00 -endpos 300 "
        echo -n "$file2 -ss $i:00 -endpos 300 "
    done
    echo `

echo $j

Or use eval $j at the end to execute the command instead of printing it to 
stdout.

--Ivo



More information about the MPlayer-users mailing list