put text to screen from acces_demux module

This forum is about all development around libVLC.
diman23
Blank Cone
Blank Cone
Posts: 14
Joined: 23 Aug 2013 00:26
VLC version: 2.0.0
Operating System: win7 / linux
Location: Germany

put text to screen from acces_demux module

Postby diman23 » 23 Aug 2013 01:16

Hi all,

I wrote a access-demux module for DASH (yes I know there is already DASH implementation available) and I would like to print the actual Bitrate (measured by DASH client) directly on the screen from my access_demuxer.
My idea was to use marquee (marq.c) but I am not sure how to do it.

I tried to get the marquee in the open function and it seems to work

Code: Select all

someClass->p_text = (filter_t*)vlc_object_create( VLC_OBJECT(p_demux), sizeof(filter_t) ); someClass->p_text->fmt_out.video.i_width = someClass->p_text->fmt_out.video.i_visible_width = 1920; someClass->p_text->fmt_out.video.i_height = someClass->p_text->fmt_out.video.i_visible_height = 1080; someClass->p_text->p_module = module_need( someClass->p_text, "sub source", "marq", true );
but how can I print something to the screen in the demux function?

Can anyone help me? Or maybe there is another way to do it?

Thank you very much :)

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: put text to screen from acces_demux module

Postby Rémi Denis-Courmont » 23 Aug 2013 15:48

You cannot print to the screen from a demuxer. That is not how the software is architected
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

diman23
Blank Cone
Blank Cone
Posts: 14
Joined: 23 Aug 2013 00:26
VLC version: 2.0.0
Operating System: win7 / linux
Location: Germany

Re: put text to screen from acces_demux module

Postby diman23 » 23 Aug 2013 16:59

Thank you for reply

Im trying now to create my own subtitles track in order to do the same thing.

in my open functiopn I do following to initialize and add ES

Code: Select all

es_format_Init( &infoSubtitle.fmt, SPU_ES, VLC_FOURCC( 's','u','b','t' ) ); infoSubtitle.fmt.i_codec = VLC_FOURCC( 's','u','b','t' ); infoSubtitle.fmt.subs.psz_encoding = strdup( "UTF-8" ); infoSubtitle.fmt.subs.i_x_origin = 100; infoSubtitle.fmt.subs.i_y_origin = 100; infoSubtitle.fmt.i_id = 1; infoSubtitle.fmt.i_priority = 2; infoSubtitle.fmt.i_cat = SPU_ES; infoSubtitle.p_es = es_out_Add( p_demux->out, &infoSubtitle.fmt );
in the demuxer I should be able to create a new block fill it with some text and send it to the decoder right?

Code: Select all

unsigned char test[5] = {'T','E','S','T','\0'}; i_sampleSize = sizeof(test); block_t *p_block = block_New( 0, i_sampleSize ); if(p_block) { p_block->i_buffer = i_sampleSize; p_block->p_buffer = test; p_block->i_dts = /*some Value*/; p_block->i_pts = /*some Value*/; es_out_Send( pcDemuxer->out, tk->p_es, p_block ); }
after I select a subtitle Track from VLC UI I can read the debug messages from subsdec module:
subsdec decoder debug: parsing subtitle text
subsdec decoder debug: some iconv_test
subsdec decoder debug: finished parsing

subsdec decoder debug: stripping subtitle text: HALO
subsdec decoder debug: return subtitle text: HALO
subsdec decoder debug: stripping subtitle text: HALO
subsdec decoder debug: return subtitle text: HALO
subsdec decoder debug: returning SPU text "HALO" from ParseText()

but I cant see anything on the screen :(
any Ideas?

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: put text to screen from acces_demux module

Postby Rémi Denis-Courmont » 24 Aug 2013 11:10

Check what the other demuxer do. You probably screwed up some parameters.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

diman23
Blank Cone
Blank Cone
Posts: 14
Joined: 23 Aug 2013 00:26
VLC version: 2.0.0
Operating System: win7 / linux
Location: Germany

Re: put text to screen from acces_demux module

Postby diman23 » 30 Aug 2013 16:17

all parameters were sufficient I just put wrong pts and dts to the block. :)
everything works fine now.

diman23
Blank Cone
Blank Cone
Posts: 14
Joined: 23 Aug 2013 00:26
VLC version: 2.0.0
Operating System: win7 / linux
Location: Germany

Re: put text to screen from acces_demux module

Postby diman23 » 02 Sep 2013 13:07

I have another question about formatting subtitles:
I just want to change the position of subtitles or the size. But setting subs_format_t has no effect,
I also tried to use
es_out_Control( p_demux->out, ES_OUT_SET_ES_FMT, pcThis->p_infoTrack->p_es, &pcThis->p_infoTrack->fmt );
but nothin helps. can someone help me please

diman23
Blank Cone
Blank Cone
Posts: 14
Joined: 23 Aug 2013 00:26
VLC version: 2.0.0
Operating System: win7 / linux
Location: Germany

Re: put text to screen from acces_demux module

Postby diman23 » 03 Sep 2013 14:21

of course I can change the properties of text rendering in advanced options. But I wonder why there are those members in subs_format_t ( i_x_origin and i_y_origin ) if they have no effect :(

diman23
Blank Cone
Blank Cone
Posts: 14
Joined: 23 Aug 2013 00:26
VLC version: 2.0.0
Operating System: win7 / linux
Location: Germany

Re: put text to screen from acces_demux module

Postby diman23 » 03 Sep 2013 16:28

I don't want to waste my time to figure out how the text renderer is setting its parameters, so setting --freetype-color 0 --freetype-rel-fontsize 40 is much easier way.
and --subsdec-align 1 puts them to bottom left corner. (I have no idea if it is possible to put them to upper left or right position) :oops:

bharmel
New Cone
New Cone
Posts: 7
Joined: 05 Sep 2013 16:29

Re: put text to screen from acces_demux module

Postby bharmel » 06 Sep 2013 13:30

Hi,

I have try to use your code to display something from my demus but vlc does not seem to know that my stream contains a subtitles.
Is there something to do to activate the subtitle engine and make the subtitle visible ?

Best regards

diman23
Blank Cone
Blank Cone
Posts: 14
Joined: 23 Aug 2013 00:26
VLC version: 2.0.0
Operating System: win7 / linux
Location: Germany

Re: put text to screen from acces_demux module

Postby diman23 » 07 Sep 2013 03:25

vlc does not seem to know that my stream contains a subtitles.
Best regards
Hi
what do you mean exactly? Did you check the loggs? does VLC open some subtitle decoder after you add elem. stream? Or did you just forgot to enable subtitles Track?
after setting es_format_t and call to es_out_Add(...) vlc should open a subtitles "decoder" which can handle the rest (e.g. render text)


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests