]> git.sesse.net Git - vlc/blob - modules/encoder/ffmpeg/encoder.c
* added file needed for video transcoding with vlc.
[vlc] / modules / encoder / ffmpeg / encoder.c
1 /*****************************************************************************
2  * encoder.c : audio/video encoder using ffmpeg library
3  *****************************************************************************
4  * Copyright (C) 2002 VideoLAN
5  * $Id: encoder.c,v 1.1 2003/01/22 10:41:57 fenrir Exp $
6  *
7  * Authors: Laurent Aimar
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include <vlc/vlc.h>
28 #include <vlc/vout.h>
29 #include <vlc/input.h>
30 #include <vlc/decoder.h>
31
32 #include <stdlib.h>
33
34 #include "codecs.h"
35 #include "encoder.h"
36
37 /*****************************************************************************
38  * Local prototypes
39  *****************************************************************************/
40 int  E_( OpenEncoderVideo  )( vlc_object_t * );
41 void E_( CloseEncoderVideo )( vlc_object_t * );
42
43 int  E_( OpenEncoderAudio ) ( vlc_object_t * );
44 void E_( CloseEncoderAudio )( vlc_object_t * );
45
46 /*****************************************************************************
47  * Module descriptor
48  *****************************************************************************/
49
50 vlc_module_begin();
51     set_description( _("ffmpeg encoder") );
52     add_shortcut( "ffmpeg" );
53
54
55     add_submodule();
56         set_capability( "video encoder", 100 );
57         set_callbacks( E_( OpenEncoderVideo ), E_( CloseEncoderVideo ) );
58         add_category_hint( "video setting", NULL );
59             add_integer( "encoder-ffmpeg-video-bitrate", 1000, NULL, "bitrate (kb/s)", "bitrate (kb/s)" );
60             add_integer( "encoder-ffmpeg-video-max-key-interval", 10, NULL, "max key interval", "maximum   value  of   frames  between   two  keyframes" );
61             add_integer( "encoder-ffmpeg-min-quantizer", 2, NULL, "min quantizer", "range 1-31" );
62             add_integer( "encoder-ffmpeg-max-quantizer", 31, NULL, "max quantizer", "range 1-31" );
63
64     add_submodule();
65         set_capability( "audio encoder", 50 );
66         set_callbacks( E_( OpenEncoderAudio ), E_( CloseEncoderAudio ) );
67         add_category_hint( "audio setting", NULL );
68             add_integer( "encoder-ffmpeg-audio-bitrate", 64, NULL, "bitrate (kb/s)", "bitrate (kb/s)" );
69
70 vlc_module_end();
71
72
73 #if 0
74     add_category_hint( "general setting", NULL );
75         add_integer( "encoder-xvid-bitrate", 1000, NULL, "bitrate (kb/s)", "bitrate (kb/s)" );
76         add_integer( "encoder-xvid-min-quantizer", 2, NULL, "min quantizer", "range 1-31" );
77         add_integer( "encoder-xvid-max-quantizer", 31, NULL, "max quantizer", "1-31" );
78     add_category_hint( "advanced setting", NULL );
79         add_integer( "encoder-xvid-reaction-delay-factor", -1, NULL, "rc reaction delay factor", "rate controler parameters");
80         add_integer( "encoder-xvid-averaging-period", -1, NULL, "rc averaging period", "rate controler parameters" );
81         add_integer( "encoder-xvid-buffer", -1, NULL, "rc buffer", "rate controler parameters" );
82     add_category_hint( "advanced frame setting", NULL );
83         add_string_from_list( "encoder-xvid-quantization", "MPEG", ppsz_xvid_quant_algo, NULL, "quantization algorithm", "" );
84         add_bool( "encoder-xvid-halfpel", 1, NULL, "half pixel  motion estimation.", "" );
85         add_bool( "encoder-xvid-4mv", 0, NULL, "fourc vector per macroblock(need halfpel)", "" );
86         add_bool( "encoder-xvid-lumi-mask", 0, NULL, "use a lumimasking algorithm", "" );
87         add_bool( "encoder-xvid-adaptive-quant", 0, NULL, "perform  an  adaptative quantization", "" );
88         add_bool( "encoder-xvid-interlacing", 0, NULL, "use MPEG4  interlaced mode", "" );
89         add_string_from_list( "encoder-xvid-me", "", ppsz_xvid_me, NULL, "motion estimation", "" );
90         add_bool( "encoder-xvid-motion-advanceddiamond", 1, NULL, "motion advanceddiamond", "" );
91         add_bool( "encoder-xvid-motion-halfpeldiamond", 1, NULL, "motion halfpel diamond", "" );
92         add_bool( "encoder-xvid-motion-halfpelrefine", 1, NULL, "motion halfpelrefine", "" );
93         add_bool( "encoder-xvid-motion-extsearch", 1, NULL, "motion extsearch", "" );
94         add_bool( "encoder-xvid-motion-earlystop", 1, NULL, "motion earlystop", "" );
95         add_bool( "encoder-xvid-motion-quickstop", 1, NULL, "motion quickstop", "" );
96         add_bool( "encoder-xvid-motion-usesquares", 0, NULL, "use a square search", "" );
97 vlc_module_end();
98 #endif