EditedMediaItem.setFrameRate cap stops working after a slower part of a variable-speed SpeedProvider
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 57/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- backend, performance
Línea de trabajo
Start by reading SequenceRenderersFactory.TargetFrameRateHelper.onOutputFrameRendered and ExoAssetLoaderVideoRenderer.feedConsumerFromDecoder, where the issue reports the same timestamp-advancement logic in CompositionPlayer and Transformer. Reproduce the variable-speed sequence and count delivered frames per output second. Done means both preview and export stay at or below 30 frames per second across the slow-to-fast transition while steady-speed behavior remains unchanged.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
Media3 1.11.0
More version details
Reproduced on 1.11.0 (CompositionPlayer preview and Transformer export). The same code is in main as of 2026-11-12 (read, not run): SequenceRenderersFactory.TargetFrameRateHelper.onOutputFrameRendered and ExoAssetLoaderVideoRenderer.feedConsumerFromDecoder.
Devices that reproduce the issue
Samsung Galaxy S20 (Android 13), Samsung Galaxy S8+ (Android 9)
Devices that do not reproduce the issue
None known
Reproducible in the demo app?
Not tested
Reproduction steps
- Create an
EditedMediaItemfrom a 30 fps clip, clipped to its first 8 s, withsetSpeed(...)using a variableSpeedProvider: 1x from 0 s, 0.5x from 2 s, 2x from 4 s (original media time), andsetFrameRate(30). - Play it in
CompositionPlayerand export it withTransformer. - Count the frames the item delivers per second of output time (for example with a pass-through
MatrixTransformationin the item's video effects).
Expected result
At most 30 frames per second in every part: 30, 30, 15, 15, 15, 15, 30, 30.
Actual result
30, 30, 15, 15, 15, 15, 60, 60: the 2x part is not capped, in preview and export. With the order reversed (2x first, then 0.5x) the cap works. A short slow part (0.4 s of original time at 0.5x) lets about 0.4 s of the following 2x part through uncapped (24, 36 frames in those seconds).
Cause: the same logic is in SequenceRenderersFactory.TargetFrameRateHelper.onOutputFrameRendered (CompositionPlayer) and ExoAssetLoaderVideoRenderer.feedConsumerFromDecoder (Transformer): after each rendered frame the next expected timestamp is advanced by one step (next + delta), not from the frame's own timestamp. While frames are further apart than one step (a slowed part), the expected timestamp falls behind, so in a following faster part no frame is dropped until it catches up.
Fix we use (patched 1.11.0, measured on the S20, the S8+ and a Galaxy S23 on Android 17): after advancing by one step, if the expected timestamp is still at or before the rendered frame's timestamp, advance it in whole steps until it is past that frame:
nextExpectedUs += deltaUs;
if (nextExpectedUs <= presentationTimeUs) {
long behindUs = presentationTimeUs - nextExpectedUs;
nextExpectedUs += (behindUs / deltaUs + 1) * deltaUs;
}
Steady speeds keep the same grid and drop the same frames as before (measured at 2x and 4x); the ramp above gives 30, 30, 15, 15, 15, 15, 30, 30 in preview and export.
Media
Not applicable: any 30 fps H.264 clip reproduces it (ours: 1080x1920, 15.9 s).
Bug Report
- You will email the zip file produced by
adb bugreportto [email protected] after filing this issue.
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 1k
- Merge medio
- 8 d 8 h
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de androidx/media
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 4 días
-
CompositionPlayer.release() leaks its playback thread and FrameProcessor when no composition was setPosiblemente ocupada @droid-girl la tomó hace 7 días. Abiertoediting preview
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
androidx/media#3506 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 4 días
-
Transformer: native SIGSEGV in `memcpy` while `SampleDataQueue` copies a sample into the decoder's input buffer (`DefaultCodec` has no guard like c57f96c92a)Posiblemente ocupada @droid-girl la tomó hoy. Abiertobug editing
androidx/media#3537 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 4 días
-
Noncontiguous TrueHD Atmos Streams Cause Audio Dropouts When Passed-Through to AV Receivers.Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug needs triage
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
Los mantenedores suelen responder en 4 días
-
DefaultFrameDroppingShaderProgram reuses a released previousTexture after end of stream, failing multi-item exports with GL 0x506Posiblemente ocupada @claincly la tomó hace 1 día. Abiertobug editing
androidx/media#3534 · 1 asignado ·
Los mantenedores suelen responder en 4 días
Todos los issues de androidx/media
Issues similares
-
Enhancing the Issue TemplateAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
SasanLabs/VulnerableApp#912 ·
Los mantenedores suelen responder en 1 día
-
area/build area/events area/storage area/storage/kafkasql area/storage/sql
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Apicurio/apicurio-registry#11079 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
OpenAEV-Platform/openaev#9139 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
desktop edt not responding
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100