Nohttp Open Source Address: https://github.com/yanzhenjie/NoHttp
Nohttp the specific use of the document has been published, you want to know all have, please point me!
Copyright NOTICE: Reprint Please specify this article to the blog from Zhangjie: http://blog.yanzhenjie.com
Demonstrate
When you read the blog, you often see the following pictures, are very interested to know how to do it, fortunately, the blog when they also recorded the operation:
This figure is I also have a blog diagram of Android three-level linkage and the ListView single-Choice multi-Select, blog and source code portal, now it is step by step to teach you how to do this diagram.
How did the GIF on the top come from?
In fact, this GIF is a MP4 video. It's just that it turned into a gif, so simple. That is the essence. But how does Android record mp4?
Recording environment
Android4.4 above system can use shell command to record video, video format is MP4.
Limitations
- Devices with high resolution do not specify a low-resolution recording screen will fail. Please try specifying a low-resolution re-recording screen
- The screen does not rotate during recording, assuming rotation occurs. The recording process may be interrupted
- The sound in the recording process cannot be recorded.
The only way to say it is to record the screen is to just mp4 the format.
Recording commands
Video format is MP4, stored in the phone SD card, the default recording time is 180s, you can use CTRL + C to end the recording.
shell screenrecord /sdcard/demo.mp4
Specify recording time
Number of references: –time-limit [seconds]. For example, specify recording 10S:
shell screenrecord --time-limit 10 /sdcard/demo.mp4
Specify resolution
Number of references: –size [width * height]. For example, specify the recording resolution 720*1280
:
shell--size 720*1280 /sdcard/demo.mp4
Specify bit rate
Reference: –bit-rate bit rate, for blogging convenience we specify the bitrate as 2Mbps
:
shell--bit-rate 2000000 /sdcard/demo.mp4
Log shows the recording process
Number of references: –verbose, for example:
shell--verbose /sdcard/demo.mp4
Rotate the video 90 degrees
Number of references: –rotate, for example:
shell--rotate/sdcard/demo.mp4
Export Video to PC
This command should be used frequently, and the file path behind it is the folder where you have just specified the save path, which will be exported to the calling command. Like what:
adb pull /sdcard/demo.mp4
View Help
Number of references: Help, for example:
shell--help
How to convert MP4 to GIF
Suppose and MP4 to GIF, here are two ways.
With FFMPGE
Suppose your computer is configured with FFMPGE is very easy, command line a word to fix:
-t<视频时长>-ss -i<视频文件> demo.gif
For example, we generate a 13S graph:
-t13-ss00:00:00-i demo.mp4 demo.gif
Turn with the tool. This is a better use, recommend OH
I have downloaded a good put Baidu net disk, first attached: HTTP://PAN.BAIDU.COM/S/1MGVHUF2
Software execution:
Select the video file to specify the starting position, end position, width height, frame per second/frame rate, etc.:
Select picture quality to save converted GIF images:
finally specify the picture to save the location, OK.
nohttp source code and demo hosted on GitHub Welcome to All Star: Https://github.com/yanzhenjie/NoHttp
Android recording screen command, Android gif, Android video