Log in

View Full Version : Need command-line tools that report clip length


bilu
5th June 2003, 05:16
Hi,

I need to get clip length from AVI,MP4 and MKV through command-line.

It's a requirement (along with command-line muxers) to integrate support for these containers in my tool.

I already can get clip length from OGM files and that's an essential feature for automatic Vobsub subtitle splitting after muxing and splitting the final encode.

Haven't looked yet for MP4 and MKV files, but I couldn't find anything like this for AVI :confused:


Best regards,

Bilu

ChristianHJW
5th June 2003, 06:30
For mkv : mkvinfo, its coming in Mosu's mkvmerge package .... talk to him how you could export the value from the tool, but it should be easy. Or you talk to jccston, he has made a shell extensible for mkv files ...

jcsston
5th June 2003, 07:15
@bilu What lanuage is your tool in? C++, Delphi, VB?

For AVI you can use a few API calls
Something like this

PAVIFILE pAVIFile;
LPCTSTR szFile;
PAVISTREAM pAVIStream;

AVIFileOpen(pAVIFile, szFile, OF_SHARE_DENY_WRITE, 0&);
AVIFileGetStream(pAVIFile, pAVIStream, streamtypeVIDEO, 0);
numFrames = AVIStreamLength(pAVIStream);

MSDN (http://msdn.microsoft.com/library/en-us/multimed/avifile_3uwj.asp) is a good starting point.

bilu
5th June 2003, 11:33
@jcsston

I don't know any program language. Believe it or not, it does a lot just based on command-line tools, batch files and Avisynth scripts! :D

If you look at what my tool and TaZit (a tool from TaZ4hvn mentioned on my thread) do just with batch files and AVS scripts, you'll be impressed! (I hope :D )


Best regards,
Bilu

TaZ4hvn
9th June 2003, 12:03
I may have missed the point here, but why don't you simply use framecount() and framerate() in avisynth ?

bilu
9th June 2003, 12:13
@TaZ4hvn

You made a good point for AVI splitting. Now if I could only do the same over MP4 ... :rolleyes:

Haven't tried Matroska yet.

Bilu