Android video recording command screenrecord

Source: Internet
Author: User

Android video recording command screenrecord:

  • Screenrecord is a shell command
  • Support for Android4.4 (API level 19) or above
  • Supported video formats: mp4 restrictions
    • Some devices may not be able to directly record because the resolution is too high. If you encounter such problems, try to specify a lower resolution.
    • Screen rotation is not supported during recording. If the screen is rotated during recording, the screen may be disconnected.
    • When recording a video, the sound will not be recorded and the recording command starts:
      adb shell screenrecord /sdcard/demo.mp4

      Recording mobile phone screen. The video format is mp4, which is stored in the mobile phone SD card. The default recording time is 180 s.

      Limit the recording time:

      Parameter: -- time-limit

      adb shell screenrecord  --time-limit 10 /sdcard/demo.mp4

      Note: The video recording time is limited to 10 s. If not limited, the default value is 180 s.

      Specify the video resolution size:

      Parameter: -- size

      adb shell screenrecord --size 1280*720 /sdcard/demo.mp4

      Note: The Video Recording resolution is 1280*720. If you do not specify the resolution of the default mobile phone, use the size supported by the advanced video encoding (AVC) on the device for the best effect.

      Specifies the video bit rate.

      Parameter: -- bit-rate

      adb shell screenrecord --bit-rate 6000000 /sdcard/demo.mp4

      Note: The specified video bit rate is 6 Mbps. If not specified, the default value is 4 Mbps. You can increase the bit rate to improve the video quality or reduce the bit rate to make the file smaller.

      Display logs on the command line

      Parameter: -- verbose

      bixiaopeng@bixiaopeng wirelessqa$ adb shell screenrecord --time-limit 10 --verbose /sdcard/demo.mp4Main display is 1080x1920 @60.00fps (orientation=0)Configuring recorder for 1080x1920 video at 4.00MbpsContent area is 1080x1920 at offset x=0 y=0Time limit reachedEncoder stopping; recorded 96 frames in 10 secondsStopping encoder and muxerExecuting: /system/bin/am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file:///sdcard/demo.mp4Broadcasting: Intent { act=android.intent.action.MEDIA_SCANNER_SCAN_FILE dat=file:///sdcard/demo.mp4 }Broadcast completed: result=0
      Rotate 90 degrees

      Parameter: -- rotate

      Note: This function is experimental and is not easy to use.

      View help commands

      Parameter: -- help

      bixiaopeng@bixiaopeng ~$ adb shell screenrecord --helpUsage: screenrecord [options] 
            
             Records the device's display to a .mp4 file.Options:--size WIDTHxHEIGHT    Set the video size, e.g. "1280x720".  Default is the device's main    display resolution (if supported), 1280x720 if not.  For best results,    use a size supported by the AVC encoder.--bit-rate RATE    Set the video bit rate, in megabits per second.  Default 4Mbps.--time-limit TIME    Set the maximum recording time, in seconds.  Default / maximum is 180.--rotate    Rotate the output 90 degrees.--verbose    Display interesting information on stdout.--help    Show this message.Recording continues until Ctrl-C is hit or the time limit is reached.
            
      Export video:
      adb pull /sdcard/demo.mp4

      Description: exports a video to the current directory.


      Public Account: wirelessqa

      About Author:

      Author: Bi Peng | old Bi mail: wirelessqa.me@gmail.com

      Micro Blog: @ WirelessQA blog: http://blog.csdn.net/wirelessqa

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.