How to write timestamp into each encoded frame data in Gstreamer?

Hi,everyone.
I encode YUV data into H265 bitstream using omxh265enc,then I send them into network using rtph265pay and udpsink. Now,I want to write timestamp into each encoded frame data.So how should I do to achieve this? And in the receiver,how can I get the timestamp of each frame data? Looking forward to your early reply.Thank you!

Hi,
At server, you can try test-appsrc:
https://devtalk.nvidia.com/default/topic/1049924/jetson-agx-xavier/using-rtsp-encode-with-h264-and-stream-images-at-device-memory-on-xavier-/post/5331159/#5331159
And assign timestamp manually.

At client, you can use appsink to extract the timestamp() out:
https://devtalk.nvidia.com/default/topic/1014789/jetson-tx1/-the-cpu-usage-cannot-down-use-cuda-decode-/post/5188538/#5188538
https://devtalk.nvidia.com/default/topic/1011376/jetson-tx1/gstreamer-decode-live-video-stream-with-the-delay-difference-between-gst-launch-1-0-command-and-appsink-callback/post/5160929/#5160929

It is pts in GstBuffer

Hi,DaneLLL.
Thanks for your reply,and the method you provided is just what I’m looking for. But the situation is a bit of diffrent.
At server,I indeed use the appsrc to push outer YUV data into pipeline,and I can set the timestamp using GST_BUFFER_PTS.
But at the client, we need to choose Windows 10 as client and we need to use Hardware Acceleration to decode(we can use omxh265dec or nvdec). However, I tried my best to install gstreamer with nvdec or omxh265dec support on Windows 10,but all failed. Of course,if I get success,I can use appsink to abtain the timestamp which was set in appsrc. Because of the failness, I have to handle the H265 data with ffmpeg at client. So the question comes: If I set the timestamp in appsrc with gstreamer, how can I get the timestamp with ffmpeg(it seems ffmpeg has no GstBuffer struct)?
If this cannot be done theoretically, can you provide me with some reliable links which can succeed installing gstreamer with omxh265dec or nvdec support on Windows 10? Thank you for your help and looking forward to your early reply.

Hi,
We don’t support omxh265dec on x86 PC. If your x86 PC has NVIDIA GPUs, you can install VIDEO CDEC SDK

Hi,DaneLLL,

How to install VIDEO CODEC SDK with gstreamer? I have tried to do this,but failed.Can you provide me with a reliable link?

On the other hand,as I said in the last post,I want to achieve a situation: If I set the timestamp in appsrc with gstreamer, how can I get the timestamp with ffmpeg(it seems ffmpeg has no GstBuffer struct)?

Hi,
If you use TX2, VIDEO CODEC SDK is not supported.
ffmpeg with hardware acceleration is not supported in default release. There is a community contribution based on tegra_multimedia_api. You may check and try.
https://github.com/jocover/jetson-ffmpeg

1 Like