ffmpegでmp3の無劣化カットをします。
目的
mp3の無劣化カットで有名なソフトウェアに「mp3DirectCut」があります。
しかし、インストールしてまで使いたくないので、他の方法を探したところ、ffmpegでできるらしいのでやってみます。
<参考>
stackoverflow.com
無劣化カット
コマンドのフォーマットは下記になります。
ffmpeg -ss <開始位置> -t <期間> -i <inputfile> -c:a copy <outputfile> ・「-ss」は「set the start time offset」の略、開始時間を指定する ・「-t」は「duration」でカットする期間を指定する ・「-c:a copy」は「-acodec copy」の略、再エンコードせずコピーを強制する
input.mp3の開始30秒から10分間(元ファイルの10分30秒まで)を出力したい場合、下記のようになります。
例1) ffmpeg -ss 30 -t 600 -i input.mp3 -c:a copy output.mp3 例2) ffmpeg -ss 00:30 -t 10:00 -i input.mp3 -c:a copy output.mp3
※「-ss」と「-t」の記載フォーマットは公式ドキュメントに説明があります。
→https://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax