diff --git libavformat/matroskaenc.c libavformat/matroskaenc.c
index 3b525ad..cd4f628 100644
--- libavformat/matroskaenc.c
+++ libavformat/matroskaenc.c
@@ -500,6 +500,8 @@ static int64_t mkv_write_cues(AVFormatContext *s, mkv_cues *cues, mkv_track *tra
 
 static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec)
 {
+#if 0 // MEANX avidemux does thing differently
+
     const uint8_t *header_start[3];
     int header_len[3];
     int first_header_size;
@@ -524,6 +526,29 @@ static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecContex
         avio_write(pb, header_start[j], header_len[j]);
 
     return 0;
+#else
+   // Not endian safe....
+      uint32_t packetLen[3],*ptr=(uint32_t *)codec->extradata;
+      uint8_t *data[3],i,j;
+      if( 3*4+ptr[0]+ptr[1]+ptr[2]!=codec->extradata_size)
+      {
+        av_log(s, AV_LOG_ERROR, "Broken avidemux xiph header.\n");
+        return -1;
+      }
+      data[0]=codec->extradata+3*4;
+      data[1]=data[0]+ptr[0];
+      data[2]=data[1]+ptr[1];
+      avio_w8(pb, 2);                    // number packets - 1
+      for (j = 0; j < 2; j++) 
+      {
+          put_xiph_size(pb, ptr[j]);
+      }
+      for (j = 0; j < 3; j++)
+        avio_write(pb, data[j], ptr[j]);
+      
+      return 0; // /MEANX
+#endif
+
 }
 
 static int put_wv_codecpriv(AVIOContext *pb, AVCodecContext *codec)
@@ -848,6 +873,23 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
     put_ebml_uint (pb, MATROSKA_ID_TRACKUID,
                    mkv->is_dash ? mkv->dash_track_number : i + 1);
     put_ebml_uint (pb, MATROSKA_ID_TRACKFLAGLACING , 0);    // no lacing (yet)
+	/**  MEANX : Add a default duration for video **/
+	if(codec->codec_type==AVMEDIA_TYPE_VIDEO)
+	{
+		if(codec->time_base.den && codec->time_base.num)
+		{
+			int num = codec->time_base.num;
+			int den = codec->time_base.den;
+			unsigned int default_duration;
+			float period = num;
+
+			period /= den;
+			period *= 1000*1000*1000; // in ns
+			default_duration = (unsigned int)floor(period);
+			put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, default_duration);
+		}
+	}
+	/**  MEANX : Add a default duration for video **/
 
     if ((tag = av_dict_get(st->metadata, "title", NULL, 0)))
         put_ebml_string(pb, MATROSKA_ID_TRACKNAME, tag->value);
