Commit d6c62919 authored by Antoine Cellerier's avatar Antoine Cellerier

Add option to specify which muxer we want to use in ffmpeg (ie:...

Add option to specify which muxer we want to use in ffmpeg (ie: #std{mux=ffmpeg{mux=flv}...) Still seems kind of broken as the resulting file can't be demuxed by vlc/libavformat. Looks like the video and audio codec aren't identified correctly in the ffmpeg muxer. Must be some error in mux.c i guess.
parent e8ff31e8
......@@ -193,6 +193,8 @@ vlc_module_begin();
add_submodule();
set_description( _("FFmpeg muxer" ) );
set_capability( "sout mux", 2 );
add_string( "ffmpeg-mux", NULL, NULL, MUX_TEXT,
MUX_LONGTEXT, VLC_TRUE );
set_callbacks( E_(OpenMux), E_(CloseMux) );
#if defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
......
......@@ -297,3 +297,6 @@ N_("<filterName>[:<option>[:<option>...]][[,|/][-]<filterName>[:<option>...]]...
#define SCALEMODE_TEXT N_("Scaling mode")
#define SCALEMODE_LONGTEXT N_("Scaling mode to use.")
#define MUX_TEXT N_("Ffmpeg mux")
#define MUX_LONGTEXT N_("Force use of ffmpeg muxer.")
......@@ -44,6 +44,10 @@
/* Version checking */
#if defined(HAVE_FFMPEG_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE)
static const char *ppsz_mux_options[] = {
"mux", NULL
};
/*****************************************************************************
* mux_sys_t: mux descriptor
*****************************************************************************/
......@@ -83,13 +87,24 @@ int E_(OpenMux)( vlc_object_t *p_this )
sout_mux_t *p_mux = (sout_mux_t*)p_this;
sout_mux_sys_t *p_sys;
AVFormatParameters params, *ap = &params;
char *psz_mux;
/* Should we call it only once ? */
av_register_all();
config_ChainParse( p_mux, "ffmpeg-", ppsz_mux_options, p_mux->p_cfg );
/* Find the requested muxer */
psz_mux = var_GetNonEmptyString( p_mux, "ffmpeg-mux" );
if( psz_mux )
{
file_oformat = guess_format( psz_mux, NULL, NULL );
}
else
{
file_oformat =
guess_format(NULL, p_mux->p_access->psz_path, NULL);
}
if (!file_oformat)
{
msg_Err( p_mux, "unable for find a suitable output format" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment