Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects AE (2020) Audio is Out of Sync in Rendered file when using H264 Codec

  • AE (2020) Audio is Out of Sync in Rendered file when using H264 Codec

  • Josh Ramakers

    March 6, 2023 at 10:03 pm

    Adobe After Effects (version 2020) – Sound is out of Sync after Rendering (With H264 Codec).

    (when using playback in After Effects the Sound stays in Sync; only the Rendered movie is Out of Sync).

    Sound is about 5 second too Early (for the whole rendered movie) in comparisation to the original source file. This only happens when I select the H264 Codec as ‘target’ codec (tried several times).

    FYI: I’m Not an experienced AE user and it is not due to a Hardware issue (Hardware is working fine, same is playback of video files; even a 200 Gb file playback’s just fine).

    Anybody any solution?

    This problem does Not occur when a lossless AVI codec is used instead (see second movie settings below) then the Sound stays In Sync.
    Both Rendered files are using the same Audio codec.
    Both Rendered files are using the same Source Movie with an Original Framerate of 23.976 FPS.

    In the Rendered Movie with Sound IN Sync it uses the AVI Lossless codec and
    the Sound Interleave, duration is changed to: 959 ms (23.00 video frames).
    This is done automatically by Adobe After effects (not manually by me).
    When using the Lossless AVI codec (default setting in Adobe After Effects) then Sound Stays IN Sync.

    When I manually change the (target) codec to H264 (I want a lower bitrate; due to not enough HD space).
    Then the Sound gets Out of Sync (the sound is about 5 second too early for the whole rendered movie).

    FYI (see first movie settings below); In the Rendered ‘Out of Sync’ movie the Sound part still uses Interleave, duration of: 958 ms (22.97 video frames). But Interleave, preload duration is set to : 959 ms

    Both values are not set by me; but by After Effects automatically.

    Media Info output movie 1; Rendered target movie with Sound OUT of Sync; General:

    Complete name : movie.1080p.H264-60Mbit-sec-PCM Sound Out of Sync
    Format : AVI
    Format/Info : Audio Video Interleave
    Format profile : OpenDML
    File size : 42.1 GiB
    Duration : 1 h 38 min
    Overall bit rate : 61.5 Mb/s
    Recorded date : 2023-03-03T01:00:40.219358

     

    Video:
    ID : 0
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4
    Format settings : CABAC / 5 Ref Frames
    Format settings, CABAC : Yes
    Format settings, Reference : 5 frames
    Codec ID : H264 <— H264 Codec
    Duration : 1 h 38 min
    Bit rate : 60.0 Mb/s
    Width : 1 920 pixels
    Height : 816 pixels
    Display aspect ratio : 2.35:1 <— Aspect ration as in Source (original) File
    Frame rate : 23.976 (23976/1000) FPS <— Framerate as in Source (original) File
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 1.598
    Time code of first frame : 0 / 0
    Time code source : Adobe tc_A / Adobe tc_O
    Stream size : 41.1 GiB (97%)
    Writing library : x264 core 152 r2851bm ba24899
    Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=3.3 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

    Audio:
    ID : 1
    Format : PCM
    Format settings : Little / Signed
    Codec ID : 1
    Duration : 1 h 38 min
    Bit rate mode : Constant
    Bit rate : 1 536 kb/s
    Channel(s) : 2 channels
    Sampling rate : 48.0 kHz
    Bit depth : 16 bits
    Stream size : 1.05 GiB (2%)
    Alignment : Aligned on interleaves
    Interleave, duration : 958 ms (22.97 video frames) < — ??? Check this strange difference; see next line)
    Interleave, preload duratio : 959 ms

     

    Media Info output movie 2: Sound IN Sync after Rendering (with LossLess codec); General:

    Complete name : Movie.1080p.AVI Lossless Codec-PCM Sound in Sync-30minutes.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    Format profile : OpenDML
    File size : 184 GiB
    Duration : 29 min 7 s
    Overall bit rate : 903 Mb/s

    Video:
    ID : 0
    Format : RGB
    Codec ID : 0x00000000
    Codec ID/Info : Basic Windows bitmap format. 1, 4 and 8 bpp versions are palettised.

    16, 24 and 32bpp contain raw RGB samples
    Duration : 29 min 7 s <— (after 200GB I ran out of space on my SSD; still playback runs OK)
    Source duration : 29 min 7 s
    Bit rate : 901 Mb/s <— Lossless AVI Codec (Extreme high bitrate)
    Width : 1 920 pixels
    Height : 816 pixels
    Display aspect ratio : 2.35:1 <— Aspect ratio as in Original File
    Frame rate : 23.976 (23976/1000) FPS <— Framerate as in Original File
    Color space : RGB
    Bit depth : 8 bits
    Bits/(Pixel*Frame) : 23.994
    Stream size : 183 GiB (100%)

    Audio:
    ID : 1
    Format : PCM
    Format settings : Little / Signed
    Codec ID : 1
    Duration : 29 min 7 s
    Bit rate mode : Constant
    Bit rate : 1 536 kb/s
    Channel(s) : 2 channels
    Sampling rate : 48.0 kHz
    Bit depth : 16 bits
    Stream size : 320 MiB (0%)
    Alignment : Aligned on interleaves
    Interleave, duration : 959 ms (23.00 video frames) <— ??? (Here Sound IN Sync from Original)
    Interleave, preload duratio : 959 ms

    Thanks,

    Josh

  • Walter Soyka

    March 7, 2023 at 8:37 pm

    I don’t think H.264 in AVI is well-supported.

    If space is the issue, I think you have a few options:

    1. Render to ProRes 422 from After Effects. It’s high quality, and compresses about 5:1 vs. lossless. You can always compress to H.264 in an MP4 container later with Media Encoder.

    2. Click the “Queue in AME” button in the render queue instead of the “Render” button. Ae 2020 can’t render directly to H.264/MP4, but Media Encoder can. Use one of the H.264 presets in Media Encoder.

    2. Stay on After Effects 2020 and get the third-party plugin AfterCodecs, which will allow you to render to H.264 in an MP4 container directly from the Ae render queue.

    3. Upgrade to the current release of After Effects (2023), which supports rendering directly to H.264/MP4 natively.

  • Josh Ramakers

    March 18, 2023 at 10:44 pm

    Thanks Walter; Very Helpfull 🙂

    I agree it’s something within the AE 2020 H.264 codec causing the issue.

    I updated to AE2023 & Adobe media encoder 2023. Now I do not have this issue that sound in out of sync from the start of the movie file.

    Now I have the issue that I cannot change the FrameRate when using (Adobe’s) Default AE H.264 codec for export (output to an MP4 file). Although my input file is 23.97 fps.

    When I select in AE the H.264 codec I can set a lot. Just not the Frame Rate. Which AE (‘due to meet format constrains’) automaticaly changes to 23.976) for which AE even gives me a warning). And that little change of 0.006 is enough to get the audio more and more out of sync (from 0 at the start of the movie to at the end about 6 seconds difference).

    I tried to select another output format (AVI) and Codec (do not know which one anymore) and then AE crashed (*) when I started rendering… 🙁

    ad (*): ‘Compressor format error’.

    I will try your suggested ProRes 422 codec.

    I really do not like Adobe tools. When working it gives fine results. But I think Adobe makes it a ‘sport’ to make easy and obvious things: very difficult. And I’m actually only using AE for (Maxon) Magic Bullit Denoiser III (which is excelent AND very easy to use ;-).

    Cheers, Josh

    Ps.

    Sorry for my late reaction. There came something much more important in between.

Viewing 1 - 3 of 3 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy