audioffmpegmetadataflac

FFMPEG: flac audio file duration in metadata is 0


I have a flac audio file with incorrect duration in the metadata. The audio has a length of 55 minutes but the metadata has a duration of 0. Is it possible to use an ffmpeg command to fix this?

Below are the outputs of an ffprobe:

  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16

Solution

  • The FLAC header is missing or incomplete. Re-encoding will re-write it:

    ffmpeg -i input.flac -c:v copy -c:a flac output.flac
    

    There will be no quality loss as FLAC is lossless.