brean / libardrone

(just links for a future project for now): c-communication library to create strings that can be send as AR.Drone 2.0 commands
0 stars 0 forks source link

Installing FFMPEG to run ardrone #1

Open mikerosz opened 7 years ago

mikerosz commented 7 years ago

https://github.com/JJLewis/ColorTracking-ARDrone2.0-Python/blob/master/Code/track.py This github is suppose to track color by using the libardone library, unfortunately I get this error. I am not sure why. I know this is not your github repository but the other guy was not helping at all. I posted error in code below. errrr

mikerosz commented 7 years ago

i installed FFMPEG on my computer as well and i tested it on command prompt. It showed me the version of software and other information

brean commented 7 years ago

Hi Mikerosz,

I used fedora Linux for development (the original author uses Ubuntu, it should work in most Linux environments). I am not sure if this will work at all with Windows.

The error message is a bit misleading. You do not only need ffmpeg but also the ffmpeg-python module. Install ffmpeg-python using pip install ffmpeg-python or python -m pip install ffmpeg-python

should look like this:

C:\Users\andreas>python -m pip install ffmpeg-python
Collecting ffmpeg-python
  Downloading ffmpeg-python-0.1.6.tar.gz
Requirement already satisfied: future in c:\python27\lib\site-packages (from ffmpeg-python)
Installing collected packages: ffmpeg-python
  Running setup.py install for ffmpeg-python ... done
Successfully installed ffmpeg-python-0.1.6

C:\Users\andreas>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ffmpeg
>>>

I don't have my ardrone with me right now, but I am interested if that worked, so feel free to provide some additional feedback if you get it running or not.

Good Luck!

mikerosz commented 7 years ago

error2 I also get this error when running the startup code you provided with flying up and down.

brean commented 7 years ago

Hi mikerosz,

I just reactivated my AR.Drone 2 and tested with my Windows 10 Notebook. If you remove the "self.com_pipe," from the list in the arnetwork.py you should be able to connect to the drone, get the video feed and send some commands (I just tested liftoff and land with the demo application). It's not ideal but should work as a workaround.

I also needed to remove the lines for the ffmpeg-test in the h264decoder.py as well as the "nice", "-n", "15", in the beginning of the Popen command of the same file. Again just a workaround, nothing I'd like to put into the repo as working solution.

Especially the video feed is quite slow and interrupts quite often (only shows a green or black screen), so I recomment a Linux installation for your usecase.

Kind Regards,

Andreas

mikerosz commented 7 years ago

Is there a way to install Linux on windows. Whenever I try to install Ubuntu, it always ask of me to insert a disc. Is there a free version of Linux somewhere out there with a clear cut installation guide. I tried installing Linux on my computer like 5 times but it never works. I don't think I am doing it correctly.

brean commented 7 years ago

There is Oracle VirtualBox, where you can create and boot a Linux-Installation ontop of Windows. I have not tried if that works for python-ardrone but I think it will. Having a virutal box might get you some problems when developing close to hardware but all you need is propper ffmpeg-support from the underlying software and networking, so I assume it should work fine.

Alternatively you can install any Linux on an SD-card, use an USB-Stick or resize your windows harddrive. Make sure to create a backup if you decide to resize the Windows-disk. It worked on all of my machines without problems but it is recommended. There is a lot of documentation out there, especially for Ubuntu. Just search for "install ubuntu alongside windows 10" with any search engine and you'll find a lot of easy to use Tutorials and step by step Videos.