1,The tv_usec in v4l2_buffer output by videoDecoder is always zero
2, After a period of continuous decoding ,about 2 minutes, videoDecoder will modify the v4l2_buffer timestamp.
This will cause trouble in the video sync after decoding
Replace 00_video_decode/video_decode_main.cpp with the file save in the attachment
Record a video in about 2 minutes
gst-launch-1.0 -e nvcamerasrc fpsRange="30.0 30.0" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! \
nvvidconv flip-method=2 ! 'video/x-raw(memory:NVMM), width=(int)176, height=(int)144, format=(string)I420' ! omxh264enc bitrate=2000000 \
! 'video/x-h264, stream-format=(string)byte-stream' ! filesink location=test.h264 -e
run video_decode
./video_decode test.h264 H264 --input-nalu
it’s the log
in dec sec 2624734436, delta 3600
out dec >>>>>>>>>>>>>>>>> sec 2624633578, delta 2655
videoDecoder have modified the v4l2_buffer's timestamp
in dec sec 2624738036, delta 3600
out dec >>>>>>>>>>>>>>>>> sec 2624636233, delta 2655
videoDecoder have modified the v4l2_buffer's timestamp
in dec sec 2624741636, delta 3600
out dec >>>>>>>>>>>>>>>>> sec 2624638909, delta 2676
videoDecoder have modified the v4l2_buffer's timestamp
in dec sec 2624745236, delta 3600
out dec >>>>>>>>>>>>>>>>> sec 2624641607, delta 2698
videoDecoder have modified the v4l2_buffer's timestamp
in dec sec 2624748836, delta 3600
out dec >>>>>>>>>>>>>>>>> sec 2624644329, delta 2722
videoDecoder have modified the v4l2_buffer's timestamp
in dec sec 2624752436, delta 3600
out dec >>>>>>>>>>>>>>>>> sec 2624647077, delta 2748
videoDecoder have modified the v4l2_buffer's timestamp
in dec sec 2624756036, delta 3600
out dec >>>>>>>>>>>>>>>>> sec 2624649852, delta 2775
videoDecoder have modified the v4l2_buffer's timestamp
in dec sec 2624759636, delta 3600
out dec >>>>>>>>>>>>>>>>> sec 2624652656, delta 2804
videoDecoder have modified the v4l2_buffer's timestamp
in dec sec 2624763236, delta 3600
out dec >>>>>>>>>>>>>>>>> sec 2624655491, delta 2835
videoDecoder have modified the v4l2_buffer's timestamp
in dec sec 2624766836, delta 3600
out dec >>>>>>>>>>>>>>>>> sec 2624658357, delta 2866
video_decode_main_testTS.cpp (32.7 KB)