ghu
ghu

Reputation: 11

gstreamer mpeg2enc has no timestamp

I was trying to change the frame size of mpeg2 transport stream video using gstreamer pipeline. The procedure was: Fist, separated the video portion and audio portion using tsdemax, then, went through mpeg2dec, capsfilter (change the frame size), mpeg2enc, and mpegtsmux to combine the audio portion of the stream. The mpegtsmux had no output.

I searched, and found a document said:

that the nature of mpeg2enc leads to it output not having metadata on timestamps

(which might be the cause of the problem), and suggested:

then stamp can easily help one out if needed, as in the fragment (mpeg2enc format=3 ! stamp ! avimux)

I am using gstreamer 1.0 'C' library, and couldn't find the element "stamp". I appreciate if someone can help me why the video through mpeg2enc can't mux with the audio, and if it is caused by the lack of timestamp, how to add a timestamp on or after the mpeg2enc?

Upvotes: 0

Views: 1626

Answers (1)

nayana
nayana

Reputation: 3932

The thing is that by default the timestamps are not preserved when working with mpeg ts..

You need to use the tsparse and its property set-timestamps=true to add the timestamps.. then you will be able to mux it back properly when needed..

gst-launch-1.0 ... ! tsparse set-timestamps=true ! video/mpegts ! tsdemux ! ...

What document you looked into? The second quote about stamp does not make sense to me..

You either have some sort of timing information or you are lost.. the timestamps must be there in video/audio stream - no matter if its from file or rtp , mpeg-ts or whatever..

If you still have problems, then update question with actual pipeline.. because now I am just guessing what you are actually doing.

HTH

Upvotes: 1

Related Questions