+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+#define VENC_TEXT N_("Video encoder")
+#define VENC_LONGTEXT N_( \
+ "Allows you to specify the video encoder to use and its associated " \
+ "options." )
+#define VCODEC_TEXT N_("Destination video codec")
+#define VCODEC_LONGTEXT N_( \
+ "Allows you to specify 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 FPS_TEXT N_("Video frame-rate")
+#define FPS_LONGTEXT N_( \
+ "Allows you to specify an output frame rate for the video." )
+#define DEINTERLACE_TEXT N_("Deinterlace video")
+#define DEINTERLACE_LONGTEXT N_( \
+ "Allows you to deinterlace the video before encoding." )
+#define DEINTERLACE_MODULE_TEXT N_("Deinterlace module")
+#define DEINTERLACE_MODULE_LONGTEXT N_( \
+ "Specifies the deinterlace module to use (ffmpeg-deinterlace or " \
+ "deinterlace)." )
+#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 VFILTER_TEXT N_("Video filter")
+#define VFILTER_LONGTEXT N_( \
+ "Allows you to specify video filters used after the video " \
+ "transcoding and subpictures overlaying." )
+
+#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 AENC_TEXT N_("Audio encoder")
+#define AENC_LONGTEXT N_( \
+ "Allows you to specify the audio encoder to use and its associated " \
+ "options." )
+#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 SENC_TEXT N_("Subtitles encoder")
+#define SENC_LONGTEXT N_( \
+ "Allows you to specify the subtitles encoder to use and its associated " \
+ "options." )
+#define SCODEC_TEXT N_("Destination subtitles codec")
+#define SCODEC_LONGTEXT N_( \
+ "Allows you to specify the destination subtitles codec used for the " \
+ "streaming output." )
+#define SFILTER_TEXT N_("Subpictures filter")
+#define SFILTER_LONGTEXT N_( \
+ "Allows you to specify subpictures filters used during the video " \
+ "transcoding. The subpictures produced by the filters will be overlayed " \
+ "directly onto the video." )
+
+#define THREADS_TEXT N_("Number of threads")
+#define THREADS_LONGTEXT N_( \
+ "Allows you to specify the number of threads used for the transcoding." )
+#define HP_TEXT N_("High priority")
+#define HP_LONGTEXT N_( \
+ "Runs the optional encoder thread at the OUTPUT priority instead of " \
+ "VIDEO." )
+
+#define ASYNC_TEXT N_("Synchronise on audio track")
+#define ASYNC_LONGTEXT N_( \
+ "This option will drop/duplicate video frames to synchronise the video " \
+ "track on the audio track." )
+
+#define HURRYUP_TEXT N_( "Hurry up" )
+#define HURRYUP_LONGTEXT N_( "Allows you to specify if the transcoder " \
+ "should drop frames if your CPU can't keep up with the encoding rate." )
+
+static int Open ( vlc_object_t * );
+static void Close( vlc_object_t * );
+
+#define SOUT_CFG_PREFIX "sout-transcode-"
+
+vlc_module_begin();
+ set_shortname( _("Transcode"));
+ set_description( _("Transcode stream output") );
+ set_capability( "sout stream", 50 );
+ add_shortcut( "transcode" );
+ set_callbacks( Open, Close );
+ set_category( CAT_SOUT );
+ set_subcategory( SUBCAT_SOUT_STREAM );
+ set_section( N_("Video"), NULL );
+ add_string( SOUT_CFG_PREFIX "venc", NULL, NULL, VENC_TEXT,
+ VENC_LONGTEXT, VLC_FALSE );
+ 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_float( SOUT_CFG_PREFIX "fps", 0, NULL, FPS_TEXT,
+ FPS_LONGTEXT, VLC_FALSE );
+ add_bool( SOUT_CFG_PREFIX "hurry-up", VLC_TRUE, NULL, HURRYUP_TEXT,
+ HURRYUP_LONGTEXT, VLC_FALSE );
+ add_bool( SOUT_CFG_PREFIX "deinterlace", 0, NULL, DEINTERLACE_TEXT,
+ DEINTERLACE_LONGTEXT, VLC_FALSE );
+ add_string( SOUT_CFG_PREFIX "deinterlace-module", "deinterlace", NULL,
+ DEINTERLACE_MODULE_TEXT, DEINTERLACE_MODULE_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_module_list_cat( SOUT_CFG_PREFIX "vfilter", SUBCAT_VIDEO_VFILTER,
+ NULL, NULL,
+ VFILTER_TEXT, VFILTER_LONGTEXT, VLC_FALSE );
+
+ 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 );
+
+ set_section( N_("Audio"), NULL );
+ add_string( SOUT_CFG_PREFIX "aenc", NULL, NULL, AENC_TEXT,
+ AENC_LONGTEXT, VLC_FALSE );
+ 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_bool( SOUT_CFG_PREFIX "audio-sync", 0, NULL, ASYNC_TEXT,
+ ASYNC_LONGTEXT, VLC_FALSE );
+
+ set_section( N_("Overlays/Subtitles"), NULL );
+ add_string( SOUT_CFG_PREFIX "senc", NULL, NULL, SENC_TEXT,
+ SENC_LONGTEXT, VLC_FALSE );
+ add_string( SOUT_CFG_PREFIX "scodec", NULL, NULL, SCODEC_TEXT,
+ SCODEC_LONGTEXT, VLC_FALSE );
+ add_bool( SOUT_CFG_PREFIX "soverlay", 0, NULL, SCODEC_TEXT,
+ SCODEC_LONGTEXT, VLC_FALSE );
+ add_module_list_cat( SOUT_CFG_PREFIX "sfilter", SUBCAT_VIDEO_SUBPIC,
+ NULL, NULL,
+ SFILTER_TEXT, SFILTER_LONGTEXT, VLC_FALSE );
+
+ set_section( N_("Miscellaneous"), NULL );
+ add_integer( SOUT_CFG_PREFIX "threads", 0, NULL, THREADS_TEXT,
+ THREADS_LONGTEXT, VLC_TRUE );
+ add_bool( SOUT_CFG_PREFIX "high-priority", 0, NULL, HP_TEXT, HP_LONGTEXT,
+ VLC_TRUE );
+
+vlc_module_end();
+
+static const char *ppsz_sout_options[] = {
+ "venc", "vcodec", "vb", "croptop", "cropbottom", "cropleft", "cropright",
+ "scale", "fps", "width", "height", "vfilter", "deinterlace",
+ "deinterlace-module", "threads", "hurry-up", "aenc", "acodec", "ab",
+ "samplerate", "channels", "senc", "scodec", "soverlay", "sfilter",
+ "audio-sync", "high-priority", NULL
+};