TelloPy
TelloPy copied to clipboard
changing the directory for pictures and video
Hi, This is a very very easy easy question, but I dont know how to work with '%s'. Let's say that my directory is: C:\Users\hi\Pictures\fly
path = '%sUsers/hi/Pictures/Screenshots/tello-%s.jpeg' % ( 'C:/', datetime.datetime.now().strftime('%Y-%m-%d_%H%M%S')) with open(path, 'wb') as fd: fd.write(data) status_print('Saved photo to %s' % path)
I switch the os.getenv() method back to 'C:/'. Then I end up getting the message:
Tello: 13:25:14.920: Info: unknown packet: 0030 cc 60 00 27 b0 30 00 00 00 00 02 0d Tello: 13:25:14.921: Info: recv: file size: cc 90 00 be 88 62 00 2e 00 01 d8 d5 09 00 00 00 2b 5f Tello: 13:25:14.921: Info: file size: num=0 bytes=644568 ALT: 10 | SPD: 0 | BAT: 61 | WIFI: 90 | CAM: 0 | MODE: 6 Tello: 13:25:14.971: Info: recv: file size: cc 60 00 27 50 62 00 2e 00 00 db ff Tello: 13:25:14.972: Warn: file size: payload too small: 00.
##Then the camera screen starts to freezing. I am so confused now, also I cannot record video either (mostly due to the 'path') Thanks,
Hello, I also changed the os.getenv() method back to 'C:/', but I received the file not found error. Have you solved this problem yet?
Hi Viet, I tried but it still doesn’t work out. I have been playing around with the path but I cant figure it out (i am stupid lol). I think you should keep it as default !!!
Update: I switched the os.getenv() method to os.getcwd() and was able to capture a picture, but the camera screen freezed after that. Still don't understand why this happenned lol
Update: I switched the os.getenv() method to os.getcwd() and was able to capture a picture, but the camera screen freezed after that. Still don't understand why this happenned lol
that is exactly what I experienced (you still can have access to control via your device, it is just the camera doesn't get the images)
@hanyazou please help if you feel free
Hello! I just removed all the previous directory jazz and did
"telloPic" + str(round(time.time())) + ".png"
for the path. It'll save to the same folder as the python script.
oh thats nice, it makes more sense to me tho
Has anyone recorded the video yet?
@viet2411 I was able to do this through Windows :)
I had to do the following:
-
Download Mplayer for Windows here: https://sourceforge.net/projects/mplayerwin/files/MPlayer-MEncoder/r38151/mplayer-svn-38151-x86_64.7z/download
-
Unzip the file via 7zip
-
Add the extracted folder to your PATH (I followed this guide)
- I had to restart PyCharm after doing this, so restart your IDE to make sure it gets the new enviroment.
-
Install the wheel (see README) and add the following packages into your Python environment via pip: av, opencv-python, image, pygame
-
In keyboard_and_video.py, change the filename at line 57 to a Windows friendly directory
- e.g.
'%s\\Pictures\\tello-%s.mp4' % ('C:\\Users\\Buddy', datetime.datetime.now().strftime(date_fmt))
- I would recommend doing this for jpegs at line 209
- e.g.
-
Uncomment line 62 and 63 (may not be necessary, but I did it anyway)
-
Hit R
-
Fly Around a Little
-
Hit R
-
Land and gracefully terminate program
And now I have an MP4 that I have to open through Google Chrome to view :)
@Walt-H Finally I can record video with this program. Thank you so much for your support!