0

I am currently writing a script for my raspberry pi 3B that calls FFmpeg to write m3u8 streams to a .TS file. However since I am recording hour long streams, some that aren't needed, I also wrote side script that will run at 5 second intervals, seek to a timestamp in the writing video and save a frame from it to be compiled into a timelapse-like video later. The current command I am using is...

ffmpeg -n -ss second_to_process -i "test.ts" -frames:v 1 "test.jpg"'

The problem right now is that frame capture operation seems to be very cpu intensive on my pi. Recording the m3u8 streams take barely any cpu since it seems to be I/O driven, but running 2-3 operations of the frame capture script eats up 75% of my cpu. I'm looking to record anywhere from 4-12 streams at any time.

Current thoughts are to try and seek keyframes/i-frame times and to save them out, since I think the intensive part is the encoding aspect when seeking, but I'm not sure if doing that is any less intensive. I've tried using opencv with python, and the processing is about the same. Open to suggestions

1 Answer 1

0

Turns out the RPI is just not strong enough for multiple simul-jpeg saves. That being said, I also cut the script way down, removing things like calls to ffprobe and reducing loop times to reduce cpu usage. I ended up going with an odroid N2 which does the job well. Saving 10 jpegs every 2 seconds seems to be about the max you can get before cpu hits a constant 100% usage.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .