[MEncoder-users] Can encode from mkv with -oac lavc but not with -oac copy

Trent Piepho xyzzy at speakeasy.org
Sat Jun 9 19:56:24 CEST 2007


On Sat, 9 Jun 2007, Dominique Dumont wrote:
>
> I've tried to encode a mkv file with -oac copy.
>
> The command is :
>
> $ mencoder 'Test.mkv' -oac copy -vf scale=1280:534,crop=1280:528:0:3 -ofps 24000/1001 -ovc x264 -x264encopts subq=1:frameref=1:bframes=3:b_pyramid:weight_b:bitrate=4000:threads=2:pass=1 -o /dev/null
>
> [snip]
> [mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
> [mkv] Track ID 2: audio (A_AC3), -aid 0, -alang eng
>

The mkv demuxer is simply completely broken for ac3 audio.  I posted a
patch to fix it, but it didn't get merged.  I'll try again:


Index: libmpdemux/demux_mkv.c
===================================================================
--- libmpdemux/demux_mkv.c	(revision 23424)
+++ libmpdemux/demux_mkv.c	(working copy)
@@ -2023,8 +2023,8 @@
   else if ((track->a_formattag == 0x2000) || /* AC3 */
            (track->a_formattag == 0x2001)) /* DTS */
     {
-      sh_a->wf->nAvgBytesPerSec = 16000;
-      sh_a->wf->nBlockAlign = 1536;
+      free(sh_a->wf);
+      sh_a->wf = NULL;
     }
   else if (track->a_formattag == 0x0001)  /* PCM || PCM_BE */
     {



More information about the MEncoder-users mailing list