For all my IP camera streams, I use, under Linux, ffmpeg by a bash script which allows me at the same time to manage:
1/ Convert the RTSP streams to HTTP (HLS) for the "Live" and therefore which generates "m3u8" file and *.ts segments
2/ Backup the stream for archiving (in increments of 5 minutes), a cron remove older files (xx days)
ffmpeg -i "rtsp://[IP_CAM01]" -rtsp_transport tcp -c copy -map 0 -f segment -segment_time 300 -segment_atclocktime 1 -segment_format mkv "cam01-% 03d.mkv" -c copy -f segment -segment_list cam01.m3u8 -segment_list_flags + live -segment_time 2 -segment_list_size 20 -segment_wrap 20 cam01-% 03d.ts
The question I ask myself, and the reason for this message is as follows:
I appeal to your feedback, your opinions, your tips!, and if you had leads (sample) to attack this kind of development, I am interested.
Thank you very much in advance for your feedback. (this is my fist question on stackoverflow, Champagne ! ;))
would there be an interest (memory / cpu / speed) to develop a program (C/C++/other?) to do the same thing by using the libraries of ffmpeg? or the "gain" and the interest would be so minimal that it is not worth the expenditure of energy and time?
Almost certainly not.
I very frequently write tools and utilities using the libav* libraries directly. But almost never because I think I can do better than ffmpeg. Its usually because I have a very specific thing that needs to be done, and developing a filter would be more difficult. Or, for example, changing the behavior of how to recover for an error, or changing specific details in how media is packaged.
If ffmpeg is working exactly like it should for your use case, replacing it is not a great idea.