[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Transformer demo application\n\nThe Transformer demo app lets you try out the API's capabilities and transform\nyour own media, including converting media between formats, trimming, and\napplying video effects.\n\nThis page describes how to get, compile, and run the demo app. This guide also\ndescribes how to use the demo app to transform your own media.\n\nGet the code\n------------\n\nThe source code for the main demo app can be found in the `demos/transformer`\nfolder of the [GitHub project](https://github.com/androidx/media). If you\nhaven't already done so, clone the project into a local directory: \n\n```\ngit clone https://github.com/androidx/media.git\n```\n\nNext, open the project in Android Studio. You should see the following in the\nAndroid Project view (the relevant folders of the demo app have been expanded):\nThe project in Android Studio\n\nCompile and run the demo\n------------------------\n\nTo compile and run the demo app, select and run the `demo-transformer`\nconfiguration in Android Studio. The demo app will install and run on a\nconnected Android-powered device. We recommend using a physical device if\npossible, because typically an emulator's implementation of Android's media\nstack has different capabilities and bugs compared to a real device.\nDemo app configuration activity\n\nThe demo app begins with the `ConfigurationActivity`, an activity where you can\nset up the input media item and the transformation you want to perform. The two\nbuttons at the top of the screen let you choose from a list of preset media\nfiles or pick a local file. Next, the scrollable list of options lets you\nconfigure the output format and transformations, and you can select effects to\napply to the media. Tapping the last button transitions to\n`TransformerActivity`, an activity that shows the current progress and a preview\nof frames as they are passing through Transformer. Once transformation\ncompletes, the input and output videos are shown together in two ExoPlayer\n`PlayerView` instances.\n\nTransform your own content\n--------------------------\n\nThe demo app supports selecting media for transformation using the buttons at\nthe top of the configuration screen. You can also pass a URL directly on the\ncommand line: \n\n```\nadb shell am start -a androidx.media3.demo.transformer.action.VIEW \\\n -d https://yourdomain.com/sample.mp4\n```\n| **Tip:** If you see errors when selecting local media using this feature, check the [troubleshooting page](/media/media3/transformer/troubleshooting#local-files).\n\nMediaPipe integration\n---------------------\n\nThe demo app includes an example integration with\n[MediaPipe](https://developers.google.com/mediapipe). You will need to build the\ndependency manually, then select the `withMediaPipe` build variant to enable\nbuilding the app with the media pipe frame processor. See the\n[README](https://github.com/androidx/media/tree/release/demos/transformer#mediapipe-frame-processing-demo)\nfor full instructions. The effects selector in the configuration activity\nincludes an example MediaPipe-based effect to try this out."]]