Commit 3ef2227a authored by gbazin's avatar gbazin
Browse files

* src/stream_output/stream_output.c: small sout_cfg_parser() changes.

* modules/stream_out/duplicate.c: small coding style changes.
* modules/stream_out/transcode.c:
  + Forward the aopts{foo=bar,etc..} and vopts={foo=bar,etc...} options to the encoders.
  + Got rid of the ffmpeg encoder specific options.
* modules/codec/ffmpeg/*:
  + Changed the encoder options to normal config options.
  + Parse the options forwarded by transcode.
* include/vlc_codec.h:
  + encoder_t cleanup.
  + include a "sout_cfg_t *" in encoder_t to allow passing options.
parent 3100140e
......@@ -111,24 +111,11 @@ struct encoder_t
/* Properties of the output of the encoder */
es_format_t fmt_out;
/* FIXME: move these to the ffmpeg encoder */
int i_key_int;
int i_b_frames;
int i_vtolerance;
int i_qmin;
int i_qmax;
int i_hq;
vlc_bool_t b_strict_rc;
vlc_bool_t b_pre_me;
vlc_bool_t b_hurry_up;
vlc_bool_t b_interlace;
int i_rc_buffer_size;
float f_rc_buffer_aggressivity;
float f_i_quant_factor;
int i_noise_reduction;
vlc_bool_t b_mpeg4_matrix;
/* Number of threads to use during encoding */
int i_threads;
vlc_bool_t b_trellis;
/* Encoder config */
sout_cfg_t *p_cfg;
};
/**
......
......@@ -5,7 +5,7 @@
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
* Gildas Bazin <gbazin@videolan.org>
* Christophe Massiot <massiot@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -29,6 +29,7 @@
#include <vlc/vlc.h>
#include <vlc/vout.h>
#include <vlc/aout.h>
#include <vlc/sout.h>
#include <vlc/decoder.h>
/* ffmpeg header */
......@@ -115,6 +116,31 @@ struct encoder_sys_t
int i_frame_size;
int i_samples_delay;
mtime_t i_pts;
/* Encoding settings */
int i_key_int;
int i_b_frames;
int i_vtolerance;
int i_qmin;
int i_qmax;
int i_hq;
vlc_bool_t b_strict_rc;
int i_rc_buffer_size;
float f_rc_buffer_aggressivity;
vlc_bool_t b_pre_me;
vlc_bool_t b_hurry_up;
vlc_bool_t b_interlace;
float f_i_quant_factor;
int i_noise_reduction;
vlc_bool_t b_mpeg4_matrix;
vlc_bool_t b_trellis;
};
static const char *ppsz_enc_options[] = {
"keyint", "bframes", "vt", "qmin", "qmax", "hq", "strict_rc",
"rc_buffer_size", "rc_buffer_aggressivity", "pre_me", "hurry_up",
"interlace", "i_quant_factor", "noise_reduction", "mpeg4_matrix",
"trellis", NULL
};
/*****************************************************************************
......@@ -131,6 +157,7 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
AVCodec *p_codec;
int i_codec_id, i_cat;
char *psz_namecodec;
vlc_value_t val;
if( !E_(GetFfmpegCodec)( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id,
&psz_namecodec ) )
......@@ -206,6 +233,68 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
p_context->dsp_mask |= FF_MM_SSE2;
}
sout_ParseCfg( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
var_Get( p_enc, ENC_CFG_PREFIX "keyint", &val );
p_sys->i_key_int = val.i_int;
var_Get( p_enc, ENC_CFG_PREFIX "bframes", &val );
p_sys->i_b_frames = val.i_int;
var_Get( p_enc, ENC_CFG_PREFIX "vt", &val );
p_sys->i_vtolerance = val.i_int;
var_Get( p_enc, ENC_CFG_PREFIX "interlace", &val );
p_sys->b_interlace = val.b_bool;
var_Get( p_enc, ENC_CFG_PREFIX "pre_me", &val );
p_sys->b_pre_me = val.b_bool;
var_Get( p_enc, ENC_CFG_PREFIX "hurry_up", &val );
p_sys->b_hurry_up = val.b_bool;
if( p_sys->b_hurry_up )
{
/* hurry up mode needs noise reduction, even small */
p_sys->i_noise_reduction = 1;
}
var_Get( p_enc, ENC_CFG_PREFIX "strict_rc", &val );
p_sys->b_strict_rc = val.b_bool;
var_Get( p_enc, ENC_CFG_PREFIX "rc_buffer_size", &val );
p_sys->i_rc_buffer_size = val.i_int;
var_Get( p_enc, ENC_CFG_PREFIX "rc_buffer_aggressivity", &val );
p_sys->f_rc_buffer_aggressivity = val.f_float;
var_Get( p_enc, ENC_CFG_PREFIX "i_quant_factor", &val );
p_sys->f_i_quant_factor = val.f_float;
var_Get( p_enc, ENC_CFG_PREFIX "noise_reduction", &val );
p_sys->i_noise_reduction = val.i_int;
var_Get( p_enc, ENC_CFG_PREFIX "mpeg4_matrix", &val );
p_sys->b_mpeg4_matrix = val.b_bool;
var_Get( p_enc, ENC_CFG_PREFIX "hq", &val );
if( val.psz_string && *val.psz_string )
{
if( !strcmp( val.psz_string, "rd" ) )
p_sys->i_hq = FF_MB_DECISION_RD;
else if( !strcmp( val.psz_string, "bits" ) )
p_sys->i_hq = FF_MB_DECISION_BITS;
else if( !strcmp( val.psz_string, "simple" ) )
p_sys->i_hq = FF_MB_DECISION_SIMPLE;
else
p_sys->i_hq = FF_MB_DECISION_RD;
}
if( val.psz_string ) free( val.psz_string );
var_Get( p_enc, ENC_CFG_PREFIX "qmin", &val );
p_sys->i_qmin = val.i_int;
var_Get( p_enc, ENC_CFG_PREFIX "qmax", &val );
p_sys->i_qmax = val.i_int;
var_Get( p_enc, ENC_CFG_PREFIX "trellis", &val );
p_sys->b_trellis = val.b_bool;
if( p_enc->fmt_in.i_cat == VIDEO_ES )
{
if( !p_enc->fmt_in.video.i_width || !p_enc->fmt_in.video.i_height )
......@@ -230,9 +319,9 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
p_context->i_quant_offset = 0.0;
p_context->i_quant_factor = -0.8;
p_context->gop_size = p_enc->i_key_int > 0 ? p_enc->i_key_int : 50;
p_context->gop_size = p_sys->i_key_int > 0 ? p_sys->i_key_int : 50;
p_context->max_b_frames =
__MIN( p_enc->i_b_frames, FF_MAX_B_FRAMES );
__MIN( p_sys->i_b_frames, FF_MAX_B_FRAMES );
p_context->b_frame_strategy = 0;
#if LIBAVCODEC_BUILD >= 4687
......@@ -249,35 +338,33 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
if ( p_enc->b_strict_rc )
if ( p_sys->b_strict_rc )
{
p_context->rc_max_rate = p_enc->fmt_out.i_bitrate;
p_context->rc_buffer_size = p_enc->i_rc_buffer_size;
p_context->rc_buffer_aggressivity = p_enc->f_rc_buffer_aggressivity;
p_context->rc_buffer_size = p_sys->i_rc_buffer_size;
p_context->rc_buffer_aggressivity = p_sys->f_rc_buffer_aggressivity;
}
if ( p_enc->f_i_quant_factor != 0.0 )
{
p_context->i_quant_factor = p_enc->f_i_quant_factor;
}
if ( p_sys->f_i_quant_factor != 0.0 )
p_context->i_quant_factor = p_sys->f_i_quant_factor;
#if LIBAVCODEC_BUILD >= 4690
p_context->noise_reduction = p_enc->i_noise_reduction;
p_context->noise_reduction = p_sys->i_noise_reduction;
#endif
if ( p_enc->b_mpeg4_matrix )
if ( p_sys->b_mpeg4_matrix )
{
p_context->intra_matrix = ff_mpeg4_default_intra_matrix;
p_context->inter_matrix = ff_mpeg4_default_non_intra_matrix;
}
if ( p_enc->b_pre_me )
if ( p_sys->b_pre_me )
{
p_context->pre_me = 1;
p_context->me_pre_cmp = FF_CMP_CHROMA;
}
if ( p_enc->b_interlace )
if ( p_sys->b_interlace )
{
p_context->flags |= CODEC_FLAG_INTERLACED_DCT;
#if LIBAVCODEC_BUILD >= 4698
......@@ -285,28 +372,24 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
#endif
}
if ( p_enc->b_trellis )
{
if ( p_sys->b_trellis )
p_context->flags |= CODEC_FLAG_TRELLIS_QUANT;
}
#if LIBAVCODEC_BUILD >= 4702
if ( p_enc->i_threads >= 1 )
{
p_context->thread_count = p_enc->i_threads;
}
#endif
if( p_enc->i_vtolerance > 0 )
{
p_context->bit_rate_tolerance = p_enc->i_vtolerance;
}
if( p_sys->i_vtolerance > 0 )
p_context->bit_rate_tolerance = p_sys->i_vtolerance;
p_context->mb_qmin = p_context->qmin = p_enc->i_qmin;
p_context->mb_qmax = p_context->qmax = p_enc->i_qmax;
if( p_sys->i_qmin > 0 )
p_context->mb_qmin = p_context->qmin = p_sys->i_qmin;
if( p_sys->i_qmax > 0 )
p_context->mb_qmax = p_context->qmax = p_sys->i_qmax;
p_context->max_qdiff = 3;
p_context->mb_decision = p_enc->i_hq;
p_context->mb_decision = p_sys->i_hq;
}
else if( p_enc->fmt_in.i_cat == AUDIO_ES )
{
......@@ -517,7 +600,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
{
frame.pts = p_pict->date ? p_pict->date : AV_NOPTS_VALUE;
if ( p_enc->b_hurry_up && frame.pts != AV_NOPTS_VALUE )
if ( p_sys->b_hurry_up && frame.pts != AV_NOPTS_VALUE )
{
mtime_t current_date = mdate();
......@@ -529,24 +612,24 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
}
else
{
p_sys->p_context->mb_decision = p_enc->i_hq;
p_sys->p_context->mb_decision = p_sys->i_hq;
if ( current_date + HURRY_UP_GUARD2 > frame.pts )
{
p_sys->p_context->flags &= ~CODEC_FLAG_TRELLIS_QUANT;
#if LIBAVCODEC_BUILD >= 4690
p_sys->p_context->noise_reduction = p_enc->i_noise_reduction
p_sys->p_context->noise_reduction = p_sys->i_noise_reduction
+ (HURRY_UP_GUARD2 + current_date - frame.pts) / 500;
#endif
msg_Dbg( p_enc, "hurry up mode 2" );
}
else
{
if ( p_enc->b_trellis )
if ( p_sys->b_trellis )
p_sys->p_context->flags |= CODEC_FLAG_TRELLIS_QUANT;
#if LIBAVCODEC_BUILD >= 4690
p_sys->p_context->noise_reduction =
p_enc->i_noise_reduction;
p_sys->i_noise_reduction;
#endif
}
}
......
......@@ -70,6 +70,8 @@ struct decoder_sys_t
static int OpenDecoder( vlc_object_t * );
static void CloseDecoder( vlc_object_t * );
static char *enc_hq_list[] = { "rd", "bits", "simple" };
static char *enc_hq_list_text[] = { N_("rd"), N_("bits"), N_("simple") };
/*****************************************************************************
* Module descriptor
*****************************************************************************/
......@@ -93,7 +95,8 @@ vlc_module_begin();
add_string( "ffmpeg-pp-name", "default", NULL, LIBAVCODEC_PP_TEXT,
LIBAVCODEC_PP_LONGTEXT, VLC_TRUE );
#endif
add_integer( "ffmpeg-debug", 0, NULL, DEBUG_TEST, DEBUG_LONGTEST, VLC_TRUE );
add_integer( "ffmpeg-debug", 0, NULL, DEBUG_TEXT, DEBUG_LONGTEXT,
VLC_TRUE );
/* chroma conversion submodule */
add_submodule();
......@@ -107,6 +110,40 @@ vlc_module_begin();
set_capability( "encoder", 100 );
set_callbacks( E_(OpenEncoder), E_(CloseEncoder) );
add_string( ENC_CFG_PREFIX "hq", "simple", NULL, ENC_HQ_TEXT,
ENC_HQ_LONGTEXT, VLC_FALSE );
change_string_list( enc_hq_list, enc_hq_list_text, 0 );
add_integer( ENC_CFG_PREFIX "keyint", 0, NULL, ENC_KEYINT_TEXT,
ENC_KEYINT_LONGTEXT, VLC_FALSE );
add_integer( ENC_CFG_PREFIX "bframes", 0, NULL, ENC_BFRAMES_TEXT,
ENC_BFRAMES_LONGTEXT, VLC_FALSE );
add_bool( ENC_CFG_PREFIX "hurry_up", 0, NULL, ENC_HURRYUP_TEXT,
ENC_HURRYUP_LONGTEXT, VLC_FALSE );
add_bool( ENC_CFG_PREFIX "interlace", 0, NULL, ENC_INTERLACE_TEXT,
ENC_INTERLACE_LONGTEXT, VLC_TRUE );
add_integer( ENC_CFG_PREFIX "vt", 0, NULL, ENC_VT_TEXT,
ENC_VT_LONGTEXT, VLC_TRUE );
add_bool( ENC_CFG_PREFIX "pre_me", 0, NULL, ENC_PRE_ME_TEXT,
ENC_PRE_ME_LONGTEXT, VLC_TRUE );
add_bool( ENC_CFG_PREFIX "strict_rc", 0, NULL, ENC_RC_STRICT_TEXT,
ENC_RC_STRICT_LONGTEXT, VLC_TRUE );
add_integer( ENC_CFG_PREFIX "rc_buffer_size", 224*1024*8 * 3/2, NULL,
ENC_RC_BUF_TEXT, ENC_RC_BUF_LONGTEXT, VLC_TRUE );
add_float( ENC_CFG_PREFIX "rc_buffer_aggressivity", 0.1, NULL,
ENC_RC_BUF_AGGR_TEXT, ENC_RC_BUF_AGGR_LONGTEXT, VLC_TRUE );
add_float( ENC_CFG_PREFIX "i_quant_factor", 0, NULL,
ENC_QUANT_FACTOR_TEXT, ENC_QUANT_FACTOR_LONGTEXT, VLC_TRUE );
add_integer( ENC_CFG_PREFIX "noise_reduction", 0, NULL,
ENC_NOISE_RED_TEXT, ENC_NOISE_RED_LONGTEXT, VLC_TRUE );
add_bool( ENC_CFG_PREFIX "mpeg4_matrix", 0, NULL,
ENC_MPEG4_MATRIX_TEXT, ENC_MPEG4_MATRIX_LONGTEXT, VLC_TRUE );
add_integer( ENC_CFG_PREFIX "qmin", 0, NULL,
ENC_QMIN_TEXT, ENC_QMIN_LONGTEXT, VLC_TRUE );
add_integer( ENC_CFG_PREFIX "qmax", 0, NULL,
ENC_QMAX_TEXT, ENC_QMAX_LONGTEXT, VLC_TRUE );
add_bool( ENC_CFG_PREFIX "trellis", 0, NULL,
ENC_TRELLIS_TEXT, ENC_TRELLIS_LONGTEXT, VLC_TRUE );
/* demux submodule */
add_submodule();
set_description( _("ffmpeg demuxer" ) );
......
......@@ -108,8 +108,8 @@ void E_(ClosePostproc)( decoder_t *, void * );
"Higher levels require considerable more CPU power, but produce " \
"better looking pictures." )
#define DEBUG_TEST N_( "Debug mask" )
#define DEBUG_LONGTEST N_( "Set ffmpeg debug mask" )
#define DEBUG_TEXT N_( "Debug mask" )
#define DEBUG_LONGTEXT N_( "Set ffmpeg debug mask" )
#define LIBAVCODEC_PP_TEXT N_("ffmpeg postproc filter chains")
/* FIXME (cut/past from ffmpeg */
......@@ -147,3 +147,73 @@ void E_(ClosePostproc)( decoder_t *, void * );
"tn tmpnoise (3 Thresholds) Temporal Noise Reducer\n" \
" 1. <= 2. <= 3. larger -> stronger filtering\n" \
"fq forceQuant <quantizer> Force quantizer\n"
/*
* Encoder options
*/
#define ENC_CFG_PREFIX "sout-ffmpeg-"
#define ENC_KEYINT_TEXT N_( "Ratio of key frames" )
#define ENC_KEYINT_LONGTEXT N_( "Allows you to specify the number of frames " \
"that will be coded for one key frame." )
#define ENC_BFRAMES_TEXT N_( "Ratio of B frames" )
#define ENC_BFRAMES_LONGTEXT N_( "Allows you to specify the number of " \
"B frames that will be coded between two reference frames." )
#define ENC_VT_TEXT N_( "Video bitrate tolerance" )
#define ENC_VT_LONGTEXT N_( "Allows you to specify the video bitrate " \
"tolerance in kbit/s." )
#define ENC_INTERLACE_TEXT N_( "Enable interlaced encoding" )
#define ENC_INTERLACE_LONGTEXT N_( "Allows you to enable interlaced " \
"encoding." )
#define ENC_PRE_ME_TEXT N_( "Enable pre motion estimation" )
#define ENC_PRE_ME_LONGTEXT N_( "Allows you to enable the pre motion " \
"estimation." )
#define ENC_RC_STRICT_TEXT N_( "Enable strict rate control" )
#define ENC_RC_STRICT_LONGTEXT N_( "Allows you to enable the strict rate " \
"control algorithm." )
#define ENC_RC_BUF_TEXT N_( "Rate control buffer size" )
#define ENC_RC_BUF_LONGTEXT N_( "Allows you to specify the rate control " \
"buffer size." )
#define ENC_RC_BUF_AGGR_TEXT N_( "Rate control buffer aggressivity" )
#define ENC_RC_BUF_AGGR_LONGTEXT N_( "Allows you to specify the rate control "\
"buffer agressivity." )
#define ENC_QUANT_FACTOR_TEXT N_( "Quantization factor" )
#define ENC_QUANT_FACTOR_LONGTEXT N_( "Allows you to specify the " \
"quantization factor." )
#define ENC_NOISE_RED_TEXT N_( "Noise reduction" )
#define ENC_NOISE_RED_LONGTEXT N_( "Allows you to specify the noise " \
"reduction." )
#define ENC_MPEG4_MATRIX_TEXT N_( "Enable mpeg4 quantization matrix" )
#define ENC_MPEG4_MATRIX_LONGTEXT N_( "Allows you to use the mpeg4 " \
"quantization matrix for mpeg2 encoding." )
#define ENC_HQ_TEXT N_( "Quality level" )
#define ENC_HQ_LONGTEXT N_( "Allows you to specify the quality level " \
"for the encoding." )
#define ENC_HURRYUP_TEXT N_( "Hurry up" )
#define ENC_HURRYUP_LONGTEXT N_( "Allows you to specify if the encoder " \
"should make on-the-fly quality tradeoffs if your CPU can't keep up with " \
"the encoding rate." )
#define ENC_QMIN_TEXT N_( "Minimum video quantizer scale" )
#define ENC_QMIN_LONGTEXT N_( "Allows you to specify the minimum video " \
"quantizer scale." )
#define ENC_QMAX_TEXT N_( "Maximum video quantizer scale" )
#define ENC_QMAX_LONGTEXT N_( "Allows you to specify the maximum video " \
"quantizer scale." )
#define ENC_TRELLIS_TEXT N_( "Enable trellis quantization" )
#define ENC_TRELLIS_LONGTEXT N_( "Allows you to enable trellis " \
"quantization." )
......@@ -400,6 +400,9 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block )
p_sys->i_buffer = 0;
p_sys->i_pts = 0; /* To make sure we recover properly */
p_sys->input_pts = p_sys->input_dts = 0;
p_sys->i_late_frames = 0;
block_Release( p_block );
return NULL;
}
......
......@@ -141,7 +141,7 @@ static void Close( vlc_object_t * p_this )
int i;
msg_Dbg( p_stream, "closing a duplication");
msg_Dbg( p_stream, "closing a duplication" );
for( i = 0; i < p_sys->i_nb_streams; i++ )
{
sout_stream_delete( p_sys->pp_streams[i] );
......@@ -176,9 +176,8 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
id->pp_ids = NULL;
msg_Dbg( p_stream, "duplicated a new stream codec=%4.4s (es=%d group=%d)",
(char*)&p_fmt->i_codec,
p_fmt->i_id,
p_fmt->i_group );
(char*)&p_fmt->i_codec, p_fmt->i_id, p_fmt->i_group );
for( i_stream = 0; i_stream < p_sys->i_nb_streams; i_stream++ )
{
void *id_new = NULL;
......
......@@ -48,16 +48,106 @@
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define VCODEC_TEXT N_("Destination video codec")
#define VCODEC_LONGTEXT N_( \
"Allows you to pecify the destination video codec used for the streaming "\
"output." )
#define VB_TEXT N_("Video bitrate")
#define VB_LONGTEXT N_( \
"Allows you to specify the video bitrate used for the streaming " \
"output." )
#define SCALE_TEXT N_("Video scaling")
#define SCALE_LONGTEXT N_( \
"Allows you to scale the video before encoding." )
#define DEINTERLACE_TEXT N_("Deinterlace video")
#define DEINTERLACE_LONGTEXT N_( \
"Allows you to deinterlace the video before encoding." )
#define WIDTH_TEXT N_("Video width")
#define WIDTH_LONGTEXT N_( \
"Allows you to specify the output video width." )
#define HEIGHT_TEXT N_("Video height")
#define HEIGHT_LONGTEXT N_( \
"Allows you to specify the output video height." )
#define CROPTOP_TEXT N_("Video crop top")
#define CROPTOP_LONGTEXT N_( \
"Allows you to specify the top coordinate for the video cropping." )
#define CROPLEFT_TEXT N_("Video crop left")
#define CROPLEFT_LONGTEXT N_( \
"Allows you to specify the left coordinate for the video cropping." )
#define CROPBOTTOM_TEXT N_("Video crop bottom")
#define CROPBOTTOM_LONGTEXT N_( \
"Allows you to specify the bottom coordinate for the video cropping." )
#define CROPRIGHT_TEXT N_("Video crop right")
#define CROPRIGHT_LONGTEXT N_( \
"Allows you to specify the right coordinate for the video cropping." )
#define ACODEC_TEXT N_("Destination audio codec")
#define ACODEC_LONGTEXT N_( \
"Allows you to specify the destination audio codec used for the " \
"streaming output." )
#define AB_TEXT N_("Audio bitrate")
#define AB_LONGTEXT N_( \
"Allows you to specify the audio bitrate used for the streaming " \
"output." )
#define ARATE_TEXT N_("Audio sample rate")
#define ARATE_LONGTEXT N_( \
"Allows you to specify the audio sample rate used for the streaming " \
"output." )
#define ACHANS_TEXT N_("Audio channels")
#define ACHANS_LONGTEXT N_( \
"Allows you to specify the number of audio channels used for the " \
"streaming output." )
#define THREADS_TEXT N_("Number of threads")
#define THREADS_LONGTEXT N_( \
"Allows you to specify the number of threads used for the transcoding." )
static int Open ( vlc_object_t * );
static void Close( vlc_object_t * );
#define SOUT_CFG_PREFIX "sout-transcode-"
vlc_module_begin();
set_description( _("Transcode stream output") );
set_capability( "sout stream", 50 );
add_shortcut( "transcode" );
set_callbacks( Open, Close );
vlc_module_end();
add_string( SOUT_CFG_PREFIX "vcodec", NULL, NULL, VCODEC_TEXT,
VCODEC_LONGTEXT, VLC_FALSE );
add_integer( SOUT_CFG_PREFIX "vb", 800 * 1000, NULL, VB_TEXT,
VB_LONGTEXT, VLC_FALSE );
add_float( SOUT_CFG_PREFIX "scale", 1, NULL, SCALE_TEXT,
SCALE_LONGTEXT, VLC_FALSE );
add_bool( SOUT_CFG_PREFIX "deinterlace", 0, NULL, DEINTERLACE_TEXT,
DEINTERLACE_LONGTEXT, VLC_FALSE );
add_integer( SOUT_CFG_PREFIX "width", 0, NULL, WIDTH_TEXT,
WIDTH_LONGTEXT, VLC_TRUE );
add_integer( SOUT_CFG_PREFIX "height", 0, NULL, HEIGHT_TEXT,
HEIGHT_LONGTEXT, VLC_TRUE );
add_integer( SOUT_CFG_PREFIX "croptop", 0, NULL, CROPTOP_TEXT,
CROPTOP_LONGTEXT, VLC_TRUE );
add_integer( SOUT_CFG_PREFIX "cropleft", 0, NULL, CROPLEFT_TEXT,
CROPLEFT_LONGTEXT, VLC_TRUE );
add_integer( SOUT_CFG_PREFIX "cropbottom", 0, NULL, CROPBOTTOM_TEXT,
CROPBOTTOM_LONGTEXT, VLC_TRUE );
add_integer( SOUT_CFG_PREFIX "cropright", 0, NULL, CROPRIGHT_TEXT,
CROPRIGHT_LONGTEXT, VLC_TRUE );
add_string( SOUT_CFG_PREFIX "acodec", NULL, NULL, ACODEC_TEXT,
ACODEC_LONGTEXT, VLC_FALSE );
add_integer( SOUT_CFG_PREFIX "ab", 64000, NULL, AB_TEXT,
AB_LONGTEXT, VLC_FALSE );
add_integer( SOUT_CFG_PREFIX "channels", 0, NULL, ACHANS_TEXT,
ACHANS_LONGTEXT, VLC_FALSE );
add_integer( SOUT_CFG_PREFIX "samplerate", 0, NULL, ARATE_TEXT,
ARATE_LONGTEXT, VLC_TRUE );
add_integer( SOUT_CFG_PREFIX "threads", 0, NULL, THREADS_TEXT,
THREADS_LONGTEXT, VLC_TRUE );
vlc_module_end();
/*****************************************************************************
* Exported prototypes
......@@ -89,6 +179,12 @@ static int pi_channels_maps[6] =
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT
};
static const char *ppsz_sout_options[] = {
"vcodec", "vb", "croptop", "cropbottom", "cropleft", "cropright",
"scale", "width", "height", "deinterlace", "threads",
"acodec", "ab", "samplerate", "channels", NULL
};
#define PICTURE_RING_SIZE 64
struct sout_stream_sys_t
......@@ -104,33 +200,19 @@ struct sout_stream_sys_t
int i_first_pic, i_last_pic;
vlc_fourcc_t i_acodec; /* codec audio (0 if not transcode) */
sout_cfg_t *p_audio_cfg;
int i_sample_rate;
int i_channels;
int i_abitrate;
vlc_fourcc_t i_vcodec; /* " video " " " " */
sout_cfg_t *p_video_cfg;
int i_vbitrate;
int i_vtolerance;
double f_scale;
int i_width;
int i_height;
int i_b_frames;
int i_key_int;
int i_qmin;
int i_qmax;
vlc_bool_t i_hq;
vlc_bool_t b_deinterlace;
vlc_bool_t b_interlace;
vlc_bool_t b_strict_rc;
vlc_bool_t b_pre_me;
vlc_bool_t b_hurry_up;
int i_rc_buffer_size;
float f_rc_buffer_aggressivity;