Can we get the PTS value of the frame
I'm using SIFT feature of Opencv in an application. I need to read the PTS value of the frame which i'm using. Is there any API to read PTS value in Opencv.
As a input I'm giving the video and I need to read the Presentation timestamp (PTS) of the frames in the video.
what do you mean by "PTS value" ?
Presentation timestamp.
so, totally unrelated to SIFT , right ?
would that be the date, when your picture was acquired ? the frame# from the video ?
(it's probably even totally unrelated to opencv)
Yes. It is unrelated to SIFT .Here I'm comparing the video frames with a reference frame, for comparing i'm using SIFT algorithm.When match-count is high, as output I need to provide the PTS value which will be in the PES Packetized Elementary Stream header. It not refers to the date/time picture when acquired.
ah, a bit clearer now. unfortunately, you can't access the PES (or any kind of codec/container/packet header) from opencv, such information gets discarded way before. (also, different codecs/containers might not even have it)
you probably need to interface with ffmpeg/gstreamer directly, to achieve this
Thank Berak!!!
I am facing same issue, I need PTS of live video stream while processing frame in OpenCV. I mean what is value of PTS (in PES header of Transport stream) of particular frame on which currently I am doing processing in OpenCV.
Can some one give me some hint whether this is doable or not?
@berak, Can you please help me out if you came across any way to do this?
@hb15 , the answer is still: not possible.
@berak, Thanks for your quick reply.
I can see my ffmpeg prints, when I build ffmpeg statically and then compile OpenCV and run OpenCV app to get frame etc.
But I am not sure how to make interface to get PTS from ffmpeg. I am new to OpenCV but worked for different development in FFMPEG.
In above thread you mentioned 'you probably need to interface with ffmpeg/gstreamer directly, to achieve this', Can you please give me some idea or link how to do this?