Announcement

Collapse
No announcement yet.

MPEG to DivX AVI audio synch

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MPEG to DivX AVI audio synch

    I recently converted an MPEG to a DivX avi. in the process, it set the audio about a second out of synch. Other than guessing and manually adjusting the offset, is there a good way to do this?

  • #2
    How did you do the conversion?

    Going directly from one temporally compressed format to another is fraught with risk in terms of maintaining synch, especially if they use different GOP lenghts.

    Personally I'd convert to uncompressed or MJPeg video (all I-frames) with PCM audio THEN do the DivX conversion.

    Dr. Mordrid
    Dr. Mordrid
    ----------------------------
    An elephant is a mouse built to government specifications.

    I carry a gun because I can't throw a rock 1,250 fps

    Comment


    • #3
      Originally posted by Dr Mordrid
      How did you do the conversion?
      I opened the MPEG in VirtualDub-MPEG.

      I set it to use DivX 5.21 compression, Standard, 1700Kbps

      Save as AVI...

      Going directly from one temporally compressed format to another is fraught with risk in terms of maintaining synch, especially if they use different GOP lenghts.
      Grand Old Party? LOL, seriously, what's a "GOP length"?

      Personally I'd convert to uncompressed or MJPeg video (all I-frames) with PCM audio THEN do the DivX conversion.

      Dr. Mordrid
      Got a link to the codec?

      Will the extra conversion make the quality worse?

      Comment


      • #4
        GOP = Group Of Pictures
        <TABLE BGCOLOR=Red><TR><TD><Font-weight="+1"><font COLOR=Black>The world just changed, Sep. 11, 2001</font></Font-weight></TR></TD></TABLE>

        Comment


        • #5
          aye.

          Comment


          • #6
            Time for Video Compression 101

            There are two types of video compression; INTRA-frame and INTER-frame (aka: termporally compressed).

            Intra-frame video consists of all bitmaps (I-frames) strung together in a stream, usually packaged in an *.avi, *.qt or *.mov file. Uncompressed, DV and MJPeg are examples and all are very commonly used for editing, but these are by no means the whole list.

            Intra-frame video could well be thought of as streaming JPeg's, or BMP's in the case of uncompressed video.

            The editable compression ratios for Intra-frame video typically run from 1:1 (no compression) to 5:1 for DV. Higher than that and recompression errors work their way into the edit in the form of pixelization.

            Maintaining synch with Intra-frame video is usually pretty straight-forward, especially if the audio is PCM (uncompressed *.wav) and locked to the video. This isn't always the case as some DV cams lock the audio and some don't, but generally it's not too hard to maintain synch.

            Inter-frame video consists not only of I-frames but also synthesized frames (B and P frames). B's and P's are not real bitmaps but constructs based on in-frame movement and other changes between the I-frames. Because of the high level of synthesized data inter-frame compression ratios run quite high; often 20:1 or more.

            Examples are MPEG-1/2, WMV, DivX, MPEG-4, Wavelet etc. etc.

            A group of one I-frame and its associated B and P frames is a GOP, or Group Of Pictures. How many I, B and P frames there are in a GOP determines the GOP length.

            Generally speaking the shorter the GOP length (and therefore the more I-Frames/second) the more "editable" the video is without undue recompression errors cropping up.

            On the other hand long GOP's are best used for distribution formats where the file will undergo no more changes. In MPEG-2 files for DVD the GOP is long; usually 15 or 18 with one I-frame followed by 14 (or 17) B and P frames.

            With temporally compressed video the audio has to be multiplexed (MUX'ed) to align the two, and since very often the audio is also temporally compressed this can get complicated.

            Examples of temporally compressed audio are MP3, WMA etc.

            Since MPEG sources are very likely long-GOP with MPEG Layer 2 or MP3 audio re-MUX'ing the audio for DivX brings in lots of room for error in terms of the likely different GOP lengths of the two video formats.

            Trust me, it ain't that simple

            In my experience re-MUX'ing can go well but just as often not, hence my recommendation to convert to an all I-frame video/PCM audio format as an in-between step.

            Uncompressed, DV and MJPeg codecs for *.avi are part of WinXP, if that's what you're running. Some editing software also installs Quicktimes codecs, which also include the above compressors.

            If the intermediate format is uncompressed video there will very little in the way of losses other than those introduced by DivX itself. Just make sure you're using an NTFS volume for the uncompressed file though as they can get HUGE; about 27 megs/second.

            Dr. Mordrid
            Last edited by Dr Mordrid; 26 May 2005, 16:08.
            Dr. Mordrid
            ----------------------------
            An elephant is a mouse built to government specifications.

            I carry a gun because I can't throw a rock 1,250 fps

            Comment


            • #7
              Thanks for the write up.

              I can't find MJPeg in my codecs list in virtualdub. Maybe Uncompressed RGB??

              Comment


              • #8
                That's the highest quality way to go.

                If you don't have MJPeg in your codecs list you can get a very good one cheap from Morgan Multimedia. A 60 day free trial is on this page;

                Video codecs: M-JPEG, JPEG2000, JPEG-XR. Digital Cinema. Stereoscopic 3D. Video For Windows (VfW) & DirectShow. Adobe Premiere Pro. 32-bit & 64-bit.


                The codec can be had for either $15 or $20 USD, depending on the version. Morgan is one of the best MJPeg codecs out there and excellent for editing or use as an intermediate codec with the high quality settings.



                Dr. Mordrid
                Dr. Mordrid
                ----------------------------
                An elephant is a mouse built to government specifications.

                I carry a gun because I can't throw a rock 1,250 fps

                Comment


                • #9
                  Take a look at my first shot at video editing...LMK what you think.

                  Comment


                  • #10
                    Apart from compression, perhaps you could cut a bit on paning and consider more jump shots and crossfades. Otherwise looks fine.

                    BTW thanks for the RiDe. lol

                    Debbie
                    We pass this way only once. Make the most of it !

                    Comment


                    • #11
                      Jump shot? You mean "Jump cut"?

                      Jump cut has a bad connotation and means shooting, pausing then picking up the same shot with footage missing. That's discouraged as its visually annoying.

                      If you mean showing a scene, cutting to another scene then cutting back to the original scene then that's OK and is properly referred to as a "cutaway".

                      Dr. Mordrid
                      Last edited by Dr Mordrid; 2 June 2005, 21:05.
                      Dr. Mordrid
                      ----------------------------
                      An elephant is a mouse built to government specifications.

                      I carry a gun because I can't throw a rock 1,250 fps

                      Comment


                      • #12
                        I have no idea what you guys are talking aboot.

                        Comment


                        • #13
                          yes Doc. but over here we often call it a jump shots (jumping from one scene to another)avoiding the pan. Bad terminology? perhaps ! but that's it.

                          Debbie
                          We pass this way only once. Make the most of it !

                          Comment


                          • #14
                            Well, the only thing I can gather is that you're talking about is the camera work. He wasn't the best...but what do you reccomend exactly?

                            Comment


                            • #15
                              I am of the opinion that too much paning is best avoided, the more so in a moving car .I would rarther go for a crossfade.
                              We pass this way only once. Make the most of it !

                              Comment

                              Working...
                              X