I'm trying to stream h264 video from a RTSP stream and directly store it into a file and skip decoding/encoding for most frames as I need high performance and hundreds of frames per second. Though the occasional frame will likely need to be analyzed (may be able to get around this in hardware.. in which case ffmpeg instead of OpenCV would work, but ffmpeg is complicated.. would prefer to avoid). I would slightly prefer mp4, but doesn't really matter the file container being used.
I know that I can do this in ffmpeg command line like this: ffmpeg -i <rtsp url=""> -c copy -map 0 -f segment -segment_time 30000 -strftime 1 -reset_timestamps 1 -segment_format mp4 <video name="">
Is it possible to do this in openCV? Seems like if I specify the same codec as the input to be used for output that it still encodes decodes based on CPU Usage still being the same instead of just skipping decoding/encoding.
Thank you for your time!