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

er
LVL 3
engineroomAsked:
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.

MereteCommented:
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
http://www.softpedia.com/get/Multimedia/Video/Video-Players/Media-Player-Classic-for-Win2kXP.shtml
Gspot
http://www.afterdawn.com/guides/archive/find_what_video_and_audio_codecs_to_use.cfm
0
MereteCommented:
If the Metadata is there it should work in MPC if not try this flash player
http://www.snapfiles.com/get/swiffplayer.html
0
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.
0
Get your problem seen by more experts

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

twdoCommented:
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?
0
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
0
twdoCommented:
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.
0
engineroomAuthor Commented:
no prob. I'll keep you updated if anything new arises.
0
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.

cyberwebservice
Experts Exchange Cleanup Volunteer
0
engineroomAuthor Commented:
It hasn't been abandoned. I'm just waiting for a solution.
0
MereteCommented:
I know links well :)
I found a post here in the
FLV GALLERY blog
Is there a way to determine the size of the video using PHP?
http://www.jeroenwijering.com/?thread=7395

 Retrieving the length a streamed flv through PHP
http://www.actionscript.org/forums/archive/index.php3/t-57940.html
0

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
marcparilloCommented:
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 )

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

From novice to tech pro — start learning today.