How can I stream h264 video from RTSP directly into file without encoding?
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!
i do not think, this is an opencv question
It is, I would like to use OpenCV, just happen to be stating how it works in ffmpeg. I would like to do the same thing with OpenCV instead.
why would you use a mainly computer-vision library (that happens to wrap some ffmpeg functionality) for this ?
Feel like you haven't read the question(not that I don't appreciate the help)
Two reasons: 1) We will likely be analyzing video in the future, having the ability to do so is nice. 2) ffmpeg is a pain to setup and write compared to opencv, other than this issue.