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
    22,258
    What are the formats that you want to convert from?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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...
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

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