- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I seems that the PTS of a MPEG2-frame is only based on the framerate and is always started at PTS=0.
In my case I have a smal clip of a video and it's necessary to show the played time in relation to the original video. My idea is to define the PTS based on the time-information in the GOP.
Is that already (or will it) implemented?
And if not, do only need to reimplement MPEG2VideoDecoderBase::CalculateFrameTime?
regards,
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Decoder use timestamps from input MediaData. If they are not set by demuxer they are started from 0. We have no plans to change it.
It looks possible to modify CalculateFrameTime so that it used GOP's timestampand frame's temporal reference. The problem can be that some streams can have these fields not set or incorrect.
As well you need to care about possible 3:2 pulldown, when frames can have duration different than 1/framerate.
Regards,
Leonid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, in that case I will reimplement CalculateFrameTime. I think a fallback in cases that the GOP-time is not set will be not a big problem.MADlakulako:Decoder use timestamps from input MediaData. If they are not set by demuxer they are started from 0. We have no plans to change it.It looks possible to modify CalculateFrameTime so that it used GOP's timestampand frame's temporal reference. The problem can be that some streams can have these fields not set or incorrect.
All member functions of MPEG2VideoDecoderBase and MPEG2VideoDecoder are declared with the (macro)keyword MPEG2_VIRTUAL, but MPEG2_VIRTUAL is defined to nothing (blank), so the member functions are not virtual and a reimplementation is not called by the base class.
I think I only need to set those lines to
#define MPEG2_VIRTUAL virtual
Is there a special reason why MPEG2_VIRTUAL is not set to virtual?
Edit:
Is it correct, that MPEG2VideoDecoderBase::FindSliceStartCode is not implemented?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Daniel,
It is not defined to virtual because we had no derived classes, API functions of MPEG2VideoDecoderBaseare called directly using MPEG2VideoDecoder wrapper and non-virtual functions call isa bit faster.
You can either define MPEG2_VIRTUAL to virtual or just declare a single function you need to virtual.
Declaration of FindSliceStartCode reamained in class by error. Thanks for pointing it out.
Regards,
Leonid
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page