locked
captured mp4 file - wrong length RRS feed

  • Question

  • I'm using an IMFMediaSession to capture Audio and Video from a Webcam to an mp4 File.

    The files are valid and can be displayed without problems, but the length information is invalid. If I capture a file with only a few seconds, the file shows a length of several hours.

    When I play the file using Windows Media Player or VLC, the players also display a wrong length. But if I inspect the file using ffmpeg, the correct information is displayed.

    Any ideas?

    Monday, April 19, 2010 11:15 AM

Answers

  • I believe this is due to the non-zero timestamp base used by the device source.  The file duration is calculated based upon the timestamp of the last sample, which could be an arbitrary large number for the device source.  You could fix this by inserting an MFT which caches the timestamp of the first sample and subtracts this timestamp from every sample timestamp that passes through the MFT (effectively 0-basing the timetsamps).
    Monday, April 26, 2010 11:31 PM

All replies

  • I believe this is due to the non-zero timestamp base used by the device source.  The file duration is calculated based upon the timestamp of the last sample, which could be an arbitrary large number for the device source.  You could fix this by inserting an MFT which caches the timestamp of the first sample and subtracts this timestamp from every sample timestamp that passes through the MFT (effectively 0-basing the timetsamps).
    Monday, April 26, 2010 11:31 PM
  • I believe this is due to the non-zero timestamp base used by the device source.  The file duration is calculated based upon the timestamp of the last sample, which could be an arbitrary large number for the device source.  You could fix this by inserting an MFT which caches the timestamp of the first sample and subtracts this timestamp from every sample timestamp that passes through the MFT (effectively 0-basing the timetsamps).

    I'm also facing the same issue. As per your reply, I have created MFT and insert before MPEG4 sink. Below is the topology

            USB Camera -> ColorTransform Node -> TeeNode -> H264 Encoder MFT -> TimeStamp MFT -> MPEG4 Sink

            USB MIC -> AAC Encoder MFT -> MPEG4 Sink

    Can you please let me whether the topology connecting is correct? If No, Please advice me to sort out this.

    Any idea @Matt Andrews?

    • Edited by KSM Abi Thursday, June 8, 2017 10:27 AM
    Tuesday, June 6, 2017 1:04 PM