To see stats,audio & video during streaming from rc interfac

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

To see stats,audio & video during streaming from rc interfac

Postby anoopvuppala » 17 Apr 2011 19:20

Hej,
I want to view the statistics in a console for that i am using "vlc --intf rc" and another window opens,there I am using stats but a reply like this appears "stats:returned (no error)"----------1)what i have to do now to view the statistics in console.

2) when i am using this command "vlc filename input_stream --sout "#std{access=udp,mux=ts,dst=194.47.147.138:1234}:display{audio,video,delay=5ms}" i am able to stream and can see video on receiving side but my problem is i am not able to see them on streaming side. so can anyone tell me what are the modifications to be done to the command to see the audio and video on streaming side

3) when i am using this command vlc --intf rc another window opens and there i have to type "stats" for viewing the statistics but is there any direct command to see the statistics directly in command line.
thanks and regards,
anoop vuppala

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 18 Apr 2011 16:20

2. It would help us if you told how you try to open the video in client.

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 18 Apr 2011 19:38

i used this command "vlc udp://@:1234" to view the video from client side but here also i am not able to view the statistics by using stats command --intf rc interface.

please guide me what i have to add to the command to view the statistics on both side

one more thing yesterday i used this command "vlc filename input_stream "#std{access=udp,mux=ts,dst=194.47.147.138:1234}" --intf rc and the video opens with a title like this "vlc (hardware YUV overlay DirectX output)" and also an rc interface open where i gave command stats and i got everything over there but i am not able to transmit i mean the video is not opened in client side.

please help me,
thanks and regards,
anoop vuppala

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 19 Apr 2011 16:45

Is the 194.47.147.138 address of client?

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 19 Apr 2011 18:05

Is the 194.47.147.138 address of client?
yes

its a client address and more over can you help me with my problem

thanks and regards,
anoop vuppala.

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 20 Apr 2011 03:15

Is the 194.47.147.138 address of client?
yes

its a client address and more over can you help me with my problem

thanks and regards,
anoop vuppala.
hey,
-> few of my problems were solved i can see audio and video on client with statistics using a modified command
client side:vlc udp://@:1234 --intf rc
-> when coming to streaming side i can see only statistics of input bitrate but no audio and video and the command is
streaming side: vlc filename,location and format --sout "#std{access=udp,mux=ts,dst=ip address of client:portnumber}" --intf rc
-> when i use this command i can view the statistics of all the things but its not receiving on client side.
streaming side: vlc filename,location and format --sout-all "#std{access=udp,mux=ts,dst=ip address of client:portnumber}" --intf rc
the problem left was
-> what are the modifications to be done to the command to get audio and video on streaming side
-> i want to store the statistics obtained in "--intf rc" interfaceand how can i do that

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 20 Apr 2011 13:13

I haven't used the statistics option so I cannot help you with those.

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 20 Apr 2011 23:20

I haven't used the statistics option so I cannot help you with those.
ok then, but can you help me whats the problem that why i am not able to see audio and video on streaming side when i use this command "vlc filename input_stream "#std{access=udp,mux=ts,dst=194.47.147.138:1234} --intf rc" please still what i had to add or remove to this command.
thanks and regards,
anoop vuppala.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 21 Apr 2011 13:41

filename input_stream
you have two inputs you want to play?

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 21 Apr 2011 19:24

filename input_stream
you have two inputs you want to play?
i didn't got you and my problem was solved.

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 22 Apr 2011 18:44

filename input_stream
you have two inputs you want to play?
i didn't got you and my problem was solved.
i used transcode function along with std in command line to see audio and video on streaming side
-> one more thing left was that is there any where in the source code to put a function so that it will call some functions every minute so that i can print the statistics to a file.

thanks and regards,

anoop vuppala

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 23 Apr 2011 14:48

one more thing left was that is there any where in the source code to put a function so that it will call some functions every minute so that i can print the statistics to a file.
You can modify statistics writing function and add new thread there that uses mwait.
http://git.videolan.org/?p=vlc.git;a=tr ... misc/stats it might be that, or not.

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 23 Apr 2011 16:54

/*****************************************************************************
* infopanels.cpp : Panels for the information dialogs
****************************************************************************
* Copyright (C) 2006-2007 the VideoLAN team
* $Id: 2b35cdb599a2869f9540b6e617d53a16d1dd9b5d $
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org>
* Ilkka Ollakka <ileoo@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include "qt4.hpp"
#include "components/info_panels.hpp"
#include "components/interface_widgets.hpp"
#include <conio.h>
#include <stdio.h>
#include <time.h>
#include <assert.h>
#include <vlc_url.h>
#include <vlc_meta.h>

#include <QTreeWidget>
#include <QHeaderView>
#include <QList>
#include <QStringList>
#include <QGridLayout>
#include <QLineEdit>
#include <QLabel>
#include <QSpinBox>

/************************************************************************
* Single panels
************************************************************************/

/**
* First Panel - Meta Info
* All the usual MetaData are displayed and can be changed.
**/
MetaPanel::MetaPanel( QWidget *parent,
intf_thread_t *_p_intf )
: QWidget( parent ), p_intf( _p_intf )
{
QGridLayout *metaLayout = new QGridLayout( this );
metaLayout->setVerticalSpacing( 12 );

int line = 0; /* Counter for GridLayout */
p_input = NULL;

#define ADD_META( string, widget ) { \
metaLayout->addWidget( new QLabel( qtr( string ) + " :" ), line, 0 ); \
widget = new QLineEdit; \
metaLayout->addWidget( widget, line, 1, 1, 9 ); \
line++; }

/* Title, artist and album*/
ADD_META( VLC_META_TITLE, title_text ); /* OK */
ADD_META( VLC_META_ARTIST, artist_text ); /* OK */
ADD_META( VLC_META_ALBUM, collection_text ); /* OK */

/* Genre Name */
/* TODO List id3genres.h is not includable yet ? */
genre_text = new QLineEdit;
metaLayout->addWidget( new QLabel( qtr( VLC_META_GENRE ) + " :" ), line, 0 );
metaLayout->addWidget( genre_text, line, 1, 1, 3 );

/* Number - on the same line */
metaLayout->addWidget( new QLabel( qtr( VLC_META_TRACK_NUMBER ) + " :" ),
line, 5, 1, 2 );
seqnum_text = new QLineEdit;
seqnum_text->setInputMask("0000");
seqnum_text->setAlignment( Qt::AlignRight );
metaLayout->addWidget( seqnum_text, line, 7, 1, 3 );
line++;

/* Date (Should be in years) */
date_text = new QLineEdit;
date_text->setInputMask("0000");
date_text->setAlignment( Qt::AlignRight );
metaLayout->addWidget( new QLabel( qtr( VLC_META_DATE ) + " :" ), line, 0 );
metaLayout->addWidget( date_text, line, 1, 1, 3 );

/* Rating - on the same line */
/*
metaLayout->addWidget( new QLabel( qtr( VLC_META_RATING ) + " :" ), line, 4, 1, 2 );
rating_text = new QSpinBox; setSpinBounds( rating_text );
metaLayout->addWidget( rating_text, line, 6, 1, 1 );
*/
/* Language on the same line */
metaLayout->addWidget( new QLabel( qfu( VLC_META_LANGUAGE ) + " :" ), line, 5, 1, 2 );
language_text = new QLineEdit;
language_text->setReadOnly( true );
metaLayout->addWidget( language_text, line, 7, 1, 3 );
line++;

/* ART_URL */
art_cover = new CoverArtLabel( this, p_intf );
metaLayout->addWidget( art_cover, line, 8, 4, 2, Qt::AlignRight );

