简体   繁体   English

Linux&C:如何在录制mp4文件时在多进程程序中设置文件读取优先级

[英]Linux & C: How to set file reading priority in multi-process program while recording mp4 files

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. 我需要弄清楚如何在程序中设置录制mp4文件的优先级。 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. 我试图同时从三个摄像机(1-HD和2个模拟摄像机)进行记录,并在每次记录60秒后创建其tar文件。

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. 在此过程中,我仅在高清摄像机中经历了跳帧,其余2台模拟摄像机都没问题。因此,我决定为记录设置高优先级,为文件去皮重设置低优先级。

please suggest me some ideas to set the priority, that neglect the frame skip. 请给我建议一些优先级的想法,而忽略跳帧。

Any help/guidance is appreciated :) 任何帮助/指导表示赞赏:)

You will probably struggle to do this using the standard round robin time sharing scheduler in Linux. 您可能会很难使用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 . 请参阅sched_setscheduler

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM