Getting statistics in VLC

VLC for Android and Chrome OS specific usage questions
shingaridavesh
New Cone
New Cone
Posts: 3
Joined: 17 Mar 2015 01:19

Getting statistics in VLC

Postby shingaridavesh » 20 Mar 2015 20:59

Hi

I am using VLC on Nexus 5 for my research. In my desktop VLC, I can see Statistics displaying Decoded, Displayed, Lost frames, Bitrate etc. information under Current Media Information.
Can I get similar statistics in VLC for Android.

Any guidance about where the code should be inserted or where it is present in Windows VLC would be of great help.

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Getting statistics in VLC

Postby edwardw » 21 Mar 2015 01:23

It's not supported out of the box. If you are feeling adventurous, you can try recompiling, enable it, and make it function, but it will require some work. See http://wiki.videolan.org/AndroidCompile

shingaridavesh
New Cone
New Cone
Posts: 3
Joined: 17 Mar 2015 01:19

Re: Getting statistics in VLC

Postby shingaridavesh » 24 Mar 2015 12:16

Thanks for reply. I implemented the following in decoder.c

static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
picture_t *p_pic;
int i_lost = 0;
int i_decoded = 0;
int i_displayed = 0;
static int sum_decoded =0;
static int sum_lost =0;
static int sum_displayed =0;



while( (p_pic = p_dec->pf_decode_video( p_dec, &p_block )) )
{
vout_thread_t *p_vout = p_owner->p_vout;
if( DecoderIsExitRequested( p_dec ) )
{
/* It prevent freezing VLC in case of broken decoder */
picture_Release( p_pic );
if( p_block )
block_Release( p_block );
break;
}

i_decoded++;

if( p_owner->i_preroll_end > VLC_TS_INVALID && p_pic->date < p_owner->i_preroll_end )
{
picture_Release( p_pic );
continue;
}

if( p_owner->i_preroll_end > VLC_TS_INVALID )
{
msg_Dbg( p_dec, "End of video preroll" );
msg_Dbg(p_dec, "****************Davesh Here***************\n");
msg_Dbg(p_dec, "Decoded Video = \t%d\n", sum_decoded);
msg_Dbg(p_dec, "Lost Video = \t%d\n", sum_lost);
msg_Dbg(p_dec, "Displayed Video = \t%d\n", sum_displayed);

if( p_vout )
vout_Flush( p_vout, VLC_TS_INVALID+1 );
/* */
p_owner->i_preroll_end = VLC_TS_INVALID;
}

if( p_dec->pf_get_cc &&
( !p_owner->p_packetizer || !p_owner->p_packetizer->pf_get_cc ) )
DecoderGetCc( p_dec, p_dec );

DecoderPlayVideo( p_dec, p_pic, &i_displayed, &i_lost );
}

/* Update ugly stat */
input_thread_t *p_input = p_owner->p_input;

if( p_input != NULL && (i_decoded > 0 || i_lost > 0 || i_displayed > 0) )
{
vlc_mutex_lock( &p_input->p->counters.counters_lock );
sum_decoded += i_decoded;
sum_lost += i_lost;
sum_displayed += i_displayed;

//msg_Dbg(p_dec, "****************Davesh with sum***************\n");
//msg_Dbg(p_dec, "Decoded Video = \t%d\n", sum_decoded);
//msg_Dbg(p_dec, "Lost Video = \t%d\n", sum_lost);
//msg_Dbg(p_dec, "Displayed Video = \t%d\n", sum_displayed);
stats_Update( p_input->p->counters.p_decoded_video, i_decoded, NULL );
stats_Update( p_input->p->counters.p_lost_pictures, i_lost , NULL);
stats_Update( p_input->p->counters.p_displayed_pictures,
i_displayed, NULL);
vlc_mutex_unlock( &p_input->p->counters.counters_lock );
}
}

Now I could see the number of frames dropped and displayed. Just posted to share and if you could suggest any better place, then that would be great.

At lower CPU frequencies, I could see Displayed Frames > Decoded Frames. Can you please explain this?

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Getting statistics in VLC

Postby edwardw » 24 Mar 2015 19:08

There is already a stats module in VLC...


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 17 guests