10
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

無音のmp3を作る

Posted at

1秒の無音のmp3を作る場合、

ffmpeg -ar 48000 -t 1 -f s16le -acodec pcm_s16le -ac 2 -i /dev/zero -acodec libmp3lame -aq 4 silent.mp3

こんな感じ。

何で無音のmp3が必要になったのか?

サウンド部分がない動画をAVAssetExportSessionを使って書き出そうとしたら失敗になる現象に遭遇。

insertEmptyTimeRangeでは、書き出しに失敗するので色々調べてみると無音のデータを書き込むといいらしい。

なので、無音のmp3を作った。

参考

http://stackoverflow.com/questions/32817411/avassetexportsession-audio-missing-in-ios9
http://stackoverflow.com/questions/28865608/insertemptytimerange-to-avmutablecompositiontrack-not-working
http://stackoverflow.com/questions/32017827/ffmpeg-create-silent-ogg-audio-file

10
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?