Giter VIP home page Giter VIP logo

telecine's Introduction

DEPRECATED: Android 11 now includes native screen recording!

Telecine

License

Copyright 2015 Jake Wharton

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

telecine's People

Contributors

andreilisun avatar arnaudruffin avatar bcartign avatar cs-rafael-toledo avatar grigala avatar hanspeide avatar jakewharton avatar jaredsburrows avatar jawnnypoo avatar jrodbx avatar kagami-src avatar lfdversluis avatar mattprecious avatar michelemas avatar monxalo avatar nightlynexus avatar phajduk avatar rodrigoswz avatar sandromachado avatar simonmarquis avatar torwart avatar totalcaesar659 avatar zach-klippenstein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

telecine's Issues

Targeting 23

Android 6.0 now requires the user to grant permission explicitly in settings for an app targeting 23+ to have the SYSTEM_ALERT_WINDOW permission.
(activity.startActivityForResult(new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + context.getPackageName())));)
Also, Telecine will have to ask for WRITE_EXTERNAL_STORAGE at runtime.

What are thoughts about Telecine targeting 23?
If it should, are there any preferences regarding the permission-granting flow?

MediaRecorder prepare fails.

java.lang.RuntimeException: Unable to prepare MediaRecorder.
        at com.jakewharton.telecine.RecordingSession.startRecording(RecordingSession.java:179)
        at com.jakewharton.telecine.RecordingSession.access$100(RecordingSession.java:47)
        at com.jakewharton.telecine.RecordingSession$1.onStart(RecordingSession.java:111)
        at com.jakewharton.telecine.OverlayView.startRecording(OverlayView.java:147)
        at com.jakewharton.telecine.OverlayView.access$300(OverlayView.java:31)
        at com.jakewharton.telecine.OverlayView$5$1$1.run(OverlayView.java:163)
        at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1121)
        at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1089)
        at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:666)
        at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:682)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
        at android.view.Choreographer.doCallbacks(Choreographer.java:599)
        at android.view.Choreographer.doFrame(Choreographer.java:559)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:781)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5466)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:733)
Caused by: java.io.IOException: prepare failed.
        at android.media.MediaRecorder._prepare(MediaRecorder.java:-2)
        at android.media.MediaRecorder.prepare(MediaRecorder.java:742)
        at com.jakewharton.telecine.RecordingSession.startRecording(RecordingSession.java:177)
        at com.jakewharton.telecine.RecordingSession.access$100(RecordingSession.java:47)
        at com.jakewharton.telecine.RecordingSession$1.onStart(RecordingSession.java:111)
        at com.jakewharton.telecine.OverlayView.startRecording(OverlayView.java:147)
        at com.jakewharton.telecine.OverlayView.access$300(OverlayView.java:31)
        at com.jakewharton.telecine.OverlayView$5$1$1.run(OverlayView.java:163)
        at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1121)
        at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1089)
        at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:666)
        at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:682)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
        at android.view.Choreographer.doCallbacks(Choreographer.java:599)
        at android.view.Choreographer.doFrame(Choreographer.java:559)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:781)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5466)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:733)
1420755940708 D Attempting to acquire permission to screen capture.
1420755940748 D Acquired permission to screen capture. Starting service.
1420755940752 D Starting up!
1420755940764 D Adding overlay view to window.
1420755946112 D Starting screen recording...
1420755946119 D Video size: 100%
1420755946147 I Output file '/storage/emulated/0/Movies/Telecine/Telecine_2015-01-08-14-25-46.mp4'.
apiLevel
21
batteryLevel
0.63
charging
false
freeDisk
27374383104.0
freeMemory
182602840
jailbroken
false
locale
en_US
locationStatus
allowed
manufacturer
HTC
model
HTC One
networkAccess
wifi
orientation
portrait
osBuild
LRX22C.H3 release-keys
osName
android
osVersion
5.0.1
screenDensity
3
screenResolution
1920x1080
totalMemory
201326592

Turn On Lint

To save me from myself (and people creating pull requests).

error at touch the clock area

Process: com.jakewharton.telecine
Flags: 0xc8be44
Package: com.jakewharton.telecine v1020000 (1.2.0)
Build: OPPO/X9007/X9007:5.0/LRX21M/1426582430:user/release-keys

