Video Refereeing for Fencing

This forum is about all development around libVLC.
maitrepiet
Blank Cone
Blank Cone
Posts: 69
Joined: 27 Oct 2009 14:44

Video Refereeing for Fencing

Postby maitrepiet » 21 Dec 2009 08:42

Hi,
I'm trying to create a video-refereeing application for fencing. I've browsed through the VLC documentation and I did some initial experiments.
I'm quite certain I can do what I want with VLC. However, it has been a while since I did some serious programming, so I would need a little help to get started. I hope this is the right place.

I'll first give some background on what I try to achieve, and then I'll get more concrete regarding the help I need.

In modern fencing, the two fencers are connected to a central scoring machine. This machine detects if a hit is scored by one fencer. It also checks if the hit was made on valid surface.
The central machine indicates a hit by lighting a lamp on the side of the fencer who made the hit. If it is a valid hit, a colored(red or green) lamp is lit, for non-valid, it is a whithe lamp.
For foil and sabre, the referee has to decide which fencer has priority, in case of double hits.
This is where the video arbitrage comes in: to help the referee in making correct decisions about priority, the actions are recorded in HD video. As the fencers move along the piste, it is not allways possible to see both the central machine (with the lamps) and the fencers.
Therefore, the lamps are inserted digitally into video stream, based on the signals of the central machine.
After a hit, the last few seconds before the hit, are played back at normal or at half the speed.

I have designed my own central scoring machine that can communicate with a PC through the serial port. So the machine can tell the PC which fencer made a hit at what time, and id it was valid or not.
So I need a small (console) apllication on a PC running Windows (XP) that on one hand communicates with the central box through a serial port, and on the other hand can send commands to VLC via a remote interface.
These commands would typically be:
start recording
insert a subpicture for the lamps
stop recording
jump back 5 seconds
play at half the speed.

I guess all this can easily be done.

Could someone get me started by providing me with some C++ code (and some recommendations for a free C++ compiler) for a console app that can send comands to the VLC remote interface? Once I have this, I'll be able to code the rest.

I would really appreciate a lot.

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: Video Refereeing for Fencing

Postby Jean-Baptiste Kempf » 22 Dec 2009 09:30

First don't use com interface, but use the http/xml-requests interface to control VLC.

What I don't understand is the subpicture of lamps... I don't get what you want at the end.
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.

maitrepiet
Blank Cone
Blank Cone
Posts: 69
Joined: 27 Oct 2009 14:44

Re: Video Refereeing for Fencing

Postby maitrepiet » 22 Dec 2009 12:56

The scoring machine has lamps to indicate if a hit has been made.
e.g. if the left fencer score a valid hit the red lamp lights on the left. If right scores a valid hit, the green lamp lights on the right.
It is important for the referee to see the exact moment at which the lights go on. As the camera follows the fencers, it is not always possible to see both the action and the lamps on the video.

This is why I need to connect the scoring machine to the PC, to send messages that a hit was made.
If a hit is scored, I want to overlay the video with a colored rectangle to mimic the lamps on the scoring machine.
So if the referee watches the video afterwards, the information of the lamps is still available.

In summary the idea is as follows:
Record the incoming video stream
if a hit is made, insert a colored rectangle into the video stream
continue recording a few seconds
then jump back to 5 seconds before the hit
playback at half speed

Does that make sense?

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: Video Refereeing for Fencing

Postby Jean-Baptiste Kempf » 22 Dec 2009 16:10

Yes. You need to add a video_filter2 in VLC.
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.

maitrepiet
Blank Cone
Blank Cone
Posts: 69
Joined: 27 Oct 2009 14:44

Re: Video Refereeing for Fencing

Postby maitrepiet » 16 Jan 2010 17:36

Hi,
I'm trying to capture a DV stream from my DV-camera, add some dynamic marquee text to it, and record it into a file. Marquee text would be changed via the RC.

I use this command line:
vlc.exe --extraintf oldrc --rc-host 127.0.0.1:12345 --sub-filter=marq --marq-marquee="Obvious Watermark" --marq-position=0 --marq-size=50 --marq-opacity=225 --marq-color=32768 dshow:// --dshow-vdev="Sony HDR-HC5E" --dshow-adev=none --sout "#std{access=file,mux=ts{pcr=100},dst=C:\Users\Piet\vlc-1.1.0-git\video.mpg}:#display"

But the recorded file does not have the marquee text in it.

What am I missing?

Ideally I would like to add logo's dynamically but that doesn't seem to work at all.

Piet


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 58 guests