jersou / studio-pack-generator

Convert a folder or a RSS URL to Studio pack zip for Lunii device
MIT License
80 stars 11 forks source link

The script make only one menu for one story despite of it generated 15 items and convert #17

Closed Alianirah closed 1 year ago

Alianirah commented 1 year ago

The script make only one menu and submenu for one story despite of it generated 15 items and convert.

I don't know how to resolve this problem.

I run it on debian

`checkAudioFormat of Star Wars - 4 - Un nouvel espoir/12 - Chapitre 12 - 1.mp3 : Format is KO Convert file Star Wars - 4 - Un nouvel espoir/23dfd00f.mp3 → Star Wars - 4 - Un nouvel espoir/12 - Chapitre 12 - 1.mp3 "ffmpeg" "-i" "Star Wars - 4 - Un nouvel espoir/23dfd00f.mp3" "-af" "volume=0.4dB,dynaudnorm" "-ac" "1" "-ar" "44100" "-map_metadata" "-1" "-y" "Star Wars - 4 - Un nouvel espoir/12 - Chapitre 12 - 1.mp3" → OK get max volume of file Star Wars - 4 - Un nouvel espoir/13 - Chapitre 12 - 2.item.wav → OK : 7.2 Db Convert file Star Wars - 4 - Un nouvel espoir/dc4b6b0f.wav → Star Wars - 4 - Un nouvel espoir/13 - Chapitre 12 - 2.item.mp3 "ffmpeg" "-i" "Star Wars - 4 - Un nouvel espoir/dc4b6b0f.wav" "-af" "volume=7.2dB,dynaudnorm" "-ac" "1" "-ar" "44100" "-map_metadata" "-1" "-y" "Star Wars - 4 - Un nouvel espoir/13 - Chapitre 12 - 2.item.mp3" → OK get max volume of file Star Wars - 4 - Un nouvel espoir/13 - Chapitre 12 - 2.mp3 → OK : 0.8 Db get info of file Star Wars - 4 - Un nouvel espoir/13 - Chapitre 12 - 2.mp3 info=Input #0, mp3, from 'Star Wars - 4 - Un nouvel espoir/13 - Chapitre 12 - 2.mp3': Metadata: title : 13 Chapitre 12 - 2 album : Un nouvel espoir (Star Wars 4) genre : Livre Audio album_artist : George Lucas track : 13 artist : Emmanuel Dekoninck date : 2022 Duration: 00:32:07.81, start: 0.025056, bitrate: 128 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s Metadata: encoder : LAME3.100 Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 450x450 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic) Metadata: comment : Cover (front) Stream mapping: Stream #0:1 -> #0:0 (mjpeg (native) -> wrapped_avframe (native)) Stream #0:0 -> #0:1 (mp3 (mp3float) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, null, to 'pipe:': Metadata: title : 13 Chapitre 12 - 2 album : Un nouvel espoir (Star Wars 4) genre : Livre Audio album_artist : George Lucas track : 13 artist : Emmanuel Dekoninck date : 2022 encoder : Lavf58.45.100 Stream #0:0: Video: wrapped_avframe, yuvj420p(progressive), 450x450 [SAR 96:96 DAR 1:1], q=2-31, 200 kb/s, 90k fps, 90k tbn, 90k tbc (attached pic) Metadata: comment : Cover (front) encoder : Lavc58.91.100 wrapped_avframe Stream #0:1: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s Metadata: encoder : Lavc58.91.100 pcm_s16le frame= 1 fps=0.5 q=-0.0 Lsize=N/A time=00:32:07.78 bitrate=N/A speed= 913x
video:1kB audio:332091kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

checkAudioFormat of Star Wars - 4 - Un nouvel espoir/13 - Chapitre 12 - 2.mp3 : Format is KO Convert file Star Wars - 4 - Un nouvel espoir/b1c7d643.mp3 → Star Wars - 4 - Un nouvel espoir/13 - Chapitre 12 - 2.mp3 "ffmpeg" "-i" "Star Wars - 4 - Un nouvel espoir/b1c7d643.mp3" "-af" "volume=0.8dB,dynaudnorm" "-ac" "1" "-ar" "44100" "-map_metadata" "-1" "-y" "Star Wars - 4 - Un nouvel espoir/13 - Chapitre 12 - 2.mp3" → OK get max volume of file Star Wars - 4 - Un nouvel espoir/14 - Chapitre 13.item.wav → OK : 7.6 Db Convert file Star Wars - 4 - Un nouvel espoir/9ed0ec7e.wav → Star Wars - 4 - Un nouvel espoir/14 - Chapitre 13.item.mp3 "ffmpeg" "-i" "Star Wars - 4 - Un nouvel espoir/9ed0ec7e.wav" "-af" "volume=7.6dB,dynaudnorm" "-ac" "1" "-ar" "44100" "-map_metadata" "-1" "-y" "Star Wars - 4 - Un nouvel espoir/14 - Chapitre 13.item.mp3" → OK get max volume of file Star Wars - 4 - Un nouvel espoir/14 - Chapitre 13.mp3 → OK : 0.8 Db get info of file Star Wars - 4 - Un nouvel espoir/14 - Chapitre 13.mp3 info=Input #0, mp3, from 'Star Wars - 4 - Un nouvel espoir/14 - Chapitre 13.mp3': Metadata: title : 14 Chapitre 13 album : Un nouvel espoir (Star Wars 4) genre : Livre Audio album_artist : George Lucas track : 14 artist : Emmanuel Dekoninck date : 2022 Duration: 00:07:03.24, start: 0.025056, bitrate: 128 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s Metadata: encoder : LAME3.100 Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 450x450 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic) Metadata: comment : Cover (front) Stream mapping: Stream #0:1 -> #0:0 (mjpeg (native) -> wrapped_avframe (native)) Stream #0:0 -> #0:1 (mp3 (mp3float) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, null, to 'pipe:': Metadata: title : 14 Chapitre 13 album : Un nouvel espoir (Star Wars 4) genre : Livre Audio album_artist : George Lucas track : 14 artist : Emmanuel Dekoninck date : 2022 encoder : Lavf58.45.100 Stream #0:0: Video: wrapped_avframe, yuvj420p(progressive), 450x450 [SAR 96:96 DAR 1:1], q=2-31, 200 kb/s, 90k fps, 90k tbn, 90k tbc (attached pic) Metadata: comment : Cover (front) encoder : Lavc58.91.100 wrapped_avframe Stream #0:1: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s Metadata: encoder : Lavc58.91.100 pcm_s16le frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:07:03.20 bitrate=N/A speed= 949x
video:1kB audio:72904kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

checkAudioFormat of Star Wars - 4 - Un nouvel espoir/14 - Chapitre 13.mp3 : Format is KO Convert file Star Wars - 4 - Un nouvel espoir/c585a2c6.mp3 → Star Wars - 4 - Un nouvel espoir/14 - Chapitre 13.mp3 "ffmpeg" "-i" "Star Wars - 4 - Un nouvel espoir/c585a2c6.mp3" "-af" "volume=0.8dB,dynaudnorm" "-ac" "1" "-ar" "44100" "-map_metadata" "-1" "-y" "Star Wars - 4 - Un nouvel espoir/14 - Chapitre 13.mp3" → OK get max volume of file Star Wars - 4 - Un nouvel espoir/15 - Mot de George Lucas.item.wav → OK : 7.7 Db Convert file Star Wars - 4 - Un nouvel espoir/b9ecf73f.wav → Star Wars - 4 - Un nouvel espoir/15 - Mot de George Lucas.item.mp3 "ffmpeg" "-i" "Star Wars - 4 - Un nouvel espoir/b9ecf73f.wav" "-af" "volume=7.7dB,dynaudnorm" "-ac" "1" "-ar" "44100" "-map_metadata" "-1" "-y" "Star Wars - 4 - Un nouvel espoir/15 - Mot de George Lucas.item.mp3" → OK get max volume of file Star Wars - 4 - Un nouvel espoir/15 - Mot de George Lucas.mp3 → OK : 2.3 Db Convert file Star Wars - 4 - Un nouvel espoir/84cd7ff7.mp3 → Star Wars - 4 - Un nouvel espoir/15 - Mot de George Lucas.mp3 "ffmpeg" "-i" "Star Wars - 4 - Un nouvel espoir/84cd7ff7.mp3" "-af" "volume=2.3dB,dynaudnorm" "-ac" "1" "-ar" "44100" "-map_metadata" "-1" "-y" "Star Wars - 4 - Un nouvel espoir/15 - Mot de George Lucas.mp3" → OK Try convert Star Wars - 4 - Un nouvel espoir/0-item.png → Star Wars - 4 - Un nouvel espoir/thumbnail.png → OK create Star Wars - 4 - Un nouvel espoir-1670262346545.zip add asset 0-item.png add asset 00 - Prologue.mp3 add asset 0-item.mp3 write Star Wars - 4 - Un nouvel espoir-1670262346545.zip Done (322.652 sec) : Star Wars - 4 - Un nouvel espoir → Star Wars - 4 - Un nouvel espoir-1670262346545.zip `

jersou commented 1 year ago

what is the file tree of this input folder ? if it's :


📂 Star Wars - 4 - Un nouvel espoir
├── 🎵 12 - Chapitre 12 - 1.mp3      ← 📗 audio story
├── 🎵 12 - Chapitre 12 - 2.mp3      ← 📗 audio story
└── 🎵 13 - Chapitre 13.mp3          ← 📗 audio story

it does not match the expected structure :

📂 Story folder
└── 📂 Choose a story         ← 📂 first menu
    ├── 🎵 the story 1.mp3      ← 📗 audio story
    ├── 🎵 the story 2.mp3      ← 📗 audio story
    └── 🎵 the story 3.mp3      ← 📗 audio story

and should be

📂 Star Wars - 4 - Un nouvel espoir
└── 📂 Choisie ton chapitre         ← 📂 first menu
    ├── 🎵 12 - Chapitre 12 - 1.mp3    ← 📗 audio story
    ├── 🎵 12 - Chapitre 12 - 2.mp3    ← 📗 audio story
    └── 🎵 13 - Chapitre 13.mp3        ← 📗 audio story
Alianirah commented 1 year ago

Perfect, really ty, i will try again