views:

154

answers:

1

I have a winform program that allows users to upload Shockwave Flash movies to a server. To get the videoDuration I create an instance of the "ShockwaveFlashObjects"-activeX, loads the movie, and then read the videoDuration until it change from "0.0" to anything else. I get that by reading the GetVariable("videoDuration").

Often it works, but sometimes it locks up or show information from the previous Flash movie that was loaded.

I also have had trouble distributing the ShockWaveFlashObject-activeX. I would really like to skip that and just read the flash-file and find out the play length of the movie.

All movies uploaded are videos so they have a specific play length.

This question didnt help with answers eather.

I have checked out the swf-format at wotsit and from what I can see it should be possible to read the framerate and framecount and by that calculate the duration, but I could not find anything about flv-files. Maybe someone allready have done this and can point me to some nice code that saves me plenty of time trying to understand the specification?

A: 

One of the possibilities is use ffmpeg to read the video/audio bitrates. Once you have these details you can divide the total file size by the sum of video/audio bitrates. That gives you estimated number of seconds (+/- few socnds).

radekg