I can't capture android screen using adb screen record tool
Asked Answered
S

5

10

I have a nexus 4 with android KitKat.

I tried screen recording using the following commands:

adb shell screenrecord --verbose /sdcard/demo.mp4

adb shell screenrecord --bit-rate 8000000 --time-limit 30 /sdcard/kitkat.mp4

Both times, the commands returned this message:

Main display is 768x1280 @60.00fps (orientation=0)
Configuring recorder for 768x1280 video at 4.00Mbps
ERROR: unable to create video/avc codec instance

In the debug console I had open in AndroidStudio, the following log messages were shown:

02-02 18:16:29.058     176-4045/? E/OMX-VENC-720p﹕ Is component secure 0
02-02 18:16:29.058     176-4045/? E/OMX-VENC-720p﹕ ERROR: Omx_venc::Comp Init Returning failure
02-02 18:16:29.058     176-4045/? E/OMX-VENC-720p﹕ ERROR: venc_open failed
02-02 18:16:29.058     176-4045/? E/OMX-VENC-720p﹕ Destroy C2D instance
02-02 18:16:29.058  11072-11086/? E/ACodec﹕ Unable to instantiate a decoder for type 'video/avc'.
02-02 18:16:29.058  11072-11085/? E/MediaCodec﹕ Codec reported an error. (omx error 0x80001003, internalError -2147483648)

Does anybody got any idea on how to solve this? (I tried smaller resolutions, but with no success)

Sadiesadira answered 2/2, 2014 at 18:27 Comment(6)
have you tired lowering the bit rate to 4000000?Cadmarr
@Cadmarr yes,but it didn't work.Sadiesadira
Are you sure that's the right log output? It's complaining about a decoder, rather than an encoder, and there should be failure messages from screenrecord in there as well. Do other apps that encode video work? e.g. github.com/google/grafika, start the "Show + capture camera" activity and hit "record".Integrity
This is failing in MediaCodec::CreateByType(), before it even tries to configure the encoder. It's unable to find the AVC codec at all. Is this a stock install of Android?Integrity
@Integrity Yes. I have installed a launcher though. Could that be the reason? (I'll try tomorrow with the default launcher) I guess not... Don't see why it wouldSadiesadira
I have this on my Wear, anyone?Jens
D
3

I got the same problem...and succeed to solve it...but I do not know how...

When I ran:

$>adb.exe shell screenrecord --verbose /sdcard/kitkat.mp4

I got this error:

Main display is 768x1280 @60.00fps (orientation=0) Configuring recorder for 768x1280 video at 4.00Mbp ERROR: unable to create video/avc codec instance

And to solve my problem, I first lowered the bitrate:

$>adb.exe shell screenrecord --bit-rate 1000000 --time-limit 30 --verbose /sdcard/kitkat.mp4

And then when I ran the default command...:

$>adb.exe shell screenrecord --verbose /sdcard/kitkat.mp4

It works...

Maybe because I also re-start the adb server after the first error...

Very strange...

Dyl answered 28/2, 2014 at 9:45 Comment(0)
P
2

Rebooted my phone after having the :

ERROR: unable to create video/avc codec instance

Then it worked...

Podgorica answered 11/7, 2014 at 16:59 Comment(2)
Rebooting fixed it for me as well. I also noticed, that my device slowed down strongly (probably some memory issues) when this happened, maybe that's what caused the original problem.Felicitation
Had an issue where the recorded vids were corrupted, rebooting my phone fixed it.Mohammedmohammedan
A
1

for anyone that might still be experiencing this issue, I had this exact same problem. I couldn't find anything online that would help me fix it.

Anyhow, at some point I opened up the Camera application on my Nexus 4 and I found out that for some reason, I couldn't record videos anymore -- the feature just wouldn't work.

At this point I figured that something may be corrupted. I did a factory data reset of the phone and when the reset completed, I attempted to use screenrecord again and the problem was gone. I was able to record the screen on my phone with no problems at all.

I still have no idea what was causing the problem, or if it has anything to do with the issue that I had with the video recording feature of the Camera application, but resetting my phone to factory settings solved this problem for me.

I hope this helps!

Arnulfo answered 15/5, 2014 at 22:31 Comment(1)
This answer would have made a great comment to the question.Cryoscopy
N
0

I don't know if this will be of much help but:

Despite the error, the device should be actually recording. So ignore the warning and check the /sdcard, your recording should be there.

Also try this (without any of the other stuff)

adb shell screenrecord /sdcard/demo.mp4

This should work. If you get the error

ERROR: unable to configure codec (err-2147483648)
WARNING: failed at ___x___,retrying at ___x___

Don't worry about it.

Just a side note (I'm sure you have this all set), double check your drivers are installed properly and paths are configured, etc.

I'm working on a little project for recording Nexus/KitKat devices: http://goo.gl/LEALYL (Blog post on the project: http://goo.gl/BnBzNw)

Nielsen answered 14/2, 2014 at 3:51 Comment(2)
The "failed at WxH, retrying at WxH" only appears when the configure() call fails because the codec can't handle the default resolution, which is set to the full size of the display. screenrecord retries at 720p. The failure in the question happens before configure() is even called. It's bailing out before it ever tries to feed anything to the encoder.Integrity
@kungapaogao After giving only screenrecord /sdcard/demo.mp4, I am getting dequeueOutputBuffer returned -11. Any idea how to resolve this ?Inglebert
C
0

Try turning off power save mode. Samsung's power save mode lowers the screen rate, screenrecord does not account for this discrepancy. Other ROMs also use this feature.

Chrystel answered 27/12, 2015 at 15:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.