I'm trying to use ffmpeg to encode a series of rendered images with a soundtrack. When we import that video into Premiere the audio seems to be 1/2 frame early. When we import that same video in Resolve the sync seems fine.
To see this, run this script and import "output.mov" into Premiere and Resolve:
#!/bin/sh
# generate 3 seconds worth of test charts at 24fps
ffmpeg -y \
-f lavfi -i testsrc=duration=3:size=1280x720:rate=24 \
-f image2 "%03d.png"
# generate a 1kHz tone with duration 1/24s
duration=$(awk "BEGIN {print 1/24}")
ffmpeg -y \
-f lavfi -i sine=frequency=1000:duration=$duration \
-t 3.0 -acodec aac 1000hz.m4a
# combine the images and the audio, and offset the audio exactly 2 seconds
ffmpeg -y \
-f image2 -framerate 24.0 -i "%03d.png" \
-itsoffset 2.0 -i 1000hz.m4a \
-vcodec libx264 -pix_fmt yuv420p -crf 20 output.mov
The result is supposed to be a 3 second video clip with the audio pop exactly on the 49th frame. And when our assistant editor loads the clip into Davinci Resolve the pop occurs exactly on frame 49 as we expect. In Premiere the pop is a half frame early.
So in ffmpeg I can add a 1/2 frame offset to the audio. That video will import in Premiere with the audio on frame 49, and in Resolve I'm told the audio is a half frame late. Is there a way to encode this video so that the audio is properly synced for Premiere AND Resolve?