[MEncoder-users] sync problem while encoding bluray with dts audio to avi then to mkv

Alexander Schwarzkopf Schwarzkopf.Alexander at web.de
Wed Apr 8 11:38:36 CEST 2009


> 1. Re: sync problem while encoding bluray with dts audio to avi
> then to mkv (James Hastings-Trew)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 04 Apr 2009 08:50:18 -0600
> From: James Hastings-Trew <jimht@???>
> Subject: Re: [MEncoder-users] sync problem while encoding bluray with
>     dts audio to avi then to mkv
> To: MEncoder usage discussions <mencoder-users@???>
> Message-ID: <49D773AA.9060606@???>
> Content-Type: text/plain; charset=ISO-8859-15; format=flowed
>
> Alexander Schwarzkopf wrote:
> > Hi,
> >
> > I am building a script to make conversion of HD content from BluRay, HDDVD, HDTV, ... in linux as simple as possible.
> >
> > I use mencoder to convert (and optionally downsize, add black borders to meet 16/9 aspect ratio, ...) video and recode to x264 in AVI container. Audio is processed with -oac copy by default, but I did also try to reencode. Then I use mkvmerge to repackage the results to Matroska.
> >
> > Now I encountered a sync problem when converting sources containing DTS audio. The AVI seems o.k., at least it plays correct using mplayer or vlc. But as soon as I convert it to Matroska the DTS stream is way out of sync (most of the time the audio gets stretched by MINUTES, making the result much longer than the original video). This does not happen at all when the source has AC3 audio and it even works for approx. 50 % of the sources with dts audio in .TS format. Sources with dts in Matroska container almost always fail.
> >
> > I've been trying for weeks now (still long runtimes per movie, even with a Core i7 ;-) ), trying every tip I could find (using -vf harddup , -mc 0 -noskip, encoding to raw formats, reencoding audio to mp3, aac, 6ch aac, ...) but nothing did solve the problem.
> >
> > As it works sometimes (even if it are rare occasions) I think it does not have much to do with mkvmerge. More likely it has something to do with erroneous source streams.
> >
> > Is there a known problem witch -oac copy / DTS audio / maybe inconsistent source streams?
> >
> > If there isn't, how can I help in resolving this issue? If it would fail in 10% of the cases I'd say: "get another source", but it's more like 90%, so it seems to me to be a more fundamental problem.
> >
> > I'm using the following commands for twopass encoding:
> > /usr/bin/mencoder xxx_1080p.mkv -alang ger -oac copy -ovc x264 \
> > -x264encopts subq=4:bframes=4:b_pyramid:weight_b:pass=1:psnr:bitrate=6000:vbv_maxrate=9500:vbv_bufsize=2000:direct_pred=auto:keyint=100:turbo=1:threads=auto\
> > -passlogfile xxx_1080p_2pass.log -vf expand=1920:1080,harddup -fps 23.976 -ofps 23.976 -o /dev/null
> > /usr/bin/mencoder xxx_1080p.mkv -alang ger -oac copy -ovc x264 -x264encopts \
> > frameref=6:analyse=all:me=umh:subme=7:trellis=2:bframes=4:b_pyramid:subq=6:mixed_refs:weight_b:no_fast_pskip:direct_pred=auto:mixed_refs:keyint=100:nr=200:vbv_maxrate=9500:vbv_bufsize=2000:bitrate=6000:threads=auto:pass=2\
> > -passlogfile xxx_1080p_2pass.log -vf expand=1920:1080,harddup -fps 23.976 -ofps 23.976 -o xxx_1080p.avi
> >
> > Thanks for reading this rather long text, and thanks in advance for any hints,
> > Alexander Schwarzkopf
> >
> You didn't mention how you were getting the streams off the bluray discs
> in the first place. I've used eac3to, and on titles with complex program
> structures (Wall-E comes to mind) eac3to often has to make 2 passes on
> the audio to resolve overlaps where the program is spread out over
> numerous discrete files on the bluray disc. These overlaps, if not
> processed properly, could possibly result in AV sync drift on a long
> title. Just a thought. Here's a link to a small article (windows
> centric, but the general principle is the same) I posted about bluray
> conversions: http://videogeek.shacknet.nu/index.php?entry=entry090204-064824
>

I am using tsMuxeR (windows version under wine) to convert .m2ts to .ts. In this process
I also use it to strip the TrueHD and DTS HD down to AC3 and DTS audio (as my script and my
hardware cannot handle the HD versions atm).

But as this script shall be a general solution I also have to expect (and have already tested)
downloaded sources already in Matroska container, where I don't know how they got there.

> Mind you, I'm converting the audio to aac which is probably not what you
> are aiming for in the end, but I believe your sync issues are
> originating at the extraction phase, which is what is convered in the
> article I linked to above.
>

This may not be the purpose of this script, but I also tried converting the audio to any format sensible
in any method I could think of. I am pretty sure that it has something to do with incosistent streams
in the various sources.

The question is how to get this more stable (as it already is when having AC3
audio from the same sources). I now do have a source that contains AC3 and DTS audio. It works 
without problems when I select AC3 to copy into AVI and merge DTS later into Matroska. 
Will test if it does not work when I copy DTS directly into the AVI and merge AC3 later.

> I've also noticed, for whatever reason, that when dealing with audio
> from a .mkv source, the audio always seems to be about 3 frames behind
> the video, and I have to compensate for that with a -delay value. Also,
> you are specifying your -fps and -opfs values wrong: use 24000/1001
> instead of 23.976.
>

If it was just a delay I would not have a problem. ;-)
I will try specifying a more precise fps value. But I am pretty sure I already tried that.

Thanks, I will read into the article you linked. Maybe I find something.

Alexander


__________________________________________________________________________
Verschicken Sie SMS direkt vom Postfach aus - in alle deutschen und viele 
ausländische Netze zum gleichen Preis! 
https://produkte.web.de/webde_sms/sms





More information about the MEncoder-users mailing list