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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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.

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:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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:



It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.