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:
- re-based sample time in custom mft, using
imfsample::setsampletime
. - 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:
- is there other cause have overlooked incorrect video duration/time scale?
- if not, there correct approach how re-base sample timestamps?
try reset every sample flag mfsampleextension_discontinuity
psample->setuint32( mfsampleextension_discontinuity, false );
Comments
Post a Comment