Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing the directory for pictures and video #78

Open
trooperisme opened this issue Mar 19, 2020 · 11 comments
Open

changing the directory for pictures and video #78

trooperisme opened this issue Mar 19, 2020 · 11 comments

Comments

@trooperisme
Copy link

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

@trooperisme trooperisme changed the title chaning the directory for pictures and video changing the directory for pictures and video Mar 19, 2020
@trooperisme
Copy link
Author

trooperisme commented Mar 19, 2020

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,

@viet2411
Copy link

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?

@trooperisme
Copy link
Author

trooperisme commented May 22, 2020

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 !!!

@viet2411
Copy link

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

@trooperisme
Copy link
Author

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)

@trooperisme
Copy link
Author

@hanyazou please help if you feel free

@gemSquared
Copy link

gemSquared commented May 22, 2020

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.

@trooperisme
Copy link
Author

oh thats nice, it makes more sense to me tho

@viet2411
Copy link

viet2411 commented Jul 7, 2020

Has anyone recorded the video yet?

@Walt-H
Copy link

Walt-H commented Jul 17, 2020

@viet2411 I was able to do this through Windows :)

I had to do the following:

  1. Download Mplayer for Windows here: https://sourceforge.net/projects/mplayerwin/files/MPlayer-MEncoder/r38151/mplayer-svn-38151-x86_64.7z/download

  2. Unzip the file via 7zip

  3. 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.
  4. Install the wheel (see README) and add the following packages into your Python environment via pip: av, opencv-python, image, pygame

  5. 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
  6. Uncomment line 62 and 63 (may not be necessary, but I did it anyway)

  7. Run keyboard_and_video.py

  8. Hit R

  9. Fly Around a Little

  10. Hit R

  11. Land and gracefully terminate program

And now I have an MP4 that I have to open through Google Chrome to view :)

giphy

@viet2411
Copy link

@Walt-H Finally I can record video with this program. Thank you so much for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants