Forum

Author Topic: importVideo() not stoping at the endpoint?  (Read 2544 times)

picare

  • Newbie
  • *
  • Posts: 33
    • View Profile
importVideo() not stoping at the endpoint?
« on: December 24, 2021, 12:48:31 AM »
Hi, i'm trying to use chunk.importVideo() to convert videos to png images.

I successfully passed parameters to the function, but i'm unable to stop the png's generation at the endpoint: it always generate the entire video with the good step!
With the following code, it starts the capture at 10 seconds succesfully, each 15 frames (30frames/sec), but doesn't stop at 1'44''.
I tried lots of parameters for time_end : (60+44)*1000, (60+44-10)*1000, (60+44)/1000, 60+44, 1, 100, -100, -1000 . All of them goes to the end of the video, or fail.

Any idea of what's wrong?
Under Metashape 2.7.5, using the menu file > import video works well and stops at the good endpoint!


Code: [Select]
path="D:/tests/GP1/GOPR7430.MP4"
image_path="D:/tests/GP1/Images/GP1_{filenum}.png" #this folder must be created before
start= 10 #start time in seconds from beginning
end= 60+44 # 1min44seconds stop time in seconds from beginning


chunk.importVideo(path,image_path,frame_step=Metashape.FrameStep.CustomFrameStep,custom_frame_step=15,time_start=start*1000,time_end=end*1000)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15166
    • View Profile
Re: importVideo() not stoping at the endpoint?
« Reply #1 on: December 28, 2021, 02:30:58 PM »
Hello picare,

Thank you for reporting, we'll fix it in the next update.
Best regards,
Alexey Pasumansky,
Agisoft LLC