puku0x / cvdrone

CV Drone (= OpenCV + AR.Drone)
https://github.com/puku0x/cvdrone/wiki/How-to-build
Other
203 stars 93 forks source link

Dropping video frames results in frozen video stream #12

Closed fabriziopece closed 8 years ago

fabriziopece commented 10 years ago

Hi,

thanks a lot for the good work! I am playing around with your test example, and I am facing a pretty weird bug/problem.

Essentially, in a very unreliable way, the video stream from the drone suddenly freezes, causing opencv to always show the very last frame grabbed. I have placed few debugging output here and there, and I have found out that when the freeze happens, in the method ARDrone::getVideo the statement av_read_frame(pFormatCtx, &packet) is never >= 0, hence no packets are parsed and the loop in ARDrone::loopVideo breaks.

I am not sure what could be the problem. I am on Ubuntu 14.04, Ar.Drone Ver. 2.4.8. Have you ever faced this problem? I have tried to change sleeping times (increasing/decreasing them), with no luck. Also, this is completely random. Sometimes I am able to fly and show video without any problem, but most of the time I can only show the video for few seconds. All other communication work fine. Another interesting behavior is that the program has about 5--8 seconds hanging time between when the Drone version is printed and when the first frame comes in (or at least is shown by opencv).

Thanks a lot for your help!

-Fabrizio

puku0x commented 10 years ago

Hi Fabrizio,

Thank you for your report.

Unfortunately, I have never faced that problem on Ubuntu 14.04 LTS 64-bit (on Virtual Box) with AR.Drone Ver. 2.4.8.

It seems FFmpeg's error, but as reported in #11, a part of CV Drone does not work well on Ubuntu 14.04. (However, it may be solved by switching general:navdata_demo=TRUE, or $apt-get update/upgrade)

Did you update all libraries ?

Thank you, puku0x

fabriziopece commented 10 years ago

Hi,

Thanks for your reply. This is indeed a Ubuntu problem, as on Mac the library works just fine.

I haven't tried switching general:navdata_demo yet, I'll let you know the result of that. As for updating the libs, I'm using my builds for openCV (latest git master), and apt version of ffmpeg. I'll try updating the latter and see what happens.

Thanks,

-Fabrizio

On Wednesday, June 25, 2014, puku0x notifications@github.com wrote:

Hi Fabrizio,

Thank you for your report.

Unfortunately, I have never faced that problem on Ubuntu 14.04 LTS 64-bit (on Virtual Box) with AR.Drone Ver. 2.4.8.

It seems FFmpeg's error, but as reported in #11 https://github.com/puku0x/cvdrone/issues/11, a part of CV Drone does not work well on Ubuntu 14.04. (However, it may be solved by switching general:navdata_demo=TRUE, or $apt-get update/upgrade)

Did you update all libraries ?

Thank you, puku0x

— Reply to this email directly or view it on GitHub https://github.com/puku0x/cvdrone/issues/12#issuecomment-47061102.

-Fabrizio

puku0x commented 8 years ago

Nothing happened ?