Skip to content

Android: export codec and quality, embedded lyrics, logo cover - #1101

Merged
CaYatur merged 2 commits into
dev/androidfrom
android/leftovers
Nov 18, 2026
Merged

CaYatur merged 2 commits into
dev/androidfrom
android/leftovers

Conversation

@CaYatur

@CaYatur CaYatur commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

For #1054 (Phase 4/5 leftovers that do not need a phone).

Export: codec and quality (PLAN Phase 5 lists both)

  • Quality is a bitrate preset: Low / Mid / High = 0.08 / 0.15 / 0.3 bits per pixel per frame (about 5 / 9 / 19 Mbit/s at 1080p30). ExportHub already took a bitrate; the export page now sends it.
  • Codec: H.264 always; H.265 only when MediaCodecList has an encoder for 1080p (exportCaps). With H.265 the bitrate is 0.6× for the same quality. If the device lacks the encoder, the app falls back to H.264.

Fix: saving failed after 32 exports of the same song

MediaStore gives a pending file its final name when it is published (IS_PENDING=0). It tries at most 32 numbers for the same name ("name (1)" … "name (31)"), then refuses ("Failed to build unique file", from MediaProvider.update). A user who exported the same song 32 times saw "Could not save" from then on. Found on the emulator, whose gallery had reached sv-test-song (31).mp4. In that case ExportFlow.save now publishes with the date and time added (sv-test-song 2026-11-18 00-47-56.mp4). It also returns the name the gallery actually used.

Embedded lyrics (desktop's automatic lyrics, "embedded" step, #937)

  • New src/shared/id3-lyrics.js: the desktop parser (src/main/lyrics-lookup.js parseId3Lyrics, syltToLrc, findEmbedded) rewritten on Uint8Array/TextDecoder, so it loads in the engine page. The desktop file is unchanged.
  • Parity test android/js-tests/id3-lyrics.test.js requires the desktop module and compares both on 26 generated tags (v2.3/v2.4, extended header, USLT in latin1, UTF-16 with either BOM, UTF-16BE without BOM and UTF-8, SYLT in milliseconds with and without line breaks, both frames together, non-ID3, v2.2), plus the selection rule and tag size.
  • Export: when automatic lyrics are on (with embedded not off) and the scene has a lyrics layer, the song's embedded lyrics go into the job as lyricsAuto. This is the same field the desktop export fills.
  • In-app player: a new playerHead request reads only the ID3 tag of the playing file (≤ 4 MB) on the lyrics worker. If that tag has no lyrics, the app's cache and provider lookup runs as before.

Logo layer cover on Android

resolveLogoSrc treated every non-Windows platform as "cannot read album art". Android can (in-app player and media session), so "auto"/"track" now show the playing track's cover there. The change is in layers.js, which is part of the mode-thumbnail key, so the 121 thumbnails were regenerated (node scripts/gen-mode-thumbs.js). bg:solid has no thumbnail, the same as before (--check reports 1 missing on dev/android too).

Timeline UI fixes (found while taking the layout screenshots)

  • No emoji in the app: the cue (hold) marker drew a pause emoji on the ruler and in the marker list, and a locked track showed a lock emoji in the narrow header. They now use the app's own icons (the canvas draws two bars), like the rest of the interface (src/shared/icons.js).
  • Landscape phone: the full transport row needs about 640 px; in the side panel (~575 px) GO overlapped the "Use timeline" button. The full row now starts at 700 px, and below that previous/next stay in the toolbar.
  • The lane paints as soon as its size is known instead of waiting for the next animation frame. On a heavy scene the canvas stayed empty for over a second on the emulator.
  • Checked on screenshots in portrait, real landscape rotation and wm size 2560x1600.

Verification (API 36 emulator, SwiftShader)

  • exportui: H.264 Low 2210 kbps, High 8244 kbps, AAC audio. Asking for H.265 + High on the emulator: exportCaps reports no HEVC encoder, so it fell back to H.264 at 8244 kbps. H.265 itself is unverified until a phone with an encoder.
  • Gallery name: with 31 numbered sv-test-song (n).mp4 already there, the export was saved as sv-test-song 2026-11-18 01-35-30.mp4 (before the fix: "Could not save").
  • embedded: an MP3 with SYLT lyrics, played in the in-app player, gives lyrics with auto: "embedded" and text starting [00:00.50]Gömülü söz bir.
  • Logo cover: resolveLogoSrc on Android gives the player's artwork for "track" and "auto"; "manual" keeps its own image.
  • Mode thumbnails: node scripts/gen-mode-thumbs.js --check: 122 total, 1 missing (bg:solid, same as before). Spot-checked 8 regenerated ones.
  • node --test android/js-tests/*.test.js: 100 pass (28 in id3-lyrics.test.js). npm test: 4570 pass, 1 skipped.
  • The Android: touch timeline with desktop parity #1100 timeline probe (19 checks) also passed on a build with these changes.

CaYatur and others added 2 commits November 18, 2026 04:36
- Export: quality preset (bitrate) and codec. H.265 is offered only when
  the device has an encoder for it (`exportCaps`); otherwise H.264.
- Embedded lyrics (ID3 SYLT/USLT) for the in-app player and for export:
  src/shared/id3-lyrics.js, with a parity test against the desktop parser.
- Logo layer: "auto"/"track" show the playing track's cover on Android.
  Mode thumbnails regenerated (layers.js is part of their key).
- Fix: saving failed after 32 exports of the same song (MediaStore tries
  32 numbers per name when a pending file is published); the file is then
  published with the date and time added.
- Probe: exportui --codec/--quality and gallery rows by date; new
  `embedded` command.

For #1054

Co-authored-by: caganturgut <[email protected]>
- The cue (hold) marker drew a pause emoji on the ruler and in the
  marker list, and a locked track showed a lock emoji in the narrow
  header. They now use the app's own icons (the canvas draws two bars),
  as the rest of the interface does (src/shared/icons.js).
- The full transport row (previous/next, "Use timeline" label) needs
  about 640 px; in the landscape phone's side panel (~575 px) GO
  overlapped the "Use timeline" button. The full row now starts at
  700 px; below that previous/next stay in the toolbar.
- The lane paints as soon as its size is known instead of waiting for
  the next animation frame (on a heavy scene the canvas stayed empty
  for over a second on the emulator).
- Debug state (`_state`) also reports the song wait, for probes.

For #1054

Co-authored-by: caganturgut <[email protected]>
@CaYatur
CaYatur merged commit 0c20afc into dev/android Nov 18, 2026
7 checks passed
@CaYatur
CaYatur deleted the android/leftovers branch November 18, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant