开发者

How to split wmv file with java

How can I split *.wmv file (using java)? I tryed simple alg开发者_如何学JAVAorythm like read bytes from wmv file and store first half in one file and other half in another file. But the second becomes non-playable. As I can see i must add to the second file correct header to allow media-players interpret data correct. Is it true? How can i do splitting if it is not and where can i find wmv header specification if my assumption is correct?


You won't be helping yourself with any format definitions, since WMV files are handled properly only through the Windows Media Format SDK.

Here is some (very little) info on how to call COM from java: http://www.eggheadcafe.com/software/aspnet/29766681/windows-media-encoder-sdk-java.aspx

Then, go to http://sourceforge.net/projects/windowsmedianet/files/WindowsMediaNetSamples/Dec%202008/

and download the samples, look into WMVSPLIT (I guess that's the name of the sample you should read).

Also, you should know that you will be able to split the files ONLY at CLEAN_POINTs (that's WMV lingo for KEYFRAME).

EDIT:

In fact, I would go, in your shoes, for some windows machine and simple .exe or some other kind of extra-process utility that you will execute from java. My strong belief is that it would be simpler.

And if you don't have a windows machine, you'll have to go through the VLC code to find ASF format parser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