0

This is for an assignment I'm not looking for you to suggest me the answer. I just need someone to point me in the right direction, maybe with a line or two of sample code.

I need to figure out how to set the priority of a recording mp4 files within my program. To the point:

i am trying to record from three cameras (1-HD and 2 analog cameras) at the same time and creating its tar file after each recording of duration 60seconds.

so after a set of records completed, i am taring those files. in doing that i am experiencing frame skip in only HD camera, remain 2 analog cameras are fine.hence forth i decided to set high priority for recording and low priority for taring those files.

please suggest me some ideas to set the priority, that neglect the frame skip.

Any help/guidance is appreciated :)

1
  • I suspect that you problem will not be solved by priority tweaking. Need code/design. Oct 31, 2017 at 12:01

1 Answer 1

0

You will probably struggle to do this using the standard round robin time sharing scheduler in Linux. One approach could be to use the "real-time" scheduler policies for the video encoding threads, and tar the files in a thread using the standard scheduler. See sched_setscheduler.

2
  • Not convinced - I suspect OP is doing mostly I/O. Oct 31, 2017 at 14:22
  • The question suggests no dropped frames until the file archiving starts, so running the video capture threads as SCHED_RR or SCHED_FIFO will prevent them from being switched out while they have processing to do and prevent dropped frames. This might mean that the archiving process is starved of processing time and does not complete before the next file is ready for archiving, but without running an experiment it is impossible to say.
    – Luke Smith
    Oct 31, 2017 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.