FFMPEG, getting length of flv on conversion

Hey all, i'm using ffmpeg to convert flv files on the fly. I need to grab the running time of each video being converted. How do i do this? Thanx all

Who is Participating?
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.

lame answer
drop it onto media player  and it will show the duration, write it down how hard is that :)
there is also Gspot which will analyze the avi shows what codecs audio is used if you need to know the audio sampling aspects
Media player classic
If the Metadata is there it should work in MPC if not try this flash player
engineroomAuthor Commented:
Lame answer indeed. I'm converting to FLV file on the fly. I'll never see the videos, so i need to somehow grab the time on conversion.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

engineroom, did you figure this out? I am writing code to upload movies to a website. I am using FFMPEG to handle the videos. I have the conversion to FLV completed, the thumbnail created, and now I need to get the video length. Any luck? Anyone?
engineroomAuthor Commented:
no dude. Nothing. I'll keep you updated. hopefully i find this out. If you find out how, let me know as well. Thanx
Will do. That sucks. I have everything else accomplished. Creating thumbnail, Converting to FLV, etc. The only thing left is to get the length of the movie. I found one posting on another forum that said that getting the metadata or the file info would return the length of the FLV file, but using he parameters he had posted, it does not. If I was able to have the info displayed to a command window, I could parse it for the length.

Keep me posted. Thanks.
engineroomAuthor Commented:
no prob. I'll keep you updated if anything new arises.
CWS (haripriya)Commented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
  Delete with points refunded

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Experts Exchange Cleanup Volunteer
engineroomAuthor Commented:
It hasn't been abandoned. I'm just waiting for a solution.
I know links well :)
I found a post here in the
Is there a way to determine the size of the video using PHP?

 Retrieving the length a streamed flv through PHP

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
I was looking for the same solution and I ran across this code.  It works for me:

ffmpeg -i <infile> 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,//

(note that's a space between the single quotes after -d and before -f )

engineroomAuthor Commented:
Thank you. I'll give that a shot!
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

From novice to tech pro — start learning today.