? Dynamic Overlays - lines/text/etc ?

*nix specific usage questions
Z-Knight
New Cone
New Cone
Posts: 4
Joined: 21 Jun 2007 00:48

? Dynamic Overlays - lines/text/etc ?

Postby Z-Knight » 02 Jul 2007 18:59

I'm sorry if this is not the proper forum (not sure this is the developer forum or not), but I have a question about overlays. I'm trying to build a tool that can playback a video stream, both from files and from a direct video input, and also the ability to overlay text and graphics over the video. By text I mean dynamic changing text, such as telemetry and by graphics I mean things like a heads-up-display that could also be dynamic/changing. Furthermore, I want to be able to allow the user to click over the video and have the location of the click show up as a dot in the video.

So the question I have is, whether this is possible with the VLC code and/or if someone has done this before or if there are examples of these kinds of capabilities. This is my first post so if this is not the location to post it then can you direct me where I should?

Thanks,

Mario

Z-Knight
New Cone
New Cone
Posts: 4
Joined: 21 Jun 2007 00:48

Re: ? Dynamic Overlays - lines/text/etc ?

Postby Z-Knight » 01 Aug 2007 17:46

any comments? am I at the wrong forum? Where should I ask this question? anything?

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: ? Dynamic Overlays - lines/text/etc ?

Postby dionoea » 07 Aug 2007 16:44

Hehe, a current google summer of code project (for VLC) is named "Dynamic Overlay" :D

