PDA

View Full Version : [ubuntu] Mencoding programming query



Mangesh_B
September 13th, 2011, 08:46 AM
Hi all,

I am using mencoder (MPlayer) for recording the TV programs, But i want to take some snapshot at regular interval. So can somebody help me out doing the same.

aeiah
September 13th, 2011, 01:13 PM
mencoder isn't interactive, so you'll have to call another program to do it (or use a 2nd instance of mencoder).

you may find that two programs cant access your tv card at the same time, in which case, it might be best to take the snapshot from the file mencoder is recording into.

found this on the doom 9 forums:


According to the manual, yes, -ss specifies a time, not a percentage.

I don't know if there's an easier way, but the following works (at least in linux):

create a text file (commands.txt) with this content:

seek 20 1
screenshot
pause
quit


(the first value for seek is the percentage)

And then run:

mplayer video.avi -slave -nosound -vf screenshot < commands.txt



instead of seek 20 1, you could do seek 96 1 to seek 96% of the way through the file, which will be an area that's been fairly recently recorded.

instead of the script, you might just be able to use this command, but i cant test either:


mplayer video.avi -slave -nosound -vf screenshot < (seek 96 1;screenshot;pause;quit;)

shantiq
September 13th, 2011, 05:20 PM
tip 5 (http://ubuntuforums.org/showthread.php?t=1154431) might give you ideas