java.lang.RuntimeException: An error occured while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:300)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.IllegalArgumentException
    at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:160)
    at com.jakewharton.telecine.RecordingSession$3.doInBackground(RecordingSession.java:321)
    at com.jakewharton.telecine.RecordingSession$3.doInBackground(RecordingSession.java:318)
    at android.os.AsyncTask$2.call(AsyncTask.java:288)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    ... 4 more

Make preference rows behave more like SwitchPreference

Since these options look like a preference list users tend to tap on the row instead of the Switch control.

While at it maybe add an optional text field for more information about the option, like the summary in a preference?

Makes System UI to crash on Android 5.1

Since I updated my Nexus 5 to Android 5.1 the app crashes the "System UI" app when I click on the button 'launch overlay'.

Most of the time, Telecine will be killed by the system (probably lacking some RAM to restart the System UI processes) and it is impossible to do any screen cast.

Screenshot Mode

What are your thoughts about a screenshot feature? This could exist as a toggle in the app between video recording vs. screenshot. When the overlay is launched in screenshot mode, a similar overlay could be launched. I'd imagine the overlay is immediately hidden when the capture button is pressed and reappears once the screenshot has been taken.

I have a friend who is partially paralyzed and has trouble using the hardware buttons to take screenshots. I planned on using this app as a base for a screenshot app (all the current ones on the market seem to be terrible). If it is something you may consider allowing into the app, I may just submit it as a pull request, rather than a separate app.

Thanks!

Screen refresh rate slows to a crawl AFTER using Telecine

On a rooted LG G3 DUAL (LG-D858HK, LRX22G) Android 5.0, if I run Telecine, record a video and stop the video then turn off the screen (either manually or let it timeout), then after the screen is turned back on, and after some more time (variable, but usually minutes), the screen refresh rate becomes very jerky, gradually gets worse and the only way to get back to normal is to reboot the device. Force Stop on Telecine does not help.

Interestingly, if the screen goes off while the device is being charged, then the problem does not occur.

If I run the app while plugged in and Force Stop while still plugged in, then unplug, the refresh issue is still a problem.

Take Bug Report not working on this device, unfortunately, and I don't have access to the device generally.

Any ideas what could be causing this?

Enable "show touches"

"Show touches" is still enabled even though I'm not recording. Please help!!! I have a circle following my finger on the screen!

Use share chooser with share notification action

Minor thing, but it is not ideal that the share action allows for a default application.
Perhaps get the PendingIntent for a BroadcastReceiver and then show the share Intent chooser/picker in the BR.

Show touches while recording

Enable developer settings 'Show touches' options while recording.

Even though with Lollipop we have touch hints for visual feedback (ripples), there are still some missing like swipe and multitouch gestures.

Still video remains black

Steps to reproduce:

  • Launch the overlay
  • Start the recording
  • Wait a few seconds without doing anything
  • Stop the recording

Results:
The video remains black.

It seems there is no key frame in the video...

Scale bitrate with video size.

This should probably be based on number of pixels. Then we can just use the same sizePercentage trick to scale the value.

First-Run Wizard

Because otherwise how the hell do you know how to stop recording?

MediaRecorder prepare fails with latest source

I am using the latest source but sometimes i still receive the prepare fails exception until now all these devices have thrown java.lang.RuntimeException: Unable to prepare MediaRecorder :

HTC ONE (Screen resolution 1080x1920)
LGE lge LG-D415 (Screen resolution 540 x 960)
LGE google Nexus 4 (Screen res 720x1280)
Samsung Galaxy Tab2 (Screen res 600x1024)

I know this bug was supposed to be fixed but it still happens, i am also using 30 fps to avoid any issues. Any one here still receives this crash?

Landscape recording crash at MediaRecorder.prepare()

Unable to record when landscape is the initial orientation.
The crashlog is submitted through Google Play.

java.lang.RuntimeException: Unable to prepare MediaRecorder.
    at com.jakewharton.telecine.RecordingSession.startRecording(RecordingSession.java:180)

Provide pure-floss build flavor

Google Analytics (and most likely bugsnag?) is non-free software, could you provide a gradle flavor that does not require this?

Add option to crop video (for example, remove Navigation bar)

