Results 1 to 8 of 8
  1. #1
    saurabh208 is offline Member
    Join Date
    Jun 2010
    Posts
    6
    Rep Power
    0

    Default Get Duration of mov ,wmv files

    hi all,

    i m doing a project in which i require to get the duration (length) of a media file...

    i tried soo much but can't find any solution

    please help me out...

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default

    Do you have a definition of the contents of a media file?
    Are there fields in the file that contain their length?
    If so, you can write a java program to read the file and extract that info.

  3. #3
    bayan is offline Member
    Join Date
    Apr 2010
    Posts
    55
    Rep Power
    0

    Default

    The length is usually saved as a tag, you know like the artist name or something, you just need to extract that.

    If your going to write a media player I recommend you use a different language, or associate a third party converter with your program.

    -Bayan-

  4. #4
    saurabh208 is offline Member
    Join Date
    Jun 2010
    Posts
    6
    Rep Power
    0

    Default

    thanks for replying...

    but i still not getting it..

    see, my problem is..

    i m windows XP user,

    i have a 100 of .mov (Quicktime player file) files.

    and i have to create a database/ XML file in which i m gonna store the name, size, duration of that files.

    so if i open .mov file in read mode then i can only read the byte information, not the duration

    & if possible then please give a sample code for that...

    thanks you..

  5. #5
    saurabh208 is offline Member
    Join Date
    Jun 2010
    Posts
    6
    Rep Power
    0

    Default

    similarly for wmv file

    as you can see the artist, duration, album and so on information in windows explorer.
    but how i can get these information through a java code

    please mention code also

  6. #6
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Location
    Destiny Islands
    Posts
    692
    Rep Power
    5

    Default

    I don't think you can. WMV is a proprietary filetype used by Microsoft... I know there exists a Windows Media SDK, but I believe it's in C/C++ only. A quick Google search reinforces my theory; others have looked for a similar bit of code (to get the duration and other data from WMV files) to no avail.

  7. #7
    gafa's Avatar
    gafa is offline Senior Member
    Join Date
    Jun 2010
    Posts
    107
    Rep Power
    0

    Default

    h-i-t

    Did you tried File class fro this?
    + 1 my REP
    Good Luck :)

  8. #8
    saurabh208 is offline Member
    Join Date
    Jun 2010
    Posts
    6
    Rep Power
    0

Similar Threads

  1. Replies: 8
    Last Post: 07-30-2010, 05:47 PM
  2. working with files (text files)
    By itaipee in forum New To Java
    Replies: 1
    Last Post: 02-24-2009, 11:38 AM
  3. Behaving text files like binary files
    By Farzaneh in forum New To Java
    Replies: 2
    Last Post: 08-27-2008, 03:20 PM
  4. Text and image files within jar files
    By erhart in forum Advanced Java
    Replies: 8
    Last Post: 01-19-2008, 04:43 AM
  5. how to convert mpeg files to .wav files
    By christina in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 04:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •