* encoder.c: video and audio encoder using the ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: encoder.c,v 1.19 2003/12/07 12:11:13 gbazin Exp $
+ * $Id: encoder.c,v 1.20 2003/12/14 21:03:27 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
if( p_enc->fmt_in.i_cat == VIDEO_ES )
{
+ if( !p_enc->fmt_in.video.i_width || !p_enc->fmt_in.video.i_height )
+ {
+ msg_Warn( p_enc, "invalid size %ix%i", p_enc->fmt_in.video.i_width,
+ p_enc->fmt_in.video.i_height );
+ free( p_sys );
+ return VLC_EGENERIC;
+ }
+
p_context->width = p_enc->fmt_in.video.i_width;
p_context->height = p_enc->fmt_in.video.i_height;
if( avcodec_open( p_context, p_codec ) )
{
msg_Err( p_enc, "cannot open encoder" );
+ free( p_sys );
return VLC_EGENERIC;
}
msg_Warn( p_enc, "stereo mode selected (codec limitation)" );
else
{
msg_Err( p_enc, "cannot open encoder" );
+ free( p_sys );
return VLC_EGENERIC;
}
}
* streamout.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: streamout.cpp,v 1.38 2003/12/10 11:04:25 courmisch Exp $
+ * $Id: streamout.cpp,v 1.39 2003/12/14 21:03:27 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
EncapsulationRadio7_Event, EncapsulationRadio8_Event,
VideoTranscEnable_Event, VideoTranscCodec_Event, VideoTranscBitrate_Event,
+ VideoTranscScale_Event,
AudioTranscEnable_Event, AudioTranscCodec_Event, AudioTranscBitrate_Event,
AudioTranscChans_Event,
EVT_TEXT(VideoTranscBitrate_Event, SoutDialog::OnTranscodingChange)
EVT_COMBOBOX(AudioTranscBitrate_Event, SoutDialog::OnTranscodingChange)
EVT_TEXT(AudioTranscBitrate_Event, SoutDialog::OnTranscodingChange)
+ EVT_COMBOBOX(VideoTranscScale_Event, SoutDialog::OnTranscodingChange)
+ EVT_TEXT(VideoTranscScale_Event, SoutDialog::OnTranscodingChange)
EVT_COMBOBOX(AudioTranscChans_Event, SoutDialog::OnTranscodingChange)
EVT_TEXT(AudioTranscChans_Event, SoutDialog::OnTranscodingChange)
{
transcode += wxT("vcodec=") + video_codec_combo->GetValue();
transcode += wxT(",vb=") + video_bitrate_combo->GetValue();
+ transcode += wxT(",scale=") + video_scale_combo->GetValue();
if( audio_transc_checkbox->IsChecked() ) transcode += wxT(",");
}
if( audio_transc_checkbox->IsChecked() )
wxT("32"),
wxT("16")
};
+ static const wxString vscales_array[] =
+ {
+ wxT("0.25"),
+ wxT("0.5"),
+ wxT("0.75"),
+ wxT("1"),
+ wxT("1.25"),
+ wxT("1.5"),
+ wxT("1.75"),
+ wxT("2")
+ };
- wxFlexGridSizer *video_sizer = new wxFlexGridSizer( 4, 1, 20 );
+ wxFlexGridSizer *video_sizer = new wxFlexGridSizer( 6, 1, 20 );
video_transc_checkbox =
new wxCheckBox( panel, VideoTranscEnable_Event, wxU(_("Video codec")));
video_codec_combo =
new wxComboBox( panel, VideoTranscBitrate_Event, wxT("1024"),
wxPoint(20,25), wxDefaultSize,
WXSIZEOF(vbitrates_array), vbitrates_array );
+ wxStaticText *scale_label =
+ new wxStaticText( panel, -1, wxU(_("Scale")));
+ video_scale_combo =
+ new wxComboBox( panel, VideoTranscScale_Event, wxT("1"),
+ wxPoint(20,25), wxDefaultSize,
+ WXSIZEOF(vscales_array), vscales_array );
video_sizer->Add( video_transc_checkbox, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
video_sizer->Add( video_codec_combo, 1,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
video_sizer->Add( video_bitrate_combo, 1,
wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
+ video_sizer->Add( scale_label, 0,
+ wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
+ video_sizer->Add( video_scale_combo, 1,
+ wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
/* Create audio transcoding checkox */
static const wxString acodecs_array[] =
* wxwindows.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: wxwindows.cpp,v 1.35 2003/10/15 12:24:14 gbazin Exp $
+ * $Id: wxwindows.cpp,v 1.36 2003/12/14 21:03:27 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
* provided facilities (eg. open file dialog) */
locale.Init( wxLANGUAGE_DEFAULT );
+ /* FIXME: The stream output mrl parsing uses ',' already so we want to
+ * keep the default '.' for floating point numbers. */
+ setlocale( LC_NUMERIC, "C" );
+
/* Make an instance of your derived frame. Passing NULL (the default value
* of Frame's constructor is NULL) as the frame doesn't have a parent
* since it is the first window */
* transcode.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: transcode.c,v 1.63 2003/12/08 13:02:40 gbazin Exp $
+ * $Id: transcode.c,v 1.64 2003/12/14 21:03:27 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
#endif
#if LIBAVCODEC_BUILD >= 4687
+ if( id->ff_dec_c->height )
id->p_encoder->fmt_in.video.i_aspect = VOUT_ASPECT_FACTOR *
( av_q2d(id->ff_dec_c->sample_aspect_ratio) *
id->ff_dec_c->width / id->ff_dec_c->height );
int i_height = id->ff_dec_c->height - p_sys->i_crop_top -
p_sys->i_crop_bottom;
- if( id->f_dst.video.i_width <= 0 && id->f_dst.video.i_height <= 0 )
+ if( id->f_dst.video.i_width <= 0 && id->f_dst.video.i_height <= 0
+ && p_sys->f_scale )
{
/* Apply the scaling */
id->f_dst.video.i_width = i_width * p_sys->f_scale;