KonradIT / goprowifihack

Unofficial GoPro WiFi API Documentation - HTTP GET requests for commands, status, livestreaming and media query.
Apache License 2.0
2.11k stars 338 forks source link

Error in opening the video downloaded by downloadLastMedia #247

Closed zhangy76 closed 2 months ago

zhangy76 commented 3 years ago

Problem:

I use "downloadLastMedia" to download the video I collected before as the code shown below. All the procedure went well but I can not open the downloaded video file on my computer. try: goproCamera = GoProCamera.GoPro() goproCamera.mode(constants.Mode.VideoMode) except: print('fail to connect to GoPro')

while 1: 

    if (RECORD_IDX%2) == 1 and IDLE:
        print('gopro begins shooting')
        goproCamera.shutter(constants.start)
        IDLE = 0

    if (RECORD_IDX%2) == 0 and RECORD_IDX>0 and IDLE==0:
        goproCamera.shutter(constants.stop)
        time.sleep(10)
        datasaving_path = SAVE_FOLDER+datatime_now+str(RECORD_IDX//2)+'_gopro.mp4'
        goproCamera.downloadLastMedia("", custom_filename=datasaving_path)
        IDLE = 1

Details:

zhangy76 commented 3 years ago

Sorry not happens every time but only the first time to download a video.