Skip to content

Instantly share code, notes, and snippets.

@sorah
Last active September 18, 2019 01:34
Show Gist options
  • Save sorah/949f1c8cbe380344a8f3eb3b4568f299 to your computer and use it in GitHub Desktop.
Save sorah/949f1c8cbe380344a8f3eb3b4568f299 to your computer and use it in GitHub Desktop.
FFXIV Shadowbringers OST MP3 fix for iPhone & iTunes Cloud Library
--- /tmp/76.a.txt 2019-09-18 10:31:33.890300257 +0900
+++ /tmp/76.b.txt 2019-09-18 10:31:40.363523048 +0900
@@ -9,24 +9,22 @@
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
-[mp3 @ 0x556dc9468640] Estimating duration from bitrate, this may be inaccurate
-Input #0, mp3, from '../shbost/SHADOWBRINGERS_76.mp3':
+Input #0, mp3, from './SHADOWBRINGERS_76.mp3':
Metadata:
album : SHADOWBRINGERS: FINAL FANTASY XIV Original Soundtrack
artist : 祖堅正慶 / Masayoshi Soken
album_artist : SQUARE ENIX MUSIC
composer : 祖堅正慶 / Masayoshi Soken
- copyright : 2019 SQUARE ENIX CO., LTD.
- TDAT : 28 July 2019
genre : Game
- TEXT : Michael–Christopher Koji Fox
- TOFN : 76_901
title : Tomorrow and Tomorrow
track : 76
arranger : 祖堅正慶 / Masayoshi Soken
+ encoder : Lavf58.29.100
date : 2019
- Duration: 00:04:31.52, start: 0.000000, bitrate: 340 kb/s
+ Duration: 00:04:31.52, start: 0.011995, bitrate: 337 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
- Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1417x1417, 90k tbr, 90k tbn, 90k tbc (attached pic)
+ Metadata:
+ encoder : Lavf
+ Stream #0:1: Video: png, rgb24(pc), 1417x1417, 90k tbr, 90k tbn, 90k tbc (attached pic)
Metadata:
comment : Cover (front)
# Somehow the MP3s shipped in FFXIV ShB OST Blu-ray doesn't play well on iPhone via iTunes Cloud Library.
# do -c:a copy the MP3 data through ffmpeg with limiting ID3 tags to get it fix.
# Q. Is ID3 tag filtering was really necessary?
# A. I guess it was not. Processing the data through ffmpeg clears the mp3 muxer warning "Estimating duration from bitrate,"
# Thus there's no problem on ID3 tag.
for x in ../shbost/*.mp3; do
echo "=========== ${x}"
out="$(basename "${x}")"
ffmpeg -y -i ${x} -f ffmetadata meta.orig.txt
grep '^\(;\|album\|artist\|composer\|genre\|title\|track\|arranger\|date\)' meta.orig.txt > meta.txt
ffmpeg -y -i ${x} -i meta.txt -vsync 0 -c:a copy -map_metadata 1 -id3v2_version 3 -write_id3v1 1 ${out}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment