WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Video function setTime() is hit & miss (https://forum.worldviz.com/showthread.php?t=5856)

tokola 09-22-2016 12:12 PM

Video function setTime() is hit & miss
 
Hi all,
I am using the video set/stopTime functions to play clips of a long video, at different points in my application. However, the playback jumps to a point at the beginning of the video once I call setTime(). This odd behavior appears totally random and have found no pattern regarding its occurrence. Weirdly enough this point is always the same, around the 12th second of the 5-min video (mp4 175MB). Due to the size I cannot upload the video. My code is very simple and the values I pass (start/stop) are always correct:

Code:

self.video.setTime(start)
self.video.stoptime(end)
self.video.play()

I am wondering if file size and/or format have anything to do with the problem. Is this a Vizard bug that someone else has come across? It makes the function unusable and if I don't resolve this, I will need to break down the video, which is such an inconvenience.

Thanks!

Jeff 09-22-2016 08:36 PM

I don't think I've seen this before. Does it also happen when running the following script? Can you upload the video and I'll try to reproduce the issue?

Code:

import viz
import vizact

viz.go()

quad = viz.addTexQuad(pos=[0,1.8,3])
video = viz.addVideo('video.mp4')
video.play()
quad.texture(video)

vizact.onkeydown('1',video.setTime,0)
vizact.onkeydown('2',video.setTime,30)
vizact.onkeydown('3',video.setTime,60)
vizact.onkeydown('4',video.setTime,90)
vizact.onkeydown('5',video.setTime,120)
vizact.onkeydown('6',video.setTime,150)


tokola 09-23-2016 10:37 AM

1 Attachment(s)
Jeff,
I played around with my implementation, which was more complicated than what you sent me (which works fine with my video). I think I identified the culprit. You need to call play() AFTER the actual setTime(). I am not sure why, but if you leave it the way I have in the example (see attachment), then playback jumps arbitrarily (maybe once every 3-4 times) to the 12th second of the video.

It seems like a bug to me, but if you decide not to fix it you might want to emphasize in the documentation that the video MUST be playing for setTime() to work right.

Thanks for looking into this promptly! Let me know if I should know something more.


All times are GMT -7. The time now is 11:49 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC