How to get the First frame from Video file?

Screenshots. Video. Linux. Commandline.

  • Screengrabs from video from the command line? Let's say you've got a ton of video clips (avi, mpeg, wmv, etc. maybe some are even incomplete!). Let's also say you'd like a little JPEG thumbnail sample of each video clip (e.g. first frame). How can I get this accomplished? http://www.radioactivepages.com/english/asfbin.html looks like it might do a little work for me, but that's only with (suprise!) ASF formats. http://www.virtualdub.org/blog/pivot/entry.php?id=20 is telling me scripting is possible with VirtualDub, but it'd be terribly helpful if it could be done from the command line. The other big issue is that those are for Windows, when I reaaaally need to be working on Linux (Can you even watch WMV on linux?). Hopeful solution requirements: many file formats, frame grabbing, from the command line, linux, works with incomplete files

  • Answer:

    mplayer. To get a jpeg of the first frame: mplayer -vo jpeg -frames 1 file.wmv

soma lkzx at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

also, i'm not averse to having seventeen different conversions and eighty hundred steps and using sixty different programs and to get this done, as long as it gets done without me having to hit buttons every five minutes.

soma lkzx

I do not have a complete solution but can point you along a path maybe. mplayer allows jpeg output from input videos. ie mplayer -vo jpeg -jpeg quality=50 -frames 1 -ao null myfile -frames 1 ( seems to put out 2 frames instead of just the one but you get the idea :-) ) ( You would need to check you had all the codecs for your file types ) Wrap this in a script and you could get thumbnails from your videos.

stuartmm

thanks, guys! i suppose having 0 conversions and 1 step and 1 program isn't so bad at all. it looks like mplayer works with incomplete files, too.

soma lkzx

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.