Page 1 of 1

put text to screen from acces_demux module

Posted: 23 Aug 2013 01:16
by diman23
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 :)

Re: put text to screen from acces_demux module

Posted: 23 Aug 2013 15:48
by Rémi Denis-Courmont
You cannot print to the screen from a demuxer. That is not how the software is architected

Re: put text to screen from acces_demux module

Posted: 23 Aug 2013 16:59
by diman23
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?

Re: put text to screen from acces_demux module

Posted: 24 Aug 2013 11:10
by Rémi Denis-Courmont
Check what the other demuxer do. You probably screwed up some parameters.

Re: put text to screen from acces_demux module

Posted: 30 Aug 2013 16:17
by diman23
all parameters were sufficient I just put wrong pts and dts to the block. :)
everything works fine now.

Re: put text to screen from acces_demux module

Posted: 02 Sep 2013 13:07
by diman23
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

Re: put text to screen from acces_demux module

Posted: 03 Sep 2013 14:21
by diman23
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 :(

Re: put text to screen from acces_demux module

Posted: 03 Sep 2013 16:28
by diman23
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:

Re: put text to screen from acces_demux module

Posted: 06 Sep 2013 13:30
by bharmel
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

Re: put text to screen from acces_demux module

Posted: 07 Sep 2013 03:25
by diman23
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)