How to determine the length of a video file?

B

BG Mahesh

hi

I am given the URL of a video file [Real/Windows media]. Is there
anyway to find the length of the video and size of that file
programatically [Java/Linux]?

-- Mahesh
 
O

Oliver Wong

BG Mahesh said:
hi

I am given the URL of a video file [Real/Windows media]. Is there
anyway to find the length of the video and size of that file
programatically [Java/Linux]?

If the URL points to a local file, then you should be able to determine
the size of the file easily. To determine the length of the video, you would
need to understand the file format of the video to decode it. Hopefully the
length info is in the header, and you can just read that; Otherwise, you
might need to decode the entire video stream to determine its length.

If the URL points to some remote server, you'll just have to pray that
whatever protocol the URL specifies (HTTP, FTP, or something else) allows
you to ask for the size of the file from the sever, rather than downloading
the whole file locally before performing all your analysis. Similarly, if
the protocol allows you to somehow get the video length, great. Otherwise,
you'll have to download the header (if there is one), and parse it.

- Oliver
 
B

BG Mahesh

hi

It is not a local file. Assume it is a Real/WMV file is there some site
I could use to figure out how to parse the header?

-- Mahesh
 
O

Oliver Wong

BG Mahesh said:
hi

It is not a local file. Assume it is a Real/WMV file is there some site
I could use to figure out how to parse the header?

You should read up on the file formats for Real and WMV. Or you could
try reverse engineering the file formats.

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top