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