You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am trying to write a tiny video editor. It basically allows you to set start and end marks and press enter to cut clips. The problem is that the end marks (and it's odd because it doesn't happen with the start marks) are set a few tenths of a second before the desired moment. It's strange because I would understand a delay due to human reaction time, but instead, there is an advance. Here is the relevant code:
from moviepy.video.io.VideoFileClip import VideoFileClip
import vlc
import wx
import sys
The results from methods player.get_time, player.get_position, player.get_length and media.get_duration are not reliable until the video has been playing for several seconds. Examples like cocoavlc.py are affected by that same issue.
Hello, I am trying to write a tiny video editor. It basically allows you to set start and end marks and press enter to cut clips. The problem is that the end marks (and it's odd because it doesn't happen with the start marks) are set a few tenths of a second before the desired moment. It's strange because I would understand a delay due to human reaction time, but instead, there is an advance. Here is the relevant code:
from moviepy.video.io.VideoFileClip import VideoFileClip
import vlc
import wx
import sys
def ms_to_hms(ms):
"""Convert milliseconds to h:mm:ss.xxx"""
seconds, ms = divmod(ms, 1000)
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
return f"{hours}:{minutes:02d}:{seconds:02d}.{ms:03d}"
class VideoFrame(wx.Frame):
TIME_UNITS = [10, 100, 1000, 5000, 60000, 300000] # Centiseconds, Deciseconds, Seconds, 5 Seconds, Minutes, 5 Minutes
def main(video_path):
app = wx.App(False)
frame = VideoFrame(None, "Video Player", video_path)
app.MainLoop()
if name == "main":
video_path = sys.argv[1]
main(video_path)
The text was updated successfully, but these errors were encountered: