How to detect whether playing media is audio or video.

Hello All!

I am not having a lot experience in coding JMF based apps. So i need your help to proceed.

My requirements are to detect that whether the clip i am going to play is audo file or video or both. Basically i want to create a control (JPanel) on which i can display an icon before playing the clip indicating that the clip is of what type. Hopefully i have conveyed my point.

Please guide me as i am in urgencey due to tight deadlines in a project.

Regards,

Alam Sher

[511 byte] By [alam.shera] at [2007-11-26 16:00:13]
# 1
Oh come on guyz please for God sake, help me. Tell me atleast is that possible or not?
AngelQ2a at 2007-7-8 22:21:34 > top of Java-index,Security,Cryptography...
# 2
> ...> Please guide me as i am in urgencey due to > tight deadlines in a project.For tight deadlines and urgency, you are probablybetter off taking up a Sun support ticket, or hiringa consultant.
AndrewThompson64a at 2007-7-8 22:21:34 > top of Java-index,Security,Cryptography...
# 3

Well i am sorry to say but i didn't expect such a rude response from someone in a public help forum. I am in urgencey and if i am crying about it definitely means i am desperate for a solution. If u dont have any solution then u have no right at all to say something worthless like this.

Thanks anyways!

Alam Sher

alam.shera at 2007-7-8 22:21:34 > top of Java-index,Security,Cryptography...
# 4

One possibility is once the Processor (or Player) is in the configured state you can retrieve the TrackControls and analyze (getFormat) the format that is set for each individual Track .If the Format is an instance of AudioFormat you can assume some form of audio, VideoFormat....

Note that these formats are what JMF is using for a default OUTPUT format based on the INPUT media. However, you can probably assume that the output and input will match up as far as Audio and Video..

I'm not sure but I also believe at this point JMF does not know if the input is missing a particular track. For example if the input format in general has an audio and video track, both will be present in the TrackControls. This does not necessarily mean that the data actually has data for both tracks.

I don't know of a method ...short of playing the media to determine that information positively.

oldSchoola at 2007-7-8 22:21:34 > top of Java-index,Security,Cryptography...
# 5
thanks buddy!I will try it and let u know if it solves the problem i would definitly inform u.Regards,Alam Sher
AngelQ2a at 2007-7-8 22:21:34 > top of Java-index,Security,Cryptography...