== ffmpeg ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers == A. Known-answer control: level of a 440 Hz sine made at amplitude 1/8 expected peak -18.1 dB and RMS -21.1 dB; measured max -17.7 dB, mean -21.1 dB (AAC coding adds a little error; tolerance 0.6 dB) -> PASS silent track measured mean -91.0 dB, max -91.0 dB (expected at or below -90 dB) -> PASS == B. The ffprobe check printed on the page: ffprobe -v error -select_streams a -show_entries stream=codec_name,channels,sample_rate -of csv=p=0 tone_pcm.mov: 1 line(s) ['pcm_s16le,44100,1'] (expected 1) -> PASS tone_ac3.mp4: 1 line(s) ['ac3,44100,1,'] (expected 1) -> PASS tone_aac.mp4: 1 line(s) ['aac,44100,1'] (expected 1) -> PASS no_audio.mp4: 0 line(s) [] (expected 0) -> PASS silent_track.mp4: 1 line(s) ['aac,44100,2'] (expected 1) -> PASS two_tracks_empty_first.mp4: 2 line(s) ['aac,44100,2', 'aac,44100,1'] (expected 2) -> PASS NOTE: a file with a silent audio track prints a line, so this check shows that a track exists, not that it carries sound (section C). == C. Level per audio track (volumedetect), the check that tells a silent track from a loud one tone_pcm.mov track 0: mean -21.1 dB, max -18.1 dB tone_ac3.mp4 track 0: mean -21.1 dB, max -18.1 dB silent_track.mp4 track 0: mean -91.0 dB, max -91.0 dB two_tracks_empty_first.mp4 track 0: mean -91.0 dB, max -91.0 dB two_tracks_empty_first.mp4 track 1: mean -21.1 dB, max -17.7 dB track 0 is silent and track 1 is loud -> PASS == D. The audio-only re-encode printed on the page: -map 0:v:0 -map 0:a:0 -c:v copy -c:a aac -b:a 160k -ac 2 -ar 48000 tone_pcm.mov (1 channel) -> fixed_pcm.mp4: audio aac, 2 channels, 48000 Hz; video h264; picture packets identical to source: True; max level -18.1 dB -> -20.8 dB (change -2.7 dB, expected about -3.0); length 6.000 s -> 6.000 s checks (aac, 2 ch, 48000 Hz, picture unchanged, level change as expected within 0.8 dB, length within 0.1 s) -> PASS tone_ac3.mp4 (1 channel) -> fixed_ac3.mp4: audio aac, 2 channels, 48000 Hz; video h264; picture packets identical to source: True; max level -18.1 dB -> -20.8 dB (change -2.7 dB, expected about -3.0); length 6.000 s -> 6.020 s checks (aac, 2 ch, 48000 Hz, picture unchanged, level change as expected within 0.8 dB, length within 0.1 s) -> PASS tone_pcm_stereo.mov (2 channel) -> fixed_pcm_stereo.mp4: audio aac, 2 channels, 48000 Hz; video h264; picture packets identical to source: True; max level -21.1 dB -> -20.8 dB (change +0.3 dB, expected about +0.0); length 6.000 s -> 6.000 s checks (aac, 2 ch, 48000 Hz, picture unchanged, level change as expected within 0.8 dB, length within 0.1 s) -> PASS tone_pcm.mov with -ac 1 instead of -ac 2: 1 channel, max level -18.1 dB -> -18.0 dB (change +0.1 dB) -> PASS NOTE: -ac 2 on a one-channel source puts it on both channels at about 3 dB lower each (the figure above). Leave -ac 2 out to keep a mono source mono. == E. The same command on the file whose first audio track is empty -map 0:a:0 keeps track 0: output max level -91.0 dB -> still silent -> PASS -map 0:a:1 keeps track 1: output max level -20.5 dB -> sound present -> PASS CONCLUSION: -map 0:a:0 does not rescue a file whose first track is empty; choose the loud track by number. == F. Remove an empty track and keep the other one without re-encoding the sound: -map 0:v:0 -map 0:a:1 -c copy output has 1 audio track, max level -17.7 dB -> PASS SUMMARY: 0 failed checks