Hi,I'm viewing 2 camera video simultanesly and recording them on linux system, but both camera lags(slow) after 3sec and I tried to put recording in Qtconcurrent::run(). but also both camera lags(slow)
-
No you can't. You are trying to modify GUI objects from another thread than the GUI thread which is wrong and forbidden.
You might also be trying to write twice in the same file and from the looks of it, you'd might even be deleting your camera objects while setting them up.
Also, recording an mp4 file is a pretty heavy task, did you benchmark your computer to be sure you can support recording two streams at once ?
-
No you can't. You are trying to modify GUI objects from another thread than the GUI thread which is wrong and forbidden.
You might also be trying to write twice in the same file and from the looks of it, you'd might even be deleting your camera objects while setting them up.
Also, recording an mp4 file is a pretty heavy task, did you benchmark your computer to be sure you can support recording two streams at once ?
-
@SGaist I did take bench mark and I'm using highend system lenovo carbon x1.
May I know the best and light recording file otherthan mp4 format?@thippu What about fixing these issues first mentioned by @SGaist :
"You are trying to modify GUI objects from another thread than the GUI thread which is wrong and forbidden.You might also be trying to write twice in the same file and from the looks of it, you'd might even be deleting your camera objects while setting them up."
? -
@thippu What about fixing these issues first mentioned by @SGaist :
"You are trying to modify GUI objects from another thread than the GUI thread which is wrong and forbidden.You might also be trying to write twice in the same file and from the looks of it, you'd might even be deleting your camera objects while setting them up."
?@jsulm You might also be trying to write twice in the same file and from the looks of it, you'd might even be deleting your camera objects while setting them up."
? ans: No twice write rec2() function got diffrent file name so,that is not a problem for me.
"You are trying to modify GUI objects from another thread than the GUI thread which is wrong and forbidden. ans: I want there should no lag in cameras view thats y went to do in diffrent thread but I dono how to avoid lags
plz help me -
@jsulm You might also be trying to write twice in the same file and from the looks of it, you'd might even be deleting your camera objects while setting them up."
? ans: No twice write rec2() function got diffrent file name so,that is not a problem for me.
"You are trying to modify GUI objects from another thread than the GUI thread which is wrong and forbidden. ans: I want there should no lag in cameras view thats y went to do in diffrent thread but I dono how to avoid lags
plz help me -
Are you using a embedded device?
With a Raspberry Pi I can watch only one camera without to have problem.I'm watching 4 videocameras with a Pentium 4 and more than 8 with a Intel Core 2 duo, with motion detection ...
To do this I'm using the FFMpeg libs for the rtsp cameras and OpenCV for the /dev/video* cameras.
I suggest you to use a dedicated object (thread) for each camera and, if you want to watch and not only to store, to emit an event for each frame.
Please considered that if you are resizing the frames that it is very cpu expensive activity.
-
Are you using a embedded device?
With a Raspberry Pi I can watch only one camera without to have problem.I'm watching 4 videocameras with a Pentium 4 and more than 8 with a Intel Core 2 duo, with motion detection ...
To do this I'm using the FFMpeg libs for the rtsp cameras and OpenCV for the /dev/video* cameras.
I suggest you to use a dedicated object (thread) for each camera and, if you want to watch and not only to store, to emit an event for each frame.
Please considered that if you are resizing the frames that it is very cpu expensive activity.
@mrdebug Thnx for the replay and suggestions
please send me example code or code which u have developed to my email : thippeswamydcts@gmail.com
for this : "I suggest you to use a dedicated object (thread) for each camera and, if you want to watch and not only to store, to emit an event for each frame." -
@thippu Never modify any GUI related classes from other thread than GUI thread. From other threads you should emit signals if something needs to be changed in the GUI.
-
@jsulm hey is there any source, i can get to understand the gui thread like how to those gui threads are there and what we shouldnot do.
-