/* Settings is unused */
/* l->addWidget( new QLabel( qtr( VLC_META_SETTING ) + " :" ), line, 5 );
setting_text = new QLineEdit;
l->addWidget( setting_text, line, 6, 1, 4 ); */

/* Less used metadata */
#define ADD_META_2( string, widget ) { \
metaLayout->addWidget( new QLabel( qtr( string ) + " :" ), line, 0 ); \
widget = new QLineEdit; \
metaLayout->addWidget( widget, line, 1, 1, 7 ); \
line++; }

/* Now Playing - Useful for live feeds (HTTP, DVB, ETC...) */
ADD_META_2( VLC_META_NOW_PLAYING, nowplaying_text );
nowplaying_text->setReadOnly( true );
ADD_META_2( VLC_META_PUBLISHER, publisher_text );
ADD_META_2( VLC_META_COPYRIGHT, copyright_text );
ADD_META_2( N_("Comments"), description_text );

/* useless metadata */

//ADD_META_2( VLC_META_ENCODED_BY, encodedby_text );
/* ADD_META( TRACKID ) Useless ? */
/* ADD_URI - DO not show it, done outside */

metaLayout->setColumnStretch( 1, 2 );
metaLayout->setColumnMinimumWidth ( 1, 80 );
metaLayout->setRowStretch( line, 10 );
#undef ADD_META
#undef ADD_META_2

CONNECT( title_text, textEdited( QString ), this, enterEditMode() );
CONNECT( artist_text, textEdited( QString ), this, enterEditMode() );
CONNECT( collection_text, textEdited( QString ), this, enterEditMode() );
CONNECT( genre_text, textEdited( QString ), this, enterEditMode() );
CONNECT( seqnum_text, textEdited( QString ), this, enterEditMode() );

CONNECT( date_text, textEdited( QString ), this, enterEditMode() );
CONNECT( description_text, textEdited( QString ), this, enterEditMode() );
/* CONNECT( rating_text, valueChanged( QString ), this, enterEditMode( QString ) );*/

/* We are not yet in Edit Mode */
b_inEditMode = false;
}

/**
* Update all the MetaData and art on an "item-changed" event
**/
void MetaPanel::update( input_item_t *p_item )
{
if( !p_item )
{
clear();
return;
}

/* Don't update if you are in edit mode */
if( b_inEditMode ) return;
else p_input = p_item;

char *psz_meta;
#define UPDATE_META( meta, widget ) { \
psz_meta = input_item_Get##meta( p_item ); \
if( !EMPTY_STR( psz_meta ) ) \
widget->setText( qfu( psz_meta ) ); \
else \
widget->setText( "" ); } \
free( psz_meta );

#define UPDATE_META_INT( meta, widget ) { \
psz_meta = input_item_Get##meta( p_item ); \
if( !EMPTY_STR( psz_meta ) ) \
widget->setValue( atoi( psz_meta ) ); } \
free( psz_meta );

/* Name / Title */
psz_meta = input_item_GetTitleFbName( p_item );
if( psz_meta )
{
title_text->setText( qfu( psz_meta ) );
free( psz_meta );
}
else
title_text->setText( "" );

/* URL / URI */
psz_meta = input_item_GetURL( p_item );
if( !EMPTY_STR( psz_meta ) )
emit uriSet( qfu( psz_meta ) );
else
{
free( psz_meta );
psz_meta = input_item_GetURI( p_item );
if( !EMPTY_STR( psz_meta ) )
emit uriSet( qfu( psz_meta ) );
}
free( psz_meta );

/* Other classic though */
UPDATE_META( Artist, artist_text );
UPDATE_META( Genre, genre_text );
UPDATE_META( Copyright, copyright_text );
UPDATE_META( Album, collection_text );
UPDATE_META( Description, description_text );
UPDATE_META( Language, language_text );
UPDATE_META( NowPlaying, nowplaying_text );
UPDATE_META( Publisher, publisher_text );
// UPDATE_META( Setting, setting_text );
//FIXME this is wrong if has Publisher and EncodedBy fields
UPDATE_META( EncodedBy, publisher_text );

UPDATE_META( Date, date_text );
UPDATE_META( TrackNum, seqnum_text );
// UPDATE_META_INT( Rating, rating_text );

#undef UPDATE_META_INT
#undef UPDATE_META

// If a artURL is available as a local file, directly display it !

QString file;
char *psz_art = input_item_GetArtURL( p_item );
if( psz_art )
{
char *psz = make_path( psz_art );
free( psz_art );
file = qfu( psz );
free( psz );
}

art_cover->showArtUpdate( file );

}

/**
* Save the MetaData, triggered by parent->save Button
**/
void MetaPanel::saveMeta()
{
if( p_input == NULL )
return;

/* now we read the modified meta data */
input_item_SetTitle( p_input, qtu( title_text->text() ) );
input_item_SetArtist( p_input, qtu( artist_text->text() ) );
input_item_SetAlbum( p_input, qtu( collection_text->text() ) );
input_item_SetGenre( p_input, qtu( genre_text->text() ) );
input_item_SetTrackNum( p_input, qtu( seqnum_text->text() ) );
input_item_SetDate( p_input, qtu( date_text->text() ) );

input_item_SetCopyright( p_input, qtu( copyright_text->text() ) );
input_item_SetPublisher( p_input, qtu( publisher_text->text() ) );
input_item_SetDescription( p_input, qtu( description_text->text() ) );

playlist_t *p_playlist = pl_Get( p_intf );
input_item_WriteMeta( VLC_OBJECT(p_playlist), p_input );

/* Reset the status of the mode. No need to emit any signal because parent
is the only caller */
b_inEditMode = false;
}


bool MetaPanel::isInEditMode()
{
return b_inEditMode;
}

void MetaPanel::enterEditMode()
{
msg_Dbg( p_intf, "Entering Edit MetaData Mode" );
setEditMode( true );
}

void MetaPanel::setEditMode( bool b_editing )
{
b_inEditMode = b_editing;
if( b_editing )emit editing();
}

/*
* Clear all the metadata widgets
*/
void MetaPanel::clear()
{
title_text->clear();
artist_text->clear();
genre_text->clear();
copyright_text->clear();
collection_text->clear();
seqnum_text->clear();
description_text->clear();
date_text->clear();
language_text->clear();
nowplaying_text->clear();
publisher_text->clear();

setEditMode( false );
emit uriSet( "" );
}

/**
* Second Panel - Shows the extra metadata in a tree, non editable.
**/
ExtraMetaPanel::ExtraMetaPanel( QWidget *parent,
intf_thread_t *_p_intf )
: QWidget( parent ), p_intf( _p_intf )
{
QGridLayout *layout = new QGridLayout(this);

QLabel *topLabel = new QLabel( qtr( "Extra metadata and other information"
" are shown in this panel.\n" ) );
topLabel->setWordWrap( true );
layout->addWidget( topLabel, 0, 0 );

extraMetaTree = new QTreeWidget( this );
extraMetaTree->setAlternatingRowColors( true );
extraMetaTree->setColumnCount( 2 );
extraMetaTree->resizeColumnToContents( 0 );
extraMetaTree->header()->hide();
/* QStringList headerList = ( QStringList() << qtr( "Type" )
* << qtr( "Value" ) );
* Useless, add this header if you think it would help the user **
*/

layout->addWidget( extraMetaTree, 1, 0 );
}

/**
* Update the Extra Metadata from p_meta->i_extras
**/
void ExtraMetaPanel::update( input_item_t *p_item )
{
if( !p_item )
{
clear();
return;
}

QList<QTreeWidgetItem *> items;

extraMetaTree->clear();

vlc_mutex_lock( &p_item->lock );
vlc_meta_t *p_meta = p_item->p_meta;
if( !p_meta )
{
vlc_mutex_unlock( &p_item->lock );
return;
}

char ** ppsz_allkey = vlc_meta_CopyExtraNames( p_meta);

for( int i = 0; ppsz_allkey ; i++ )
{
const char * psz_value = vlc_meta_GetExtra( p_meta, ppsz_allkey );
QStringList tempItem;
tempItem.append( qfu( ppsz_allkey ) + " : ");
tempItem.append( qfu( psz_value ) );
items.append( new QTreeWidgetItem ( extraMetaTree, tempItem ) );
free( ppsz_allkey );
}
vlc_mutex_unlock( &p_item->lock );
free( ppsz_allkey );

extraMetaTree->addTopLevelItems( items );
extraMetaTree->resizeColumnToContents( 0 );
}

/**
* Clear the ExtraMetaData Tree
**/
void ExtraMetaPanel::clear()
{
extraMetaTree->clear();
}

/**
* Third panel - Stream info
* Display all codecs and muxers info that we could gather.
**/
InfoPanel::InfoPanel( QWidget *parent,
intf_thread_t *_p_intf )
: QWidget( parent ), p_intf( _p_intf )
{
QGridLayout *layout = new QGridLayout(this);

QList<QTreeWidgetItem *> items;

QLabel *topLabel = new QLabel( qtr( "Information about what your media or"
" stream is made of.\nMuxer, Audio and Video Codecs, Subtitles "
"are shown." ) );
topLabel->setWordWrap( true );
layout->addWidget( topLabel, 0, 0 );

InfoTree = new QTreeWidget(this);
InfoTree->setColumnCount( 1 );
InfoTree->setColumnWidth( 0, 20000 );
InfoTree->header()->hide();
// InfoTree->header()->setStretchLastSection(false);
// InfoTree->header()->setResizeMode(QHeaderView::ResizeToContents);
layout->addWidget(InfoTree, 1, 0 );
}

/**
* Update the Codecs information on parent->update()
**/
void InfoPanel::update( input_item_t *p_item)
{
if( !p_item )
{
clear();
return;
}

InfoTree->clear();
QTreeWidgetItem *current_item = NULL;
QTreeWidgetItem *child_item = NULL;

for( int i = 0; i< p_item->i_categories ; i++)
{
current_item = new QTreeWidgetItem();
current_item->setText( 0, qfu(p_item->pp_categories->psz_name) );
InfoTree->addTopLevelItem( current_item );

for( int j = 0 ; j < p_item->pp_categories->i_infos ; j++ )
{
child_item = new QTreeWidgetItem ();
child_item->setText( 0,
qfu(p_item->pp_categories->pp_infos[j]->psz_name)
+ ": "
+ qfu(p_item->pp_categories->pp_infos[j]->psz_value));

current_item->addChild(child_item);
}
InfoTree->setItemExpanded( current_item, true);
}
}

/**
* Clear the tree
**/
void InfoPanel::clear()
{
InfoTree->clear();
}

/**
* Save all the information to a file
* Not yet implemented.
**/
/*
void InfoPanel::saveCodecsInfo()
{}
*/

/**
* Fourth Panel - Stats
* Displays the Statistics for reading/streaming/encoding/displaying in a tree
*/
InputStatsPanel::InputStatsPanel( QWidget *parent,
intf_thread_t *_p_intf )
: QWidget( parent ), p_intf( _p_intf )
{
QGridLayout *layout = new QGridLayout(this);

QList<QTreeWidgetItem *> items;

QLabel *topLabel = new QLabel( qtr( "Current"
" media / stream " "statistics") );
topLabel->setWordWrap( true );
layout->addWidget( topLabel, 0, 0 );

StatsTree = new QTreeWidget(this);
StatsTree->setColumnCount( 3 );
StatsTree->header()->hide();

#define CREATE_TREE_ITEM( itemName, itemText, itemValue, unit ) { \
itemName = \
new QTreeWidgetItem((QStringList () << itemText << itemValue << unit )); \
itemName->setTextAlignment( 1 , Qt::AlignRight ) ; }

#define CREATE_CATEGORY( catName, itemText ) { \
CREATE_TREE_ITEM( catName, itemText , "", "" ); \
catName->setExpanded( true ); \
StatsTree->addTopLevelItem( catName ); }

#define CREATE_AND_ADD_TO_CAT( itemName, itemText, itemValue, catName, unit ){ \
CREATE_TREE_ITEM( itemName, itemText, itemValue, unit ); \
catName->addChild( itemName ); }

/* Create the main categories */
CREATE_CATEGORY( audio, qtr("Audio") );
CREATE_CATEGORY( video, qtr("Video") );
CREATE_CATEGORY( input, qtr("Input/Read") );
CREATE_CATEGORY( streaming, qtr("Output/Written/Sent") );

CREATE_AND_ADD_TO_CAT( read_media_stat, qtr("Media data size"),
"0", input , "KiB" );
CREATE_AND_ADD_TO_CAT( input_bitrate_stat, qtr("Input bitrate"),
"0", input, "kb/s" );
CREATE_AND_ADD_TO_CAT( demuxed_stat, qtr("Demuxed data size"), "0", input, "KiB") ;
CREATE_AND_ADD_TO_CAT( stream_bitrate_stat, qtr("Content bitrate"),
"0", input, "kb/s" );
CREATE_AND_ADD_TO_CAT( corrupted_stat, qtr("Discarded (corrupted)"),
"0", input, "" );
CREATE_AND_ADD_TO_CAT( discontinuity_stat, qtr("Dropped (discontinued)"),
"0", input, "" );

CREATE_AND_ADD_TO_CAT( vdecoded_stat, qtr("Decoded"),
"0", video, qtr("blocks") );
CREATE_AND_ADD_TO_CAT( vdisplayed_stat, qtr("Displayed"),
"0", video, qtr("frames") );
CREATE_AND_ADD_TO_CAT( vlost_frames_stat, qtr("Lost"),
"0", video, qtr("frames") );

CREATE_AND_ADD_TO_CAT( send_stat, qtr("Sent"), "0", streaming, qtr("packets") );
CREATE_AND_ADD_TO_CAT( send_bytes_stat, qtr("Sent"),
"0", streaming, "KiB" );
CREATE_AND_ADD_TO_CAT( send_bitrate_stat, qtr("Upstream rate"),
"0", streaming, "kb/s" );

CREATE_AND_ADD_TO_CAT( adecoded_stat, qtr("Decoded"),
"0", audio, qtr("blocks") );
CREATE_AND_ADD_TO_CAT( aplayed_stat, qtr("Played"),
"0", audio, qtr("buffers") );
CREATE_AND_ADD_TO_CAT( alost_stat, qtr("Lost"), "0", audio, qtr("buffers") );

#undef CREATE_AND_ADD_TO_CAT
#undef CREATE_CATEGORY
#undef CREATE_TREE_ITEM

input->setExpanded( true );
video->setExpanded( true );
streaming->setExpanded( true );
audio->setExpanded( true );

StatsTree->resizeColumnToContents( 0 );
StatsTree->setColumnWidth( 1 , 200 );

layout->addWidget(StatsTree, 1, 0 );
}

