Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-14-2015, 12:05 AM   #1
LQ Newbie
Registered: Mar 2015
Posts: 13

Rep: Reputation: Disabled
Is there a way to see the current frames playing in the video?


Mplayer is my main video player and I always use the command line with mplayer to play the videos.

From the terminal it shows the stats about the video as it is playing. At the bottom it shows the elapsed time in seconds. Is there a way to see elapsed frames instead of seconds?

If mplayer can't do it, I'm open to other players if they do it. Thanks
Old 03-14-2015, 12:55 PM   #2
LQ Newbie
Registered: Mar 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
I did a google search on this and did not find what I wanted. So, I will have to do a rough estimate of the current frame number by multiplying the current time in seconds by 30 or whatever the fps is for the video.

So far, It is working great as I used this frame number for ffmpeg to achieve the desire fade in/out effects.

Last edited by SteveM777; 03-14-2015 at 01:00 PM.
Old 03-16-2015, 07:25 AM   #3
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 3,263
Blog Entries: 1

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I normally just do the math. Bear in mind that 30 fps is really 30000/1001. You lose one frame of that 30 every 30-ish seconds. And it's not the only framerate in town. I normally do the math against the audio sample rate though.

For example:

42 seconds
* 48000 (samples per second audio)
= 2016000 total audio samples

/ (30000/1001)
= 1601.6 audio samples per frame

2016000 / 1601.6
= 1258.7413

so 42 seconds of video is 1258 frames plus .7413 * 48000 samples of audio. Although I tend to make my videos even seconds (with that extra audio chunk) so it looks pretty (and predictable) on youtube. Video editors like KDENlive, lives, cinelerra, ... probably show the frame count (sort of) in the seconds.frame format. Where the .### is the frame count on that second, not the fraction of seconds. Not that I would know as I do most of my editing on the CLI. But I tend to fiddle with the individual frames as images before making a video of them.

Where 42*30 would be 1260, and 2 additional frames that might not otherwise exist, or get truncated if you use -shortest when muxing the audio and video together.

Last edited by Shadow_7; 03-16-2015 at 07:46 AM. Reason: clarification


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Video not playing (mplayer) on -current latest upgrades beder Slackware 3 03-03-2013 06:17 AM
Screen capture while playing video yields to blue window where video is playing kayasaman Linux - Desktop 10 01-19-2012 09:54 AM
ubuntu 5.10 x86_64: mplayer/xine/... stop playing video after a couple of frames Tinkster Ubuntu 2 01-10-2006 01:13 PM
Frames dropped while playing divx/dvd ganja_guru Linux - Software 8 05-20-2005 06:45 AM
Xine playing frames out of order JohnCain Linux - Software 2 05-10-2005 01:12 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:07 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration