LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is there a way to see the current frames playing in the video? (https://www.linuxquestions.org/questions/linux-newbie-8/is-there-a-way-to-see-the-current-frames-playing-in-the-video-4175536696/)

SteveM777 03-14-2015 12:05 AM

Is there a way to see the current frames playing in the video?
 
hi

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

SteveM777 03-14-2015 12:55 PM

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.

Shadow_7 03-16-2015 07:25 AM

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

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

so...
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.


All times are GMT -5. The time now is 04:37 AM.