I have an RTSP video stream encoded by h264 that carries camera's
timestamps inside SEI NAL units.
I'm not sure where those units are exactly located, but I have an example
of how to output them using a patch for ffmpeg:
libavcodec/h2645_parse.c:
...
+ #include <inttypes.h>
...
static int h264_parse_nal_header(H2645NAL *nal, void *logctx)
nal->ref_idc = get_bits(gb, 2);
nal->type = get_bits(gb, 5);
+ if( nal->type == 6 ) {
+ uint64_t* ts = (uint64_t*)(nal->data+3);
+ av_log(logctx, AV_LOG_DEBUG,
+ "nal_unit_type: %d(%s), nal_ref_idc: %d, ts: %"PRId64"\n",
+ nal->type, h264_nal_unit_name(nal->type), nal->ref_idc, *ts
);
+ return 1;
+ }
After applying this patch ffmpeg starts showing timestamps that I need.
Is it possible to decode those timestamps alongside with video frames using
libav* libraries? Since I'm not a video or C programming expert, ideally
I'd like to do it using Python (OpenCV or PyAV), but any help is
appreciated.
--
Andrey
_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".