This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: scale mismatched frame dimensions in VideoBuilder before encoding

Frames passed to addFrame() may not match the encoder's configured
dimensions, causing buffer size mismatches and silent data corruption.
Scale the bitmap to the target dimensions before YUV conversion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+7 -2
+1 -1
posedetection/build.gradle.kts
··· 4 4 5 5 mavenPublishing { 6 6 publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) 7 - coordinates("com.performancecoachlab.posedetection", "posedetection-compose", "4.9.2") 7 + coordinates("com.performancecoachlab.posedetection", "posedetection-compose", "4.9.3") 8 8 9 9 pom { 10 10 name.set("Pose Detection")
+6 -1
posedetection/src/androidMain/kotlin/com/performancecoachlab/posedetection/encoding/VideoBuilder.android.kt
··· 187 187 muxer = MediaMuxer(outputPath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4) 188 188 initialised = true 189 189 } 190 - val bitmap = frame.asAndroidBitmap() 190 + val raw = frame.asAndroidBitmap() 191 + val bitmap = if (raw.width != width || raw.height != height) { 192 + Bitmap.createScaledBitmap(raw, width, height, true) 193 + } else { 194 + raw 195 + } 191 196 val yuvData = convertBitmapToYuv420(bitmap) 192 197 val inputBufferIndex = try { 193 198 encoder.dequeueInputBuffer(timeoutUs)