Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 9:52 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Video/Draw script issues
PostPosted: July 5th, 2007, 4:33 am 
Offline

Joined: May 12th, 2006, 6:39 pm
Posts: 9
Location: Canada
I'm trying to use the new v6 drawing functions but have run into some problems that I've run out of ideas to fix?

What I wanted to achieve:
1. A user browses for a video file that opens up in a 'player' that has 'seek' and 'scrub' functions. There are also default playback speed buttons ie. x2, x5 etc.
2. The user can pause the video to then 'draw' over the top, much like the sports commentators highlighting things during video playback (usually stating the obvious at the same time!)

First requirement is sorted, but with some compromises. I wanted to play the video as 'Chroma key' so that I could utilise the draw functions in a frame layed on top of the video, but this setting seems to stall the seek/scrub functions? So, with the video set to 'On top', I move on.

To achieve part 2, here was my plan:

1. When the user browses for a video, the variable that holds the path is used for two video objects.

1st video is set to 'On top' and is used for normal playback.
2nd video is set to 'Chroma key-Overlay disabled' and is hidden. Screen capture software can be used to create a jpeg image of this video which can then be 'Drawn' on.

2. When the the user pauses the video, a further button becomes available to facilitate the capture. This is achieved by hiding the first instance of the video (set to 'on top') and shows the second instance (set to 'Chroma Key-Overlay disabled'). I'm using script to monitor the time in the first video and was attemting to use this time and the video script function video.Go(variable) to set the initial play position of the second video.

I'm no scripter, but here is the code I am trying:

function vidStillimage()
{
vidStillPos = Math.round(vidPosSecs)
Videostill.Go(vidStillPos)
wait(waitTime)
//Debug.trace(vidStillPos)
Videostill.Play()
Videostill.Stop()
}


Everything works in terms of launching the command line screen capture program after showing the second video, and I get a .jpeg copy of the video image (success, the theory worked!!!), the only problem is, the second video always starts at the beginning, not at the time I want it to??

I've used the Debug.trace tool to monitor whether or not the vidStillPos variable is set to the correct time (which it is) but for some reason the video refuses to go to this time?

Not sure if this is related to it being set as 'Chroma key'?

It has been one of those long stints with limited success so hopefully this doesn't come across as too confusing!

Any help would be much appreciated.

Cheers

_________________
Si Goldring
Canada

Opus Pro XE 5.5
(1) Windows XP Pro SP2; Intel Core2 6600; 2GB RAM
(2) Toshiba A70 Sat; Pentium4 3.06GHz; 1GB RAM; Windows XP SP2


Top
 Profile  
 
 Post subject: Any ideas?
PostPosted: July 8th, 2007, 11:09 pm 
Offline

Joined: May 12th, 2006, 6:39 pm
Posts: 9
Location: Canada
Wondered if any of the pro's or DW have any ideas as my project has come to a grinding halt until I can find a solution.

Thanks again.

_________________
Si Goldring
Canada

Opus Pro XE 5.5
(1) Windows XP Pro SP2; Intel Core2 6600; 2GB RAM
(2) Toshiba A70 Sat; Pentium4 3.06GHz; 1GB RAM; Windows XP SP2


Top
 Profile  
 
 Post subject:
PostPosted: July 9th, 2007, 2:06 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
Sorry--I haven't time to create a test....Any chance of a simplified sample to demonstrate the problem?? Sometimes you can spend so much time looking at the problem that you miss the most obvious and a fresh eye spots it straight away.


When I have a problem like this, I reduce it to the most simple form possible, then get that working and build from there, so first comment out everything except Videostill.Play(1) using an actual time. Does that work??
then replace the time with a variable which is declared immediatly above, does that work? then replace that variable with 'vidStillPos'.Does that work? just build the function up to the original a line at a time.
I'm sure you'e done all this already.

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: July 9th, 2007, 10:05 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
did a very quick test of two videos with the following function attached to a
button


Code:

function VidTest()
{
VidPos=David.GetPosition()
Debug.trace(VidPos+"\n")
VidPos=Math.round(VidPos)
Debug.trace(VidPos+"\n")


wait(2)
Debug.trace("vid 2 goto saved pos"+"\n")
David2.Go(VidPos)
Debug.trace("play from stored pos"+"\n")
David2.Show()
David2.Play()
}


this worked as expected, but I haven't tried anything else yet

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: July 9th, 2007, 2:36 pm 
Offline

Joined: October 25th, 2004, 4:03 pm
Posts: 249
Location: Digital Workshop
Opus: v7.04
OS: XP, Vista Home Premium, Win7 Professional 64bit
System: Dell Inspiron 560 Quad Core 2.5Ghz 4Gb RAM, 1Tb HD, HP laptop and various others
Just a thought (probably obvious) but have you tested the Seek action with the videos in question - some formats won't allow a Seek command so the video will always play from the beginning.

Paul

_________________
Managing Director
Digital Workshop


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 9th, 2007, 4:41 pm 
Offline

Joined: May 12th, 2006, 6:39 pm
Posts: 9
Location: Canada
Thanks for the help guys, it's definitely appreciated.

What video format did you use Sandy? I am using an .avi file with the techsmith codec (I need a good quality image with a reasonable file size and I found that mpeg1 wasn't giving me the resolution I need)

I think the key to my prblem is the video mode ('On top','Chroma Key' etc)

If I display a video using the 'On Top' mode, I am able to seek as well as use the 'Go' function, but of course, I cannot display anything over the top of it.

If I display a video using the 'Chroma Key' with or without 'overlay disabled', I cannot seek nor use the 'Go' function. This is also true of the 'Rendered' mode, but this mode gives the best quality image. However, both of these modes allow me to display graphics over top.

The problem is, I need to be able to 'fast fwd' the video, or go to a set time (ie. give the user a text input box where they can enter a time from which to play the video) as well as give them the opportunity to 'draw' over the video image (for highlighting purposes during a presentation)

Is it possible to change the video mode on the fly? If I could add a function to my pause button that could change the video mode from 'On Top' while the user wants to draw, this would be ideal. When they had finished, I could clear the drawing, change the video mode back to 'On top' and away they go again.

If not, how do I find a codec or video format that will allow seeking in the 'Chroma-Key' or 'rendered' modes?

Finally, if both of these options are not available, is anyone aware of a command line screen grabbing utility that will grab a video image. I am using 'Capturemation' which is excellent, but unfortunately will not capture a video image that is being played using hardware acceleration (which I believe is what the 'On top' mode is using). If there is, I could grab a capture when the user pauses to draw, replace the video with a jpeg image of the video which they can then draw on. Once they had finished, again I can clear the drawing and the jpeg image and show the video again.

Again, thanks for the help, I hope this is something that can be achieved as it will be an awesome presentation tool.

_________________
Si Goldring
Canada

Opus Pro XE 5.5
(1) Windows XP Pro SP2; Intel Core2 6600; 2GB RAM
(2) Toshiba A70 Sat; Pentium4 3.06GHz; 1GB RAM; Windows XP SP2


Top
 Profile  
 
 Post subject:
PostPosted: July 9th, 2007, 5:26 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
I am using an AVI, but no idea which codec. I have two videos one set to chroma key. I appear to be able to use go and start on it, but I could be doing something different??

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject: checking for codec needed
PostPosted: July 10th, 2007, 1:08 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I'm not quite into video yet, but bookmarked this site.
http://www.codec-download.com/modules.p ... oad&cid=18

Somewhere on that site, there is a tool to determine which codecs are needed for a given video file. I think VideoInspector and Codec Viewer, probably others as well. Click their Categories, or the Help Manual at top.


Site could be good for other topics. Good luck.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: July 10th, 2007, 9:44 pm 
Offline

Joined: May 12th, 2006, 6:39 pm
Posts: 9
Location: Canada
Thanks Lar, looked at the site and there are some useful tools.

However, I must admit defeat in terms of getting the seek/go function to work in anything other than 'Video On Top' mode.

I have exhausted my supply of AVI codecs (the ones supplied with Camtasia studio) in an effort to replicate the one that Sandy used and was able to 'seek/go' in 'Chroma' mode, unfortunately with no success. So the idea of having 2 video objects with different modes set and using the 'go' function to set the 'play back from' time on the video that can be 'drawn' on is currently not an option.

My next 'work-around' of using screen capture software to capture video/directX as an image to then 'draw' over can be achieved, but at a cost. It would also require a copy for every 'player' distributed. This is a work related project as opposed to a contract, so funding is always limited.

It seems like my last option is to add a chapter with 'alpha-transparent' properties and a page containing a 'draw' frame. This will then open on top of the video. I've done a few tests to trial the theory, but will let you know if it is effective or not.

DW - Any word on whether or not video mode can be dynamically changed? (Probably not, but doesn't hurt to ask)

Thanks,

_________________
Si Goldring
Canada

Opus Pro XE 5.5
(1) Windows XP Pro SP2; Intel Core2 6600; 2GB RAM
(2) Toshiba A70 Sat; Pentium4 3.06GHz; 1GB RAM; Windows XP SP2


Top
 Profile  
 
 Post subject:
PostPosted: July 12th, 2007, 12:36 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
More codec related Resources. Clean site!
http://www.free-codecs.com/Sherlock_The ... wnload.htm
http://www.free-codecs.com/index.htm

I have no grasp of what the issues or fixes may be. Good luck.
As an aside, I've seen comments here in the Forum where something does not work in Opus preview mode, but magically works correctly once published and opened/viewed.

You might find some tech talk at MS site. --- msdn2.microsoft.com/en-us/library/ms867170.aspx or a search there.

Lar

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: July 16th, 2007, 9:05 pm 
Offline

Joined: May 12th, 2006, 6:39 pm
Posts: 9
Location: Canada
The answer to my problem was simple enough (as it usually turns out to be!!!)

I still have the same problem with the 'Chroma Key' setting. I cannot use the 'seek' or 'Go' function effectively, so I had to use the 'On Top' mode. The good news is that only one object can have the status 'On Top', so with that in mind, when the video is at a point where the presenter wants to draw on top of it, it opens a second video object.

The second video is also set to 'On Top'. So I now have two video objects set to the same moment in time, except, only one is on top. Now I can use command line screen capture software to take an image of the video NOT 'On Top'. This is then saved to the local computer and immediately loaded into an image object. Now I hide the video objects and the presenter can draw away to their hearts content on the jpeg image!

There always seems to be a way, it justs take a while to get there sometimes!

Again, many thanks for help and advice offered.

_________________
Si Goldring
Canada

Opus Pro XE 5.5
(1) Windows XP Pro SP2; Intel Core2 6600; 2GB RAM
(2) Toshiba A70 Sat; Pentium4 3.06GHz; 1GB RAM; Windows XP SP2


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group