Convert Values Into Time And Kbps Or Mbps

This is a discussion on Convert Values Into Time And Kbps Or Mbps within the C++ Programming forums, part of the General Programming Boards category; I have fetch the header of media file and there are two values come form the .wmv file Duration and ...

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    2

    Convert Values Into Time And Kbps Or Mbps

    I have fetch the header of media file and there are two values come form the .wmv file
    Duration and bitmap
    this values are basically in QWORD and DWORD types
    for simplicity i have convert it into WCHAR.

    Now i want to convert it into proper format
    e.g
    for DURATION the value is in hh:mm:ss format
    for BITRATE the value is in kbps or mbps form

    i would be wonder if any body help me.

    Thanks in advance .

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,787
    What are the formats that you want to convert from?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    "I Win!" by U. Lose vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,754
    Play Duration
    Specifies the time needed to play the file in 100-nanosecond units. This value should include the duration (estimated, if an exact value is unavailable) of the the last media object in the presentation. The value of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1.
    Send Duration
    Specifies the time needed to send the file in 100-nanosecond units. This value should include the duration of the last packet in the content. The value of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1. Players can ignore this value.
    duration/10000 - gives ms
    Should be not to hard to get sec, minutes and hours from this?

    Maximum Bitrate
    Specifies the maximum instantaneous bit rate in bits per second for the entire file. This shall equal the sum of the bit rates of the individual digital media streams. It shall be noted that the digital media stream includes ASF data packetization overhead as well as digital media data in payloads. Only those streams that have a free-standing Stream Properties Object in the header shall have their bit rates included in the sum; streams whose Stream Properties Object exists as part of an Extended Stream Properties Object in the Header Extension Object shall not have their bit rates included in this sum, except when this value would otherwise be 0.
    so br/1024 should give kBt/sec
    and in the same way will be easy to get Mbit/sec...
    To be or not to be == true

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21