Can I record video in Android Studio in another format, instead of WebM?
Asked Answered
P

2

38

I'm developing an app in Android Studio, and it's useful to be able to record video from the emulator (via the button in the Logcat tab). However, in recent versions of Studio (I'm now on 3.4.1) the default video format has changed to WebM.

WebM videos are really big and awkward to work with. Is there an easy way to request a different format, e.g. MP4?

Inside the emulator settings, there's a different recording UI that allows you to save as .webm or .gif. I'm actually using GIFs right now, but it's not the best workaround. I'd prefer to use the Android Studio UI as it's more convenient.

Palter answered 24/6, 2019 at 12:51 Comment(2)
Good question, and saying it's "awkward" is too polite. It's a PITA!!!Asco
Here's a related bug in Google's issue tracker: "Why can't we save recorded video in mp4 format anymore?" issuetracker.google.com/issues/137897477Wicklow
P
45

You can still record videos from the command line:

adb shell screenrecord /sdcard/video.mp4

When you are done recording, press Ctrl+C.

Then you can copy the file to your computer (current folder)

adb pull /sdcard/video.mp4

If you want you can delete the file from the sdcard

adb shell rm /sdcard/video.mp4

Promptitude answered 5/9, 2019 at 14:49 Comment(3)
Thanks for this tip. WhyTF did Google change this? When showing the app to users, they don't necessarily have a compatible browser to view this. Why doesn't Google provide an option to pick from the logcat panel ? BTW this tip won't work if trying to record from emulators.. A product manager in the Android Studio team should be clearing their desk out and escorted off the premises right now for hobbling a critical feature. This tip doesn't work either android.stackexchange.com/questions/168944/…Asco
@Asco I could record from an emulator perfectly well.Panay
On a Mac, to pull it to a location other than the project directory add the path at the end. For instance, adb pull /sdcard/video.mp4 ~/Desktop/Video/Unruly
S
17

I found this solution from issue tracker which posted in question comment and deleted answer.

Just need to uncheck Use Emulator Recording (webm) after you start Screen Record in Logcat.
Then the recording will be mp4 format

Subtle answered 22/2, 2022 at 8:49 Comment(3)
Awesome, simple and what is more important it works. Any idea why web is default format? For me it is very strange decision.Smelt
That option seems to be missing with my version, I only have the Show Taps checkboxToneme
@Smelt The maximum recording time in Android Studio with WebM is 30 minutes, otherwise with MP4 it's 3 minutes. Maybe it's a file size issue.Delmadelmar

© 2022 - 2024 — McMap. All rights reserved.