I have a video file. I require to perform the latency test between the time from video encoding to decoding. Unfortunately, we can’t get the raw image data as the jetson orin doesn’t have 4 pin port for accessing the leopard cameras. We are going to perform the video decoding of a video file and re-encode that video file. During this time we want to compute the latency between these pipeline, Also latency of decoding the video to raw data and latency of encoding raw data into video file.
Can anyone please let me know how to do this? How to write this pipeline? The below is a script for decoding video.
Not sure I correctly understand ‘the latency test between the time from video encoding to decoding’.
If you have a video file in MP4 format, it is already encoded and muxed into MP4 container. So what you want to measure would be the latency of disk/filesystem/gst-filesrc + mp4 demuxing + h264 parsing + h264 decoding + nv3dsink + display controler + your monitor latency (refresh rate).
HI, I am trying to measure the latency for gstreamer to encode a video and the latency of gstreamer to decode a video for H264 compression. Hence, I require a streamer pipline inoder to caclulate that.
I heard of the tool called gstshark as below:
It helps to compute inter-latencies between pipeline. I did try this as follows:
Thank you, I can decode and encode the video. I am getting the output.mp4 file. Terminal output as follows:
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Pipeline is PREROLLING ...
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 0
NVMEDIA: Need to set EMC bandwidth : 846000
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:00.968119607
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
If we see clearly there is execution ended time available. “Execution ended after 0:00:00.968119607”. If I can get the execution started time. I am guessing I can the latency of the whole process.
Also note that my decoding-encoding pipeline had not -e flag as your decoding pipeline has.
Not sure what is your intention here. Sorry if it doesn’t work with your understanding.
You may better understand when using gst-shark tracers.
For reference, here using gst-shark v0.6.0 with R35.1.0:
git clone https://github.com/RidgeRun/gst-shark
cd gst-shark
git checkout release/v0.6.0
./autogen.sh --prefix /usr/ --libdir /usr/lib/aarch64-linux-gnu/
sudo make -j$(nproc) install
rm ~/.cache/gstreamer-1.0/registry.aarch64.bin
GST_DEBUG=*:4 gst-inspect-1.0 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstsharktracers.so
# If ok so far, try the example:
GST_DEBUG="GST_TRACER:7" GST_TRACERS="interlatency" gst-launch-1.0 videotestsrc ! queue ! videorate max-rate=15 ! fakesink sync=true