Skip to content

Transformer sometimes generates video with initial black frame #829

@amezcua

Description

@amezcua

Version

Media3 1.2.0

More version details

No response

Devices that reproduce the issue

Android tests on S21 Ultra, emulator

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

Open the demo app (keep the default video selected), tap Trimming, select a valid trimming interval for the video starting from a non zero value. Export the video, download the video to the PC and play it with QuickTime, the first frame(s) are sometimes black, depending on the interval.

Reproducible as well with VLC in OSX Sonoma but visible only when opening the file in advanced mode preview (opening it directly does not show the initial black frames). To reproduce in VLC:

File/Advanced Open File/Browse... In the dialog simple click on the file, the preview shows the first frame black

Reproducible with the Android tests as well with some of the videos.

  • Test used clippedMedia_completesWithClippedDuration
  • Video in the test MP4_ASSET_WITH_INCREASING_TIMESTAMPS_320W_240H_15S_URI_STRING does not reproduce the issue
  • Change the video to MP4_ASSET_SEF_H265_URI_STRING
  • Change the clipping interval values to:
    long clippingStartMs = 1_000;
    long clippingEndMs = 2_000;

The exported video has initial black frame(s)

  • Change the clipping interval values to:
    long clippingStartMs = 1_500;
    long clippingEndMs = 5_000;

The exported video does NOT have the initial black frame(s)

These results are reproducible by running the test both in the emulator and in the Galaxy S21.

Expected result

The exported video does not have any black initial frame(s).

Actual result

Export succeeds with inconsistent results, some times including black frames at the beginning.

Media

Files with the issues. The issue is clearly visible when opening the following URLs in Safari. Chrome does not show the initial black frames. Otherwise download the files and test with QuickTime or VLC as mentioned in the repro steps.

Black initial frames. Test clippedMedia_completesWithClippedDuration. Export interval 1_000 to 2_000
https://github.com/androidx/media/assets/781581/71392df8-681d-4f0c-8abf-e66782d00824

No black initial frames. Test clippedMedia_completesWithClippedDuration. Export interval 1_500 to 5_000
https://github.com/androidx/media/assets/781581/864f25d6-c9ad-4912-bd10-1d0fb03cd1a8

Output of the sample app with the black frames
https://github.com/androidx/media/assets/781581/0d7cda03-d60a-4743-b5fc-fa9ab4434900

Bug Report

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions