c++ - Correcting live IMFMediaSource time stamps -


i have 2 cameras, listed below, trying use in media foundation topology. here summary of topology:

webcam --> mjpg decoder --> custom mft --> h264 encoder --> mp4 file sink

the problem generated mp4 file has incorrect duration , time scale tags, both mp4 container , h264 stream. can correct tool mp4box or yamb, eventual goal stream video.

one potential cause have identified samples generated camera sources not start @ time 0. according bullet #2 in http://msdn.microsoft.com/en-us/library/windows/desktop/ms700134(v=vs.85).aspx#live_sources, timestamps of live source should start @ 0.

along line, i've tried following "correct" sample timestamps:

  1. re-based sample time in custom mft, using imfsample::setsampletime.
  2. created wrapper imfmediasource , imfmediastream objects, catches , corrects time stamps associated memediasample , mestreamtick events.

in both of these cases, media session throws error 0xc00d4a44 (mf_e_sink_no_samples_processed), , resulting mp4 file ends abruptly after "mdat" atom declaration.


cameras

  • logitech bcc950 conferencecam
  • thinkpad w520 integrated camera

systems used (both have same issue):

  • windows 7 professional x64
  • windows 8 x86

questions:

  1. is there other cause have overlooked incorrect video duration/time scale?
  2. if not, there correct approach how re-base sample timestamps?

try reset every sample flag mfsampleextension_discontinuity

psample->setuint32( mfsampleextension_discontinuity, false ); 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -