Real-time cropping in browser

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
WpgCameraMan
New Cone
New Cone
Posts: 4
Joined: 24 Dec 2006 20:24

Real-time cropping in browser

Postby WpgCameraMan » 29 Mar 2009 07:08

I've been knocking myself out on this for a week, and I'm not getting anywhere.

I'm trying to do some re-sizing/cropping of VLC using the plugin for Firefox. I've got all the latest versions.

Here's the scoop. I have a camera trained on a digital clock in my house. It's a standard 4:3 video camera, using a capture card, streaming out over a closed network. The streaming part is all working very well. However, cropping and zooming of this image to JUST send out the clock is not possible (it just isn't, trust me).

Via my browser at work, I want to take that stream, and be able to manipulate that stream visually in various ways. I want to be able to change the size (zoom), and mask out all the other crap aside from the actual clock.

Now this DOES work when I open the plugin, I can size/crop/mask as I like. Problem is, I have to close the embedded object, then open it again when I make any changes.

This code here:

Code: Select all

<button id="DSK_Hid3" style=" text-align: center ; position: absolute; left:180px; top:320px; width:60px; height:90px" onclick="vlc.video.crop('100x100+0+80');">crop</button>
does not work, in fact, it crashes my browser.

What I want to do is be able to change all these parameters without having to close & open the VLC plugin. I have to fine-tune these numbers while seeing the results on the screen, so obviously changing this and waiting for the stream to kick in again to see if the numbers were right is a serious pain.

In most cases, I know exactly how big the player window needs to be, it's a matter of selecting the right x1/y1/x2/y2 values to get the clock to fit in that known size.

I'm also playing around with the idea of a 'drag-box' , so I click and drag a selection box over the video I want to fit. That might also work as well.

If you look at Media Player Classic, using the numeric key pad, you can do the same thing I'm trying to make happen.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Real-time cropping in browser

Postby Jean-Baptiste Kempf » 29 Mar 2009 13:00

VLC keys don't work?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

WpgCameraMan
New Cone
New Cone
Posts: 4
Joined: 24 Dec 2006 20:24

Re: Real-time cropping in browser

Postby WpgCameraMan » 29 Mar 2009 20:29

VLC keys don't work?
Doesn't seem like the hotkeys work for the Mozilla Plugin. I think I'll have to figure out my geometry using a normal-sized screen, then drag a selection rectangle over that. I'll come up with something, just wish I could set some numbers while the stream is playing.

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: Real-time cropping in browser

Postby revolunet » 31 Mar 2009 10:14

you have to use the 'crop=' option when you open the stream. (you can test on http://www.revolunet.com/static/downloa ... anced.html )

But you cant do this 'LIVE' except with hotkeys maybe, but hotkeys in browsers is hasardous
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 31 guests