Link to home
Start Free TrialLog in
Avatar of engineroom
engineroom

asked on

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
Avatar of Merete
Merete
Flag of Australia image

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
If the Metadata is there it should work in MPC if not try this flash player
http://www.snapfiles.com/get/swiffplayer.html
Avatar of engineroom
engineroom

ASKER

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.
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?
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.
no prob. I'll keep you updated if anything new arises.
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
It hasn't been abandoned. I'm just waiting for a solution.
ASKER CERTIFIED SOLUTION
Avatar of Merete
Merete
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start 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 )

Thank you. I'll give that a shot!