With "normal" VLC you can use the logo and marq filters to display images and text (and update those using the rc interface ... but it's not really friendly).

With avacore's project, you'll be able to create your own application which will then talk to a VLC filter and tell it where to put images and text, move those arround and change a bunch of parameters. This is still work in progress but testers are more than welcome.
The project's wiki page is: http://wiki.videolan.org/SoC_2007_Proje ... o_Overlays
The code is hosted in our VLC SoC git repository: http://git.videolan.org/cgi-bin/gitweb. ... ore_branch

It currently only works on Linux (which should be ok for you I guess :) ). The VLC filter will be default compiled. Then you can go in the extras/ directory and run "make overlay-test" to compile the test program. Just run the test program to see what command line args you need to pass to VLC (You'll also need one call to mkfifo ... at least I did). The current demo only shows what you can do with images. avacore will commit the text related stuff soon.

Comments (for example on the wiki page's talk page) would be more than welcome.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Z-Knight
New Cone
New Cone
Posts: 4
Joined: 21 Jun 2007 00:48

Re: ? Dynamic Overlays - lines/text/etc ?

Postby Z-Knight » 08 Aug 2007 21:14

Thanks a lot...I'll definitely look into it.

drakkan
New Cone
New Cone
Posts: 2
Joined: 20 Sep 2007 09:26

Re: ? Dynamic Overlays - lines/text/etc ?

Postby drakkan » 20 Sep 2007 10:23

I'm interested in dynamic overlay too,

I downloaded the soc branch but I'm unable to compile it,

here is the error:

Code: Select all

i586-pc-linux-gnu-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -DSYS_LINUX -I../../include -I/vlcsvn/include -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE -DLOCALEDIR=\"/usr/share/locale\" -DDATA_PATH=\"/usr/share/vlc\" -DPLUGIN_PATH=\"/vlcsvn/lib/vlc\" -O0 -D__LIBVLC__ -D__PLUGIN__ -DMODULE_NAME=i420_yuy2_mmx -DMODULE_NAME_IS_i420_yuy2_mmx -fvisibility=hidden -fomit-frame-pointer -Wall -Wextra -Wno-unused-parameter -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wold-style-definition -Wmissing-prototypes -Wvolatile-register-var -MT libi420_yuy2_mmx_plugin_la-i420_yuy2.lo -MD -MP -MF .deps/libi420_yuy2_mmx_plugin_la-i420_yuy2.Tpo -c i420_yuy2.c -fPIC -DPIC -o .libs/libi420_yuy2_mmx_plugin_la-i420_yuy2.o i420_yuy2.c: In function 'I420_YUY2': i420_yuy2.c:292: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm' make[4]: *** [libi420_yuy2_mmx_plugin_la-i420_yuy2.lo] Error 1 make[4]: Leaving directory `/tmp/vlc-soc/modules/video_chroma' make[3]: *** [all-modules] Error 1 make[3]: Leaving directory `/tmp/vlc-soc/modules/video_chroma' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/tmp/vlc-soc/modules' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/vlc-soc' make: *** [all] Error 2
on the same hardware with the same compile options 0.8.6c compile fine,

can you give me a suggestion?

thanks
drakkan

atom
New Cone
New Cone
Posts: 2
Joined: 03 May 2008 17:39

Re: ? Dynamic Overlays - lines/text/etc ?

Postby atom » 03 May 2008 17:49

Hi, I am trying to achieve similar thing as "Z-Knight" - basically to get a video (MPEG-4 SP) from camera showing a robot, add some image overlay (e.g., the trajectory robot is following), and stream this to clients (using rtsp, or anything else). The problem is, that I am not able to find any information how to add dynamic overlays to the video. I am even not able to find the code from the "Dynamic Overlays GSoC" project. So, please, what should I do, download or code to the VideoLAN to make dynamic overlays working?
Many thanks in advance...

Z-Knight
New Cone
New Cone
Posts: 4
Joined: 21 Jun 2007 00:48

Re: ? Dynamic Overlays - lines/text/etc ?

Postby Z-Knight » 01 Jul 2008 20:37

has anyone had success with overlays or has any new news?

I was hoping the Summer of Code project would be further along but I don't know if it is since it hasn't been updated.

rarchive
New Cone
New Cone
Posts: 6
Joined: 16 Jul 2008 09:55

Re: ? Dynamic Overlays - lines/text/etc ?

Postby rarchive » 16 Jul 2008 11:37

i didnt find the vlc "Project for Dynamic Overlays" which was supposed to be in soc.vlc.git !!!

have u tested dynamicoverlay in latest vlc.git ???

i was trying to test overlay with vlc/test/overlay-test.c but i dont know and have idea about command-fifo and response-fifo !!!

any one knows?

westmdflounder
Blank Cone
Blank Cone
Posts: 11
Joined: 26 Dec 2008 22:33

Re: ? Dynamic Overlays - lines/text/etc ?

Postby westmdflounder » 29 Dec 2008 02:28

I'm far from an expert, so forgive anything I say that seems bogus. But, I have made the text overlay part of this work and will offer a bit of novice information. Me being the novice. Also, be warned up front, to use the dynamic overlay module, you will have to write a program that feeds information to vlc on what, where, and how to display the information. The overlay-test.c program will give you the basics. More on that later. First, here's a short explanation of what's what.

command-fifo and response-fifo are special files that allow for the communication to and from vlc. For this to work you must include a sfilter like --sub-filter overlay{input=command-fifo,output=response-fifo}. Replace command-fifo and response-fifo with whatever you like. command-fifo could be 'bob' and response-fifo could be 'jill'. It really doesn't matter as long as they are unique file names. vlc will create these two special files when it starts up. One important fact is that you must give them a path to a place where the user running vlc can create files.

To see dynamic overlays work, you must compile vlc/test/dynamicoverlay/overlay-test.c. And, vlc must be running before you run the overlay-test program with:
--sub-filter overlay{input=overlay_input,output=overlay_output}

In this example 'overlay_input' and 'overlay_output' are were arbitrarily chosen by me. There is nothing sacred about their names as long as they are unique and running in a directory that the vlc user can create files within.

In my example you would run the test program as follows, while watching the stream (so that you can view the results).
./overlay-test overlay_input overlay_output

If the files don't open properly, you might see the error 'Opening FIFOs... failed'. If everything goes well, you will see different status information as this program executes.

At this point you will see four green/yellow boxes move around the screen. Then, after a few moments, you will see the text 'Hello world!' display in the upper left hand corner of the screen. It will fade in and fade out. The program will stop running and the text and green/yellow boxes will disappear.

There are a few things buggie about the test program, but hopefully if you get this far you can figure them out. It runs through the majority of the commands you will need to write your own program. I took overlay-test.c and changed it to handle what I wanted.

Hope this helps.

sly078
Blank Cone
Blank Cone
Posts: 21
Joined: 29 Dec 2008 12:29

Re: ? Dynamic Overlays - lines/text/etc ?

Postby sly078 » 29 Dec 2008 13:14

Hi,

Firstly, I explain what I want to do. I want to add an overlay on a frame of a video (for exemple a circle around an object to underline it) and I want that the video pauses on this frame during few seconds.

I try to use the logo and marq VLC's filters and it is nearly what I want to have. Logo filter has 2 drawbacks : it displays the logo on all the duration of the video and .. it is a logo ! I explain : I would like to see normaly what is inside the circle and I don't find how do to that with logo filter (Is it possible that the picture file representing the logo is just the circle and not a circle filled in white or another color ?).

A way to add a pause on a video is to add identical frames in the video. Is it possible with VLC ? Is there another way to make a pause on a video with VLC ?

Can the dynamic overlay project achieve these tasks ?

A different way to do that is to decode the video, modify the right frame, duplicate it and recode the video. If I found a fast way to do that it will also be great. So, is it possible to extract a frame from a video with VLC ?

Thanks,

Sly

PS : I thought my question was related on this topic but I work on windows. Please tell me if I have to create a new post in another forum.

sly078
Blank Cone
Blank Cone
Posts: 21
Joined: 29 Dec 2008 12:29

Re: ? Dynamic Overlays - lines/text/etc ?

Postby sly078 » 30 Dec 2008 09:46

I went deeper in the use of logo filter. The first problem I have is that I can't create transparencies image to display it as a logo overlay. I always have a white box for a background behind my logo. Does anyone know how to solve this problem ?

Secondly, I tip the command line : vlc --sub-filter logo --logo-file logo2.png,5000,100;logo1.png,5000,100 --logo-repeat 2 myvideo.mpg

On my new video, logo1 is displayed during 5 seconds, then logo2 is displayed during 5 seconds and it repeats (logo 1, logo 2, ...). I know, in the command line logo2 is before logo1 but in the video the order is right... It is the first strange thing. I tried different values of logo-repeat parameter. With 0, no logo is displayed, with 1 only logo1 is displayed on the beginning of the video and with 2 and more, logos are displayed repeatedly. It is another strange behaviour.

I recall that I want my logo appears at a certain moment in my video and disapears few seconds later. So, logo1 is an empty logo and logo2 is the logo I want to display.

I hope someone will be able to help me.

Thanks,

Sly

PS : I use VLC 0.8.6.c. May be, in the latest version of VLC, logo has more options (like the time of beginnig of logo apparition in the video) ?

westmdflounder
Blank Cone
Blank Cone
Posts: 11
Joined: 26 Dec 2008 22:33

Re: ? Dynamic Overlays - lines/text/etc ?

Postby westmdflounder » 31 Dec 2008 04:03

I would definitely upgrade to a 0.9x version. The syntax is different after 0.9.0.

If you haven't already, you might want to read this page.
http://wiki.videolan.org/Documentation:Modules/logo

Transparent png files most certainly work in the latest versions. I don't if there were issues in 0.8.6.

sly078
Blank Cone
Blank Cone
Posts: 21
Joined: 29 Dec 2008 12:29

Re: ? Dynamic Overlays - lines/text/etc ?

Postby sly078 » 31 Dec 2008 10:26

Thanks westmdflounder, I have seen some pages but not this one.

I tried with the latest verson (0.9.8a). Apart from the syntax, nothing seems to be different. I have the same result. Just, with the last version, at the beginning of the video, the title of the video is displayed during 5 seconds. Is it possible to disable that ?

I have some precisions about logo-repeat parameter : -1 loops on the logos (it's ok) ; with 0 no logo is displayed (it's ok ?) ; with 1 only the second logo is displayed at the beginning (where is the first logo ?) ; with 2 the logos displayed are 2,1,2 (where is the first first logo ?) ; with 3 I have 2,1,2,1,2 (same question) etc.

About transparent png, they work with version 0.8.6. That was me who didn't create it correctly.

I will try to see if transcoding is faster with the latest version or not...

Sly

sly078
Blank Cone
Blank Cone
Posts: 21
Joined: 29 Dec 2008 12:29

Re: ? Dynamic Overlays - lines/text/etc ?

Postby sly078 » 31 Dec 2008 14:49

I tried to transcode my videos with the latest version and it bugs. What was not the case with version 0.8.6. I tried to find the best quality it is possible to have. Over 1024 kbits/s videos are all the same (and a little bit worse that the original). Is it an official limitation ?

Last question : is it possible to direclty transcode the video in a DVD compliant format in order to avoid another step of transcoding when a DVD is created. Please tell me where can I find these informations or where do I have to ask theses questions to have some answers :(

tamiro44
Cone that earned his stripes
Cone that earned his stripes
Posts: 131
Joined: 15 Feb 2009 15:21

Re: ? Dynamic Overlays - lines/text/etc ?

Postby tamiro44 » 18 Mar 2009 09:15

Hi,
Is there a way to write telemetry on video from stream (RTP)?

Thanks,
Tamiro.

SergioTCG
Blank Cone
Blank Cone
Posts: 15
Joined: 04 Oct 2006 21:34

Re: ? Dynamic Overlays - lines/text/etc ?

Postby SergioTCG » 23 Mar 2010 15:03

Hello,

did anyone get the dynamic overlay module working on Windows, or is the module strictly Linux-based?

Any help would be well appreciated,

Thank you

tamiro44
Cone that earned his stripes
Cone that earned his stripes
Posts: 131
Joined: 15 Feb 2009 15:21

Re: ? Dynamic Overlays - lines/text/etc ?

Postby tamiro44 » 23 Mar 2010 16:40

Do you interesting in text only?


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 3 guests