Home > Uncategorized > Screenshot and video information with mplayer

Screenshot and video information with mplayer

Let our test file be “/tmp/test.wmv“.

Getting video info

mplayer '/tmp/test.wmv' -ao null -vo null -frames 1 -identify

It will produce a long output. You can refine the output:

(mplayer '/tmp/test.wmv' -ao null -vo null -frames 1 -identify | grep ID_) 2>/dev/null

Again, it will produce a long output that I omit. The video length is here (given is sec.):

ID_LENGTH=119.93

Another interesting line is the video summary:

(mplayer '/tmp/test.wmv' -ao null -vo null -frames 1 -identify | grep 'VIDEO:') 2>/dev/null

Sample output:

VIDEO:  [WMV3]  320x240  24bpp  1000.000 fps  386.0 kbps (47.1 kbyte/s)

Taking a screenshot at a given time

mplayer '/tmp/test.wmv' -ss '20' -noautosub -frames 1 -ao null -vo png:outdir='/tmp'

Here we take a screenshot from the video at 20 sec. The output file will be /tmp/00000001.png (mplayer gives this name automatically).

Ref.: I found these tricks in this project.

Advertisements
  1. September 19, 2016 at 15:44

    Thanks, I used this post to get a snapchat of a .mp4, which I didn’t manage to succeed with a vlc.

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: