Closed parkerlreed closed 6 years ago
I don't have a smart watch, but the documentation of createEncoderByType()
says:
Note: It is preferred to use
findEncoderForFormat(MediaFormat)
andcreateByCodecName(String)
to ensure that the resulting codec can handle a given format.
Maybe you could try replacing this call as suggested. Not sure it will work better.
Is there a way to query what it supports via adb?
I got my environment setup so I can build the server. What exactly would I change in that call to test it out?
I just realized the watch has NO encoders. Only decoders.
That's probably the issue.
Thanks, was going to close it out myself as I assumed there wasn't really anything that could be done for it.
Maybe you could test using screenrecord
:
adb shell screenrecord /sdcard/file.mp4
@parkerlreed how does one get to that codec information on android please ?
@elig0n Just an application that shows it. At the time I just found a random application online but it seems there's one on the store https://play.google.com/store/apps/details?id=net.tyniw.mediacodecinfo.application
@rom1v I seem to have my charger but not my watch... I'll see if I can dig it out and give it a test.
@parkerlreed I just created a project to give more infos about video codecs available: CheckVideoCodecs
.
Please post its results for your watch.
Hi, I faced the same error above. and @rom1v I tried screen record. It says the following.
ERROR: unable to create video/avc codec instance
WARNING: failed at 454x454, retrying at 1280x720
ERROR: unable to create video/avc codec instance
Seems like android wear watches does not have encoders at all.
This was never Android 4. Most watches were on Marshmallow at the time (and I'm hitting the same on Nougat)
Also sorry for the late response. Just circled back around to this. I am unable to build the CheckVideoCodecs
[parker@stealth CheckVideoCodecs]$ make run
./gradlew assembleDebug
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
make: *** [Makefile:8: build] Error 1
I am facing the same issue with my Amazfit Stratos... I lost touch function and need to confirm the code on the screen to pair the watch again but i am getting these erros:
C:\Windows\system32>"D:\Downloads\Compressed\scrcpy-win64-v1.9\scrcpy-win64\scrcpy.exe" D:\Downloads\Compressed\scrcpy-win64-v1.9\scrcpy-win64\scr...erver.jar: 1 file pushed. 2.0 MB/s (22470 bytes in 0.011s) INFO: Initial texture: 320x296 ERROR: Could not open video stream
Other times:
C:\Windows\system32>"D:\Downloads\Compressed\scrcpy-win64-v1.9\scrcpy-win64\scrcpy.exe" D:\Downloads\Compressed\scrcpy-win64-v1.9\scrcpy-win64\scr...erver.jar: 1 file pushed. 3.2 MB/s (22470 bytes in 0.007s) [server] ERROR: Exception on thread Thread[main,5,main] java.lang.IllegalArgumentException: Failed to initialize video/avc, error 0xfffffffe at android.media.MediaCodec.native_setup(Native Method) at android.media.MediaCodec.
(MediaCodec.java:486) at android.media.MediaCodec.createEncoderByType(MediaCodec.java:456) at com.genymobile.scrcpy.ScreenEncoder.createCodec(ScreenEncoder.java:137) at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:62) at com.genymobile.scrcpy.Server.scrcpy(Server.java:32) at com.genymobile.scrcpy.Server.main(Server.java:133) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) ERROR: Could not open video stream INFO: Initial texture: 320x296
Some can help me please? Tested at Galaxy S8 and worked like a charm.
@andreluigo Is it Android 4?
Anyway, it seems "smart watches" don't have a H.264 encoder.
@andreluigo Is it Android 4?
No. It's newer. Actually O.S. of Amazfit is Watch 2.0 (based on Android, i guess).
I wonder if this could be fixed by using "video/raw" encoding instead of "video/avc"? Wear does support raw video encoding, and ffmpeg can convert it: https://developer.android.com/training/wearables/apps/debugging?hl=en#screenrecord
This issue seems closed but I'm failing to find a solution. What's the way to make it work with Wear OS?
There's nothing special. You just need a watch that is new enough to support it (hardware video encoding). Works right away on my Galaxy Watch4 Classic.
Asus Zenwatch 2 on Android Wear 2.0.