feat: Share lyrics as video with audio - #1918
Open
Kratosgado wants to merge 4 commits into
Open
Conversation
- Add video sharing mode alongside existing image card sharing - Extract audio segment from Media3 cache with Opus→AAC transcoding - Encode static lyrics card + audio into MP4 using MediaCodec - Two-pass muxing strategy (video-only first, then mux with audio) - Image/Video toggle in selection UI (shown when synced lyrics available) - Fix FileProvider permission grant using clipData - Fix recycled bitmap crash from Coil memory cache
- Add LyricsFrameRenderer for per-frame rendering with active line highlighted - Three sharing modes: Image, Video (static), Animated (karaoke-style) - Animated mode renders at 15fps with 1Mbps bitrate (~1.5-2MB for 10s) - Active line: bold white 62px, inactive lines: dimmed 35% opacity 54px - Pre-computed static background for efficient per-frame rendering - Rename lyrics_share_as_image to lyrics_share
Owner
|
thanks for the contribution. However, I'm working on a backend overhaul, so contributions aren't actively reviewed and accepted. I'll let you know once the overhaul is done |
Author
alright |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds video sharing mode to the lyrics card feature. Users can now share selected lyrics as a short MP4 video with the actual audio from the song playing over the card.
Closes #1917
Changes
AudioSegmentExtractor.kt): Reads audio from Media3 cache, transcodes Opus→AAC via MediaCodec, trims to the selected lyrics' timestamp rangeLyricsVideoEncoder.kt): Encodes lyrics card bitmap as H.264 video frames via EGL/GLES20 surface rendering, muxes with audio using a two-pass strategyArchitecture
Fallback behavior
If audio extraction or video encoding fails (song not cached, codec error), gracefully falls back to sharing as an image card.
Testing