Hoping someone out there can help me with this audio issue I'm having using FFmpeg. I've written a bash script using FFmpeg that processes as source a broadcast quality ProRes (HQ) file with four mono tracks of audio. Source audio is LPCM 24-bit, 48kHz signed little endian, and I am exporting the same. Track 1 is full mix left, track 2 is full mix right, track 3 is music/FX left and track 4 is music/FX right. The script takes the source video and trims the video asset using in and out points from a sidecar XML. It also adds a custom slate at the head that uses a separate slate-only MOV file and is joined together via concat. Custom text is added to the slate via the drawtext filter and, finally, audio tracks 3 and 4 are removed and tracks 1 and 2 are merged together into a single stereo interleaved track using amerge.
All of this, seemingly, works like a charm. The problem I'm noticing occurs when I run the resulting export through our in-house QC software. This software detects audio signal clipping at multiple points throughout the file created by FFmpeg. When I create this exact same file via Adobe Premiere or another transcode system, our QC does not detect any clipping. Our QC tools also do not detect any clipping in the source file. This leads me to believe that the clipping is being introduced either by FFmpeg or by my implementation of it. I've tried multiple additional filters within FFmpeg, including pan, amix, volume, etc., but nothing seems to help.
Anyone have any ideas? Pasting the relevant section of my script for reference:
ffmpeg \
-ss "$hour":"$min":"$sec""$mil_fin" \
-t "$hour_minus":"$min_b":"$sec_b""$mil_fin_b" \
-i "$vid" \
-i "$elements_path"Slate_HD.mov \
-filter_complex \
"[0:a:0] [0:a:1] amerge=inputs=2 [stereo]; \
[1:0] [1:1] [0:0] [stereo] concat=n=2:v=1:a=1 [v] [a]; \
[v]drawtext=enable='between(t,0,28)':fontfile="$fonts"Arial.ttf:fontsize=50:fontcolor=white\
:x=170:y=170:text='$title', \
drawtext=enable='between(t,0,28)':fontfile="$fonts"Arial.ttf:fontsize=50:fontcolor=white\
:x=170:y=170+50:text='Series $series_number Episode $episode_number', \
drawtext=enable='between(t,0,28)':fontfile="$fonts"Arial.ttf:fontsize=50:fontcolor=white\
:x=170:y=170+150:text='$transcode_date', \
yadif=0:-1:0 [o]" \
-map '[o]' -map '[a]' \
-timecode 09:59:30:00 \
-c:v prores_ks -profile:v 3 \
-c:a pcm_s24le \
-threads 3 \
"$output_name".mov