176 Commits

Author SHA1 Message Date
sheenachhabra
8d65b75185 Rename setFragmentedMp4Enabled to setOutputFragmentedMp4
PiperOrigin-RevId: 619216854
2024-03-26 09:34:23 -07:00
sheenachhabra
2eaece5ed9 Move setMaxDelayBetweenSamplesMs on Transformer builder
This property is transformer specific and does not belong to
muxer interface.
This is to eventually replace muxer interface in Transformer module with
muxer interface in Muxer module.

PiperOrigin-RevId: 618895836
2024-03-25 11:02:15 -07:00
andrewlewis
88c6877418 Slow down dizzy crop demo effect
PiperOrigin-RevId: 609667000
2024-02-23 02:54:43 -08:00
sheenachhabra
fd2ea22e47 Allow AV1 output mime type in FrameworkMuxer
The `MediaMuxer` (FrameworkMuxer) supports AV1 mime type from API 34.
For this to work track `Format/MediaFormat` must have `CSD`
data.

Change also include providing AV1 option in demo app.

Transmuxing of an AV1 mime type input will not work because
`Extractor` does not extract AV1 CSD data.

Verified changes manually via demo app.

PiperOrigin-RevId: 603002380
2024-01-31 04:02:21 -08:00
tonihei
ed5b7004b4 Replace or suppress deprecated usages
Many usages are needed to support other deprecations and some
can be replaced by the recommended direct alternative.

Also replace links to deprecated/redirected dev site

PiperOrigin-RevId: 601795998
2024-01-26 10:06:18 -08:00
tofunmi
94ce356bc1 Transformer demo: support selecting all media MIME types
It's useful for development and debugging to select a local image
or audio (only) file as well as a video file in the transformer demo
app.

I tested manually that you can select a local video, audio and image
but not e.g. a pdf with the main "choose local file" picker and only
an image with the choose local image picker for the bitmap overlay
demo.

PiperOrigin-RevId: 600722622
2024-01-23 02:35:19 -08:00
simakova
d884f19871 Add edit label
PiperOrigin-RevId: 597257431
2024-01-10 08:36:14 -08:00
Googler
460501fcd1 Log ExportResult information when running transformer demo app
Log elapsed time, in addition to displaying it on screen.
Reuse logging logic between tests and demo.

PiperOrigin-RevId: 597186692
2024-01-10 02:24:31 -08:00
sheenachhabra
846ace16aa Allow creating fragmented MP4 file via demo app
PiperOrigin-RevId: 594435072
2023-12-29 04:39:04 -08:00
sheenachhabra
ac67f739d4 Specify which input file has B-frames in Transformer demo app
For out of order B-frames, the samples comes out of order and hence
presentation timestamps are not strictly increasing.
This can be verified by adding following assertion in `writeSampleData()` API
either in `MuxerWrapper` or in `Muxer API`.
```
checkArgument(
          bufferInfo.presentationTimeUs > lastSamplePresentationTimeUs,
          "Out of order B-frames are not supported");
```

PiperOrigin-RevId: 589152093
2023-12-08 09:23:42 -08:00
sheenachhabra
5db9a66b3b Implement resume API in Transformer
Changes includes:
1. Add resume flow.
2. Change demo app code to resume export.
3. Changes in test infra to trigger resume.
4. E2E Test cases

PiperOrigin-RevId: 579895744
2023-11-06 11:01:04 -08:00
sheenachhabra
5b0be4e8b0 Create unique name for export output file.
With pause/resume functionality coming in, we need the output file
path to be different from the previous one.

PiperOrigin-RevId: 577175540
2023-10-27 06:12:23 -07:00
simakova
beb1711d4c Remove CompositionPlayer activity from the transformer demo app
The CompositionPlayer is not ready yet.

Issue: androidx/media#741
PiperOrigin-RevId: 574859927
2023-10-19 07:19:15 -07:00
ibaker
d60596cfca Use package-level @OptIn for demo apps
This demonstrates that `@OptIn` can now be used at the package-level
(since [`androidx.annotation:annotation-experimental:1.3.0`](https://developer.android.com/jetpack/androidx/releases/annotation#annotation-experimental-1.3.0)).

PiperOrigin-RevId: 572187729
2023-10-10 03:02:25 -07:00
simakova
67e10e9362 Cleanup layout files in Transformer demo
* Update AOSP copywright headers in all xml files in the Transformer demo app
* Use "end/start" instead of "right/left" to ensure correct behavior in right-to-left locales
* Simplify contrast_options and trim_options layout

PiperOrigin-RevId: 571933637
2023-10-09 07:38:33 -07:00
simakova
d9cf350eb0 Add CompositionPlayer to the Transformer demo app
PiperOrigin-RevId: 571284291
2023-10-06 03:05:56 -07:00
huangdarwin
2bdda35731 Overlay: Rename videoFrameAnchor to backgroundFrameAnchor.
Overlays may be overlaid over:
* In VideoFrameProcessor, videos or images (or texture input).
* In Compositor, other videos.

In Compositor, Overlays may consist of video, so it could be confusing
for videoFrameAnchor to contrast with overlayAnchor.

Also, rename overlayAnchor to overlayFrameAnchor, since it's modifying
the anchor in the overlay's frame, so this name seems slightly more precise.

PiperOrigin-RevId: 562004292
2023-09-01 11:28:19 -07:00
huangdarwin
6da70c842e Overlay: Rename alpha to alphaScale.
The actual logic scales the alpha, instead of setting it, so rename
this to what it does.

We would also prefer alpha to be scaled here, to not lose alpha information
(for example for PNGs with transparent regions).

PiperOrigin-RevId: 560121708
2023-08-25 10:00:50 -07:00
sheenachhabra
d5f8487fe2 Add pause and resume button in demo app
Currently the resume button will restart the export from
the beginning.

PiperOrigin-RevId: 559787856
2023-08-24 10:05:51 -07:00
samrobinson
99ac6feeee Add varargs convenience constructors to Sequence & Composition.Builder
Improves API ease-of-use & readability and reduces verbose boilerplate.

PiperOrigin-RevId: 558163557
2023-08-22 15:17:55 +01:00
claincly
c6804e40a3 Display more accurate time in demo app
PiperOrigin-RevId: 558077709
2023-08-18 15:21:53 +01:00
claincly
c1913e8d89 Deprecate SingleFrameShaderProgram
PiperOrigin-RevId: 555450958
2023-08-11 20:22:03 +00:00
samrobinson
fec6252065 Add basic volume scaling to the Transformer demo app.
PiperOrigin-RevId: 553086635
2023-08-07 11:23:14 +00:00
simakova
415b17c1e1 Allow an empty video effects array
PiperOrigin-RevId: 551829203
2023-08-01 14:21:20 +01:00
Googler
465e7c1277 Rewrite tracing to be more flexible and provide more info.
For each event, the timestamp and presentation time is logged. The trace can
then be dumped to a tsv file and easily imported in a spreadsheet.

PiperOrigin-RevId: 550839156
2023-08-01 13:59:51 +01:00
tofunmi
7eee15ecb4 Update OverlaySettings to explicitly state overlay transformations
Alters the OverlayShaderProgram implementation to support rotations, however we need to apply the transformations separately in order for them to work as expected so the matrix is removed from the interface in favour of explicit methods.

Adds a rotation test to ensure this ability doesn't regress

PiperOrigin-RevId: 549890847
2023-08-01 13:45:22 +01:00
samrobinson
aa1ca747de Add channel mixing effect to demo application.
PiperOrigin-RevId: 547465758
2023-07-13 15:52:43 +01:00
andrewlewis
22b7a7dc39 Tidy handling of package not found exception in demo
PiperOrigin-RevId: 546900066
2023-07-13 15:34:37 +01:00
andrewlewis
bdbf3e29a1 Fix incorrect class name for MediaPipe demo
Issue: androidx/media#500

#minor-release

PiperOrigin-RevId: 545942450
2023-07-13 15:03:46 +01:00
Googler
5050171ff6 Rename "useHdr" to "useHighPrecisionColorComponents."
BaseGlShaderProgram and SingleFrameGlShaderProgram are technically color space agnostic. useHdr is passed to the TexturePool, which only uses the value to choose between high/regular precision. useHdr is therefore a bit misleading and should be generalized to "useHighPrecisionColorComponents."

PiperOrigin-RevId: 545726629
2023-07-13 14:56:37 +01:00
huangdarwin
7a368b9a11 Effect: Remove GlTextureInfo accessor methods.
The extra check was a bit excessive, especially as it's called multiple times
per frame.

PiperOrigin-RevId: 545657102
2023-07-13 14:51:38 +01:00
kimvde
81c83e4213 Remove HDR modes from TransformationRequest
PiperOrigin-RevId: 545352306
2023-07-05 09:16:52 +00:00
kimvde
b358d075a1 Replace usages of deprecated TransformationRequest setter
PiperOrigin-RevId: 543765376
2023-06-29 22:59:06 +00:00
andrewlewis
90c8f642af Pass GlObjectsProvider to methods
By passing this class where it's needed, implementations don't need to store it
in a field (reducing boilerplate) and it's clearer that it can't be unset when
needed.

PiperOrigin-RevId: 542823522
2023-06-23 16:49:12 +00:00
Googler
86515f8683 Show the file path of the exported output video.
PiperOrigin-RevId: 535233266
2023-05-25 15:11:05 +00:00
huangdarwin
a6897aedaa Effect: Add GlTextureInfo release() and accessor methods.
This allows us to disallow access after release.

PiperOrigin-RevId: 534046475
2023-05-24 15:42:47 +01:00
ibaker
b3db85133a Add android.namespace to all build.gradle files
This is a pre-requisite for the Android Studio upgrade assistant to
upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains
this is missing.

Issue: androidx/media#409
PiperOrigin-RevId: 533463246
2023-05-19 17:19:15 +01:00
huangdarwin
b61abefd7b Demo: Prefer UNICODE character.
PiperOrigin-RevId: 524802289
2023-04-17 17:18:01 +01:00
claincly
eadb78e52a Fix crash when there's no input player view.
This happens when the input is an image. The output will always be video so the
outputPlayer and outputVideoTextView will always present.

PiperOrigin-RevId: 524329436
2023-04-17 17:11:35 +01:00
ibaker
b834e49f9f Use @link instead of @value
Dackka doesn't support `@value`

#minor-release

PiperOrigin-RevId: 524309695
2023-04-17 17:10:49 +01:00
simakova
fab3abfd7c Fix input video duration in the result view in transformer demo
PiperOrigin-RevId: 524305085
2023-04-17 17:09:13 +01:00
claincly
b40f4792f0 Add a portrait image to the demo app.
PiperOrigin-RevId: 524282997
2023-04-17 17:07:03 +01:00
claincly
2ee84b809d Tap the video playback view to switch audio output.
PiperOrigin-RevId: 524027177
2023-04-17 17:02:27 +01:00
tonihei
6952771e2f Remove remaining references to exoplayer.dev
PiperOrigin-RevId: 520314781
2023-03-30 17:20:36 +00:00
tofunmi
c17e043403 Transformer Demo: Hide playback views during transformation
PiperOrigin-RevId: 518560945
2023-03-30 17:00:11 +00:00
tofunmi
8df4fd769c Log export errors that occur after export completes
PiperOrigin-RevId: 518281002
2023-03-22 10:35:05 +00:00
Googler
7c7a6298ff Fixed TableLayout in demo UI to work with small screens
PiperOrigin-RevId: 518257650
2023-03-21 14:23:29 +00:00
huangdarwin
236748070c Demo: Shorten default trim range from 10s to 1s.
Shorten the demo's default trim range from 0-10s to 0-1s, and change the
UI-supported trim range from 0-60s to 0-10s.

Most demo videos aren't very long, and the default demo is 10 seconds.

The use-case for trimming in the demo seems to be mostly for validating trimming
works, or generating test media. Test media should tend to be short in order to be
small, so shortening the trim range helps this be accomplished more effectively.

PiperOrigin-RevId: 517103583
2023-03-16 15:35:18 +00:00
tofunmi
2c852ea7bb Replace bitmap overlay uri EditText with local file picker
PiperOrigin-RevId: 515283537
2023-03-14 07:47:10 +00:00
tofunmi
68578be372 Update createStaticBitmapOverlay to take in context.
By making this method accept context, we can use DefaultDataSource.Factory in the DatasourceBitmapLoader to support a wider range on URI schemes in Bitmap Overlays. (and implement a local file picker for images for custom bitmap overlays in the demo transformer app)

PiperOrigin-RevId: 515013460
2023-03-14 07:39:43 +00:00