/**
* Update the Statistics
**/
void InputStatsPanel::update( input_item_t *p_item )
{
assert( p_item );
vlc_mutex_lock( &p_item->p_stats->lock );

#define UPDATE( widget, format, calc... ) \
{ QString str; widget->setText( 1 , str.sprintf( format, ## calc ) ); }
if (UPDATE == null)
{
File *fp;
fp = fopen ("1.txt","w");

float reme= (float)(p_item->p_stats->i_read_bytes)/1024;
float inbi= (float)(p_item->p_stats->f_input_bitrate * 8000 );
float demu= (float)(p_item->p_stats->i_demux_read_bytes)/1024 ;
int corr= p_item->p_stats->i_demux_corrupted;
int disc= p_item->p_stats->i_demux_discontinuity;
int vde = p_item->p_stats->i_decoded_video;
int vdi = p_item->p_stats->i_displayed_pictures;
int vlo = p_item->p_stats->i_lost_pictures;
int ade = p_item->p_stats->i_decoded_audio;
int apl = p_item->p_stats->i_played_abuffers;
int alo = p_item->p_stats->i_lost_abuffers;
long time_taken = clock();
time_t mytime = time(0);
char s = asctime(localtime(&mytime)));
fprintf(fp,"%s","Time");
int stat[] = {reme,inbi,demu,corr,disc,vde,vdi,vlo,ade,apl,alo};
fwrite (stat,7,sizeof(stat),fp);
}
UPDATE( read_media_stat, "%8.0f",
(float)(p_item->p_stats->i_read_bytes)/1024);
UPDATE( input_bitrate_stat, "%6.0f",
(float)(p_item->p_stats->f_input_bitrate * 8000 ));
UPDATE( demuxed_stat, "%8.0f",
(float)(p_item->p_stats->i_demux_read_bytes)/1024 );
UPDATE( stream_bitrate_stat, "%6.0f",
(float)(p_item->p_stats->f_demux_bitrate * 8000 ));
UPDATE( corrupted_stat, "%5i", p_item->p_stats->i_demux_corrupted );
UPDATE( discontinuity_stat, "%5i", p_item->p_stats->i_demux_discontinuity );

/* Video */
UPDATE( vdecoded_stat, "%5i", p_item->p_stats->i_decoded_video );
UPDATE( vdisplayed_stat, "%5i", p_item->p_stats->i_displayed_pictures );
UPDATE( vlost_frames_stat, "%5i", p_item->p_stats->i_lost_pictures );

/* Sout */
UPDATE( send_stat, "%5i", p_item->p_stats->i_sent_packets );
UPDATE( send_bytes_stat, "%8.0f",
(float)(p_item->p_stats->i_sent_bytes)/1024 );
UPDATE( send_bitrate_stat, "%6.0f",
(float)(p_item->p_stats->f_send_bitrate*8)*1000 );

/* Audio*/
UPDATE( adecoded_stat, "%5i", p_item->p_stats->i_decoded_audio );
UPDATE( aplayed_stat, "%5i", p_item->p_stats->i_played_abuffers );
UPDATE( alost_stat, "%5i", p_item->p_stats->i_lost_abuffers );

#undef UPDATE

vlc_mutex_unlock(& p_item->p_stats->lock );
}

void InputStatsPanel::clear()
{
}
i edited the source code by adding if function in line 570 and got the following errors and the modified file info_panel.cpp

errors

components/info_panels.cpp: In member function 'void InputStatsPanel::update(input_item_t*)':
components/info_panels.cpp:570: error: 'UPDATE' was not declared in this scope
components/info_panels.cpp:570: error: 'null' was not declared in this scope
components/info_panels.cpp:572: error: 'File' was not declared in this scope
components/info_panels.cpp:572: error: 'fp' was not declared in this scope
components/info_panels.cpp:586: error: 'clock' was not declared in this scope
components/info_panels.cpp:587: error: 'time_t' was not declared in this scope
components/info_panels.cpp:587: error: expected ';' before 'mytime'
components/info_panels.cpp:588: error: 'mytime' was not declared in this scope
components/info_panels.cpp:588: error: expected ',' or ';' before ')' token
make[6]: *** [components/libqt4_plugin_la-info_panels.lo] Error 1

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 24 Apr 2011 14:42

Code: Select all

if (UPDATE == null)
?

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 24 Apr 2011 22:04

Code: Select all

if (UPDATE == null)
?
update is a void function so it will not return anything so i want to check it update is null then execute the entire steps if not so i will remove null and i will call update with pointer
just like here "update( input_item_t *p_item )"
and i will declare ifdef function in info_pannels.hpp with a time_t mytime.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 25 Apr 2011 14:27

UPDATE is a macro, and it takes 3 parameters.

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 26 Apr 2011 03:50

hey thanks for the reply
i removed if condition and i am getting an error for File, fp saying that not declared in this scope so where should i have to declare them can you be specific.
thanks and regards,
anoop vuppala.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 26 Apr 2011 14:55

Where did you get the File?
Should it be FILE?
http://www.cprogramming.com/tutorial/cfileio.html

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 26 Apr 2011 16:34

Where did you get the File?
Should it be FILE?
http://www.cprogramming.com/tutorial/cfileio.html
its a text file and i want to write statistics to that file.
the problem is when i am declaring File *fp
it showing me an error saying that "File and fp were not declared in this scope"
so where should i have to declare them
please tell me

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 27 Apr 2011 15:10

#include at the beginning should make them OK.

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 27 Apr 2011 16:34

#include at the beginning should make them OK.
i declared a structure in File *fp in class infopanel and now the error is removed and i done streaming my video and i got content in the file like this
& �x�O��1W��
��O�0�� \��;I����� X�O���&'\�O��YH�!
H�O�
��1F�qD��E�D �D�@`�D`�D�@�

& �x�O��1W��
��O�0�� ��<6x����� X�O���&'\�O��Y��� H�O�anoop
ę=F�� D$�E��D��D�@ �D �D�@ '9
��
`l
�f
�tJ�
(
"
& �x�O��1W��
��O�0�� vM<�}����� X�O���&'\�O��Y0'9
i assigned the function in two different ways: the above is output for first method.
Method1:
{
FILE *fp = fopen ("/media/9C1CC0671CC03DD0/1.txt","a");
float reme = (float)(p_item->p_stats->i_read_bytes)/1024;
float stat[] = {reme};
fwrite (stat,sizeof(float),sizeof(stat),fp);
fclose(fp);
}
Method2:
FILE *fp = fopen ("/media/9C1CC0671CC03DD0/1.txt","a");
float reme = (p_item->p_stats->i_read_bytes);
fprintf(fp,"%f",&reme);
i think i am at the end i am working very hard for a simple things but even though i am not able to do.
guide me please
thanks and regards,
anoop vuppala.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 28 Apr 2011 14:00

IIRC fprintf works with variables, so something like

Code: Select all

float reme = (float)(p_item->p_stats->i_read_bytes); fprintf(fp,"%f",reme);
might work.

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 29 Apr 2011 23:48

IIRC fprintf works with variables, so something like

Code: Select all

float reme = (float)(p_item->p_stats->i_read_bytes); fprintf(fp,"%f",reme);
might work.
now its working and i am getting statistics output to a file as required. but how can i install or use those files in another computer is there any way to install them with out compiling in another computer.
thanks and regards,
anoop vuppala.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: To see stats,audio & video during streaming from rc inte

Postby VLC_help » 30 Apr 2011 17:18

You could create a plugin that you could just add to other VLC installations, if you don't want to share your whole VLC setup to other computers.

anoopvuppala
Blank Cone
Blank Cone
Posts: 29
Joined: 06 Mar 2011 17:26

Re: To see stats,audio & video during streaming from rc inte

Postby anoopvuppala » 30 Apr 2011 23:54

You could create a plugin that you could just add to other VLC installations, if you don't want to share your whole VLC setup to other computers.
i want to share the whole vlc i mean example like ".exe" file. which parameter stores the necessary information of buffer (empty, full) and where it is located in source code
thanks and regards,

anoop


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 29 guests