paulpacifico / shutter-encoder

A professional video compression tool accessible to all, mostly based on FFmpeg.
https://www.shutterencoder.com
GNU General Public License v3.0
1.06k stars 60 forks source link

[Bug] File-Level Audio Concatenation Leading to Wrong Results #175

Open horatio-shieh opened 10 months ago

horatio-shieh commented 10 months ago

Dear Paul,

I hope this message finds you well. I wanted to bring to your attention an issue I encountered while attempting to merge two .mp3 files with differing sampling rates using your tool.

To assist in diagnosing the issue, I have attached two sample files generated by OpenAI's TTS API for your review. The first file has a sampling rate of 24000, and the second file's sampling rate has been tweaked to 44100. Upon merging, it appears that the playback of the second file is accelerated.

Upon further investigation, I noticed that in Merge.java, the file-level concatenation command -f concat is used for merging files, which, as per FFmpeg wiki, is generally recommended for files sharing identical codec parameters. This could explain the wrong playback speed when merging files with different sampling rates. A helpful resource that outlines best practices for such tasks is available at Concatenation of files with different codecs, which worked for me.

Thank you for the effort you've invested in developing this amazing tool and making it widely accessible!

Horatio