Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I wrote a small shell script to obtain an HTML page which nicely presents a set of pictures with thumbnail navigation, etc.
I would like to extend my program to treat videos. I know how to extract a single frame (or consecutive frames) of a video using mplayer/mencoder. However since a single thumbnail may not be enough to distinguish videos easily, I would have liked to show 5-10 thumbnails for each video, hence showing some progression of the movie.
The idea would be to have a single command line, in which I give as input a video file and the numbers of frames I want. Independently of the video's length, the program should find out which frame numbers to grab (e.g. video is 2min long with 25fps so those are 3000 frames. If I want 5 thumbnails, than the the program would output the frames numbered 1, 750, 1500, 2250 and 3000).
It doesn't seem like ffmpeg or transcode offer any better option than mplayer, but this could be because those tools offer so many options that I missed the one I need.
Any idea how this can be done at best? Is there a tool which would do something similar?
If not, then how would you do this at best? ("tcprobe" -> get number of frames, then do some shell(perl?) programming to obtain the desired frame numbers and finally call mplayer as many times as I have frames to extract).
Thanks for a possible hint/help.
PS: I don't know perl, so another solution would be nice ;-)
Parsing the output of tcprobe seems a good idea but it won't show the total number of frames on some files I have here.
You could use mplayer to dump the frame stats to a text file and then parse the last line of that:
mplayer -benchmark -nosound -vo null Chap.mpg | grep V: > vframes.txt
Edit: It seems there are no newline characters so there is no last line as such. Parsing the last 128 bytes works for the file I'm testing here:
mplayer -benchmark -nosound -vo null Chap.mpg | grep 'V:' | tail -c 128 | cut -d '/' -f2 | cut -d ' ' -f1 > vframes.txt