Changed bit_rate to bitrate
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@927 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
8d3c8a4ea1
commit
e30fc4ac2c
|
@ -482,7 +482,7 @@ void Event::StreamEvent( int event_id, int rate, int scale )
|
|||
|
||||
#if HAVE_LIBAVCODEC
|
||||
|
||||
void Event::StreamMpeg( int event_id, const char *format, int bit_rate, int rate, int scale )
|
||||
void Event::StreamMpeg( int event_id, const char *format, int bitrate, int rate, int scale )
|
||||
{
|
||||
static char sql[BUFSIZ];
|
||||
static char eventpath[PATH_MAX];
|
||||
|
@ -551,7 +551,7 @@ void Event::StreamMpeg( int event_id, const char *format, int bit_rate, int rate
|
|||
|
||||
if ( !vid_stream )
|
||||
{
|
||||
vid_stream = new VideoStream( "pipe:", format, bit_rate, fps, image.Colours(), (image.Width()*scale)/ZM_SCALE_SCALE, (image.Height()*scale)/ZM_SCALE_SCALE );
|
||||
vid_stream = new VideoStream( "pipe:", format, bitrate, fps, image.Colours(), (image.Width()*scale)/ZM_SCALE_SCALE, (image.Height()*scale)/ZM_SCALE_SCALE );
|
||||
}
|
||||
|
||||
if ( scale != 100 )
|
||||
|
|
|
@ -93,7 +93,7 @@ public:
|
|||
|
||||
static void StreamEvent( int event_id, int rate=100, int scale=100 );
|
||||
#if HAVE_LIBAVCODEC
|
||||
static void StreamMpeg( int event_id, const char *format, int bit_rate=100000, int rate=100, int scale=100 );
|
||||
static void StreamMpeg( int event_id, const char *format, int bitrate=100000, int rate=100, int scale=100 );
|
||||
#endif // HAVE_LIBAVCODEC
|
||||
};
|
||||
|
||||
|
|
|
@ -1137,7 +1137,7 @@ void Monitor::StreamImages( unsigned long idle, unsigned long refresh, time_t tt
|
|||
|
||||
#if HAVE_LIBAVCODEC
|
||||
|
||||
void Monitor::StreamMpeg( const char *format, int bit_rate, int scale, int buffer )
|
||||
void Monitor::StreamMpeg( const char *format, int bitrate, int scale, int buffer )
|
||||
{
|
||||
fprintf( stdout, "Content-type: video/x-ms-asf\r\n\r\n");
|
||||
|
||||
|
@ -1145,7 +1145,7 @@ void Monitor::StreamMpeg( const char *format, int bit_rate, int scale, int buffe
|
|||
if ( !fps )
|
||||
fps = 5;
|
||||
|
||||
VideoStream vid_stream( "pipe:", format, bit_rate, fps, camera->Colours(), (width*scale)/ZM_SCALE_SCALE, (height*scale)/ZM_SCALE_SCALE );
|
||||
VideoStream vid_stream( "pipe:", format, bitrate, fps, camera->Colours(), (width*scale)/ZM_SCALE_SCALE, (height*scale)/ZM_SCALE_SCALE );
|
||||
|
||||
int last_read_index = image_buffer_count;
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ public:
|
|||
static Monitor *Load( int id, bool load_zones=false, Purpose purpose=QUERY );
|
||||
void StreamImages( unsigned long idle=5000, unsigned long refresh=50, time_t ttl=0, int scale=100 );
|
||||
#if HAVE_LIBAVCODEC
|
||||
void StreamMpeg( const char *format, int bit_rate=100000, int scale=100, int buffer=0 );
|
||||
void StreamMpeg( const char *format, int bitrate=100000, int scale=100, int buffer=0 );
|
||||
#endif // HAVE_LIBAVCODEC
|
||||
};
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ void VideoStream::SetupFormat( const char *p_filename, const char *format )
|
|||
snprintf(ofc->filename, sizeof(ofc->filename), "%s", filename);
|
||||
}
|
||||
|
||||
void VideoStream::SetupCodec( int colours, int width, int height, int bit_rate, int frame_rate )
|
||||
void VideoStream::SetupCodec( int colours, int width, int height, int bitrate, int frame_rate )
|
||||
{
|
||||
pf = (colours==1?PIX_FMT_GRAY8:PIX_FMT_RGB24);
|
||||
|
||||
|
@ -79,7 +79,7 @@ void VideoStream::SetupCodec( int colours, int width, int height, int bit_rate,
|
|||
c->codec_type = CODEC_TYPE_VIDEO;
|
||||
|
||||
/* put sample parameters */
|
||||
c->bit_rate = bit_rate;
|
||||
c->bit_rate = bitrate;
|
||||
/* resolution must be a multiple of two */
|
||||
c->width = width;
|
||||
c->height = height;
|
||||
|
@ -190,7 +190,7 @@ void VideoStream::OpenStream()
|
|||
av_write_header(ofc);
|
||||
}
|
||||
|
||||
VideoStream::VideoStream( const char *filename, const char *format, int bit_rate, int frame_rate, int colours, int width, int height )
|
||||
VideoStream::VideoStream( const char *filename, const char *format, int bitrate, int frame_rate, int colours, int width, int height )
|
||||
{
|
||||
if ( !initialised )
|
||||
{
|
||||
|
@ -198,7 +198,7 @@ VideoStream::VideoStream( const char *filename, const char *format, int bit_rate
|
|||
}
|
||||
|
||||
SetupFormat( filename, format );
|
||||
SetupCodec( colours, width, height, bit_rate, frame_rate );
|
||||
SetupCodec( colours, width, height, bitrate, frame_rate );
|
||||
SetParameters();
|
||||
OpenStream();
|
||||
}
|
||||
|
|
|
@ -47,12 +47,12 @@ protected:
|
|||
static void Initialise();
|
||||
|
||||
void SetupFormat( const char *p_filename, const char *format );
|
||||
void SetupCodec( int colours, int width, int height, int bit_rate, int frame_rate );
|
||||
void SetupCodec( int colours, int width, int height, int bitrate, int frame_rate );
|
||||
void SetParameters();
|
||||
void OpenStream();
|
||||
|
||||
public:
|
||||
VideoStream( const char *filename, const char *format, int bit_rate, int frame_rate, int colours, int width, int height );
|
||||
VideoStream( const char *filename, const char *format, int bitrate, int frame_rate, int colours, int width, int height );
|
||||
~VideoStream();
|
||||
double EncodeFrame( uint8_t *buffer, int buffer_size );
|
||||
};
|
||||
|
|
10
src/zms.cpp
10
src/zms.cpp
|
@ -27,7 +27,7 @@ int main(void )
|
|||
char format[32] = "";
|
||||
int id = 1;
|
||||
int event = 0;
|
||||
unsigned int bit_rate = 100000;
|
||||
unsigned int bitrate = 100000;
|
||||
unsigned int rate = 100;
|
||||
unsigned int scale = 100;
|
||||
unsigned int buffer = 0;
|
||||
|
@ -63,8 +63,8 @@ int main(void )
|
|||
event = strtoull( value, (char **)NULL, 10 );
|
||||
else if ( !strcmp( name, "format" ) )
|
||||
strncpy( format, value, sizeof(format) );
|
||||
else if ( !strcmp( name, "bit_rate" ) )
|
||||
bit_rate = atoi( value );
|
||||
else if ( !strcmp( name, "bitrate" ) )
|
||||
bitrate = atoi( value );
|
||||
else if ( !strcmp( name, "rate" ) )
|
||||
rate = atoi( value );
|
||||
else if ( !strcmp( name, "scale" ) )
|
||||
|
@ -112,7 +112,7 @@ int main(void )
|
|||
else
|
||||
{
|
||||
#if HAVE_LIBAVCODEC
|
||||
monitor->StreamMpeg( format, bit_rate, scale, buffer );
|
||||
monitor->StreamMpeg( format, bitrate, scale, buffer );
|
||||
#else // HAVE_LIBAVCODEC
|
||||
Error(( "MPEG streaming of '%s' attempted while disabled", query ));
|
||||
fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" );
|
||||
|
@ -130,7 +130,7 @@ int main(void )
|
|||
else
|
||||
{
|
||||
#if HAVE_LIBAVCODEC
|
||||
Event::StreamMpeg( event, format, bit_rate, rate, scale );
|
||||
Event::StreamMpeg( event, format, bitrate, rate, scale );
|
||||
#else // HAVE_LIBAVCODEC
|
||||
Error(( "MPEG streaming of '%s' attempted while disabled", query ));
|
||||
fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" );
|
||||
|
|
|
@ -247,7 +247,7 @@ if ( $mode == "stream" )
|
|||
<?php
|
||||
if ( ZM_WEB_VIDEO_STREAM_METHOD == 'mpeg' )
|
||||
{
|
||||
$stream_src = ZM_PATH_ZMS."?mode=mpeg&event=$eid&rate=$rate&scale=$scale&bit_rate=".VIDEO_BITRATE;
|
||||
$stream_src = ZM_PATH_ZMS."?mode=mpeg&event=$eid&rate=$rate&scale=$scale&bitrate=".VIDEO_BITRATE;
|
||||
if ( isWindows() )
|
||||
{
|
||||
if ( isInternetExplorer() )
|
||||
|
|
|
@ -104,7 +104,7 @@ if ( $mode == "stream" )
|
|||
{
|
||||
if ( ZM_WEB_VIDEO_STREAM_METHOD == 'mpeg' )
|
||||
{
|
||||
$stream_src = ZM_PATH_ZMS."?mode=mpeg&monitor=".$monitor['Id']."&scale=$scale&bit_rate=".VIDEO_BITRATE."&buffer=0";
|
||||
$stream_src = ZM_PATH_ZMS."?mode=mpeg&monitor=".$monitor['Id']."&scale=$scale&bitrate=".VIDEO_BITRATE."&buffer=0";
|
||||
if ( isWindows() )
|
||||
{
|
||||
if ( isInternetExplorer() )
|
||||
|
|
|
@ -101,7 +101,7 @@ if ( $mode == "stream" )
|
|||
{
|
||||
if ( ZM_WEB_VIDEO_STREAM_METHOD == 'mpeg' )
|
||||
{
|
||||
$stream_src = ZM_PATH_ZMS."?mode=mpeg&monitor=".$monitor['Id']."&scale=$scale&bit_rate=".VIDEO_BITRATE."&buffer=0";
|
||||
$stream_src = ZM_PATH_ZMS."?mode=mpeg&monitor=".$monitor['Id']."&scale=$scale&bitrate=".VIDEO_BITRATE."&buffer=0";
|
||||
if ( isWindows() )
|
||||
{
|
||||
if ( isInternetExplorer() )
|
||||
|
|
Loading…
Reference in New Issue