The navigation bar is often unnecessary to include in the recording - indeed, some devices don't have an on screen nav bar, so you wouldn't see it anyway.

It would be really good if this could be auto-cropped from the final video (with an appropriate setting to control this). I had a quick play with various height parameters in the code, but that only made the whole size smaller. So, I'm not sure how this can be done, or whether it can be done at all.

The alternative is to crop the video post-production which is obviously cumbersome. Indeed, I'm yet to find a decent tool on OS X, to do this well.

Overlay not showing

hi, im use Android 5.0.2
my device Redmi Note 3 (Mediatek)
when i click/touch launch overlay, nothing happen..
where is overlay for play or stop recording?

MediaRecorder stop fails.

java.lang.RuntimeException: stop failed.
        at android.media.MediaRecorder.native_stop(MediaRecorder.java:-2)
        at android.media.MediaRecorder.stop(MediaRecorder.java:816)
        at com.jakewharton.telecine.RecordingSession.stopRecording(RecordingSession.java:214)
        at com.jakewharton.telecine.RecordingSession.access$200(RecordingSession.java:47)
        at com.jakewharton.telecine.RecordingSession$1.onStop(RecordingSession.java:115)
        at com.jakewharton.telecine.OverlayView$4.onClick(OverlayView.java:144)
        at android.view.View.performClick(View.java:4763)
        at android.view.View$PerformClick.run(View.java:19821)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5274)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
1420825353847 D Attempting to acquire permission to screen capture.
1420825353939 D Acquired permission to screen capture. Starting service.
1420825353949 D Starting up!
1420825353988 D Adding overlay view to window.
1420825365120 D Starting screen recording...
1420825365122 D Video size: 100%
1420825365143 I Output file '/storage/emulated/0/Movies/Telecine/Telecine_2015-01-09-18-42-45.mp4'.
1420825365569 D Screen recording started.
1420825372006 D Stopping screen recording...
1420825372006 D Removing overlay view from window.
apiLevel
21
batteryLevel
0.38
brand
lge
charging
false
dpi
640
freeDisk
12074573824.0
freeMemory
237855864
jailbroken
false
locale
pl_PL
locationStatus
allowed
manufacturer
LGE
model
LG-D855
networkAccess
wifi
orientation
portrait
osBuild
LRX21R.A1417604035
osName
android
osVersion
5.0
screenDensity
4
screenResolution
2392x1440
time
2015-01-09T17:42:52Z
totalMemory
268435456

Wrong VirtualDisplay size leading to letter box effect

These lines of code are computing the wrong video size:

    DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
    int displayHeight = displayMetrics.heightPixels * sizePercentage / 100;
    int displayWidth = displayMetrics.widthPixels * sizePercentage / 100;

On a Nexus 6, the screen resolution is 1440x2560.
But, this DisplayMetrics will contain a size of 1440x2392.
This corresponds to the screen resolution, without the navigation bar.
Therefore, you'll end up with a small (but noticable) letter box effect. 😞

The solution would be to use the WindowManager service and the getRealMetrics method:

WindowManager wm = (WindowManager) context.getSystemService(WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
display.getRealMetrics(metrics);

😃

Many DeadObjectExceptions showing up in LogCat

Every time a recording is stopped, a number of DeadObjectExceptions are written to logcat. The number of these is ever-increasing (until next reboot). It increments each time Telecine (or any other app using MediaProjection) is launched (killed?). Now, maybe this can simply be ignored. But, having, sometimes, hundreds of these messages written each time the recording is stopped, is rather annoying at least.

See here: https://code.google.com/p/android/issues/detail?id=81152

Confirmed on 5.1.1 (Nexus 5)

Any ideas on how to work around this?

05-23 12:46:16.623 725-725/? W/MediaProjectionManagerService﹕ Failed to notify media projection has stopped
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:496)
at android.media.projection.IMediaProjectionCallback$Stub$Proxy.onStop(IMediaProjectionCallback.java:75)
at com.android.server.media.projection.MediaProjectionManagerService$ClientStopCallback.run(MediaProjectionManagerService.java:614)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at com.android.server.SystemServer.run(SystemServer.java:269)
at com.android.server.SystemServer.main(SystemServer.java:170)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.