swf frame count - ffmpeg command or via php

I am simply looking to determine the number of frames in an swf file via a command line like ffmpeg or via php script?
Who is Participating?

Well, open the CMD and go to directory where is a output.swf file.
In the same folder must be placed a ffmpeg.exe.

Then write at command prompt and press Enter key:

ffmpeg -i "output.swf" -f null /dev/null

You can see this on my PC:


Then the process for counting a number of frames starts:


And after counting you can see a total number of frames that I signed with a red rectangular:


You need something like this:


Download link:


And try to explain what do you want to determine with FFmpeg?

listingsmagicAuthor Commented:
I convert a file using ffmpeg - from mp4 to swf.  It shows me the number of frames as it's converting it.

ffmpeg -i input.mp4 -sameq output.swf

It will show me how many frames it created.  But I want to store that information into a database and don't know how to get it in real time.  Just doing ffmpeg -i output.swf doesn't tell me number of frames.  

Duration: 00:11:53.12, start: 0.000000, bitrate: 63 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, mono, s16, 64 kb/s
    Stream #0.1: Video: flv, yuv420p, 640x360, 24 tbr, 24 tbn, 24 tbc

I get this.  So I am trying to determine how to a) get the frame count as the conversion takes place somehow - or b) after the conversion run some script to tell me the frame count.
listingsmagicAuthor Commented:
Thanks buddy - now just some string manipulation and I have it.  Perfect answer!

I forgot something. If you insist to use command line programs or PHP that is OK.

But, I always use Avidemux:


It is a Windows FREEWARE program for video converting and editing.

So, try to guess what this program has, as a basic display in timeline?

Number of frames of course !!!

Here is an opened FLV file in Avidemux and in red rectangular is a total number of frames. When you scroll through the video you can see how many times use every frame and it is the same for every frame.

But you can also cut only a part of the video, so you can check beginning of this cutting video and the end.

And that is all that I can recommended. Except one Windows program that shows total number of frames and it is Virtualdub.

Here is a image of Avidemux opened video:



Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.