]> git.sesse.net Git - vlc/commitdiff
Add option to specify which muxer we want to use in ffmpeg (ie: #std{mux=ffmpeg{mux...
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 11 Feb 2007 16:26:19 +0000 (16:26 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 11 Feb 2007 16:26:19 +0000 (16:26 +0000)
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/ffmpeg.h
modules/codec/ffmpeg/mux.c

index a42ecc64837f5b09da5f8585de8698dd30e00e79..1324f652260ed18e4c39d9d6b2778b036cedb8f0 100644 (file)
@@ -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)
index 35dd6b16500503040749dbd74f0ea5162f0fd9ee..b8cd5868322e7f5b7758195e69f9fa3553aff5b9 100644 (file)
@@ -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.")
+
index 9844dfe65cade744f09b0d4e219274d913fb076f..29704d8d8d511912e5f2a9ccb8da9ba9b88fe318 100644 (file)
 /* 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
  *****************************************************************************/
@@ -79,17 +83,28 @@ static offset_t IOSeek( void *opaque, offset_t offset, int whence );
  *****************************************************************************/
 int E_(OpenMux)( vlc_object_t *p_this )
 {
-    AVOutputFormat *file_oformat; 
+    AVOutputFormat *file_oformat;
     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 */
-    file_oformat =
-        guess_format(NULL, p_mux->p_access->psz_path, NULL);
+    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" );