0

I have this ffprobe command reading from rtsp feed. My aim is to extract video frame and audio frame from the feed along with their associated pts_time. My rtsp feed has h265 video format and aac audio format.

I need to pass the video data to OpenCV for processing. OpenCV takes bgr24 format. I used to rely on ffmpeg -i rtsp:// -c copy -f rawvideo -pix_fmt bgr24 -pipe: where its stdout produces video frame in bytes. I am not so sure if this is similar to the "data" in ffprobe packets or not. Doing so has limitation when I need to work on audio and synchronizing audio and video. It seems ffprobe provide both audio and video data naturally in one simple command along with pts_time reference.

I have been trying find reference for show_data and its use of data. It would be appreciated if anyone provide guidance on this.

ffprobe -hide_banner -loglevel fatal -i rtsp://... -show_packets -show_data -print_format json

{

"codec_type": "video",

"stream_index": 0,

"pts": 28128,

"pts_time": "0.312533",

"dts": 28128,

"dts_time": "0.312533",

"duration": 3600,

"duration_time": "0.040000",

"size": "7937",

"flags": "__",

"data": "\n00000000: 0000 0102 01d0 02b9 7420 4bfb 5df1 637e ........t K.].c~\n00000010: 0000 0302 2067 e2e9 48f8 6197 3952 8432 .... g..H.a.9R.2\n00000020: a689 afb5 69ec 0ca>

},

{

"codec_type": "audio",

"stream_index": 1,

"pts": 6280,

"pts_time": "0.392500",

"dts": 6280,

"dts_time": "0.392500",

"duration": 1024,

"duration_time": "0.064000",

"size": "258",

"flags": "K_",

"data": "\n00000000: 0102 9ffe 0b24 2ad1 2962 a5ca a569 0275 .....$*.)b...i.u\n00000010: 15a0 f442 2f92 95ee abca 7892 00f6 aac8 ...B/.....x.....\n00000020: ff8d f8b7 f368 5fb>

},

Cee Wee
  • 11
  • 1

0 Answers0